FLTK 1.3.2

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

Fl_Tooltip.H

    00001 //
    00002 // "$Id: Fl_Tooltip.H 9706 2012-11-06 20:46:14Z matt $"
    00003 //
    00004 // Tooltip header file for the Fast Light Tool Kit (FLTK).
    00005 //
    00006 // Copyright 1998-2011 by Bill Spitzak and others.
    00007 //
    00008 // This library is free software. Distribution and use rights are outlined in
    00009 // the file "COPYING" which should have been included with this file.  If this
    00010 // file is missing or damaged, see the license at:
    00011 //
    00012 //     http://www.fltk.org/COPYING.php
    00013 //
    00014 // Please report all bugs and problems on the following page:
    00015 //
    00016 //     http://www.fltk.org/str.php
    00017 //
    00018
    00019 /* \file
    00020    Fl_Tooltip widget . */
    00021
    00022 #ifndef Fl_Tooltip_H
    00023 #define Fl_Tooltip_H
    00024
    00025 #include <FL/Fl.H>
    00026 #include <FL/Fl_Widget.H>
    00027
    00036 class FL_EXPORT Fl_Tooltip {
    00037 public:
    00039   static float delay() { return delay_; }
    00041   static void delay(float f) { delay_ = f; }
    00046   static float hoverdelay() { return hoverdelay_; }
    00051   static void hoverdelay(float f) { hoverdelay_ = f; }
    00053   static int enabled() { return Fl::option(Fl::OPTION_SHOW_TOOLTIPS); }
    00055   static void enable(int b = 1) { Fl::option(Fl::OPTION_SHOW_TOOLTIPS, (b!=0));}
    00057   static void disable() { enable(0); }
    00058   static void (*enter)(Fl_Widget* w);
    00059   static void enter_area(Fl_Widget* w, int X, int Y, int W, int H, const char* tip);
    00060   static void (*exit)(Fl_Widget *w);
    00062   static Fl_Widget* current() {return widget_;}
    00063   static void current(Fl_Widget*);
    00064
    00066   static Fl_Font font() { return font_; }
    00068   static void font(Fl_Font i) { font_ = i; }
    00070   static Fl_Fontsize size() { return (size_ == -1 ? FL_NORMAL_SIZE : size_); }
    00072   static void size(Fl_Fontsize s) { size_ = s; }
    00074   static Fl_Color color() { return color_; }
    00076   static void color(Fl_Color c) { color_ = c; }
    00078   static Fl_Color textcolor() { return textcolor_; }
    00080   static void textcolor(Fl_Color c) { textcolor_ = c; }
    00081 #if FLTK_ABI_VERSION >= 10301
    00082
    00083   static int margin_width() { return margin_width_; }
    00085   static void margin_width(int v) { margin_width_ = v; }
    00087   static int margin_height() { return margin_height_; }
    00089   static void margin_height(int v) { margin_height_ = v; }
    00091   static int wrap_width() { return wrap_width_; }
    00093   static void wrap_width(int v) { wrap_width_ = v; }
    00094 #else
    00095   static int margin_width() { return 3; }
    00096   static int margin_height() { return 3; }
    00097   static int wrap_width() { return 400; }
    00098 #endif
    00099
    00100 #ifdef __APPLE__
    00101   // the unique tooltip window
    00102   static Fl_Window* current_window(void);
    00103 #endif
    00104
    00105   // These should not be public, but Fl_Widget::tooltip() needs them...
    00106   // fabien: made it private with only a friend function access
    00107 private:
    00108   friend void Fl_Widget::tooltip(const char *);
    00109   friend void Fl_Widget::copy_tooltip(const char *);
    00110   static void enter_(Fl_Widget* w);
    00111   static void exit_(Fl_Widget *w);
    00112   static void set_enter_exit_once_();
    00113
    00114 private:
    00115   static float delay_;
    00116   static float hoverdelay_;
    00117   static Fl_Color color_;
    00118   static Fl_Color textcolor_;
    00119   static Fl_Font font_;
    00120   static Fl_Fontsize size_;
    00121   static Fl_Widget* widget_;
    00122 #if FLTK_ABI_VERSION >= 10301
    00123   static int margin_width_;
    00124   static int margin_height_;
    00125   static int wrap_width_;
    00126 #endif
    00127 };
    00128
    00129 #endif
    00130
    00131 //
    00132 // End of "$Id: Fl_Tooltip.H 9706 2012-11-06 20:46:14Z matt $".
    00133 //