DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2762
Version: 1.3-feature
This enables setting the icon for fl_choice via fl_choice_icon.
Link: http://www.fltk.org/str.php?L2762
Version: 1.3-feature
Index: FL/fl_ask.H
===================================================================
--- FL/fl_ask.H (revision 9166)
+++ FL/fl_ask.H (working copy)
@@ -48,6 +48,8 @@
FL_EXPORT int fl_choice(const char *q,const char *b0,const char *b1,const char
*b2,...) __fl_attr((__format__ (__printf__, 1, 5)));
FL_EXPORT const char *fl_input(const char *label, const char *deflt = 0, ...)
__fl_attr((__format__ (__printf__, 1, 3)));
FL_EXPORT const char *fl_password(const char *label, const char *deflt = 0,
...) __fl_attr((__format__ (__printf__, 1, 3)));
+// set the icon character for fl_choice - set to 0 for default
+FL_EXPORT void fl_choice_icon(char iconchar);
FL_EXPORT Fl_Widget *fl_message_icon();
extern FL_EXPORT Fl_Font fl_message_font_;
Index: src/fl_ask.cxx
===================================================================
--- src/fl_ask.cxx (revision 9166)
+++ src/fl_ask.cxx (working copy)
@@ -46,6 +46,7 @@
static int ret_val;
static const char *iconlabel = "?";
static const char *message_title_default;
+static char choice_icon[2]={ '?', 0 };
Fl_Font fl_message_font_ = FL_HELVETICA;
Fl_Fontsize fl_message_size_ = -1;
static int enableHotspot = 1;
@@ -384,6 +385,14 @@
return r;
}
+/** choose letter for fl_choice icon
+*/
+
+void fl_choice_icon(char iconchar)
+{
+ choice_icon[0]=iconchar ? iconchar : '?';
+}
+
/** Shows a dialog displaying the \p fmt message,
this dialog features up to 3 customizable choice buttons
@@ -403,6 +412,8 @@
if (avoidRecursion) return 0;
+ iconlabel=choice_icon;
+
va_list ap;
// fl_beep(FL_BEEP_QUESTION);
@@ -410,6 +421,9 @@
va_start(ap, b2);
int r = innards(fmt, ap, b0, b1, b2);
va_end(ap);
+
+ iconlabel="?";
+
return r;
}
/** Gets the Fl_Box icon container of the current default dialog used in
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev