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)
82 , vertical_scrollbar_mode(
84 , horizontal_scrollbar_mode(
90 VALIDATE(grid_definition,
_(
"No list defined."));
91 grid_ = std::make_shared<builder_grid>(*grid_definition);
97 auto panel = std::make_unique<scrollbar_panel>(*
this);
102 DBG_GUI_G <<
"Window builder: placed scrollbar_panel '" <<
id
103 <<
"' with definition '" <<
definition <<
"'.";
109 panel->finalize_setup();
112 grid* content_grid =
panel->content_grid();
113 assert(content_grid);
115 const unsigned rows =
grid_->rows;
116 const unsigned cols =
grid_->cols;
120 for(
unsigned x = 0; x < rows; ++x) {
122 for(
unsigned y = 0; y < cols; ++y) {
126 grid_->col_grow_factor[y]);
129 auto widget =
grid_->widgets[x * cols + y]->build();
133 grid_->flags[x * cols + y],
134 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)
scrollbar_mode get_scrollbar_mode(const std::string &scrollbar_mode)
Returns the scrollbar mode flags.
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.