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()) {
114 const std::string& caption)
152 const std::string&
msg,
153 const std::string& button_caption,
154 const bool auto_close,
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)
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 a text, the text 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)
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
Various uncategorised dialogs.
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="")
This file contains the settings handling of the widget library.
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.