16 #define GETTEXT_DOMAIN "wesnoth-lib"
29 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
30 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
46 const auto conf = cast_config_to<panel_definition>();
50 result.x += conf->left_border;
51 result.y += conf->top_border;
52 result.w -= conf->left_border + conf->right_border;
53 result.h -= conf->top_border + conf->bottom_border;
82 const auto conf = cast_config_to<panel_definition>();
85 return point(conf->left_border + conf->right_border, conf->top_border + conf->bottom_border);
100 load_resolutions<resolution>(cfg);
105 , top_border(cfg[
"top_border"])
106 , bottom_border(cfg[
"bottom_border"])
107 , left_border(cfg[
"left_border"])
108 , right_border(cfg[
"right_border"])
120 builder_panel::builder_panel(
const config& cfg)
127 grid = std::make_shared<builder_grid>(*
c);
132 auto widget = std::make_unique<panel>(*
this);
134 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)
Euivalent 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.
A panel is a visible container to hold multiple widgets.
virtual void impl_draw_background() override
See widget::impl_draw_background.
virtual void impl_draw_foreground() override
See widget::impl_draw_foreground.
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.
This file contains the settings handling of the widget library.
virtual std::unique_ptr< widget > build() const override
resolution(const config &cfg)
panel_definition(const config &cfg)
Base class of a resolution, contains the common keys for a resolution.
std::vector< state_definition > state
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.