From 34716f86a02b71aa210f998dd7be48bc07550199 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Wed, 16 May 2012 23:19:37 +0000 Subject: Added three methods and dox to Fl_Tooltip: margin_width() -- controls margins around tooltip's text margin_height() -- controls margins above and below tooltip's text wrap_width() -- controls maximum width of text before wordwrapping is enforced These are read-only for the current release, and read/write as an ABI feature. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9510 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Tooltip.H | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'FL') diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H index ca631b327..0378aa80b 100644 --- a/FL/Fl_Tooltip.H +++ b/FL/Fl_Tooltip.H @@ -28,6 +28,10 @@ /** The Fl_Tooltip class provides tooltip support for all FLTK widgets. It contains only static methods. + + \image html tooltip-options.png "Fl_Tooltip Options" + \image latex src/tooltip-options.png "Fl_Tooltip Options" width=6cm + */ class FL_EXPORT Fl_Tooltip { public: @@ -74,6 +78,25 @@ public: static Fl_Color textcolor() { return textcolor_; } /** Sets the color of the text in the tooltip. The default is black. */ static void textcolor(Fl_Color c) { textcolor_ = c; } +#if FLTK_ABI_VERSION >= 10302 + /** Gets the amount of extra space left/right of the tooltip's text. Default is 3. */ + static int margin_width() { return margin_width_; } + /** Sets the amount of extra space left/right of the tooltip's text. Default is 3. */ + static void margin_width(int v) { margin_width_ = v; } + /** Gets the amount of extra space above and below the tooltip's text. Default is 3. */ + static int margin_height() { return margin_height_; } + /** Sets the amount of extra space above and below the tooltip's text. Default is 3. */ + static void margin_height(int v) { margin_height_ = v; } + /** Gets the maximum width for tooltip's text before it word wraps. Default is 400. */ + static int wrap_width() { return wrap_width_; } + /** Sets the maximum width for tooltip's text before it word wraps. Default is 400. */ + static void wrap_width(int v) { wrap_width_ = v; } +#else + static int margin_width() { return 3; } + static int margin_height() { return 3; } + static int wrap_width() { return 400; } +#endif + #ifdef __APPLE__ // the unique tooltip window static Fl_Window* current_window(void); @@ -96,6 +119,11 @@ private: static Fl_Font font_; static Fl_Fontsize size_; static Fl_Widget* widget_; //!< Keeps track of the current target widget +#if FLTK_ABI_VERSION >= 10302 + 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 +#endif }; #endif -- cgit v1.2.3