DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2041
Version: 1.4-feature


Attached file "str2041-r9162.patch"...


Link: http://www.fltk.org/str.php?L2041
Version: 1.4-feature
Index: src/Fl_Tooltip.cxx
===================================================================
--- src/Fl_Tooltip.cxx  (revision 9162)
+++ src/Fl_Tooltip.cxx  (working copy)
@@ -166,6 +166,12 @@
   for (;;) {
     if (!tw) {exit_(0); return;}
     if (tw == widget_) return;
+
+    // Send the FL_TOOLTIP event to tw. The return value technically does not 
matter.
+       // This allows tw to modify the its tooltip before it
+       // displays it. E.G. Slider widget with its current value as a tooltop.
+       tw->handle(FL_TOOLTIP);
+
     if (tw->tooltip()) break;
     tw = tw->parent();
   }
Index: src/Fl_Group.cxx
===================================================================
--- src/Fl_Group.cxx    (revision 9162)
+++ src/Fl_Group.cxx    (working copy)
@@ -277,6 +277,10 @@
       if (o->visible()) o->handle(event);
     }
     return 1;
+ 
+  case FL_TOOLTIP:
+    if (tooltip()) return 1;
+    return 0;
 
   default:
     // For all other events, try to give to each child, starting at focus:
Index: FL/Enumerations.H
===================================================================
--- FL/Enumerations.H   (revision 9162)
+++ FL/Enumerations.H   (working copy)
@@ -287,7 +287,16 @@
   /** The screen configuration (number, positions) was changed.
    Use Fl::add_handler() to be notified of this event.
    */
-  FL_SCREEN_CONFIGURATION_CHANGED = 24
+  FL_SCREEN_CONFIGURATION_CHANGED = 24,
+
+  /** The widget under the cursor has a chance to display a tooltip. 
+   *  When a widget receives this event, it can modify its tooltip. The
+   *  modified tooltip will be drawn. If the widget removes its tooltip,
+   *  the parent with a tooltip will be drawn.
+   *
+   *  \sa Fl_Widget::tooltip(const char *t)
+   */
+  FL_TOOLTIP   = 25
 };
 
 /** \name When Conditions */
Index: FL/names.h
===================================================================
--- FL/names.h  (revision 9162)
+++ FL/names.h  (working copy)
@@ -67,6 +67,7 @@
   "FL_DND_LEAVE",
   "FL_DND_RELEASE",
   "FL_SCREEN_CONFIGURATION_CHANGED",
+  "FL_TOOLTIP"
 };
 
 /**
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to