summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2002-05-13 05:05:11 +0000
committerBill Spitzak <spitzak@gmail.com>2002-05-13 05:05:11 +0000
commit80465e4bfff4fd298fa6fb40ccb624d4abd57709 (patch)
treef623ce9c237a4cd0bb142e07dd4949be97149865 /FL
parenta35c5a6a2e74b9c9aa87f71b699a4b86cda0b857 (diff)
Backported the fltk2.0 tooltips. This may be somewhat binary incompatable
as Fl_Widget::tooltip(x) is no longer an inline (though the previous version will work if there is at least one call to the new one). It may be better to just enable tooltips all the time. Also Fl_Tooltip::enable() is changed, but few programs call that. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2210 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Tooltip.H59
-rw-r--r--FL/Fl_Widget.H6
2 files changed, 24 insertions, 41 deletions
diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H
index 785059ba1..5328dc510 100644
--- a/FL/Fl_Tooltip.H
+++ b/FL/Fl_Tooltip.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tooltip.H,v 1.16.2.7 2002/04/14 02:43:48 easysw Exp $"
+// "$Id: Fl_Tooltip.H,v 1.16.2.8 2002/05/13 05:05:11 spitzak Exp $"
//
// Tooltip header file for the Fast Light Tool Kit (FLTK).
//
@@ -23,59 +23,42 @@
// Please report all bugs and problems to "fltk-bugs@fltk.org".
//
-#ifndef _Fl_Tooltip_H_
-#define _Fl_Tooltip_H_
+#ifndef Fl_Tooltip_H
+#define Fl_Tooltip_H
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
-
-class Fl_Tooltip_Box;
-class Fl_Tooltip_Window;
-
class FL_EXPORT Fl_Tooltip {
-
- friend class Fl_Tooltip_Box;
- friend class Fl_Tooltip_Window;
- friend class Fl_Widget;
-
- static float delay_;
- static Fl_Tooltip_Box *box;
- static Fl_Tooltip_Window *window;
- static Fl_Widget *widget;
- static int shown;
- static unsigned color_;
- static int font_;
- static int size_;
-
- static void tooltip_timeout(void *);
- static void tooltip_exit(Fl_Widget *);
-
- static void (*tooltip_callback_)(void *);
- static void (*tooltip_exit_)(void *);
-
public:
-
- // These functions are user-called functions
static float delay() { return delay_; }
- static void delay(float f) { delay_ = (f < 0.1f) ? 0.1f : f; }
+ static void delay(float f) { delay_ = f; }
+ static int enabled() { return enabled_; }
+ static void enable(int b = 1) { enabled_ = b;}
+ static void disable() { enabled_ = 0; }
+ static void (*enter)(Fl_Widget* w);
+ static void enter_area(Fl_Widget* w, int X, int Y, int W, int H, const char* tip);
+ static void (*exit)(Fl_Widget *w);
+
static int font() { return font_; }
static int size() { return size_; }
static void font(int i) { font_ = i; }
static void size(int s) { size_ = s; }
static void color(unsigned c) { color_ = c; }
static Fl_Color color() { return (Fl_Color)color_; }
-
- static void enter(Fl_Widget *w);
- static void exit(Fl_Widget *w);
- static int enabled() {return tooltip_callback_ != 0;}
- static void enable(int b = 1) {if (!b) enter(0); tooltip_callback_ = b ? tooltip_timeout : 0; tooltip_exit_ = b ? (void (*)(void *))tooltip_exit : 0;}
- static void disable() {enter(0); tooltip_callback_ = 0; tooltip_exit_ = 0;}
+ static void textcolor(unsigned c) { textcolor_ = c; }
+ static Fl_Color textcolor() { return (Fl_Color)textcolor_; }
+private:
+ static float delay_;
+ static int enabled_;
+ static unsigned color_;
+ static unsigned textcolor_;
+ static int font_;
+ static int size_;
};
-
#endif
//
-// End of "$Id: Fl_Tooltip.H,v 1.16.2.7 2002/04/14 02:43:48 easysw Exp $".
+// End of "$Id: Fl_Tooltip.H,v 1.16.2.8 2002/05/13 05:05:11 spitzak Exp $".
//
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 50e8d9a94..958879364 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Widget.H,v 1.6.2.4.2.13 2002/01/01 15:11:28 easysw Exp $"
+// "$Id: Fl_Widget.H,v 1.6.2.4.2.14 2002/05/13 05:05:11 spitzak Exp $"
//
// Widget header file for the Fast Light Tool Kit (FLTK).
//
@@ -143,7 +143,7 @@ public:
void deimage(Fl_Image* a) {label_.deimage=a;}
void deimage(Fl_Image& a) {label_.deimage=&a;}
const char *tooltip() const {return tooltip_;}
- void tooltip(const char *t) {tooltip_=t;}
+ FL_EXPORT void tooltip(const char *t);
Fl_Callback_p callback() const {return callback_;}
void callback(Fl_Callback* c, void* p) {callback_=c; user_data_=p;}
void callback(Fl_Callback* c) {callback_=c;}
@@ -207,5 +207,5 @@ public:
#endif
//
-// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.13 2002/01/01 15:11:28 easysw Exp $".
+// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.14 2002/05/13 05:05:11 spitzak Exp $".
//