summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-01-14 12:30:44 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-01-14 12:30:44 +0200
commit3339a34349d62f3cbec24e16a2a2056b5552287e (patch)
tree56d0ea741a357a95ffb95dd15068970907ac6928 /src
parentdbe37a31752bfe0d166715297944908cf11f385a (diff)
downloadfpGUI-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.pas10
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);