From d9d246eb364431120619874d4f6e316ef38fcc5d Mon Sep 17 00:00:00 2001 From: Duong Nguyen Date: Tue, 22 Jul 2008 19:00:16 +0000 Subject: Bug 240817 - SWT Tree: in 3.4, DragSourceEvent gives higher x-coordinate than in 3.3 --- .../win32/org/eclipse/swt/dnd/DragSource.java | 6 +++--- .../win32/org/eclipse/swt/dnd/TableDragSourceEffect.java | 6 +++--- .../win32/org/eclipse/swt/dnd/TreeDragSourceEffect.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd') diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java index 528fc8fd6f..cc63a3b204 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java @@ -315,10 +315,10 @@ private void drag(Event dragEvent) { * area and use it during the drag to prevent the image from being inverted. * On XP if the shell is RTL, the image is not displayed. */ - int offset = event.x - dragEvent.x; + int offsetX = event.offsetX; hwndDrag = topControl.handle; if ((topControl.getStyle() & SWT.RIGHT_TO_LEFT) != 0) { - offset = image.getBounds().width - offset; + offsetX = image.getBounds().width - offsetX; RECT rect = new RECT (); OS.GetClientRect (topControl.handle, rect); hwndDrag = OS.CreateWindowEx ( @@ -334,7 +334,7 @@ private void drag(Event dragEvent) { null); OS.ShowWindow (hwndDrag, OS.SW_SHOW); } - OS.ImageList_BeginDrag(imagelist.getHandle(), 0, offset, event.y - dragEvent.y); + OS.ImageList_BeginDrag(imagelist.getHandle(), 0, offsetX, event.offsetY); /* * Feature in Windows. When ImageList_DragEnter() is called, * it takes a snapshot of the screen If a drag is started diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TableDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TableDragSourceEffect.java index 727abc40d8..bc25bd33ae 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TableDragSourceEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TableDragSourceEffect.java @@ -83,11 +83,11 @@ public class TableDragSourceEffect extends DragSourceEffect { int DI_GETDRAGIMAGE = OS.RegisterWindowMessage (new TCHAR (0, "ShellGetDragImage", true)); //$NON-NLS-1$ if (OS.SendMessage (control.handle, DI_GETDRAGIMAGE, 0, shdi) != 0) { if ((control.getStyle() & SWT.MIRRORED) != 0) { - event.x += shdi.sizeDragImage.cx - shdi.ptOffset.x; + event.offsetX = shdi.sizeDragImage.cx - shdi.ptOffset.x; } else { - event.x += shdi.ptOffset.x; + event.offsetX = shdi.ptOffset.x; } - event.y += shdi.ptOffset.y; + event.offsetY = shdi.ptOffset.y; int /*long*/ hImage = shdi.hbmpDragImage; if (hImage != 0) { BITMAP bm = new BITMAP (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragSourceEffect.java index e39a75684a..645549a14f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragSourceEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragSourceEffect.java @@ -82,11 +82,11 @@ public class TreeDragSourceEffect extends DragSourceEffect { int DI_GETDRAGIMAGE = OS.RegisterWindowMessage (new TCHAR (0, "ShellGetDragImage", true)); //$NON-NLS-1$ if (OS.SendMessage (control.handle, DI_GETDRAGIMAGE, 0, shdi) != 0) { if ((control.getStyle() & SWT.MIRRORED) != 0) { - event.x += shdi.sizeDragImage.cx - shdi.ptOffset.x; + event.offsetX = shdi.sizeDragImage.cx - shdi.ptOffset.x; } else { - event.x += shdi.ptOffset.x; + event.offsetX = shdi.ptOffset.x; } - event.y += shdi.ptOffset.y; + event.offsetY = shdi.ptOffset.y; int /*long*/ hImage = shdi.hbmpDragImage; if (hImage != 0) { BITMAP bm = new BITMAP (); -- cgit