FLTK 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 
41 class FL_EXPORT Fl_Tooltip {
42 public:
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; }
58  static int enabled() { return Fl::option(Fl::OPTION_SHOW_TOOLTIPS); }
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
93 private:
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 
100 private:
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 
110 #endif
111 
112 //
113 // End of "$Id: Fl_Tooltip.H 8405 2011-02-08 20:59:46Z manolo $".
114 //