FLTK 1.4.4: Fl_Tooltip.H Source File

FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Tooltip.H
1//
2// Tooltip header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2011 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17/* \file
18 Fl_Tooltip widget . */
19
20#ifndef Fl_Tooltip_H
21#define Fl_Tooltip_H
22
23#include <FL/Fl.H>
24#include <FL/Fl_Widget.H>
25
34 class FL_EXPORT Fl_Tooltip {
35 friend class Fl_TooltipBox;
36public:
38 static float delay() { return delay_; }
40 static void delay(float f) { delay_ = f; }
42 static float hidedelay() { return hidedelay_; }
44 static void hidedelay(float f) { hidedelay_ = f; }
49 static float hoverdelay() { return hoverdelay_; }
54 static void hoverdelay(float f) { hoverdelay_ = f; }
56 static int enabled() { return Fl::option(Fl::OPTION_SHOW_TOOLTIPS); }
58 static void enable(int b = 1) { Fl::option(Fl::OPTION_SHOW_TOOLTIPS, (b!=0));}
60 static void disable() { enable(0); }
61 static void (*enter)(Fl_Widget* w);
62 static void enter_area(Fl_Widget* w, int X, int Y, int W, int H, const char* tip);
63 static void (*exit)(Fl_Widget *w);
65 static Fl_Widget* current() {return widget_;}
66 static void current(Fl_Widget*);
67
69 static Fl_Font font() { return font_; }
71 static void font(Fl_Font i) { font_ = i; }
73 static Fl_Fontsize size() { return (size_ == -1 ? FL_NORMAL_SIZE : size_); }
75 static void size(Fl_Fontsize s) { size_ = s; }
77 static Fl_Color color() { return color_; }
79 static void color(Fl_Color c) { color_ = c; }
81 static Fl_Color textcolor() { return textcolor_; }
83 static void textcolor(Fl_Color c) { textcolor_ = c; }
85 static int margin_width() { return margin_width_; }
87 static void margin_width(int v) { margin_width_ = v; }
89 static int margin_height() { return margin_height_; }
91 static void margin_height(int v) { margin_height_ = v; }
93 static int wrap_width() { return wrap_width_; }
95 static void wrap_width(int v) { wrap_width_ = v; }
97 static Fl_Window* current_window(void);
98
99 // These should not be public, but Fl_Widget::tooltip() needs them...
100 // fabien: made it private with only a friend function access
101private:
102 friend void Fl_Widget::tooltip(const char *);
103 friend void Fl_Widget::copy_tooltip(const char *);
104 static void enter_(Fl_Widget* w);
105 static void exit_(Fl_Widget *w);
106 static void set_enter_exit_once_();
107
108private:
109 static float delay_;
110 static float hidedelay_;
111 static float hoverdelay_;
112 static Fl_Color color_;
113 static Fl_Color textcolor_;
114 static Fl_Font font_;
115 static Fl_Fontsize size_;
116 static Fl_Widget* widget_;
117 static int margin_width_;
118 static int margin_height_;
119 static int wrap_width_;
120 static const int draw_symbols_; // 1 = draw @-symbols in tooltips, 0 = no
121};
122
123#endif
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1063
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
FL_NORMAL_SIZE
Fl_Fontsize FL_NORMAL_SIZE
normal font size
Definition Fl_Widget.cxx:107
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1092
Fl.H
Fl static class.
Fl_Widget.H
Fl_Widget and Fl_Label classes.
Fl_Tooltip
The Fl_Tooltip class provides tooltip support for all FLTK widgets.
Definition Fl_Tooltip.H:34
Fl_Tooltip::margin_width
static void margin_width(int v)
Sets the amount of extra space left/right of the tooltip's text.
Definition Fl_Tooltip.H:87
Fl_Tooltip::delay
static float delay()
Gets the tooltip delay.
Definition Fl_Tooltip.H:38
Fl_Tooltip::textcolor
static Fl_Color textcolor()
Gets the color of the text in the tooltip.
Definition Fl_Tooltip.H:81
Fl_Tooltip::delay
static void delay(float f)
Sets the tooltip delay.
Definition Fl_Tooltip.H:40
Fl_Tooltip::font
static Fl_Font font()
Gets the typeface for the tooltip text.
Definition Fl_Tooltip.H:69
Fl_Tooltip::margin_height
static int margin_height()
Gets the amount of extra space above and below the tooltip's text.
Definition Fl_Tooltip.H:89
Fl_Tooltip::enabled
static int enabled()
Returns non-zero if tooltips are enabled.
Definition Fl_Tooltip.H:56
Fl_Tooltip::color
static void color(Fl_Color c)
Sets the background color for tooltips.
Definition Fl_Tooltip.H:79
Fl_Tooltip::hidedelay
static float hidedelay()
Gets the time until an open tooltip hides again.
Definition Fl_Tooltip.H:42
Fl_Tooltip::current
static Fl_Widget * current()
Gets the current widget target.
Definition Fl_Tooltip.H:65
Fl_Tooltip::hidedelay
static void hidedelay(float f)
Sets the time until an open tooltip hides again.
Definition Fl_Tooltip.H:44
Fl_Tooltip::enable
static void enable(int b=1)
Enables tooltips on all widgets (or disables if b is false).
Definition Fl_Tooltip.H:58
Fl_Tooltip::wrap_width
static int wrap_width()
Gets the maximum width for tooltip's text before it word wraps.
Definition Fl_Tooltip.H:93
Fl_Tooltip::size
static Fl_Fontsize size()
Gets the size of the tooltip text.
Definition Fl_Tooltip.H:73
Fl_Tooltip::textcolor
static void textcolor(Fl_Color c)
Sets the color of the text in the tooltip.
Definition Fl_Tooltip.H:83
Fl_Tooltip::margin_width
static int margin_width()
Gets the amount of extra space left/right of the tooltip's text.
Definition Fl_Tooltip.H:85
Fl_Tooltip::hoverdelay
static void hoverdelay(float f)
Sets the tooltip hover delay, the delay between tooltips.
Definition Fl_Tooltip.H:54
Fl_Tooltip::font
static void font(Fl_Font i)
Sets the typeface for the tooltip text.
Definition Fl_Tooltip.H:71
Fl_Tooltip::wrap_width
static void wrap_width(int v)
Sets the maximum width for tooltip's text before it word wraps.
Definition Fl_Tooltip.H:95
Fl_Tooltip::color
static Fl_Color color()
Gets the background color for tooltips.
Definition Fl_Tooltip.H:77
Fl_Tooltip::margin_height
static void margin_height(int v)
Sets the amount of extra space above and below the tooltip's text.
Definition Fl_Tooltip.H:91
Fl_Tooltip::hoverdelay
static float hoverdelay()
Gets the tooltip hover delay, the delay between tooltips.
Definition Fl_Tooltip.H:49
Fl_Tooltip::size
static void size(Fl_Fontsize s)
Sets the size of the tooltip text.
Definition Fl_Tooltip.H:75
Fl_Tooltip::disable
static void disable()
Same as enable(0), disables tooltips on all widgets.
Definition Fl_Tooltip.H:60
Fl_Widget
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:112
Fl_Widget::tooltip
const char * tooltip() const
Gets the current tooltip text.
Definition Fl_Widget.H:731
Fl_Widget::copy_tooltip
void copy_tooltip(const char *text)
Sets the current tooltip text.
Definition Fl_Tooltip.cxx:386
Fl_Window
This widget produces an actual window.
Definition Fl_Window.H:55
Fl::OPTION_SHOW_TOOLTIPS
@ OPTION_SHOW_TOOLTIPS
If tooltips are enabled (default), hovering the mouse over a widget with a tooltip text will open a l...
Definition Fl.H:267
Fl::option
static bool option(Fl_Option opt)
FLTK library options management.
Definition Fl.cxx:2047