summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-04-15 11:45:39 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-04-15 11:45:39 +0000
commit4b251646770b838c9d30e7f07d0ca4e2bdb1689d (patch)
tree6911cfbfa33d1b63d6adfa9bc1c3a5375145379b /src/corelib
parent6660740cf39f01309e27ace4c8f27eb0827ec41f (diff)
downloadfpGUI-4b251646770b838c9d30e7f07d0ca4e2bdb1689d.tar.xz
* Implemented ActiveWindow method.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/gdi/gfx_gdi.pas6
-rw-r--r--src/corelib/gfxbase.pas1
-rw-r--r--src/corelib/x11/gfx_x11.pas6
3 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas
index b2f6970b..26dd3eae 100644
--- a/src/corelib/gdi/gfx_gdi.pas
+++ b/src/corelib/gdi/gfx_gdi.pas
@@ -162,6 +162,7 @@ type
property WinHandle: TfpgWinHandle read FWinHandle;
public
constructor Create(AOwner: TComponent); override;
+ procedure ActivateWindow; override;
procedure CaptureMouse; override;
procedure ReleaseMouse; override;
end;
@@ -1318,6 +1319,11 @@ begin
FWinHandle := 0;
end;
+procedure TfpgWindowImpl.ActivateWindow;
+begin
+ SetForegroundWindow(FWinHandle);
+end;
+
procedure TfpgWindowImpl.CaptureMouse;
begin
Windows.SetCapture(FWinHandle);
diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas
index 80245ce1..e616ab55 100644
--- a/src/corelib/gfxbase.pas
+++ b/src/corelib/gfxbase.pas
@@ -393,6 +393,7 @@ type
procedure UpdateWindowPosition;
procedure MoveWindow(const x: TfpgCoord; const y: TfpgCoord);
function WindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint;
+ procedure ActivateWindow; virtual; abstract;
procedure CaptureMouse; virtual; abstract;
procedure ReleaseMouse; virtual; abstract;
procedure SetFullscreen(AValue: Boolean); virtual;
diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas
index ca0f5a90..f32b645d 100644
--- a/src/corelib/x11/gfx_x11.pas
+++ b/src/corelib/x11/gfx_x11.pas
@@ -199,6 +199,7 @@ type
property WinHandle: TfpgWinHandle read FWinHandle;
public
constructor Create(AOwner: TComponent); override;
+ procedure ActivateWindow; override;
procedure CaptureMouse; override;
procedure ReleaseMouse; override;
procedure SetFullscreen(AValue: Boolean); override;
@@ -1595,6 +1596,11 @@ begin
FBackupWinHandle := 0;
end;
+procedure TfpgWindowImpl.ActivateWindow;
+begin
+ XSetInputFocus(xapplication.Display, FWinHandle, RevertToParent, CurrentTime);
+end;
+
procedure TfpgWindowImpl.CaptureMouse;
begin
XGrabPointer(xapplication.Display, FWinHandle,