summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
Diffstat (limited to 'FL')
-rw-r--r--FL/Enumerations.H6
-rw-r--r--FL/Fl_Tooltip.H12
-rw-r--r--FL/names.h5
3 files changed, 16 insertions, 7 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H
index 2478a8c58..db6465096 100644
--- a/FL/Enumerations.H
+++ b/FL/Enumerations.H
@@ -414,7 +414,11 @@ enum Fl_Event { // events
/** A zoom event (ctrl/+/-/0/ or cmd/+/-/0/) was processed.
Use Fl::add_handler() to be notified of this event.
*/
- FL_ZOOM_EVENT = 27
+ FL_ZOOM_EVENT = 27,
+ /** A tooltip is about to pop up for this widget. The mouse coordinates are
+ available in Fl::event_x() and Fl::event_y(). Change the widget tooltip
+ as needed. */
+ FL_TOOLTIP_EVENT = 28
// DEV NOTE: Keep this list in sync with FL/names.h
};
diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H
index b79d93149..d417ba189 100644
--- a/FL/Fl_Tooltip.H
+++ b/FL/Fl_Tooltip.H
@@ -95,6 +95,8 @@ public:
static void wrap_width(int v) { wrap_width_ = v; }
/** Returns the window that is used for tooltips */
static Fl_Window* current_window(void);
+ /** \brief Temporarily Override Tooltip Text during an FL_TOOLTIP_EVENT. */
+ static int override_text(const char *new_text);
// These should not be public, but Fl_Widget::tooltip() needs them...
// fabien: made it private with only a friend function access
@@ -104,20 +106,22 @@ private:
static void enter_(Fl_Widget* w);
static void exit_(Fl_Widget *w);
static void set_enter_exit_once_();
+ static void tooltip_timeout_(void*);
private:
- static float delay_; //!< delay before a tooltip is shown
- static float hidedelay_; //!< delay until tooltip is closed again
- static float hoverdelay_; //!< delay between tooltips
+ static float delay_; //!< delay before a tooltip is shown
+ static float hidedelay_; //!< delay until tooltip is closed again
+ static float hoverdelay_; //!< delay between tooltips
static Fl_Color color_;
static Fl_Color textcolor_;
static Fl_Font font_;
static Fl_Fontsize size_;
- static Fl_Widget* widget_; //!< Keeps track of the current target widget
+ static Fl_Widget* widget_; //!< Keeps track of the current target widget
static int margin_width_; //!< distance around tooltip text left+right
static int margin_height_; //!< distance around tooltip text top+bottom
static int wrap_width_; //!< maximum width of tooltip text before it word wraps
static const int draw_symbols_; // 1 = draw @-symbols in tooltips, 0 = no
+ static char *override_text_; //!< a copy of the last text for an overridden tooltip
};
#endif
diff --git a/FL/names.h b/FL/names.h
index 984afbfe0..e47d005ec 100644
--- a/FL/names.h
+++ b/FL/names.h
@@ -73,9 +73,10 @@ const char * const fl_eventnames[] =
"FL_FULLSCREEN",
"FL_ZOOM_GESTURE",
"FL_ZOOM_EVENT",
- "FL_EVENT_28", // not yet defined, just in case it /will/ be defined ...
+ "FL_TOOLTIP_EVENT",
"FL_EVENT_29", // not yet defined, just in case it /will/ be defined ...
- "FL_EVENT_30" // not yet defined, just in case it /will/ be defined ...
+ "FL_EVENT_30", // not yet defined, just in case it /will/ be defined ...
+ "FL_EVENT_31" // not yet defined, just in case it /will/ be defined ...
};
/**