00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_TOOLTIP_H_
00023 #define _FL_TOOLTIP_H_
00024
00025 #include "Fl.h"
00026 #include "Fl_Widget.h"
00027
00029 class FL_API Fl_Tooltip {
00030 static Fl_Widget* widget;
00031 public:
00032 static float delay() { return delay_; }
00033 static void delay(float f) { delay_ = f; }
00034
00035 static bool enabled() { return enabled_; }
00036 static void enable(bool b = true) { enabled_ = b; }
00037 static void disable() { enabled_ = false; }
00038
00039 static bool effects() { return effects_; }
00040 static void effects(bool v) { effects_ = v; }
00041
00042 static int effect_type() { return effect_type_; }
00043 static void effect_type(int v) { effect_type_ = v; }
00044
00045 typedef const char* (*Generator)(Fl_Widget*, void*);
00046 static void enter(Fl_Widget* w, int X, int Y, int W, int H, Generator, void* = 0);
00047 static void enter(Fl_Widget* w, int X, int Y, int W, int H, const char* t) { enter(w, X, Y, W, H, 0, (void*)t); }
00048 static void enter(Fl_Widget* w);
00049 static void exit();
00050 static Fl_Widget* current() {return widget;}
00051 static void current(Fl_Widget*);
00052
00053 static Fl_Named_Style* default_style;
00054 static Fl_Font font() { return default_style->label_font; }
00055 static void font(Fl_Font i) { default_style->label_font = i; }
00056 static unsigned size() { return default_style->label_size; }
00057 static void size(unsigned s) { default_style->label_size = s; }
00058 static void color(Fl_Color c) { default_style->color = c; }
00059 static Fl_Color color() { return default_style->color; }
00060 static void textcolor(Fl_Color c) {default_style->label_color = c; }
00061 static Fl_Color textcolor() { return default_style->label_color; }
00062 static void boxtype(Fl_Boxtype b) {default_style->box = b; }
00063 static Fl_Boxtype boxtype() { return default_style->box; }
00064
00065 private:
00066 static float delay_;
00067 static bool enabled_;
00068 static bool effects_;
00069 static int effect_type_;
00070 static void tooltip_timeout(void*);
00071 };
00072
00073 #endif