DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2561
Version: 1.3-feature
I'm no huge fan of the behaviour of alert popups showing up under the
mouse. Window placement is something that should be left to the window
manager.
Attached patch adds a new knob to turn this behaviour off. Default is the
old way, i.e. on.
Link: http://www.fltk.org/str.php?L2561
Version: 1.3-feature
diff -up fltk-1.3.x-r8411/FL/fl_ask.H.orig fltk-1.3.x-r8411/FL/fl_ask.H
--- fltk-1.3.x-r8411/FL/fl_ask.H.orig 2011-02-11 12:47:47.549008153 +0100
+++ fltk-1.3.x-r8411/FL/fl_ask.H 2011-02-11 12:48:01.524317914 +0100
@@ -64,6 +64,9 @@ extern FL_EXPORT Fl_Fontsize fl_message_
inline void fl_message_font(Fl_Font f, Fl_Fontsize s) {
fl_message_font_ = f; fl_message_size_ = s;}
+FL_EXPORT void fl_message_hotspot(int enable);
+FL_EXPORT int fl_message_hotspot(void);
+
// pointers you can use to change FLTK to a foreign language:
extern FL_EXPORT const char* fl_no;
extern FL_EXPORT const char* fl_yes;
diff -up fltk-1.3.x-r8411/src/fl_ask.cxx.orig fltk-1.3.x-r8411/src/fl_ask.cxx
--- fltk-1.3.x-r8411/src/fl_ask.cxx.orig 2011-02-11 12:47:40.624863770
+0100
+++ fltk-1.3.x-r8411/src/fl_ask.cxx 2011-02-11 12:48:03.778690500 +0100
@@ -1,9 +1,9 @@
//
-// "$Id: fl_ask.cxx 8405 2011-02-08 20:59:46Z manolo $"
+// "$Id: fl_ask.cxx 8280 2011-01-16 18:16:35Z manolo $"
//
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -56,6 +56,7 @@ static int ret_val;
static const char *iconlabel = "?";
Fl_Font fl_message_font_ = FL_HELVETICA;
Fl_Fontsize fl_message_size_ = -1;
+static int enableHotspot = 1;
#ifdef __APPLE__
extern "C" void NSBeep(void);
#endif
@@ -228,7 +229,8 @@ static int innards(const char* fmt, va_l
if (button[1]->visible() && !input->visible())
button[1]->take_focus();
- message_form->hotspot(button[0]);
+ if (enableHotspot)
+ message_form->hotspot(button[0]);
if (b0 && Fl_Widget::label_shortcut(b0))
button[0]->shortcut(0);
else
@@ -479,8 +481,30 @@ const char *fl_password(const char *fmt,
return r;
}
+/** Sets whether or not to move the common message box used in
+ many common dialogs like fl_message(), fl_alert(),
+ fl_ask(), fl_choice(), fl_input(), fl_password() to follow
+ the mouse pointer
+ \note \#include <FL/fl_ask.H>
+ */
+void fl_message_hotspot(int enable) {
+
+ enableHotspot = enable;
+}
+
+/** Gets whether or not to move the common message box used in
+ many common dialogs like fl_message(), fl_alert(),
+ fl_ask(), fl_choice(), fl_input(), fl_password() to follow
+ the mouse pointer
+ \note \#include <FL/fl_ask.H>
+ */
+int fl_message_hotspot(void) {
+
+ return enableHotspot;
+}
+
/** @} */
//
-// End of "$Id: fl_ask.cxx 8405 2011-02-08 20:59:46Z manolo $".
+// End of "$Id: fl_ask.cxx 8280 2011-01-16 18:16:35Z manolo $".
//
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev