diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-30 01:26:05 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-30 01:26:05 +0000 |
| commit | 4bed0a3665cfa558009b8ac9b995eac11278c7a7 (patch) | |
| tree | 5d896d40ef1fa9cf15774db4be1e2135de068a67 | |
| parent | 36656517e6646a0bd8c287040ec57438cc686890 (diff) | |
Tooltip tweeks.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2716 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl.cxx | 46 | ||||
| -rw-r--r-- | src/Fl_Tooltip.cxx | 33 |
2 files changed, 46 insertions, 33 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index f2742a473..bd665eb26 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl.cxx,v 1.24.2.41.2.56 2002/10/29 19:45:09 easysw Exp $" +// "$Id: Fl.cxx,v 1.24.2.41.2.57 2002/10/30 01:26:03 easysw Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -811,27 +811,31 @@ Fl_Window::~Fl_Window() { int Fl_Window::handle(int ev) { - if (parent()) switch (ev) { - case FL_SHOW: - if (!shown()) show(); - else XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless - break; - case FL_HIDE: - if (shown()) { - // Find what really turned invisible, if is was a parent window - // we do nothing. We need to avoid unnecessary unmap calls - // because they cause the display to blink when the parent is - // remapped. However if this or any intermediate non-window - // widget has really had hide() called directly on it, we must - // unmap because when the parent window is remapped we don't - // want to reappear. - if (visible()) { - Fl_Widget* p = parent(); for (;p->visible();p = p->parent()) {} - if (p->type() >= FL_WINDOW) break; // don't do the unmap + if (parent()) { + switch (ev) { + case FL_SHOW: + if (!shown()) show(); + else XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless + break; + case FL_HIDE: + if (shown()) { + // Find what really turned invisible, if is was a parent window + // we do nothing. We need to avoid unnecessary unmap calls + // because they cause the display to blink when the parent is + // remapped. However if this or any intermediate non-window + // widget has really had hide() called directly on it, we must + // unmap because when the parent window is remapped we don't + // want to reappear. + if (visible()) { + Fl_Widget* p = parent(); for (;p->visible();p = p->parent()) {} + if (p->type() >= FL_WINDOW) break; // don't do the unmap + } + XUnmapWindow(fl_display, fl_xid(this)); } - XUnmapWindow(fl_display, fl_xid(this)); + break; } - break; +// } else if (ev == FL_FOCUS || ev == FL_UNFOCUS) { +// Fl_Tooltip::exit(Fl_Tooltip::current()); } return Fl_Group::handle(ev); @@ -969,5 +973,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl.cxx,v 1.24.2.41.2.56 2002/10/29 19:45:09 easysw Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.41.2.57 2002/10/30 01:26:03 easysw Exp $". // diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 214c66760..5d4ff5d1e 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tooltip.cxx,v 1.38.2.25 2002/10/29 19:45:10 easysw Exp $" +// "$Id: Fl_Tooltip.cxx,v 1.38.2.26 2002/10/30 01:26:05 easysw Exp $" // // Tooltip source file for the Fast Light Tool Kit (FLTK). // @@ -144,8 +144,10 @@ void Fl_Tooltip::current(Fl_Widget* w) { // This is called when a widget is destroyed: static void tt_exit(Fl_Widget *w) { -// printf("tt_exit(w=%p)\n", w); -// printf(" widget=%p, window=%p\n", widget, window); +#ifdef DEBUG + printf("tt_exit(w=%p)\n", w); + printf(" widget=%p, window=%p\n", Fl_Tooltip::current(), window); +#endif // DEBUG if (!Fl_Tooltip::current()) return; Fl_Tooltip::current(0); @@ -160,8 +162,11 @@ tt_exit(Fl_Widget *w) { static void tt_enter(Fl_Widget* wp) { -// printf("tt_enter(widget=%p)\n", widget); -// printf(" window=%p\n", window); +#ifdef DEBUG + printf("tt_enter(wp=%p)\n", wp); + printf(" window=%p\n", window); +#endif // DEBUG + // find the enclosing group with a tooltip: Fl_Widget* w = wp; while (w && !w->tooltip()) { @@ -171,16 +176,18 @@ tt_enter(Fl_Widget* wp) { if (!w) { Fl_Tooltip::enter_area(0, 0, 0, 0, 0, 0); } else { - Fl_Tooltip::enter_area(wp,0,0,wp->w(), wp->h(), w->tooltip()); + Fl_Tooltip::enter_area(w,0,0,w->w(), w->h(), w->tooltip()); } } void Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) { -// printf("Fl_Tooltip::enter_area(wid=%p, x=%d, y=%d, w=%d, h=%d, t=\"%s\")\n", -// wid, x, y, w, h, t ? t : "(null)"); -// printf(" recursion=%d, window=%p\n", recursion, window); +#ifdef DEBUG + printf("Fl_Tooltip::enter_area(wid=%p, x=%d, y=%d, w=%d, h=%d, t=\"%s\")\n", + wid, x, y, w, h, t ? t : "(null)"); + printf(" recursion=%d, window=%p\n", recursion, window); +#endif // DEBUG if (recursion) return; if (!t || !*t || !enabled()) { @@ -208,8 +215,10 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) Fl::add_timeout(Fl_Tooltip::delay(), tooltip_timeout); } -// printf(" tip=\"%s\", window->shown()=%d\n", tip ? tip : "(null)", -// window ? window->shown() : 0); +#ifdef DEBUG + printf(" tip=\"%s\", window->shown()=%d\n", tip ? tip : "(null)", + window ? window->shown() : 0); +#endif // DEBUG } void Fl_Widget::tooltip(const char *tt) { @@ -223,5 +232,5 @@ void Fl_Widget::tooltip(const char *tt) { } // -// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.25 2002/10/29 19:45:10 easysw Exp $". +// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.26 2002/10/30 01:26:05 easysw Exp $". // |
