summaryrefslogtreecommitdiff
path: root/src/corelib/gdi
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-12 17:20:40 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-28 10:57:21 +0200
commit295242c96cf0c0f791fcc4aeea7555269d493503 (patch)
treeb8bcaca64f5260fec6134a8c91b6f99ee84e4e43 /src/corelib/gdi
parent8c7e0c3444a9746fbff7caecbc2014e114b837c6 (diff)
downloadfpGUI-295242c96cf0c0f791fcc4aeea7555269d493503.tar.xz
TfpgWindowBase introduced a new abstract method
* This abstract method is called from TfpgWidget's AcceptDrops setter function * Template implementation in X11 * Actual implementation in GDI
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index 7da02311..e7c3db3c 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -28,9 +28,10 @@ unit fpg_gdi;
interface
uses
- Windows,
Classes,
SysUtils,
+ Windows,
+ ActiveX,
fpg_base,
fpg_impl
{$IFDEF DEBUG}
@@ -152,6 +153,7 @@ type
FNonFullscreenStyle: longword;
FFullscreenIsSet: boolean;
FSkipResizeMessage: boolean;
+ QueueAcceptDrops: boolean;
function DoMouseEnterLeaveCheck(AWindow: TfpgGDIWindow; uMsg, wParam, lParam: Cardinal): Boolean;
procedure WindowSetFullscreen(aFullScreen, aUpdate: boolean);
property DragManager: TGDIDragManager read GetDragManager;
@@ -173,6 +175,7 @@ type
procedure DoSetWindowTitle(const ATitle: string); override;
procedure DoSetMouseCursor; override;
procedure DoDNDEnabled(const AValue: boolean); override;
+ procedure DoAcceptDrops(const AValue: boolean); override;
property WinHandle: TfpgWinHandle read FWinHandle;
public
constructor Create(AOwner: TComponent); override;
@@ -1587,6 +1590,11 @@ begin
// the forms require some adjustments before the Window appears
SetWindowParameters;
FSkipResizeMessage := False;
+
+ if QueueAcceptDrops then
+ begin
+ DoAcceptDrops(True);
+ end;
end;
procedure TfpgGDIWindow.DoReleaseWindowHandle;
@@ -1704,7 +1712,24 @@ end;
procedure TfpgGDIWindow.DoDNDEnabled(const AValue: boolean);
begin
- // TODO: still needs to be implemented
+ { GDI has nothing to do here }
+end;
+
+procedure TfpgGDIWindow.DoAcceptDrops(const AValue: boolean);
+begin
+ if AValue then
+ begin
+ if HasHandle then
+ DragManager.RegisterDragDrop
+ else
+ QueueAcceptDrops := True; // we need to do this once we have a winhandle
+ end
+ else
+ begin
+ if HasHandle then
+ DragManager.RevokeDragDrop;
+ QueueAcceptDrops := False;
+ end;
end;
constructor TfpgGDIWindow.Create(AOwner: TComponent);