From 373b713182b6da1b1af992810926ed75b41ba8e8 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 16 Sep 2014 19:04:00 +0100 Subject: Edit2 font alias is now a variable and not hard coded. This makes it a bit more configurable (default values) for various platforms. Thanks to Marcus Sackrow for the suggestion. --- src/corelib/fpg_base.pas | 7 ++++--- src/corelib/fpg_main.pas | 38 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 96332d5d..f676aa19 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -138,6 +138,7 @@ var FPG_DEFAULT_FONT_DESC: string = 'Liberation Sans-10:antialias=true'; FPG_DEFAULT_SANS: string = 'Liberation Sans'; {$ENDIF} + FPG_DEFAULT_FIXED_FONT_DESC: string = 'Courier New-10'; const UserNamedColorStart = 128; @@ -727,8 +728,8 @@ type destructor Destroy; override; function Execute(const ADropActions: TfpgDropActions; const ADefaultAction: TfpgDropAction = daCopy): TfpgDropAction; virtual; abstract; end; - - + + { TfpgBaseTimer } TfpgBaseTimer = class(TObject) diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index 7ba8a96a..02f0acde 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -51,7 +51,7 @@ type TfpgMenuItemFlags = set of (mifSelected, mifHasFocus, mifSeparator, mifEnabled, mifChecked, mifSubMenu); - + TfpgTextFlags = set of (txtLeft, txtHCenter, txtRight, txtTop, txtVCenter, txtBottom, txtWrap, txtDisabled, txtAutoSize); @@ -62,7 +62,7 @@ type const AllAnchors = [anLeft, anRight, anTop, anBottom]; TextFlagsDflt = [txtLeft, txtTop]; - + type { ******************************************* @@ -229,7 +229,7 @@ type function GetCheckBoxSize: integer; virtual; procedure DrawCheckbox(ACanvas: TfpgCanvas; x, y: TfpgCoord; ix, iy: TfpgCoord); virtual; end; - + TMsgHookItem = class Dest: TObject; @@ -327,12 +327,12 @@ type property Width: integer read FWidth; property Height: integer read FHeight; end; - - + + TfpgClipboard = class(TfpgClipboardImpl) end; - + TfpgFileList = class(TfpgFileListImpl) end; @@ -1296,7 +1296,7 @@ begin Result := TStringList.Create else Exit; //==> - + for n := 0 to fpgNamedFonts.Count-1 do begin oFont := TNamedFontItem(fpgNamedFonts[n]); @@ -1365,7 +1365,7 @@ begin fpgStyleManager.FreeStyleInstance; fpgStyle := nil; fpgCaret.Free; - + for i := fpgTimers.Count-1 downto 0 do if fpgTimers[i] <> nil then TfpgTimer(fpgTimers[i]).Free; @@ -1381,7 +1381,7 @@ begin FFontResList.Free; FreeAndNil(FModalFormStack); - + for i := 0 to FMessageHookList.Count-1 do TMsgHookItem(FMessageHookList[i]).Free; FreeAndNil(FMessageHookList); @@ -1392,7 +1392,7 @@ begin uMsgQueueList.Delete(i); end; uMsgQueueList.Free; - + inherited Destroy; end; @@ -1503,7 +1503,7 @@ begin ShortDayNames[5] := rsShortThu; ShortDayNames[6] := rsShortFri; ShortDayNames[7] := rsShortSat; - + LongDayNames[1] := rsLongSun; LongDayNames[2] := rsLongMon; LongDayNames[3] := rsLongTue; @@ -1937,10 +1937,10 @@ begin end; end; nw := Max(wtxt, w); - + wraplst := TStringList.Create; wraplst.Text := AText; - + if (txtWrap in AFlags) then begin for i := 0 to wraplst.Count-1 do @@ -1950,7 +1950,7 @@ begin end; htxt := (Font.Height * wraplst.Count) + (ALineSpace * Pred(wraplst.Count)); - + // Now paint the actual text for i := 0 to wraplst.Count-1 do begin @@ -1965,7 +1965,7 @@ begin nx := x + (w - wtxt) div 2 else // txtLeft is default nx := x; - + // vertical alignment if (txtBottom in AFlags) then ny := y + l + h - htxt @@ -1976,7 +1976,7 @@ begin fpgStyle.DrawString(self, nx, ny, wraplst[i], lEnabled); end; - + wraplst.Free; Result := htxt; end; @@ -2054,7 +2054,7 @@ begin fpgSetNamedFont('Label1', FPG_DEFAULT_FONT_DESC); fpgSetNamedFont('Label2', FPG_DEFAULT_FONT_DESC + ':bold'); fpgSetNamedFont('Edit1', FPG_DEFAULT_FONT_DESC); - fpgSetNamedFont('Edit2', 'Courier New-10'); + fpgSetNamedFont('Edit2', FPG_DEFAULT_FIXED_FONT_DESC); fpgSetNamedFont('List', FPG_DEFAULT_FONT_DESC); fpgSetNamedFont('Grid', FPG_DEFAULT_SANS + '-9'); fpgSetNamedFont('GridHeader', FPG_DEFAULT_SANS + '-9:bold'); @@ -2254,7 +2254,7 @@ begin ACanvas.SetColor(clWindowBackground); ACanvas.SetLineStyle(1, lsSolid); ACanvas.FillRectangle(x, y, w, h); - + if ARaised then ACanvas.SetColor(clHilite2) else -- cgit v1.2.3-70-g09d2