summaryrefslogtreecommitdiff
path: root/src/corelib/gdi
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-22 17:29:14 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-28 10:57:22 +0200
commit0feb218751cb39e3dd23077876b23293906ec68f (patch)
tree7e974ceb56b1805c6214769bec5feba755581874 /src/corelib/gdi
parent89fff5ef2a0262689b871d5d2717475721f5d3b0 (diff)
downloadfpGUI-0feb218751cb39e3dd23077876b23293906ec68f.tar.xz
GDI: store user selected information from DragEnter event handler
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index ce80be83..849b55cb 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -148,6 +148,8 @@ type
private
FDropManager: TfpgOLEDropTarget;
FDropPos: TPoint;
+ FUserMimeSelection: TfpgString;
+ FUserAcceptDrag: Boolean;
function GetDropManager: TfpgOLEDropTarget;
procedure HandleDNDLeave(Sender: TObject);
procedure HandleDNDEnter(Sender: TObject; DataObj: IDataObject; KeyState: Longint; PT: TPoint; var Effect: DWORD);
@@ -1334,6 +1336,7 @@ procedure TfpgGDIWindow.HandleDNDLeave(Sender: TObject);
var
wg: TfpgWidget;
begin
+ FUserMimeSelection := '';
wg := self as TfpgWidget;
if wg.AcceptDrops then { if we get here, this should always be true anyway }
begin
@@ -1374,7 +1377,11 @@ begin
if not lAccept then
Effect := DROPEFFECT_NONE
else
+ begin
Effect := TranslateToWinDragEffect(lDropAction);
+ FUserMimeSelection := lMimeChoice;
+ FUserAcceptDrag := True;
+ end;
{ Notify widget of drag status, so it can update its look }
if lAccept then
@@ -1843,6 +1850,8 @@ begin
FDropPos.x := 0;
FDropPos.y := 0;
FFullscreenIsSet := false;
+ FUserMimeSelection := '';
+ FUserAcceptDrag := False;
end;
destructor TfpgGDIWindow.Destroy;
@@ -2724,7 +2733,7 @@ begin
end;
-constructor TGDIDragManager.Create(ADropTarget: TObject);
+constructor TGDIDragManager.Create(ADropTarget: TfpgWindowBase);
begin
inherited Create;
FDropTarget := ADropTarget;