16 #define GETTEXT_DOMAIN "wesnoth-lib" 39 const auto conf = cast_config_to<vertical_scrollbar_definition>();
41 return conf->minimum_positioner_length;
46 const auto conf = cast_config_to<vertical_scrollbar_definition>();
48 return conf->maximum_positioner_length;
53 const auto conf = cast_config_to<vertical_scrollbar_definition>();
55 return conf->top_offset;
60 const auto conf = cast_config_to<vertical_scrollbar_definition>();
62 return conf->bottom_offset;
72 return positioner_rect.
contains(coordinate);
78 if(static_cast<std::size_t>(coordinate.x) >
get_width()
79 || static_cast<std::size_t>(coordinate.y) >
get_height()) {
96 return static_cast<std::size_t
>(coordinate.y) <
get_height();
107 load_resolutions<resolution>(cfg);
112 , minimum_positioner_length(cfg[
"minimum_positioner_length"])
113 , maximum_positioner_length(cfg[
"maximum_positioner_length"])
114 , top_offset(cfg[
"top_offset"])
115 , bottom_offset(cfg[
"bottom_offset"])
119 "minimum_positioner_length"));
122 state.emplace_back(cfg.
child(
"state_enabled"));
123 state.emplace_back(cfg.
child(
"state_disabled"));
124 state.emplace_back(cfg.
child(
"state_pressed"));
125 state.emplace_back(cfg.
child(
"state_focused"));
133 builder_vertical_scrollbar::builder_vertical_scrollbar(
const config& cfg)
140 auto widget = std::make_unique<vertical_scrollbar>(*this);
145 <<
" placed vertical scrollbar '" <<
id <<
"' with definition '"
Base class of a resolution, contains the common keys for a resolution.
config & child(config_key_type key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
std::vector< state_definition > state
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
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.
#define VALIDATE(cond, message)
The macro to use for the validation of WML.
This file contains the settings handling of the widget library.
An abstract description of a rectangle with integer coordinates.
map_location coordinate
Contains an x and y coordinate used for starting positions in maps.
A config object defines a single node in a WML file, with access to child nodes.
Contains the implementation details for lexical_cast and shouldn't be used directly.