summaryrefslogtreecommitdiff
path: root/src/corelib/gdi/gfx_gdi.pas
diff options
context:
space:
mode:
authordrewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-24 18:09:34 +0000
committerdrewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-24 18:09:34 +0000
commit38831e0bb35c193376aace81430507e07883c61c (patch)
tree1b34d734b5c662466eed210392e988ab9d18b012 /src/corelib/gdi/gfx_gdi.pas
parent7b306401872c09d5996a748ce1e4e8a90306e980 (diff)
downloadfpGUI-38831e0bb35c193376aace81430507e07883c61c.tar.xz
made DoAllocateWinHandle only allocate not show a handle
added a proc to show or hide an allocated handle. implemented and tested in x11. only implemented in windows not tested fixed x11 waitmessage proc to not use 100% cpu on ShowMessage
Diffstat (limited to 'src/corelib/gdi/gfx_gdi.pas')
-rw-r--r--src/corelib/gdi/gfx_gdi.pas47
1 files changed, 29 insertions, 18 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas
index eb211bb3..dca5ce15 100644
--- a/src/corelib/gdi/gfx_gdi.pas
+++ b/src/corelib/gdi/gfx_gdi.pas
@@ -127,6 +127,7 @@ type
FParentWinHandle: TfpgWinHandle;
procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); override;
procedure DoReleaseWindowHandle; override;
+ procedure DoSetWindowVisible(const AValue: Boolean); override;
function HandleIsValid: boolean; override;
procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override;
procedure DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); override;
@@ -853,24 +854,6 @@ begin
// the forms require some adjustments before the Window appears
SetWindowParameters;
-
- BringWindowToTop(FWinHandle);
-
- if FWindowType in [wtPopup] then
- Windows.ShowWindow(FWinHandle, SW_SHOWNOACTIVATE)
- else
- Windows.ShowWindow(FWinHandle, SW_SHOWNORMAL);
-
- if (waAutoPos in FWindowAttributes) or
- (waScreenCenterPos in FWindowAttributes) then
- begin
- GetWindowRect(FWinHandle, r);
- FLeft := r.Left;
- FTop := r.Top;
- end;
-
- // send the first paint message
- Windows.UpdateWindow(FWinHandle);
end;
procedure TfpgWindowImpl.DoReleaseWindowHandle;
@@ -881,6 +864,34 @@ begin
FWinHandle := 0;
end;
+procedure TfpgWindowImpl.DoSetWindowVisible(const AValue: Boolean);
+var
+ r: TRect;
+begin
+ if AValue then begin
+ BringWindowToTop(FWinHandle);
+
+ if FWindowType in [wtPopup] then
+ Windows.ShowWindow(FWinHandle, SW_SHOWNOACTIVATE)
+ else
+ Windows.ShowWindow(FWinHandle, SW_SHOWNORMAL);
+
+ if (waAutoPos in FWindowAttributes) or
+ (waScreenCenterPos in FWindowAttributes) then
+ begin
+ GetWindowRect(FWinHandle, r);
+ FLeft := r.Left;
+ FTop := r.Top;
+ end;
+
+ Windows.UpdateWindow(FWinHandle);
+ end
+ else begin
+ Windows.ShowWindow(FWinHandle, SW_HIDE);
+ end;
+
+end;
+
procedure TfpgWindowImpl.DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord);
begin
if HandleIsValid then