16 #define GETTEXT_DOMAIN "wesnoth-lib" 53 const std::string&
id)
55 button_status.
ptr = find_widget<button>(&window,
id,
false,
true);
58 if(!button_status.
caption.empty()) {
99 window.keyboard_capture(&label);
114 const std::string& caption)
118 buttons_[button].ptr->set_label(caption);
127 buttons_[button].ptr->set_visible(visible);
135 buttons_[button].ptr->set_retval(retval);
152 const std::string&
msg,
153 const std::string& button_caption,
155 const bool message_use_markup,
156 const bool title_use_markup)
158 message dlg(title, msg, auto_close, message_use_markup, title_use_markup);
164 const std::string&
msg,
166 bool message_use_markup,
167 bool title_use_markup)
175 switch(button_style) {
205 bool message_use_markup)
window(const builder_window::window_resolution &definition)
< Needs to be initialized in show.
Helper to implement private functions without modifying the header.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void show_message(const std::string &title, const std::string &msg, const std::string &button_caption, const bool auto_close, const bool message_use_markup, const bool title_use_markup)
Shows a message to the user.
void set_button_caption(const button_id button, const std::string &caption)
Main class to show messages to the user.
Shows an ok and cancel button.
std::vector< button_status > buttons_
Holds a pointer to the buttons.
bool message_use_markup_
Whether to enable formatting markup for the dialog message.
std::string title_
The title for the dialog.
button_style
Selects the style of the buttons to be shown.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
bool title_use_markup_
Whether to enable formatting markup for the dialog title.
A label displays a text, the text can be wrapped but no scrollbars are provided.
static std::string _(const char *str)
#define LOG_STREAM(level, domain)
bool show(const unsigned auto_close_time=0)
Shows the window.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
This file contains the settings handling of the widget library.
std::string image_
The image which is shown in the dialog.
Shows a yes and no button.
std::string message_
The message to show to the user.
Various uncategorised dialogs.
std::string id
Text to match against addon_info.tags()
Default, unset return value.
int get_retval() const
Returns the cached window exit code.
static void init_button(window &window, message::button_status &button_status, const std::string &id)
Initialiazes a button.
void set_button_retval(const button_id button, const int retval)
Standard logging facilities (interface).
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
retval
Default window/dialog return values.
bool auto_close_
Does the window need to use click_dismiss when the dialog doesn't need a scrollbar.
void set_button_visible(const button_id button, const widget::visibility visible)
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
base class of top level items, the only item which needs to store the final canvases to draw on...