diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-14 12:30:44 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-14 12:30:44 +0200 |
commit | 3339a34349d62f3cbec24e16a2a2056b5552287e (patch) | |
tree | 56d0ea741a357a95ffb95dd15068970907ac6928 /src | |
parent | dbe37a31752bfe0d166715297944908cf11f385a (diff) | |
download | fpGUI-3339a34349d62f3cbec24e16a2a2056b5552287e.tar.xz |
GDI: OnDragDrop the Sender and Source parameters are now populated.
Sender: the widget the mouse was over when drop occurs.
Source: If whole DND is inside the same app, then Source is the
original Widget the DND started from.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gdi/fpg_gdi.pas | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index f655de2b..9bae51c5 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -1466,6 +1466,7 @@ var stgmed: STGMEDIUM; data: pchar; wg: TfpgWidget; + swg: TfpgWidget; { source widget } CF: DWORD; lIsTranslated: Boolean; begin @@ -1488,7 +1489,14 @@ begin { Yippie! the data is there, so go get it! } data := GlobalLock(stgmed.HGLOBAL); if Assigned(wg.OnDragDrop) then - wg.OnDragDrop(self, nil, pt.x, pt.y, data); + begin + if Assigned(uDragSource) then + swg := uDragSource as TfpgWidget + else + swg := nil; + wg.OnDragDrop(wg, swg, pt.x, pt.y, data); + uDragSource := nil; + end; GlobalUnlock(stgmed.HGLOBAL); { release the data using the COM API } ReleaseStgMedium(stgmed); |