NTK 1.3.0
Fl_Tooltip.H
1//
2// "$Id: Fl_Tooltip.H 8405 2011-02-08 20:59:46Z manolo $"
3//
4// Tooltip header file for the Fast Light Tool Kit (FLTK).
5//
6// Copyright 1998-2011 by Bill Spitzak and others.
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Library General Public
10// License as published by the Free Software Foundation; either
11// version 2 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Library General Public License for more details.
17//
18// You should have received a copy of the GNU Library General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21// USA.
22//
23// Please report all bugs and problems on the following page:
24//
25// http://www.fltk.org/str.php
26//
27
28/* \file
29 Fl_Tooltip widget . */
30
31#ifndef Fl_Tooltip_H
32#define Fl_Tooltip_H
33
34#include <FL/Fl.H>
35#include <FL/Fl_Widget.H>
36
41class FL_EXPORT Fl_Tooltip {
42public:
44 static float delay() { return delay_; }
46 static void delay(float f) { delay_ = f; }
51 static float hoverdelay() { return hoverdelay_; }
56 static void hoverdelay(float f) { hoverdelay_ = f; }
60 static void enable(int b = 1) { Fl::option(Fl::OPTION_SHOW_TOOLTIPS, (b!=0));}
62 static void disable() { enable(0); }
63 static void (*enter)(Fl_Widget* w);
64 static void enter_area(Fl_Widget* w, int X, int Y, int W, int H, const char* tip);
65 static void (*exit)(Fl_Widget *w);
67 static Fl_Widget* current() {return widget_;}
68 static void current(Fl_Widget*);
69
71 static Fl_Font font() { return font_; }
73 static void font(Fl_Font i) { font_ = i; }
75 static Fl_Fontsize size() { return (size_ == -1 ? FL_NORMAL_SIZE : size_); }
77 static void size(Fl_Fontsize s) { size_ = s; }
79 static Fl_Color color() { return color_; }
81 static void color(Fl_Color c) { color_ = c; }
83 static Fl_Color textcolor() { return textcolor_; }
85 static void textcolor(Fl_Color c) { textcolor_ = c; }
86#ifdef __APPLE__
87 // the unique tooltip window
88 static Fl_Window* current_window(void);
89#endif
90
91 // These should not be public, but Fl_Widget::tooltip() needs them...
92 // fabien: made it private with only a friend function access
93private:
94 friend void Fl_Widget::tooltip(const char *);
95 friend void Fl_Widget::copy_tooltip(const char *);
96 static void enter_(Fl_Widget* w);
97 static void exit_(Fl_Widget *w);
98 static void set_enter_exit_once_();
99
100private:
101 static float delay_;
102 static float hoverdelay_;
103 static Fl_Color color_;
104 static Fl_Color textcolor_;
105 static Fl_Font font_;
106 static Fl_Fontsize size_;
107 static Fl_Widget* widget_;
108};
109
110extern void (*fl_show_tooltip)( const char *s );
111extern void (*fl_hide_tooltip)( void );
112
113#endif
114
115//
116// End of "$Id: Fl_Tooltip.H 8405 2011-02-08 20:59:46Z manolo $".
117//
FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE
normal font size
Definition: Fl_Widget.cxx:111
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:707
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:764
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:736
Fl static class.
Fl_Widget, Fl_Label classes .
The Fl_Tooltip class provides tooltip support for all FLTK widgets.
Definition: Fl_Tooltip.H:41
static float delay()
Gets the tooltip delay.
Definition: Fl_Tooltip.H:44
static Fl_Color textcolor()
Gets the color of the text in the tooltip.
Definition: Fl_Tooltip.H:83
static void delay(float f)
Sets the tooltip delay.
Definition: Fl_Tooltip.H:46
static Fl_Font font()
Gets the typeface for the tooltip text.
Definition: Fl_Tooltip.H:71
static int enabled()
Returns non-zero if tooltips are enabled.
Definition: Fl_Tooltip.H:58
static void color(Fl_Color c)
Sets the background color for tooltips.
Definition: Fl_Tooltip.H:81
static Fl_Widget * current()
Gets the current widget target.
Definition: Fl_Tooltip.H:67
static void enable(int b=1)
Enables tooltips on all widgets (or disables if b is false).
Definition: Fl_Tooltip.H:60
static Fl_Fontsize size()
Gets the size of the tooltip text.
Definition: Fl_Tooltip.H:75
static void textcolor(Fl_Color c)
Sets the color of the text in the tooltip.
Definition: Fl_Tooltip.H:85
static void hoverdelay(float f)
Sets the tooltip hover delay, the delay between tooltips.
Definition: Fl_Tooltip.H:56
static void font(Fl_Font i)
Sets the typeface for the tooltip text.
Definition: Fl_Tooltip.H:73
static Fl_Color color()
Gets the background color for tooltips.
Definition: Fl_Tooltip.H:79
static float hoverdelay()
Gets the tooltip hover delay, the delay between tooltips.
Definition: Fl_Tooltip.H:51
static void size(Fl_Fontsize s)
Sets the size of the tooltip text.
Definition: Fl_Tooltip.H:77
static void disable()
Same as enable(0), disables tooltips on all widgets.
Definition: Fl_Tooltip.H:62
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:111
const char * tooltip() const
Gets the current tooltip text.
Definition: Fl_Widget.H:550
void copy_tooltip(const char *text)
Sets the current tooltip text.
Definition: Fl_Tooltip.cxx:365
This widget produces an actual window.
Definition: Fl_Window.H:58
@ OPTION_SHOW_TOOLTIPS
If tooltips are enabled, hovering the mouse over a widget with a tooltip text will open a little tool...
Definition: Fl.H:184
static bool option(Fl_Option opt)
FLTK library options management.
Definition: Fl.cxx:1980