diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-09-20 09:10:07 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-09-20 09:10:07 +0200 |
commit | f819c8528a09b331876e5f62a5cad8aae522fa54 (patch) | |
tree | 22578610e0ea0af012839ff004b1ae36629b003e /src | |
parent | ddb121dcd5dab08de93b1279e986951263582778 (diff) | |
download | fpGUI-f819c8528a09b331876e5f62a5cad8aae522fa54.tar.xz |
Moved GetClientRect() and GetBoundsRect() out of TfpgWidget into TfpgBaseWindow
Now these functions are accessible to platform specific code too.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpg_base.pas | 12 | ||||
-rw-r--r-- | src/corelib/fpg_widget.pas | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 0ac42f04..63c3ea15 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -451,6 +451,8 @@ type procedure MoveWindow(const x: TfpgCoord; const y: TfpgCoord); function WindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; function HasParent: Boolean; override; + function GetClientRect: TfpgRect; virtual; + function GetBoundsRect: TfpgRect; virtual; procedure ActivateWindow; virtual; abstract; procedure CaptureMouse; virtual; abstract; procedure ReleaseMouse; virtual; abstract; @@ -1204,6 +1206,16 @@ begin Result := FParent <> nil; end; +function TfpgWindowBase.GetClientRect: TfpgRect; +begin + Result.SetRect(0, 0, Width, Height); +end; + +function TfpgWindowBase.GetBoundsRect: TfpgRect; +begin + Result.SetRect(Left, Top, Width+1, Height+1); +end; + procedure TfpgWindowBase.SetFullscreen(AValue: Boolean); begin if AValue then diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index 39bb4193..1d51a7ad 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -141,8 +141,6 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure AfterConstruction; override; - function GetClientRect: TfpgRect; virtual; - function GetBoundsRect: TfpgRect; virtual; function InDesigner: boolean; procedure InvokeHelp; virtual; procedure Realign; @@ -341,16 +339,6 @@ begin end; end; -function TfpgWidget.GetClientRect: TfpgRect; -begin - Result.SetRect(0, 0, Width, Height); -end; - -function TfpgWidget.GetBoundsRect: TfpgRect; -begin - Result.SetRect(Left, Top, Width+1, Height+1); -end; - function TfpgWidget.InDesigner: boolean; begin Result := (FFormDesigner <> nil) |