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;
67 SDL_Rect positioner_rect =
77 if(static_cast<std::size_t>(coordinate.
x) >
get_width()
78 || static_cast<std::size_t>(coordinate.
y) >
get_height()) {
95 return static_cast<std::size_t
>(coordinate.
y) <
get_height();
104 DBG_GUI_P <<
"Parsing vertical scrollbar " <<
id <<
'\n';
106 load_resolutions<resolution>(cfg);
111 , minimum_positioner_length(cfg[
"minimum_positioner_length"])
112 , maximum_positioner_length(cfg[
"maximum_positioner_length"])
113 , top_offset(cfg[
"top_offset"])
114 , bottom_offset(cfg[
"bottom_offset"])
118 "minimum_positioner_length"));
121 state.emplace_back(cfg.
child(
"state_enabled"));
122 state.emplace_back(cfg.
child(
"state_disabled"));
123 state.emplace_back(cfg.
child(
"state_pressed"));
124 state.emplace_back(cfg.
child(
"state_focused"));
132 builder_vertical_scrollbar::builder_vertical_scrollbar(
const config& cfg)
139 auto widget = std::make_unique<vertical_scrollbar>(*this);
144 <<
" 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...
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.
bool point_in_rect(int x, int y, const SDL_Rect &rect)
Tests whether a point is inside a rectangle.
SDL_Rect create_rect(const int x, const int y, const int w, const int h)
Creates an SDL_Rect with the given dimensions.
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.