FLTK 1.3.9
Loading...
Searching...
No Matches
Fl_Tooltip Class Reference

The Fl_Tooltip class provides tooltip support for all FLTK widgets. More...

#include <Fl_Tooltip.H>

Static Public Member Functions

static Fl_Color color ()
 Gets the background color for tooltips.
 
static void color (Fl_Color c)
 Sets the background color for tooltips.
 
static Fl_Widgetcurrent ()
 Gets the current widget target.
 
static void current (Fl_Widget *)
 Sets the current widget target.
 
static float delay ()
 Gets the tooltip delay.
 
static void delay (float f)
 Sets the tooltip delay.
 
static void disable ()
 Same as enable(0), disables tooltips on all widgets.
 
static void enable (int b=1)
 Enables tooltips on all widgets (or disables if b is false).
 
static int enabled ()
 Returns non-zero if tooltips are enabled.
 
static void enter_area (Fl_Widget *w, int X, int Y, int W, int H, const char *tip)
 You may be able to use this to provide tooltips for internal pieces of your widget.
 
static Fl_Font font ()
 Gets the typeface for the tooltip text.
 
static void font (Fl_Font i)
 Sets the typeface for the tooltip text.
 
static float hoverdelay ()
 Gets the tooltip hover delay, the delay between tooltips.
 
static void hoverdelay (float f)
 Sets the tooltip hover delay, the delay between tooltips.
 
static int margin_height ()
 Gets the amount of extra space above and below the tooltip's text.
 
static void margin_height (int v)
 Sets the amount of extra space above and below the tooltip's text.
 
static int margin_width ()
 Gets the amount of extra space left/right of the tooltip's text.
 
static void margin_width (int v)
 Sets the amount of extra space left/right of the tooltip's text.
 
static Fl_Fontsize size ()
 Gets the size of the tooltip text.
 
static void size (Fl_Fontsize s)
 Sets the size of the tooltip text.
 
static Fl_Color textcolor ()
 Gets the color of the text in the tooltip.
 
static void textcolor (Fl_Color c)
 Sets the color of the text in the tooltip.
 
static int wrap_width ()
 Gets the maximum width for tooltip's text before it word wraps.
 
static void wrap_width (int v)
 Sets the maximum width for tooltip's text before it word wraps.
 

Static Public Attributes

static void(* enter )(Fl_Widget *w) = nothing
 
static void(* exit )(Fl_Widget *w) = nothing
 

Friends

void Fl_Widget::copy_tooltip (const char *)
 
void Fl_Widget::tooltip (const char *)
 

Detailed Description

The Fl_Tooltip class provides tooltip support for all FLTK widgets.

It contains only static methods.

Fl_Tooltip Options

Member Function Documentation

◆ color() [1/2]

static Fl_Color Fl_Tooltip::color ( )
inlinestatic

Gets the background color for tooltips.

The default background color is a pale yellow.

◆ color() [2/2]

static void Fl_Tooltip::color ( Fl_Color  c)
inlinestatic

Sets the background color for tooltips.

The default background color is a pale yellow.

◆ current()

void Fl_Tooltip::current ( Fl_Widget w)
static

Sets the current widget target.

Acts as though enter(widget) was done but does not pop up a tooltip. This is useful to prevent a tooltip from reappearing when a modal overlapping window is deleted. FLTK does this automatically when you click the mouse button.

◆ delay() [1/2]

static float Fl_Tooltip::delay ( )
inlinestatic

Gets the tooltip delay.

The default delay is 1.0 seconds.

◆ delay() [2/2]

static void Fl_Tooltip::delay ( float  f)
inlinestatic

Sets the tooltip delay.

The default delay is 1.0 seconds.

◆ disable()

static void Fl_Tooltip::disable ( )
inlinestatic

Same as enable(0), disables tooltips on all widgets.


◆ enable()

static void Fl_Tooltip::enable ( int  b = 1)
inlinestatic

Enables tooltips on all widgets (or disables if b is false).


◆ enabled()

static int Fl_Tooltip::enabled ( )
inlinestatic

Returns non-zero if tooltips are enabled.


◆ enter_area()

void Fl_Tooltip::enter_area ( Fl_Widget wid,
int  x,
int  y,
int  w,
int  h,
const char *  t 
)
static

You may be able to use this to provide tooltips for internal pieces of your widget.

Call this after setting Fl::belowmouse() to your widget (because that calls the above enter() method). Then figure out what thing the mouse is pointing at, and call this with the widget (this pointer is used to remove the tooltip if the widget is deleted or hidden, and to locate the tooltip), the rectangle surrounding the area, relative to the top-left corner of the widget (used to calculate where to put the tooltip), and the text of the tooltip (which must be a pointer to static data as it is not copied).

◆ font() [1/2]

static Fl_Font Fl_Tooltip::font ( )
inlinestatic

Gets the typeface for the tooltip text.


◆ font() [2/2]

static void Fl_Tooltip::font ( Fl_Font  i)
inlinestatic

Sets the typeface for the tooltip text.


◆ hoverdelay() [1/2]

static float Fl_Tooltip::hoverdelay ( )
inlinestatic

Gets the tooltip hover delay, the delay between tooltips.

The default delay is 0.2 seconds.

◆ hoverdelay() [2/2]

static void Fl_Tooltip::hoverdelay ( float  f)
inlinestatic

Sets the tooltip hover delay, the delay between tooltips.

The default delay is 0.2 seconds.

◆ margin_height() [1/2]

static int Fl_Tooltip::margin_height ( )
inlinestatic

Gets the amount of extra space above and below the tooltip's text.

Default is 3.

◆ margin_height() [2/2]

static void Fl_Tooltip::margin_height ( int  v)
inlinestatic

Sets the amount of extra space above and below the tooltip's text.

Default is 3.

◆ margin_width() [1/2]

static int Fl_Tooltip::margin_width ( )
inlinestatic

Gets the amount of extra space left/right of the tooltip's text.

Default is 3.

◆ margin_width() [2/2]

static void Fl_Tooltip::margin_width ( int  v)
inlinestatic

Sets the amount of extra space left/right of the tooltip's text.

Default is 3.

◆ size() [1/2]

static Fl_Fontsize Fl_Tooltip::size ( )
inlinestatic

Gets the size of the tooltip text.


◆ size() [2/2]

static void Fl_Tooltip::size ( Fl_Fontsize  s)
inlinestatic

Sets the size of the tooltip text.


◆ textcolor() [1/2]

static Fl_Color Fl_Tooltip::textcolor ( )
inlinestatic

Gets the color of the text in the tooltip.

The default is black.

◆ textcolor() [2/2]

static void Fl_Tooltip::textcolor ( Fl_Color  c)
inlinestatic

Sets the color of the text in the tooltip.

The default is black.

◆ wrap_width() [1/2]

static int Fl_Tooltip::wrap_width ( )
inlinestatic

Gets the maximum width for tooltip's text before it word wraps.

Default is 400.

◆ wrap_width() [2/2]

static void Fl_Tooltip::wrap_width ( int  v)
inlinestatic

Sets the maximum width for tooltip's text before it word wraps.

Default is 400.


The documentation for this class was generated from the following files: