summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2003-09-14 14:11:06 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2003-09-14 14:11:06 +0000
commitf6769cebc6734ac38b4732da4997751f6d4cc94c (patch)
tree147f947ac1186db68ce2ec628833751579bd7b7d /src
parent8c56fa75c7d2c865778a0e35e242536063acfb4c (diff)
Add Fl_Tooltip::hoverdelay() method and code (STR #126)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3102 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Tooltip.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx
index 3c8c655ef..73866346d 100644
--- a/src/Fl_Tooltip.cxx
+++ b/src/Fl_Tooltip.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tooltip.cxx,v 1.38.2.27 2003/01/30 21:42:53 easysw Exp $"
+// "$Id: Fl_Tooltip.cxx,v 1.38.2.28 2003/09/14 14:11:06 easysw Exp $"
//
// Tooltip source file for the Fast Light Tool Kit (FLTK).
//
@@ -30,6 +30,7 @@
#include <stdio.h>
float Fl_Tooltip::delay_ = 1.0f;
+float Fl_Tooltip::hoverdelay_ = 0.2f;
int Fl_Tooltip::enabled_ = 1;
unsigned Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
FL_NUM_GREEN - 1,
@@ -156,7 +157,7 @@ tt_exit(Fl_Widget *w) {
if (window) window->hide();
if (recent_tooltip) {
if (Fl::event_state() & FL_BUTTONS) recent_tooltip = 0;
- else Fl::add_timeout(.2f, recent_timeout);
+ else Fl::add_timeout(Fl_Tooltip::hoverdelay(), recent_timeout);
}
}
@@ -203,7 +204,10 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t)
// remember it:
widget_ = wid; X = x; Y = y; W = w; H = h; tip = t;
// popup the tooltip immediately if it was recently up:
- if (recent_tooltip || Fl_Tooltip::delay() < .1) {
+ if (recent_tooltip) {
+ if (window) window->hide();
+ Fl::add_timeout(Fl_Tooltip::hoverdelay(), tooltip_timeout);
+ } else if (Fl_Tooltip::delay() < .1) {
#ifdef WIN32
// possible fix for the Windows titlebar, it seems to want the
// window to be destroyed, moving it messes up the parenting:
@@ -232,5 +236,5 @@ void Fl_Widget::tooltip(const char *tt) {
}
//
-// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.27 2003/01/30 21:42:53 easysw Exp $".
+// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.28 2003/09/14 14:11:06 easysw Exp $".
//