diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-14 12:24:44 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-14 12:24:44 +0200 |
commit | 66b2641d24d48a706fece8f36937323ca263ce05 (patch) | |
tree | 80dd474cbcb1f335bc846ef94d0fe2995cdac912 /src | |
parent | 8bb4ab508334b8a7c9c68c82feb8e624461ce371 (diff) | |
download | fpGUI-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')
-rw-r--r-- | src/corelib/gdi/fpg_gdi.pas | 11 |
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, |