16 #define GETTEXT_DOMAIN "wesnoth-lib"
29 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
30 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
61 :
tbase(builder,
"matrix"), content_(), pane_(nullptr)
63 const auto cfg = cast_config_to<matrix_definition>();
84 cfg->content->build(
content_, replacements);
92 const std::map<std::string, std::string>& tags)
129 const bool must_be_active)
const
180 load_resolutions<resolution>(cfg);
197 builder_matrix::builder_matrix(
const config& cfg)
199 , vertical_scrollbar_mode(
201 , horizontal_scrollbar_mode(
203 , builder_top(nullptr)
204 , builder_bottom(nullptr)
205 , builder_left(nullptr)
206 , builder_right(nullptr)
210 builder_top = std::make_shared<builder_grid>(*top);
228 return std::make_unique<matrix>(*
this);
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.
virtual void place(const point &origin, const point &size) override
See widget::place.
virtual widget * find_at(const point &coordinate, const bool must_be_active) override
See widget::find_at.
widget * find(const std::string_view id, const bool must_be_active) override
See widget::find.
virtual void layout_children() override
See widget::layout_children.
virtual void layout_initialize(const bool full_initialization) override
See widget::layout_initialize.
virtual void impl_draw_children() override
See widget::impl_draw_children.
virtual void request_reduce_width(const unsigned maximum_width) override
See widget::request_reduce_width.
virtual void layout_children() override
See widget::layout_children.
virtual widget * find_at(const point &coordinate, const bool must_be_active) override
See widget::find_at.
virtual point calculate_best_size() const override
See widget::calculate_best_size.
virtual void place(const point &origin, const point &size) override
See widget::place.
pane * pane_
Contains the pane used for adding new items to the matrix.
matrix(const implementation::builder_matrix &builder)
virtual void layout_initialize(const bool full_initialization) override
See widget::layout_initialize.
virtual iteration::walker_ptr create_walker() override
See widget::create_walker.
bool disable_click_dismiss() const override
See widget::disable_click_dismiss.
widget * find(const std::string_view id, const bool must_be_active) override
See widget::find.
grid content_
The grid containing our children.
unsigned create_item(const widget_data &item_data, const std::map< std::string, std::string > &tags)
A pane is a container where new members can be added and removed during run-time.
unsigned create_item(const widget_data &item_data, const std::map< std::string, std::string > &tags)
Creates a new item.
unsigned get_state() const
void set_active(const bool active)
state_t state_
Current state of the widget.
Define the common log macros for the gui toolkit.
scrollbar_mode get_scrollbar_mode(const std::string &scrollbar_mode)
Returns the scrollbar mode flags.
std::unique_ptr< class walker_base > walker_ptr
builder_widget_ptr create_widget_builder(const config &cfg)
Create a widget builder.
std::map< std::string, widget_item > widget_data
Contains the implementation details for lexical_cast and shouldn't be used directly.
map_location coordinate
Contains an x and y coordinate used for starting positions in maps.
std::size_t size(std::string_view str)
Length in characters of a UTF-8 string.
builder_widget_ptr builder_main
builder_grid_ptr builder_left
builder_grid_ptr builder_top
virtual std::unique_ptr< widget > build() const override
builder_grid_ptr builder_bottom
builder_grid_ptr builder_right
resolution(const config &cfg)
matrix_definition(const config &cfg)
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)