summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Cornu <ccornu>2003-04-28 15:58:29 +0000
committerChristophe Cornu <ccornu>2003-04-28 15:58:29 +0000
commit49fe23b3c86198b5087c44952997cc27c23aac40 (patch)
tree8b5880c7032b2f84a10cbca6260a2531107f35eb
parentdedbf36dc56312790938f094948a66223612e6c4 (diff)
downloadeclipse.platform.swt-49fe23b3c86198b5087c44952997cc27c23aac40.tar.gz
eclipse.platform.swt-49fe23b3c86198b5087c44952997cc27c23aac40.tar.xz
eclipse.platform.swt-49fe23b3c86198b5087c44952997cc27c23aac40.zip
PR35842
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java7
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java15
2 files changed, 21 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index c9f8f6ce22..5499c55ab0 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -1861,6 +1861,12 @@ public void setCursor (Cursor cursor) {
}
if (hwnd == 0) return;
}
+ Control control = WidgetTable.get (hwndCursor);
+ if (control == null) control = this;
+ control.setCursor (hwndCursor);
+}
+
+void setCursor (int hwndCursor) {
int lParam = OS.HTCLIENT | (OS.WM_MOUSEMOVE << 16);
OS.SendMessage (hwndCursor, OS.WM_SETCURSOR, hwndCursor, lParam);
}
@@ -4220,6 +4226,5 @@ LRESULT wmNotifyChild (int wParam, int lParam) {
LRESULT wmScrollChild (int wParam, int lParam) {
return null;
}
-
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index 55ec24d4f4..fecd61db29 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -900,6 +900,21 @@ void setBounds (int x, int y, int width, int height, int flags) {
}
}
+void setCursor (int hwndCursor) {
+ /*
+ * Bug in Windows. Under certain circumstances, when WM_SETCURSOR
+ * is sent using SendMessage(), Windows GP's in the window proc for
+ * the tree. The fix is to avoid calling the tree window proc and
+ * set the cursor for the tree outside of WM_SETCURSOR.
+ *
+ * NOTE: This code assumes that the default cursor for the tree
+ * is IDC_ARROW.
+ */
+ int hCursor = findCursor ();
+ if (hCursor == 0) hCursor = OS.LoadCursor (0, OS.IDC_ARROW);
+ OS.SetCursor (hCursor);
+}
+
void setCheckboxImageList () {
if ((style & SWT.CHECK) == 0) return;
int count = 5;