16 #define GETTEXT_DOMAIN "wesnoth-lib"
32 {
"always", scrollbar_mode::ALWAYS_VISIBLE },
33 {
"never", scrollbar_mode::ALWAYS_INVISIBLE },
34 {
"auto", scrollbar_mode::AUTO_VISIBLE },
35 {
"initial_auto", scrollbar_mode::AUTO_VISIBLE_FIRST_RUN },
40 if(v_align ==
"top") {
42 }
else if(v_align ==
"bottom") {
45 if(!v_align.empty() && v_align !=
"center") {
46 ERR_GUI_E <<
"Invalid vertical alignment '" << v_align
47 <<
"' falling back to 'center'.";
55 if(h_align ==
"left") {
57 }
else if(h_align ==
"right") {
60 if(!h_align.empty() && h_align !=
"center") {
61 ERR_GUI_E <<
"Invalid horizontal alignment '" << h_align
62 <<
"' falling back to 'center'.";
68 unsigned get_border(
const std::vector<std::string>& borders)
71 for(
const auto &
border : borders)
75 }
else if(
border ==
"top") {
77 }
else if(
border ==
"bottom") {
79 }
else if(
border ==
"left") {
81 }
else if(
border ==
"right") {
92 const unsigned v_flags =
get_v_align(cfg[
"vertical_alignment"]);
93 const unsigned h_flags =
get_h_align(cfg[
"horizontal_alignment"]);
96 if(cfg[
"vertical_grow"].to_bool()) {
99 if(!(cfg[
"vertical_alignment"]).empty()) {
100 ERR_GUI_P <<
"vertical_grow and vertical_alignment "
101 "can't be combined, alignment is ignored.";
107 if(cfg[
"horizontal_grow"].to_bool()) {
110 if(!(cfg[
"horizontal_alignment"]).empty()) {
111 ERR_GUI_P <<
"horizontal_grow and horizontal_alignment "
112 "can't be combined, alignment is ignored.";
129 <<
"Falling back to 'initial_auto'.";
139 const std::string&
id)
141 if(!retval_id.empty()) {
146 ERR_GUI_E <<
"Window builder: retval_id '" << retval_id
A config object defines a single node in a WML file, with access to child nodes.
static const unsigned HORIZONTAL_GROW_SEND_TO_CLIENT
static const unsigned HORIZONTAL_ALIGN_RIGHT
static const unsigned VERTICAL_ALIGN_BOTTOM
static const unsigned BORDER_TOP
static const unsigned VERTICAL_ALIGN_CENTER
static const unsigned VERTICAL_GROW_SEND_TO_CLIENT
static const unsigned BORDER_BOTTOM
static const unsigned BORDER_RIGHT
static const unsigned HORIZONTAL_ALIGN_CENTER
static const unsigned VERTICAL_ALIGN_TOP
static const unsigned BORDER_LEFT
static const unsigned BORDER_ALL
static const unsigned HORIZONTAL_ALIGN_LEFT
static retval get_retval_by_id(const std::string &id)
Gets the retval for the default buttons.
Definitions for the interface to Wesnoth Markup Language (WML).
@ border
The border of the map.
Define the common log macros for the gui toolkit.
unsigned get_v_align(const std::string &v_align)
Returns the vertical alignment.
int get_retval(const std::string &retval_id, const int retval, const std::string &id)
Returns the return value for a widget.
unsigned get_h_align(const std::string &h_align)
Returns the horizontal alignment.
unsigned get_border(const std::vector< std::string > &borders)
Returns the border flags.
unsigned read_flags(const config &cfg)
Returns the placement/resize flags.
scrollbar_container::scrollbar_mode scrollbar_mode
static std::map< std::string, scrollbar_mode > scrollbar_mode_map
scrollbar_mode get_scrollbar_mode(const std::string &scrollbar_mode)
Returns the scrollbar mode flags.
retval
Default window/dialog return values.
Contains the implementation details for lexical_cast and shouldn't be used directly.
std::vector< std::string > split(const config_attribute_value &val)