Add int return type to Fl::get_mouse(int&, int&) providing the number of mouse-containing screen.
This commit is contained in:
parent
a342d9f3d5
commit
b4f73314a7
@ -6,6 +6,8 @@ Changes in FLTK 1.5.0 Released: xxx yy 2026
|
|||||||
|
|
||||||
|
|
||||||
Bug Fixes and other Improvements
|
Bug Fixes and other Improvements
|
||||||
|
- Member function int Fl::get_mouse(int&, int&) has now a return value providing the
|
||||||
|
number of the mouse-containing screen (previously, return type was void).
|
||||||
|
|
||||||
|
|
||||||
Platform Specific Fixes and Build Procedure Improvements
|
Platform Specific Fixes and Build Procedure Improvements
|
||||||
|
|||||||
@ -145,14 +145,17 @@ FL_EXPORT inline int event_dy() { return e_dy; }
|
|||||||
//
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return where the mouse is on the screen by doing a round-trip query to
|
Return the number of the mouse-containing screen and computes the mouse screen coordinates.
|
||||||
the server. You should use Fl::event_x_root() and
|
This requires a round-trip query to the server. You should use Fl::event_x_root() and
|
||||||
Fl::event_y_root() if possible, but this is necessary if you are
|
Fl::event_y_root() if possible, but this is necessary if you are
|
||||||
not sure if a mouse event has been processed recently (such as to
|
not sure if a mouse event has been processed recently (such as to
|
||||||
position your first window). If the display is not open, this will
|
position your first window). If the display is not open, this will
|
||||||
open it.
|
open it.
|
||||||
|
\param X,Y assigned with the mouse screen coordinates upon return
|
||||||
|
\return number of the mouse-containing screen
|
||||||
|
\since 1.5 added a function return value
|
||||||
*/
|
*/
|
||||||
FL_EXPORT extern void get_mouse(int &,int &);
|
FL_EXPORT extern int get_mouse(int &X,int &Y);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mouse Click Functions
|
// Mouse Click Functions
|
||||||
|
|||||||
@ -2310,8 +2310,8 @@ int Fl::get_key(int k) {
|
|||||||
return screen_driver()->get_key(k);
|
return screen_driver()->get_key(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fl::get_mouse(int &x, int &y) {
|
int Fl::get_mouse(int &x, int &y) {
|
||||||
Fl::screen_driver()->get_mouse(x, y);
|
return Fl::screen_driver()->get_mouse(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * fl_filename_name(const char *name) {
|
const char * fl_filename_name(const char *name) {
|
||||||
|
|||||||
@ -22,9 +22,9 @@ void Fl_Window::hotspot(int X, int Y, int offscreen) {
|
|||||||
int mx,my;
|
int mx,my;
|
||||||
|
|
||||||
// Update the screen position based on the mouse position.
|
// Update the screen position based on the mouse position.
|
||||||
Fl::get_mouse(mx,my);
|
int ms = Fl::get_mouse(mx,my);
|
||||||
// put the window on the mouse-containing screen
|
// put the window on the mouse-containing screen
|
||||||
this->screen_num(Fl::screen_num(mx, my));
|
this->screen_num(ms);
|
||||||
X = mx-X; Y = my-Y;
|
X = mx-X; Y = my-Y;
|
||||||
|
|
||||||
// If offscreen is 0 (the default), make sure that the window
|
// If offscreen is 0 (the default), make sure that the window
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user