diff options
| author | Bill Spitzak <spitzak@gmail.com> | 2002-05-14 15:24:03 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 2002-05-14 15:24:03 +0000 |
| commit | 76b185b33e89ab3db5c404f32dd62879ab17a8c4 (patch) | |
| tree | 0d6bc08436f65945d6e558e5784d4823d1292cf3 /src | |
| parent | 7a455a05c64d74ebf5509c79f40715dbdcdc8a29 (diff) | |
Clicking on tooltips makes them go away and they don't reappear.
Tooltips do not appear when widgets are entered for reasons other
than the mouse moving (ie like when an overlaying window disappears)
Possible fix for WIN32 titlebar color when tooltip is instantly
displayed for a new widget (untested).
Recursion problem in DnD fixed (caused a drag inside the same program
to paste many times into where you dropped). Tested only on X but
this bug may be X-only.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2220 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 25 | ||||
| -rw-r--r-- | src/Fl_Input.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Tooltip.cxx | 17 |
3 files changed, 30 insertions, 18 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index c7fd27136..949107ee7 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl.cxx,v 1.24.2.41.2.28 2002/05/13 15:43:09 easysw Exp $" +// "$Id: Fl.cxx,v 1.24.2.41.2.29 2002/05/14 15:24:02 spitzak Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -424,7 +424,6 @@ void Fl::belowmouse(Fl_Widget *o) { Fl_Widget *p = belowmouse_; if (o != p) { belowmouse_ = o; - if (!dnd_flag) Fl_Tooltip::enter(o); for (; p && !p->contains(o); p = p->parent()) { p->handle(dnd_flag ? FL_DND_LEAVE : FL_LEAVE); } @@ -468,15 +467,15 @@ void fl_fix_focus() { } else Fl::focus(0); - if (!Fl::pushed()) { + if (!(Fl::event_state() & 0x7f00000 /*FL_BUTTONS*/)) { // set belowmouse based on Fl::modal() and fl_xmousewin: w = fl_xmousewin; if (w) { if (Fl::modal()) w = Fl::modal(); if (!w->contains(Fl::belowmouse())) { - Fl::belowmouse(w); w->handle(FL_ENTER); + if (!w->contains(Fl::belowmouse())) Fl::belowmouse(w); } else { // send a FL_MOVE event so the enter/leave state is up to date Fl::e_x = Fl::e_x_root-fl_xmousewin->x(); @@ -485,6 +484,7 @@ void fl_fix_focus() { } } else { Fl::belowmouse(0); + Fl_Tooltip::enter(0); } } } @@ -534,9 +534,10 @@ static int send(int event, Fl_Widget* to, Fl_Window* window) { int Fl::handle(int event, Fl_Window* window) { - Fl_Widget* w = window; - e_number = event; + if (fl_local_grab) return fl_local_grab(event); + + Fl_Widget* w = window; switch (event) { @@ -648,6 +649,7 @@ int Fl::handle(int event, Fl_Window* window) case FL_ENTER: fl_xmousewin = window; fl_fix_focus(); + Fl_Tooltip::enter(belowmouse()); return 1; case FL_LEAVE: @@ -663,10 +665,13 @@ int Fl::handle(int event, Fl_Window* window) default: break; } - if (w && send(event, w, window)) return 1; - int ret = send_handlers(event); + if (w && send(event, w, window)) { + dnd_flag = 0; + if (event == FL_MOVE) Fl_Tooltip::enter(belowmouse()); + return 1; + } dnd_flag = 0; - return ret; + return send_handlers(event); } //////////////////////////////////////////////////////////////// @@ -892,5 +897,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl.cxx,v 1.24.2.41.2.28 2002/05/13 15:43:09 easysw Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.41.2.29 2002/05/14 15:24:02 spitzak Exp $". // diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 304b5f4a3..0dafa564a 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input.cxx,v 1.10.2.15.2.10 2002/05/06 04:15:21 easysw Exp $" +// "$Id: Fl_Input.cxx,v 1.10.2.15.2.11 2002/05/14 15:24:03 spitzak Exp $" // // Input widget for the Fast Light Tool Kit (FLTK). // @@ -34,8 +34,6 @@ #include <FL/fl_draw.H> #include <FL/fl_ask.H> #include "flstring.h" -#include <stdio.h> - void Fl_Input::draw() { if (input_type() == FL_HIDDEN_INPUT) return; @@ -395,5 +393,5 @@ Fl_Input::Fl_Input(int x, int y, int w, int h, const char *l) } // -// End of "$Id: Fl_Input.cxx,v 1.10.2.15.2.10 2002/05/06 04:15:21 easysw Exp $". +// End of "$Id: Fl_Input.cxx,v 1.10.2.15.2.11 2002/05/14 15:24:03 spitzak Exp $". // diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 2597d050e..f0ed3a17b 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tooltip.cxx,v 1.38.2.20 2002/05/13 17:23:10 easysw Exp $" +// "$Id: Fl_Tooltip.cxx,v 1.38.2.21 2002/05/14 15:24:03 spitzak Exp $" // // Tooltip source file for the Fast Light Tool Kit (FLTK). // @@ -133,7 +133,6 @@ static void tt_enter(Fl_Widget* widget) { // printf("tt_enter(widget=%p)\n", widget); // printf(" window=%p\n", window); - // find the enclosing group with a tooltip: Fl_Widget* w = widget; while (w && !w->tooltip()) { @@ -164,6 +163,11 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) widget = wid; X = x; Y = y; W = w; H = h; tip = t; if (recent_tooltip || Fl_Tooltip::delay() < .1) { // switch directly from a previous tooltip to the new one: +#ifdef WIN32 + // possible fix for the Windows titlebar, it seems to want the + // window to be destroyed, moving it messes up the parenting: + if (window) window->hide(); +#endif tooltip_timeout(0); } else { if (window) window->hide(); @@ -173,7 +177,12 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) tip = 0; widget = 0; if (window) window->hide(); - if (recent_tooltip) Fl::add_timeout(.2, recent_timeout); + if (recent_tooltip) { + if (Fl::event_state() & 0x7f00000 /*FL_BUTTONS*/) + recent_tooltip = 0; + else + Fl::add_timeout(.2, recent_timeout); + } } // printf(" tip=\"%s\", window->shown()=%d\n", tip ? tip : "(null)", @@ -191,5 +200,5 @@ void Fl_Widget::tooltip(const char *tt) { } // -// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.20 2002/05/13 17:23:10 easysw Exp $". +// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.21 2002/05/14 15:24:03 spitzak Exp $". // |
