diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-14 12:31:22 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-14 12:31:22 +0200 |
commit | 5f593bd29a4c43a14f35e2adfc63c788bf3a80d4 (patch) | |
tree | 561c9a34e0225e05b4e5d5edcd78a948b7ba1a8a /src/corelib/x11 | |
parent | 3339a34349d62f3cbec24e16a2a2056b5552287e (diff) | |
download | fpGUI-5f593bd29a4c43a14f35e2adfc63c788bf3a80d4.tar.xz |
X11: 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/corelib/x11')
-rw-r--r-- | src/corelib/x11/fpg_x11.pas | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 4ccdd24e..0fa561c4 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -1226,6 +1226,7 @@ var s: variant; data: PChar; wg: TfpgWidget; + swg: TfpgWidget; { source widget that started drag - if drag and drop occur in the same application } begin {$IFDEF DNDDEBUG} writeln('TfpgX11Application.HandleDNDselection'); @@ -1272,7 +1273,14 @@ begin if wg.AcceptDrops then begin if Assigned(wg.OnDragDrop) then - wg.OnDragDrop(nil, nil, FDropPos.X, FDropPos.Y, s); + begin + if Assigned(uDragSource) then + swg := uDragSource as TfpgWidget + else + swg := nil; + wg.OnDragDrop(wg, swg, FDropPos.X, FDropPos.Y, s); + uDragSource := nil; { reset variable for the next DND action } + end; end; end; {$IFDEF DNDDEBUG} |