16 #define GETTEXT_DOMAIN "wesnoth-lib"
27 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
28 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
44 const auto conf = cast_config_to<panel_definition>();
48 result.x += conf->left_border;
49 result.y += conf->top_border;
50 result.w -= conf->left_border + conf->right_border;
51 result.h -= conf->top_border + conf->bottom_border;
88 const auto conf = cast_config_to<panel_definition>();
91 return point(conf->left_border + conf->right_border, conf->top_border + conf->bottom_border);
106 load_resolutions<resolution>(cfg);
111 , top_border(cfg[
"top_border"].to_unsigned())
112 , bottom_border(cfg[
"bottom_border"].to_unsigned())
113 , left_border(cfg[
"left_border"].to_unsigned())
114 , right_border(cfg[
"right_border"].to_unsigned())
126 builder_panel::builder_panel(
const config& cfg)
133 grid = std::make_shared<builder_grid>(*
c);
138 auto widget = std::make_unique<panel>(*
this);
140 DBG_GUI_G <<
"Window builder: placed panel '" <<
id <<
"' with definition '"
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 draw()
Draw the canvas' shapes onto the screen.
A generic container base class.
virtual bool impl_draw_foreground() override
See widget::impl_draw_foreground.
virtual bool impl_draw_background() override
See widget::impl_draw_background.
virtual bool get_active() const override
See styled_widget::get_active.
virtual unsigned get_state() const override
See styled_widget::get_state.
virtual SDL_Rect get_client_rect() const override
See container_base::get_client_rect.
virtual point border_space() const override
See container_base::border_space.
virtual void set_self_active(const bool active) override
See container_base::set_self_active.
static std::string _(const char *str)
Define the common log macros for the gui toolkit.
void point(int x, int y)
Draw a single point.
Contains the implementation details for lexical_cast and shouldn't be used directly.
Contains the SDL_Rect helper code.
virtual std::unique_ptr< widget > build() const override
resolution(const config &cfg)
panel_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)
#define VALIDATE(cond, message)
The macro to use for the validation of WML.