16 #define GETTEXT_DOMAIN "wesnoth-lib"
32 bool title_uses_markup,
33 bool message_uses_markup)
36 , single_button_(false)
41 register_label(
"title",
true, title, title_uses_markup);
42 register_label(
"message",
true,
message, message_uses_markup);
47 listbox& list = find_widget<listbox>(
"listbox");
50 for(
const auto & it :
items_)
56 data.emplace(
"item", column);
67 button& button_ok = find_widget<button>(
"ok");
68 button& button_cancel = find_widget<button>(
"cancel");
86 index_ = find_widget<listbox>(
"listbox").get_selected_row();
Main class to show messages to the user.
Abstract base class for all modal dialogs.
int get_retval() const
Returns the cached window exit code.
virtual void pre_show() override
Actions to be taken before showing the window.
virtual void post_show() override
Actions to be taken after the window has been shown.
std::vector< std::string > list_type
std::string cancel_label_
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
bool select_row(const unsigned row, const bool select=true)
Selects a row.
unsigned get_item_count() const
Returns the number of items in the listbox.
void keyboard_capture(widget *widget)
REGISTER_DIALOG(editor_edit_unit)
std::map< std::string, widget_item > widget_data
std::map< std::string, t_string > widget_item
@ OK
Dialog was closed with the OK button.