summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-01-14 12:24:44 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-01-14 12:24:44 +0200
commit66b2641d24d48a706fece8f36937323ca263ce05 (patch)
tree80dd474cbcb1f335bc846ef94d0fe2995cdac912 /src/corelib
parent8bb4ab508334b8a7c9c68c82feb8e624461ce371 (diff)
downloadfpGUI-66b2641d24d48a706fece8f36937323ca263ce05.tar.xz
GDI: OnDragEnter now has Sender and Source parameters populated
Sender = widget the mouse entered and triggered the event Source = if the whole DND is inside the same app, then Source is the original Widget drag started from.
Diffstat (limited to 'src/corelib')
-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 9eb9f952..f655de2b 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -312,6 +312,7 @@ uses
var
wapplication: TfpgApplication;
+ uDragSource: TfpgWidget; { points to the Source widget of the DND when drop is inside the same app }
MouseFocusedWH: HWND;
OldMousePos: TPoint; // used to detect fake MouseMove events
NeedToUnitialize: Boolean;
@@ -1375,6 +1376,7 @@ procedure TfpgGDIWindow.HandleDNDEnter(Sender: TObject; DataObj: IDataObject;
KeyState: Longint; PT: TPoint; var Effect: DWORD);
var
wg: TfpgWidget;
+ swg: TfpgWidget;
lMimeList: TStringList;
lMimeChoice: TfpgString;
lAccept: Boolean;
@@ -1401,7 +1403,13 @@ begin
lDropAction := TranslateToFPGDropAction(Effect);
if Assigned(wg.OnDragEnter) then
- wg.OnDragEnter(self, nil, lMimeList, lMimeChoice, lDropAction, lAccept);
+ begin
+ if Assigned(uDragSource) then
+ swg := uDragSource as TfpgWidget
+ else
+ swg := nil;
+ wg.OnDragEnter(self, swg, lMimeList, lMimeChoice, lDropAction, lAccept);
+ end;
finally
lMimeList.Free;
end;
@@ -2890,6 +2898,7 @@ begin
end;
end;
+ uDragSource := TfpgDrag(self).Source as TfpgWidget;
{ Now let OLE take over from here }
FDropSource := TfpgOLEDropSource.Create;
dwResult := ActiveX.DoDragDrop( FDataObject as IDataObject,