Author: AlbrechtS
Date: 2011-02-12 04:08:52 -0800 (Sat, 12 Feb 2011)
New Revision: 8417
Log:
Common dialogs like fl_message() and fl_ask() can now have a window
title (STR #2562).
Added a test case for disabling the hotspot and using a window title
to test/ask.cxx.
Modified:
branches/branch-1.3/CHANGES
branches/branch-1.3/CREDITS
branches/branch-1.3/FL/fl_ask.H
branches/branch-1.3/src/fl_ask.cxx
branches/branch-1.3/test/ask.cxx
Modified: branches/branch-1.3/CHANGES
===================================================================
--- branches/branch-1.3/CHANGES 2011-02-12 11:50:06 UTC (rev 8416)
+++ branches/branch-1.3/CHANGES 2011-02-12 12:08:52 UTC (rev 8417)
@@ -54,6 +54,8 @@
- Added Fl_Menu_ methods: insert(), find_index(), clear_submenu()
- Hotspot behavior of fl_message() and other common dialogs is now
optional (STR #2561).
+ - Common dialogs like fl_message() and fl_ask() can now have a window
+ title (STR #2562).
IDE support and command line build options
Modified: branches/branch-1.3/CREDITS
===================================================================
--- branches/branch-1.3/CREDITS 2011-02-12 11:50:06 UTC (rev 8416)
+++ branches/branch-1.3/CREDITS 2011-02-12 12:08:52 UTC (rev 8417)
@@ -48,6 +48,7 @@
Howard Lightstone
Mike Lindner
Alexander Mai
+ Pierre Ossman
Alexander Rabi
James Roth
Albrecht Schlosser
Modified: branches/branch-1.3/FL/fl_ask.H
===================================================================
--- branches/branch-1.3/FL/fl_ask.H 2011-02-12 11:50:06 UTC (rev 8416)
+++ branches/branch-1.3/FL/fl_ask.H 2011-02-12 12:08:52 UTC (rev 8417)
@@ -3,7 +3,7 @@
//
// Standard dialog header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2011 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
@@ -67,6 +67,8 @@
FL_EXPORT void fl_message_hotspot(int enable);
FL_EXPORT int fl_message_hotspot(void);
+FL_EXPORT void fl_message_title(const char *title);
+
// 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;
Modified: branches/branch-1.3/src/fl_ask.cxx
===================================================================
--- branches/branch-1.3/src/fl_ask.cxx 2011-02-12 11:50:06 UTC (rev 8416)
+++ branches/branch-1.3/src/fl_ask.cxx 2011-02-12 12:08:52 UTC (rev 8417)
@@ -244,6 +244,7 @@
if (g) // regrab the previous popup menu, if there was one
Fl::grab(g);
icon->label(prev_icon_label);
+ message_form->label(0); // reset window title
avoidRecursion = 0;
return ret_val;
@@ -508,6 +509,26 @@
return enableHotspot;
}
+/** Sets the title of the dialog window used in many common dialogs.
+
+ This window \p title will be used in the next call of one of the
+ common dialogs like fl_message(), fl_alert(), fl_ask(), fl_choice(),
+ fl_input(), fl_password().
+
+ The \p title string is copied internally, so that you can use a
+ local variable or free the string immediately after this call. It
+ applies only to the \b next call of one of the common dialogs and
+ will be reset to an empty title (the default for all dialogs) after
+ that call.
+
+ \note \#include <FL/fl_ask.H>
+ \param[in] title window label, string copied internally
+*/
+void fl_message_title(const char *title) {
+ makeform();
+ message_form->copy_label(title);
+}
+
/** @} */
//
Modified: branches/branch-1.3/test/ask.cxx
===================================================================
--- branches/branch-1.3/test/ask.cxx 2011-02-12 11:50:06 UTC (rev 8416)
+++ branches/branch-1.3/test/ask.cxx 2011-02-12 12:08:52 UTC (rev 8417)
@@ -61,8 +61,12 @@
}
void window_callback(Fl_Widget*, void*) {
+ int hotspot = fl_message_hotspot();
+ fl_message_hotspot(0);
+ fl_message_title("note: no hotspot set for this dialog");
int rep = fl_choice("Are you sure you want to quit?",
"Cancel", "Quit", "Dunno");
+ fl_message_hotspot(hotspot);
if (rep==1)
exit(0);
else if (rep==2)
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit