summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2005-07-28 22:36:26 +0000
committerFelipe Heidrich <fheidric>2005-07-28 22:36:26 +0000
commita711f134bea2a5ea9440a0a25aac4e56b6baf002 (patch)
tree3afed643b592d9c664fc26133bdbede33910b5df
parentd8a1cac986e8cedb3f956fe303ba13a1698f6acc (diff)
downloadeclipse.platform.swt-a711f134bea2a5ea9440a0a25aac4e56b6baf002.tar.gz
eclipse.platform.swt-a711f134bea2a5ea9440a0a25aac4e56b6baf002.tar.xz
eclipse.platform.swt-a711f134bea2a5ea9440a0a25aac4e56b6baf002.zip
fix for: toolitem's tooltip stop working when toolbar is reparented (no bugzilla entry)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java6
2 files changed, 19 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index e4b4967b9d..b68458604b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -142,6 +142,20 @@ int /*long*/ eventHandle () {
return fixedHandle;
}
+void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+ super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+ ToolItem [] items = getItems ();
+ if (toolTipText == null) {
+ for (int i = 0; i < items.length; i++) {
+ ToolItem item = items [i];
+ if (item.toolTipText != null) {
+ item.setToolTipText(oldShell, null);
+ item.setToolTipText(newShell, item.toolTipText);
+ }
+ }
+ }
+}
+
boolean forceFocus (int /*long*/ focusHandle) {
if (lastFocus != null && lastFocus.setFocus ()) return true;
ToolItem [] items = getItems ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index 556bf56e34..55f2dece14 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -973,10 +973,14 @@ public void setToolTipText (String string) {
toolTipText = string;
if (parent.toolTipText == null) {
Shell shell = parent._getShell ();
- shell.setToolTipText (handle, toolTipText);
+ setToolTipText (shell, toolTipText);
}
}
+void setToolTipText (Shell shell, String string) {
+ shell.setToolTipText (handle, string);
+}
+
/**
* Sets the width of the receiver, for <code>SEPARATOR</code> ToolItems.
*