Rewrite Fl_Tooltip.cxx for the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11565 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
fe624b83fc
commit
3bc5be71a3
@ -118,6 +118,10 @@ public:
|
||||
virtual int need_menu_handle_part1_extra() {return 0;}
|
||||
// implement to support fl_open_uri()
|
||||
virtual int open_uri(const char *uri, char *msg, int msglen) {return 0;}
|
||||
// the default implementation of use_tooltip_timeout_condition() may be enough
|
||||
virtual int use_tooltip_timeout_condition() {return 0;}
|
||||
// the default implementation of use_recent_tooltip_fix() may be enough
|
||||
virtual int use_recent_tooltip_fix() {return 0;}
|
||||
};
|
||||
|
||||
#endif // FL_SYSTEM_DRIVER_H
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include <FL/Fl_Tooltip.H>
|
||||
#include <FL/fl_draw.H>
|
||||
#include <FL/Fl_Menu_Window.H>
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_System_Driver.H>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h> // strdup()
|
||||
@ -151,9 +153,8 @@ static void tooltip_timeout(void*) {
|
||||
if (window) window->hide();
|
||||
} else {
|
||||
int condition = 1;
|
||||
#if !(defined(__APPLE__) || defined(WIN32)) // bugfix: no need to refactor
|
||||
condition = (Fl::grab() == NULL);
|
||||
#endif
|
||||
// bugfix: no need to refactor
|
||||
if (Fl::system_driver()->use_tooltip_timeout_condition()) condition = (Fl::grab() == NULL);
|
||||
if ( condition ) {
|
||||
if (!window) window = new Fl_TooltipBox;
|
||||
// this cast bypasses the normal Fl_Window label() code:
|
||||
@ -287,12 +288,9 @@ void Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char*
|
||||
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:
|
||||
if (window && window->visible()) window->hide();
|
||||
#endif // WIN32
|
||||
if (Fl::system_driver()->use_recent_tooltip_fix() && window && window->visible()) window->hide();
|
||||
tooltip_timeout(0);
|
||||
} else {
|
||||
if (window && window->visible()) window->hide();
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
virtual int need_menu_handle_part2() {return 1;}
|
||||
virtual int need_menu_handle_part1_extra() {return 1;}
|
||||
virtual int open_uri(const char *uri, char *msg, int msglen);
|
||||
virtual int use_tooltip_timeout_condition() {return 1;}
|
||||
};
|
||||
|
||||
#endif // FL_POSIX_SYSTEM_DRIVER_H
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
virtual int filename_isdir_quick(const char* n);
|
||||
virtual const char *filename_ext(const char *buf);
|
||||
virtual int open_uri(const char *uri, char *msg, int msglen);
|
||||
virtual int use_recent_tooltip_fix() {return 1;}
|
||||
};
|
||||
|
||||
#endif // FL_WINAPI_SYSTEM_DRIVER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user