16 #define GETTEXT_DOMAIN "wesnoth-lib"
45 const auto conf = cast_config_to<horizontal_scrollbar_definition>();
48 return conf->minimum_positioner_length;
53 const auto conf = cast_config_to<horizontal_scrollbar_definition>();
56 return conf->maximum_positioner_length;
61 const auto conf = cast_config_to<horizontal_scrollbar_definition>();
64 return conf->left_offset;
69 const auto conf = cast_config_to<horizontal_scrollbar_definition>();
72 return conf->right_offset;
116 DBG_GUI_P <<
"Parsing horizontal scrollbar " <<
id;
118 load_resolutions<resolution>(cfg);
123 , minimum_positioner_length(cfg[
"minimum_positioner_length"])
124 , maximum_positioner_length(cfg[
"maximum_positioner_length"])
125 , left_offset(cfg[
"left_offset"])
126 , right_offset(cfg[
"right_offset"])
130 "minimum_positioner_length"));
134 state.emplace_back(
VALIDATE_WML_CHILD(cfg,
"state_disabled",
_(
"Missing required state for horizontal scrollbar")));
144 builder_horizontal_scrollbar::builder_horizontal_scrollbar(
const config& cfg)
151 auto widget = std::make_unique<horizontal_scrollbar>(*
this);
156 <<
" placed horizontal scrollbar '" <<
id <<
"' with definition '"
A config object defines a single node in a WML file, with access to child nodes.
static std::string _(const char *str)
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.
This file contains the settings handling of the widget library.
Base class of a resolution, contains the common keys for a resolution.
std::vector< state_definition > state
An abstract description of a rectangle with integer coordinates.
bool contains(int x, int y) const
Whether the given point lies within the rectangle.
std::string missing_mandatory_wml_key(const std::string §ion, const std::string &key, const std::string &primary_key, const std::string &primary_value)
Returns a standard message for a missing wml key.
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.