16 #define GETTEXT_DOMAIN "wesnoth-lib"
52 const std::string&
id)
54 button_status.
ptr = find_widget<button>(&
window,
id,
false,
true);
57 if(!button_status.
caption.empty()) {
113 const std::string& caption)
151 const std::string&
msg,
152 const std::string& button_caption,
153 const bool auto_close,
154 const bool message_use_markup,
155 const bool title_use_markup)
157 message dlg(title,
msg, auto_close, message_use_markup, title_use_markup);
163 const std::string&
msg,
165 bool message_use_markup,
166 bool title_use_markup)
174 switch(button_style) {
204 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.
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)
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
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 post_show(window &window) override
Actions to be taken after the window has been shown.
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.
A label displays text that can be wrapped but no scrollbars are provided.
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)
Standard logging facilities (interface).
#define LOG_STREAM(level, domain)
Various uncategorised dialogs.
REGISTER_DIALOG(tod_new_schedule)
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.