diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2013-05-20 11:37:35 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2013-05-20 11:37:35 +0100 |
commit | d10dac387ba331f1f289b28b4d1a56a7882733f2 (patch) | |
tree | 53eb563f65667a0f9b23e3c078e65eed7e999851 /src/corelib | |
parent | 13468500f5ffa00c790d9c59779e45b7cba14e93 (diff) | |
download | fpGUI-d10dac387ba331f1f289b28b4d1a56a7882733f2.tar.xz |
bug: Under Windows the mouse coordinates in OnDragDrop was screen coordinates.
I forgot to translate those to widget coordinates.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/gdi/fpg_gdi.pas | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index c8460a4c..74787683 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -1522,6 +1522,7 @@ var swg: TfpgWidget; { source widget } CF: DWORD; lIsTranslated: Boolean; + lPoint: Windows.Point; begin if not FUserAcceptDrag then exit; @@ -1547,7 +1548,11 @@ begin swg := uDragSource as TfpgWidget else swg := nil; - wg.OnDragDrop(wg, swg, pt.x, pt.y, data); + // convert mouse screen coordinates to widget coordinates + lPoint.x := pt.x; + lPoint.y := pt.y; + ScreenToClient(wg.WinHandle, lPoint); + wg.OnDragDrop(wg, swg, lPoint.x, lPoint.y, data); uDragSource := nil; end; GlobalUnlock(stgmed.HGLOBAL); |