15 #define GETTEXT_DOMAIN "wesnoth-editor"
23 #ifdef GUI2_EXPERIMENTAL_LISTBOX
67 unsigned current_player,
68 unsigned maximum_players,
70 : selection_(
std::min(current_player, maximum_players))
71 , starting_positions_(starting_positions)
73 if(starting_positions_.size() != maximum_players) {
74 starting_positions_.resize(maximum_players);
80 tlistbox& list = find_widget<tlistbox>(&window,
"listbox",
false);
81 window.keyboard_capture(&list);
83 std::map<std::string, string_map>
data;
86 column[
"label"] =
_(
"player^None");
87 data.insert(std::make_pair(
"player", column));
96 symbols[
"player_number"] = std::to_string(
i + 1);
99 _(
"Player $player_number"), &symbols);
100 data.insert(std::make_pair(
"player", column));
102 if(player_pos.
valid()) {
103 column[
"label"] = (
formatter() <<
"(" << player_pos.
x + 1 <<
", "
104 << player_pos.
y + 1 <<
")").str();
105 data.insert(std::make_pair(
"location", column));
120 tlistbox& list = find_widget<tlistbox>(&window,
"listbox",
false);
std::string interpolate_variables_into_string(const std::string &str, const string_map *const symbols)
Function which will interpolate variables, starting with '$' in the string 'str' with the equivalent ...
void pre_show(twindow &window)
Inherited from tdialog.
bool select_row(const unsigned row, const bool select=true)
Selectes a row.
REGISTER_DIALOG(label_settings)
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.
static UNUSEDNOWARN std::string _(const char *str)
Dialog is closed with ok button.
std::map< std::string, t_string > string_map
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.
void post_show(twindow &window)
Inherited from tdialog.
std::vector< map_location > starting_positions_
std::map< std::string, t_string > string_map
Encapsulates the map of the game.
GLenum GLenum GLvoid GLvoid * column
int get_selected_row() const
Returns the first selected row.