diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-27 14:15:56 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-27 14:15:56 +0000 |
commit | d460287312276cd014a27a34abfadbe6478007b4 (patch) | |
tree | 37ee06a1636089bd1097cef4356abbad7b57046a /src/corelib | |
parent | 460d7e9925b4623639d4c6e8505ee8376b133d61 (diff) | |
download | fpGUI-d460287312276cd014a27a34abfadbe6478007b4.tar.xz |
* Moved some constants to the gfx_constants unit.
* Replaced some code/magic numbers with constants instead.
* fpGUI Default Font is now a variable and not a constant. This allows us to change the
default font at application startup.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpgfx.pas | 5 | ||||
-rw-r--r-- | src/corelib/gfx_constants.pas | 5 | ||||
-rw-r--r-- | src/corelib/gfxbase.pas | 24 |
3 files changed, 26 insertions, 8 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index c68c8ec7..65977f62 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -165,7 +165,6 @@ type MenuFont: TfpgFont; MenuAccelFont: TfpgFont; MenuDisabledFont: TfpgFont; - public constructor Create; virtual; destructor Destroy; override; procedure DrawButtonFace(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; AFlags: TFButtonFlags); virtual; @@ -336,8 +335,6 @@ var uClipboard: TfpgClipboard; uMsgQueueList: TList; -const - ONE_MILISEC = 1 / (24 * 60 * 60 * 1000); type TNamedFontItem = class @@ -415,7 +412,7 @@ end; function fpgGetTickCount: DWord; begin - Result := DWord(Trunc(Now * 24 * 60 * 60 * 1000)); + Result := DWord(Trunc(Now * MSecsPerDay)); end; function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; diff --git a/src/corelib/gfx_constants.pas b/src/corelib/gfx_constants.pas index d271bfbc..f204cbab 100644 --- a/src/corelib/gfx_constants.pas +++ b/src/corelib/gfx_constants.pas @@ -15,7 +15,7 @@ unit gfx_constants; interface uses - gfxbase; + SysUtils, gfxbase; resourcestring @@ -74,7 +74,8 @@ const DOUBLECLICK_MS = 320; // the max time between left-clicks for doubleclick DOUBLECLICK_DISTANCE = 5; // max distance between points when doing doubleclick - + ONE_MILISEC = 1/MSecsPerDay; + { This is so that when we support LTR and RTL languages, the colon will be added at the correct place. } diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index 03724322..bc602db0 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -1,3 +1,20 @@ +{ + fpGUI - Free Pascal GUI Library + + Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + The Big Bang starts here! The starting unit for fpGUI. +} + unit gfxbase; {$mode objfpc}{$H+} @@ -63,8 +80,11 @@ const // The special keys, based on the well-known keyboard scan codes {$I keys.inc} - - FPG_DEFAULT_FONT_DESC = 'Arial-10:antialias=true'; + +var + FPG_DEFAULT_FONT_DESC: string = 'Arial-10:antialias=true'; + +const UserNamedColorStart = 128; {$I predefinedcolors.inc} |