Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2001-09-04 17:04:30 +0000
committerSteve Northover2001-09-04 17:04:30 +0000
commit72bca330545187aed3f298af1ba72f7fcfb258d6 (patch)
treea9269b768aa1afc2177a2732350713507a3c84e3 /bundles
parent09e53cfe9001f0fc72ed497903f248e93a374f11 (diff)
downloadeclipse.platform.swt-72bca330545187aed3f298af1ba72f7fcfb258d6.tar.gz
eclipse.platform.swt-72bca330545187aed3f298af1ba72f7fcfb258d6.tar.xz
eclipse.platform.swt-72bca330545187aed3f298af1ba72f7fcfb258d6.zip
*** empty log message ***
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java1
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java8
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java11
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java16
4 files changed, 36 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
index d4e8a65b4a..a896720699 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
@@ -410,6 +410,7 @@ LRESULT WM_NOTIFY (int wParam, int lParam) {
OS.MoveMemory (lpnmtdi, lParam, NMTTDISPINFO.sizeof);
String string = toolTipText (lpnmtdi);
if (string != null && string.length () != 0) {
+ string = Display.withCrLf (string);
/* Use the character encoding for the default locale */
byte [] buffer = Converter.wcsToMbcs (0, string, true);
getShell ().setToolTipText (lpnmtdi, buffer);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
index 8eeb187dad..e779e9b37e 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
@@ -760,6 +760,14 @@ void setToolTipText (int hwnd, String text) {
OS.GetModuleHandle (null),
null);
if (toolTipHandle == 0) error (SWT.ERROR_NO_HANDLES);
+ /*
+ * Feature in Windows. Despite the fact that the
+ * tool tip text contains \r\n, the tooltip will
+ * not honour the new line unless TTM_SETMAXTIPWIDTH
+ * is set. The fix is to set TTM_SETMAXTIPWIDTH to
+ * a large value.
+ */
+ OS.SendMessage (toolTipHandle, OS.TTM_SETMAXTIPWIDTH, 0, 0x7FFF);
}
TOOLINFO lpti = new TOOLINFO ();
lpti.cbSize = TOOLINFO.sizeof;
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 6e2916c6e1..e79df91776 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
@@ -223,6 +223,16 @@ void createItem (TabItem item, int index) {
void createHandle () {
super.createHandle ();
state &= ~CANVAS;
+
+ /*
+ * Feature in Windows. Despite the fact that the
+ * tool tip text contains \r\n, the tooltip will
+ * not honour the new line unless TTM_SETMAXTIPWIDTH
+ * is set. The fix is to set TTM_SETMAXTIPWIDTH to
+ * a large value.
+ */
+ int hwndToolTip = OS.SendMessage (handle, OS.TCM_GETTOOLTIPS, 0, 0);
+ OS.SendMessage (hwndToolTip, OS.TTM_SETMAXTIPWIDTH, 0, 0x7FFF);
}
void createWidget () {
@@ -607,6 +617,7 @@ LRESULT WM_NOTIFY (int wParam, int lParam) {
if (item != null) string = item.toolTipText;
}
if (string != null && string.length () != 0) {
+ string = Display.withCrLf (string);
int length = string.length ();
char [] buffer = new char [length + 1];
string.getChars (0, length, buffer, 0);
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 a3c02b3c08..ce7facc98d 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
@@ -180,6 +180,21 @@ void createHandle () {
state &= ~CANVAS;
/*
+ * Feature in Windows. Despite the fact that the
+ * tool tip text contains \r\n, the tooltip will
+ * not honour the new line unless TTM_SETMAXTIPWIDTH
+ * is set. The fix is to set TTM_SETMAXTIPWIDTH to
+ * a large value.
+ */
+ /*
+ * This line is intentionally commented. The tool
+ * bar currently sets this value to 300 so it is
+ * not necessary to set TTM_SETMAXTIPWIDTH.
+ */
+// int hwndToolTip = OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0);
+// OS.SendMessage (hwndToolTip, OS.TTM_SETMAXTIPWIDTH, 0, 0x7FFF);
+
+ /*
* Feature in Windows. When the control is created,
* it does not use the default system font. A new HFONT
* is created and destroyed when the control is destroyed.
@@ -602,6 +617,7 @@ LRESULT WM_NOTIFY (int wParam, int lParam) {
if (item != null) string = item.toolTipText;
}
if (string != null && string.length () != 0) {
+ string = Display.withCrLf (string);
int length = string.length ();
char [] buffer = new char [length + 1];
string.getChars (0, length, buffer, 0);

Back to the top