diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-02-16 14:48:23 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-02-16 14:50:50 +0100 |
| commit | 1cdd669dc6176ad8233484686591b235947f22c1 (patch) | |
| tree | 1d04db2003dc8356698f63cc9e5588052a2e325a /src | |
| parent | 390095392b51034f42e03534925f59802076b487 (diff) | |
Fix "fl_message_icon() regression" (#395)
Some attributes of the default message icon had not been copied to
the new Fl_Message class when opening a new dialog.
Clarify documentation about supported icon attributes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Message.cxx | 8 | ||||
| -rw-r--r-- | src/fl_ask.cxx | 20 |
2 files changed, 25 insertions, 3 deletions
diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx index 970dde3f4..a6588f8b5 100644 --- a/src/Fl_Message.cxx +++ b/src/Fl_Message.cxx @@ -163,11 +163,15 @@ Fl_Message::Fl_Message(const char *iconlabel) icon_->labelsize(icon_template->labelsize()); icon_->color(icon_template->color()); icon_->labelcolor(icon_template->labelcolor()); + icon_->image(icon_template->image()); + icon_->align(icon_template->align()); - if (message_icon_label_) { // fl_message_icon_label() has been called + if (message_icon_label_) { // fl_message_icon_label() has been called icon_->copy_label(message_icon_label_); message_icon_label_ = 0; - } else { // use default (static, per message default string) + } else if (icon_template->label()) { // sticky icon template label() has been set + icon_->copy_label(icon_template->label()); + } else { // default string (c'tor argument) icon_->label(iconlabel); } diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 95031753e..99cf6da90 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -256,6 +256,24 @@ int fl_choice_n(const char *fmt, const char *b0, const char *b1, const char *b2, The return value cannot be Null. The object pointed to is an Fl_Box widget. The returned pointer (Fl_Widget *) can be safely cast to an Fl_Box* pointer. + \note You can set some attributes of this \b default icon box. These attributes + are sticky, i.e. they will be used in all subsequent common dialogs unless + overridden by specific "one shot" variables. Setting any attribute except + those mentioned below causes undefined behavior. + + Supported icon attributes: + + - box() + - labelfont() + - labelsize() + - color() + - labelcolor() + - image() + - align() + + The icon size can not be changed. If you set an image() you should scale it + to the available size, i.e. \p w() and \p h() of the icon box. + \code #include <FL/fl_ask.H> \endcode */ Fl_Widget *fl_message_icon() { @@ -267,7 +285,7 @@ Fl_Widget *fl_message_icon() { This version of fl_input() is deprecated. The return value points to an internal allocated string that may be changed later. You must copy the string immediately after return from this method - at least - before the next call of the event loop. + before the next execution of the event loop. \deprecated Please use fl_input_str(int maxchar, const char *fmt, const char *defstr, ...) instead. |
