Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2006-08-02 22:18:48 +0000
committerSteve Northover2006-08-02 22:18:48 +0000
commit2b80a146a94b1cb9f46070133b109e63b39c6545 (patch)
tree92e9ca5acd3d7981142250114fd4d91744a8eadb /bundles
parentc3364be5c79ecf9065da54c42cb951973dc3abeb (diff)
downloadeclipse.platform.swt-2b80a146a94b1cb9f46070133b109e63b39c6545.tar.gz
eclipse.platform.swt-2b80a146a94b1cb9f46070133b109e63b39c6545.tar.xz
eclipse.platform.swt-2b80a146a94b1cb9f46070133b109e63b39c6545.zip
138528 - Tooltips do not show after tool button pressed
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java28
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java28
2 files changed, 56 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
index 77a713d28e..a8daf0c915 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
@@ -759,6 +759,34 @@ LRESULT WM_GETDLGCODE (int wParam, int lParam) {
return new LRESULT (OS.DLGC_BUTTON);
}
+LRESULT WM_MOUSELEAVE (int wParam, int lParam) {
+ LRESULT result = super.WM_MOUSELEAVE (wParam, lParam);
+ if (result != null) return result;
+ /*
+ * Bug in Windows. On XP, when a tooltip is
+ * hidden due to a time out or mouse press,
+ * the tooltip remains active although no
+ * longer visible and won't show again until
+ * another tooltip becomes active. If there
+ * is only one tooltip in the window, it will
+ * never show again. The fix is to remove the
+ * current tooltip and add it again every time
+ * the mouse leaves the control.
+ */
+ if (OS.COMCTL32_MAJOR >= 6) {
+ TOOLINFO lpti = new TOOLINFO ();
+ lpti.cbSize = TOOLINFO.sizeof;
+ int hwndToolTip = OS.SendMessage (handle, OS.TCM_GETTOOLTIPS, 0, 0);
+ if (OS.SendMessage (hwndToolTip, OS.TTM_GETCURRENTTOOL, 0, lpti) != 0) {
+ if ((lpti.uFlags & OS.TTF_IDISHWND) == 0) {
+ OS.SendMessage (hwndToolTip, OS.TTM_DELTOOL, 0, lpti);
+ OS.SendMessage (hwndToolTip, OS.TTM_ADDTOOL, 0, lpti);
+ }
+ }
+ }
+ return result;
+}
+
LRESULT WM_NCHITTEST (int wParam, int lParam) {
LRESULT result = super.WM_NCHITTEST (wParam, lParam);
if (result != null) return result;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java
index 4cb860bfb4..a373b71a80 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java
@@ -1142,6 +1142,34 @@ LRESULT WM_LBUTTONUP (int wParam, int lParam) {
return super.WM_LBUTTONUP (wParam, lParam);
}
+LRESULT WM_MOUSELEAVE (int wParam, int lParam) {
+ LRESULT result = super.WM_MOUSELEAVE (wParam, lParam);
+ if (result != null) return result;
+ /*
+ * Bug in Windows. On XP, when a tooltip is
+ * hidden due to a time out or mouse press,
+ * the tooltip remains active although no
+ * longer visible and won't show again until
+ * another tooltip becomes active. If there
+ * is only one tooltip in the window, it will
+ * never show again. The fix is to remove the
+ * current tooltip and add it again every time
+ * the mouse leaves the control.
+ */
+ if (OS.COMCTL32_MAJOR >= 6) {
+ TOOLINFO lpti = new TOOLINFO ();
+ lpti.cbSize = TOOLINFO.sizeof;
+ int hwndToolTip = OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0);
+ if (OS.SendMessage (hwndToolTip, OS.TTM_GETCURRENTTOOL, 0, lpti) != 0) {
+ if ((lpti.uFlags & OS.TTF_IDISHWND) == 0) {
+ OS.SendMessage (hwndToolTip, OS.TTM_DELTOOL, 0, lpti);
+ OS.SendMessage (hwndToolTip, OS.TTM_ADDTOOL, 0, lpti);
+ }
+ }
+ }
+ return result;
+}
+
LRESULT WM_NOTIFY (int wParam, int lParam) {
/*
* Feature in Windows. When the toolbar window

Back to the top