I forgot to initialise the FL_OBJECT when setting the tooltip
and so had to create some fancy hack to get stuff to work at
all. Even then, things didn't work properly in the Toolbar.
This patch fixes it all and could be applied to 1.2 also
Jean-Marc, although I believe I created a yet more ugly hack for
that ;-)
Lars, Ok to apply to cvs?
Angus
Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.558
diff -u -p -r1.558 ChangeLog
--- ChangeLog 14 Oct 2002 13:25:15 -0000 1.558
+++ ChangeLog 14 Oct 2002 16:00:00 -0000
@@ -1,3 +1,10 @@
+2002-10-14 Angus Leeming <[EMAIL PROTECTED]>
+
+ * Tooltips.h (set) make it private:
+ * Tooltips.C (set): don't forget to initialise the FL_OBJECT!
+
+ * FormBase.C (show):
+ * FormBaseDeprecated.C (show): no longer invoke Tooltips::set().
2002-10-14 Andr� P�nitz <[EMAIL PROTECTED]>
Index: FormBase.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBase.C,v
retrieving revision 1.62
diff -u -p -r1.62 FormBase.C
--- FormBase.C 7 Oct 2002 10:49:02 -0000 1.62
+++ FormBase.C 14 Oct 2002 16:00:00 -0000
@@ -157,10 +157,6 @@ void FormBase::show()
iconify_policy,
maximize_title.c_str());
}
-
- // For some strange reason known only to xforms, the tooltips can only
- // be set on a form that is already visible...
- tooltips().set();
}
Index: FormBaseDeprecated.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormBaseDeprecated.C,v
retrieving revision 1.36
diff -u -p -r1.36 FormBaseDeprecated.C
--- FormBaseDeprecated.C 7 Oct 2002 10:49:02 -0000 1.36
+++ FormBaseDeprecated.C 14 Oct 2002 16:00:00 -0000
@@ -166,10 +166,6 @@ void FormBaseDeprecated::show()
iconify_policy,
maximize_title.c_str());
}
-
- // For some strange reason known only to xforms, the tooltips can only
- // be set on a form that is already visible...
- tooltips().set();
}
Index: Tooltips.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Tooltips.C,v
retrieving revision 1.22
diff -u -p -r1.22 Tooltips.C
--- Tooltips.C 5 Sep 2002 15:14:23 -0000 1.22
+++ Tooltips.C 14 Oct 2002 16:00:00 -0000
@@ -81,6 +81,10 @@ void Tooltips::init(FL_OBJECT * ob, stri
// Store the tooltip string
tooltipsMap[ob] = formatted(str, 400);
+
+ // Set the tooltip
+ char const * const c_str = enabled_ ? str.c_str() : 0;
+ fl_set_object_helper(ob, c_str);
}
Index: Tooltips.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Tooltips.h,v
retrieving revision 1.12
diff -u -p -r1.12 Tooltips.h
--- Tooltips.h 5 Sep 2002 15:14:23 -0000 1.12
+++ Tooltips.h 14 Oct 2002 16:00:00 -0000
@@ -43,9 +43,6 @@ public:
/// Are the tooltips on or off?
static bool enabled() { return enabled_; }
- /// This method is connected to the tooltipsToggled signal.
- void set();
-
#if FL_VERSION < 1 && FL_REVISION < 89
/** Return the tooltip associated with this object.
@@ -61,6 +58,9 @@ public:
static void toggleEnabled();
private:
+
+ /// This method is connected to the Tooltips::toggled signal.
+ void set();
/// Are the tooltips on or off?
static bool enabled_;