diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-11-29 08:54:34 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-11-29 08:54:34 +0000 |
commit | 709237f47fd404fc163ca5f2d7532f08647a9e05 (patch) | |
tree | d7fd6dab9ae4a538369cb76ae8ee35bbea5ff159 /src/corelib | |
parent | 9eb3c0612e792949d450509236bf12500c559eb6 (diff) | |
download | fpGUI-709237f47fd404fc163ca5f2d7532f08647a9e05.tar.xz |
* Created a new overloaded CentrePoint function.
* Implemented a new method TfpgPopupMenu.MenuItemByName
* Created a example project showing how the ICommand and ICommandHolder interfaces
can be used.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpgfx.pas | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index a10685f6..bd6d15d5 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -278,12 +278,13 @@ function fpgGetTickCount: DWord; // Rectangle routines -function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; -function InflateRect(var Rect: TfpgRect; dx: Integer; dy: Integer): Boolean; -function OffsetRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; -function OffsetRect(var Rect: TfpgRect; dx: Integer; dy: Integer): Boolean; -function CenterPoint(const Rect: TRect): TPoint; -function fpgRect(ALeft, ATop, AWidth, AHeight: integer): TfpgRect; +function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; +function InflateRect(var Rect: TfpgRect; dx: Integer; dy: Integer): Boolean; +function OffsetRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; +function OffsetRect(var Rect: TfpgRect; dx: Integer; dy: Integer): Boolean; +function CenterPoint(const Rect: TRect): TPoint; +function CenterPoint(const Rect: TfpgRect): TPoint; +function fpgRect(ALeft, ATop, AWidth, AHeight: integer): TfpgRect; // Debug rountines procedure PrintRect(var Rect: TRect); @@ -441,11 +442,14 @@ end; function CenterPoint(const Rect: TRect): TPoint; begin - with Rect do - begin - Result.X := (Left+Right) div 2; - Result.Y := (Top+Bottom) div 2; - end; + Result.X := (Rect.Left + Rect.Right) div 2; + Result.Y := (Rect.Top + Rect.Bottom) div 2; +end; + +function CenterPoint(const Rect: TfpgRect): TPoint; +begin + Result.X := (Rect.Left + Rect.Right) div 2; + Result.Y := (Rect.Top + Rect.Bottom) div 2; end; function fpgRect(ALeft, ATop, AWidth, AHeight: integer): TfpgRect; |