16 #define GETTEXT_DOMAIN "wesnoth-lib"
61 load_resolutions<resolution>(cfg);
72 grid = std::make_shared<builder_grid>(child);
80 builder_scrollbar_panel::builder_scrollbar_panel(
const config& cfg)
86 VALIDATE(grid_definition,
_(
"No list defined."));
87 grid_ = std::make_shared<builder_grid>(*grid_definition);
93 auto panel = std::make_unique<scrollbar_panel>(*
this);
95 DBG_GUI_G <<
"Window builder: placed scrollbar_panel '" <<
id
96 <<
"' with definition '" <<
definition <<
"'.";
102 panel->finalize_setup();
105 grid* content_grid =
panel->content_grid();
106 assert(content_grid);
108 const unsigned rows =
grid_->rows;
109 const unsigned cols =
grid_->cols;
113 for(
unsigned x = 0; x < rows; ++x) {
115 for(
unsigned y = 0; y < cols; ++y) {
119 grid_->col_grow_factor[y]);
122 auto widget =
grid_->widgets[x * cols + y]->build();
126 grid_->flags[x * cols + y],
127 grid_->border_size[x * cols + y]);
A config object defines a single node in a WML file, with access to child nodes.
optional_config_impl< config > optional_child(config_key_type key, int n=0)
Equivalent to mandatory_child, but returns an empty optional if the nth child was not found.
void init_grid(const builder_grid &grid_builder)
Initializes and builds the grid.
void set_row_grow_factor(const unsigned row, const unsigned factor)
Sets the grow factor for a row.
void set_column_grow_factor(const unsigned column, const unsigned factor)
Sets the grow factor for a column.
void set_rows_cols(const unsigned rows, const unsigned cols)
Wrapper to set_rows and set_cols.
void set_child(std::unique_ptr< widget > widget, const unsigned row, const unsigned col, const unsigned flags, const unsigned border_size)
Sets a child in the grid.
static std::string _(const char *str)
Contains the implementation details for lexical_cast and shouldn't be used directly.
std::vector< state_definition > state
std::string missing_mandatory_wml_tag(const std::string §ion, const std::string &tag)
Returns a standard message for a missing wml child (tag).
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
#define VALIDATE_WML_CHILD(cfg, key, message)
#define VALIDATE(cond, message)
The macro to use for the validation of WML.