15 #define GETTEXT_DOMAIN "wesnoth-lib"
22 #ifdef GUI2_EXPERIMENTAL_LISTBOX
69 bool title_uses_markup,
70 bool message_uses_markup)
72 , single_button_(false)
77 register_label(
"title",
true, title, title_uses_markup);
78 register_label(
"message",
true, message, message_uses_markup);
83 tlistbox& list = find_widget<tlistbox>(&window,
"listbox",
false);
84 window.keyboard_capture(&list);
86 for(
const auto & it :
items_)
88 std::map<std::string, string_map>
data;
92 data.insert(std::make_pair(
"item", column));
103 tbutton& button_ok = find_widget<tbutton>(&window,
"ok",
false);
104 tbutton& button_cancel = find_widget<tbutton>(&window,
"cancel",
false);
125 tlistbox& list = find_widget<tlistbox>(&window,
"listbox",
false);
bool select_row(const unsigned row, const bool select=true)
Selectes a row.
REGISTER_DIALOG(label_settings)
virtual void set_label(const t_string &label)
const std::vector< std::string > items
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
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.
Dialog is closed with ok button.
unsigned get_item_count() const
Returns the number of items in the listbox.
void add_row(const string_map &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
std::string cancel_label_
std::map< std::string, t_string > string_map
GLenum GLenum GLvoid GLvoid * column
void post_show(twindow &window)
Inherited from tdialog.
void pre_show(twindow &window)
Inherited from tdialog.
GLsizei GLenum GLuint GLuint GLsizei char * message
std::vector< std::string > list_type
int get_selected_row() const
Returns the first selected row.