16 #define GETTEXT_DOMAIN "wesnoth-lib"
51 const std::string&
id)
56 if(!button_status.
caption.empty()) {
111 const std::string& caption)
149 const std::string&
msg,
150 const std::string& button_caption,
151 const bool auto_close,
152 const bool message_use_markup,
153 const bool title_use_markup)
155 message dlg(title,
msg, auto_close, message_use_markup, title_use_markup);
161 const std::string&
msg,
163 bool message_use_markup,
164 bool title_use_markup)
172 switch(button_style) {
202 bool message_use_markup)
Main class to show messages to the user.
bool message_use_markup_
Whether to enable formatting markup for the dialog message.
std::string title_
The title for the dialog.
std::string message_
The message to show to the user.
virtual void post_show() override
Actions to be taken after the window has been shown.
button_style
Selects the style of the buttons to be shown.
@ yes_no_buttons
Shows a yes and no button.
@ close_button
Shows a close button.
@ ok_button
Shows an ok button.
@ ok_cancel_buttons
Shows an ok and cancel button.
@ auto_close
Enables auto close.
@ cancel_button
Shows a cancel button.
void set_button_caption(const button_id button, const std::string &caption)
std::vector< button_status > buttons_
Holds a pointer to the buttons.
std::string image_
The image which is shown in the dialog.
bool title_use_markup_
Whether to enable formatting markup for the dialog title.
void set_button_visible(const button_id button, const widget::visibility visible)
bool auto_close_
Does the window need to use click_dismiss when the dialog doesn't need a scrollbar.
virtual void pre_show() override
Actions to be taken before showing the window.
void set_button_retval(const button_id button, const int retval)
bool show(const unsigned auto_close_time=0)
Shows the window.
int get_retval() const
Returns the cached window exit code.
base class of top level items, the only item which needs to store the final canvases to draw on.
void keyboard_capture(widget *widget)
void set_click_dismiss(const bool click_dismiss)
static std::string _(const char *str)
std::string id
Text to match against addon_info.tags()
Standard logging facilities (interface).
#define LOG_STREAM(level, domain)
Various uncategorised dialogs.
REGISTER_DIALOG(editor_edit_unit)
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
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.
retval
Default window/dialog return values.
@ NONE
Default, unset return value.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Helper to implement private functions without modifying the header.
static void init_button(window &window, message::button_status &button_status, const std::string &id)
Initialiazes a button.