summaryrefslogtreecommitdiff
path: root/src/Fl_Tooltip.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-08-02 15:32:00 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-08-02 15:32:00 +0000
commit836d2fac260c861106e0d96203bea4a04c9dd2d2 (patch)
treee265f4eab743fc350dac1af4394fe88440c7181c /src/Fl_Tooltip.cxx
parentbd069130577e28b3b26dbb5637bb3172fe108e81 (diff)
Fix tooltips a la 2.0.
Update 1.1 tooltip interface to be identical to the 2.0 interface for most things (no enter_area function right now...) Add localized makedepend files (no system include files, just ../FL/bla.h) so that builds recompile as necessary. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1516 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Tooltip.cxx')
-rw-r--r--src/Fl_Tooltip.cxx30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx
index a2c05b07a..929f90ca9 100644
--- a/src/Fl_Tooltip.cxx
+++ b/src/Fl_Tooltip.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tooltip.cxx,v 1.38.2.1 2001/08/01 21:24:49 easysw Exp $"
+// "$Id: Fl_Tooltip.cxx,v 1.38.2.2 2001/08/02 15:31:59 easysw Exp $"
//
// Tooltip source file for the Fast Light Tool Kit (FLTK).
//
@@ -27,6 +27,7 @@
#include <FL/Fl_Menu_Window.H>
#include <FL/Fl_Box.H>
#include <FL/fl_draw.H>
+#include <FL/Fl_Tooltip.H>
#include <stdio.h>
@@ -71,7 +72,7 @@ public:
Fl_Window *widgetWindow = Fl_Tooltip::widget->window();
if (!widgetWindow) {
- printf("!widgetWindow\n");
+// printf("!widgetWindow\n");
return;
}
@@ -109,6 +110,13 @@ public:
// when the pointer enters them
void
Fl_Tooltip::enter(Fl_Widget *w) {
+// printf("Fl_Tooltip::enter(%p)\n", w);
+ if ((!w || !w->tooltip()) && tooltip_callback_ && window) {
+ Fl::remove_timeout(tooltip_callback_);
+ window->hide();
+ shown = 0;
+ return;
+ }
if (!tooltip_callback_ || !w || !w->tooltip()) return;
Fl::add_timeout(delay_, tooltip_callback_, w);
}
@@ -119,14 +127,21 @@ Fl_Tooltip::enter(Fl_Widget *w) {
// the widget
void
Fl_Tooltip::exit(Fl_Widget *w) {
- if (tooltip_exit_ && w && w->tooltip()) tooltip_exit_(w);
+// printf("Fl_Tooltip::exit(%p)\n", w);
+ if (tooltip_exit_) tooltip_exit_(w);
}
void
Fl_Tooltip::tooltip_exit(Fl_Widget *w) {
- Fl::remove_timeout(tooltip_callback_, w);
- if ((w == widget || (widget && w == widget->window())) && shown && window) {
- widget = 0;
+// printf("Fl_Tooltip::tooltip_exit(%p), widget = %p, window = %p, shown = %d\n",
+// w, widget, window, shown);
+ if (!w || w != widget) return;
+
+ Fl::remove_timeout(tooltip_callback_);
+
+ widget = 0;
+
+ if (window) {
window->hide();
shown = 0;
}
@@ -134,6 +149,7 @@ Fl_Tooltip::tooltip_exit(Fl_Widget *w) {
void
Fl_Tooltip::tooltip_timeout(void *v) {
+// printf("Fl_Tooltip::tooltip_timeout(%p)\n", v);
if (!window) {
Fl_Group* saveCurrent = Fl_Group::current();
Fl_Group::current(0);
@@ -172,5 +188,5 @@ Fl_Tooltip::tooltip_timeout(void *v) {
//
-// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.1 2001/08/01 21:24:49 easysw Exp $".
+// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.2 2001/08/02 15:31:59 easysw Exp $".
//