15 #define GETTEXT_DOMAIN "wesnoth-lib"
52 button_status.
button = find_widget<tbutton>(&window,
id,
false,
true);
55 if(!button_status.
caption.empty()) {
75 tcontrol& title_widget = find_widget<tlabel>(&window,
"title",
false);
82 tcontrol& img_widget = find_widget<timage>(&window,
"image",
false);
89 tcontrol& label = find_widget<tcontrol>(&window,
"label",
false);
95 window.keyboard_capture(&label);
103 for(
auto & button_status :
buttons_)
105 button_status.button =
nullptr;
114 buttons_[button].button->set_label(caption);
123 buttons_[button].button->set_visible(visible);
131 buttons_[button].button->set_retval(retval);
138 , visible(
twidget::tvisible::invisible)
148 const bool message_use_markup)
150 tmessage dlg(title, message, auto_close, message_use_markup);
159 bool message_use_markup,
167 switch(button_style) {
200 bool message_use_markup)
void show_error_message(CVideo &video, const std::string &message, bool message_use_markup)
Shows an error message to the user.
static void init_button(twindow &window, tmessage::tbutton_status &button_status, const std::string &id)
Initialiazes a button.
bool show(CVideo &video, const unsigned auto_close_time=0)
Shows the window.
std::vector< tbutton_status > buttons_
Holds a pointer to the buttons.
REGISTER_DIALOG(label_settings)
Main class to show messages to the user.
std::string title_
The title for the dialog.
virtual void set_label(const t_string &label)
#define LOG_STREAM(level, domain)
Helper to implement private functions without modifying the header.
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
virtual void set_use_markup(bool use_markup)
static UNUSEDNOWARN std::string _(const char *str)
Dialog is closed with no return value, should be rare but eg a message popup can do it...
void set_button_retval(const tbutton_id button, const int retval)
void show_message(CVideo &video, const std::string &title, const std::string &message, const std::string &button_caption, const bool auto_close, const bool message_use_markup)
Shows a message to the user.
Shows an ok and cancel button.
tbutton_style
Selects the style of the buttons to be shown.
std::string message_
The message to show to the user.
bool message_use_markup_
Whether to enable formatting markup for the dialog message.
static size_t id
Ids for the timers.
bool auto_close_
Does the window need to use click_dismiss when the dialog doesn't need a scrollbar.
void pre_show(twindow &window)
Inherited from tdialog.
Base class for all visible items.
std::string image_
The image which is shown in the dialog.
void post_show(twindow &window)
Inherited from tdialog.
void set_button_visible(const tbutton_id button, const twidget::tvisible::scoped_enum visible)
Standard logging facilities (interface).
GLsizei GLenum GLuint GLuint GLsizei char * message
GLsizei const GLcharARB ** string
Shows a yes and no button.
void set_button_caption(const tbutton_id button, const std::string &caption)