15 #define GETTEXT_DOMAIN "wesnoth-lib"
32 if(v_align ==
"top") {
34 }
else if(v_align ==
"bottom") {
37 if(!v_align.empty() && v_align !=
"center") {
38 ERR_GUI_E <<
"Invalid vertical alignment '" << v_align
39 <<
"' falling back to 'center'.\n";
47 if(h_align ==
"left") {
49 }
else if(h_align ==
"right") {
52 if(!h_align.empty() && h_align !=
"center") {
53 ERR_GUI_E <<
"Invalid horizontal alignment '" << h_align
54 <<
"' falling back to 'center'.\n";
60 unsigned get_border(
const std::vector<std::string>& borders)
63 for(
const auto &
border : borders)
67 }
else if(
border ==
"top") {
69 }
else if(
border ==
"bottom") {
71 }
else if(
border ==
"left") {
73 }
else if(
border ==
"right") {
84 const unsigned v_flags =
get_v_align(cfg[
"vertical_alignment"]);
85 const unsigned h_flags =
get_h_align(cfg[
"horizontal_alignment"]);
88 if(cfg[
"vertical_grow"].to_bool()) {
91 if(!(cfg[
"vertical_alignment"]).empty()) {
92 ERR_GUI_P <<
"vertical_grow and vertical_alignment "
93 "can't be combined, alignment is ignored.\n";
99 if(cfg[
"horizontal_grow"].to_bool()) {
102 if(!(cfg[
"horizontal_alignment"]).empty()) {
103 ERR_GUI_P <<
"horizontal_grow and horizontal_alignment "
104 "can't be combined, alignment is ignored.\n";
116 if(scrollbar_mode ==
"always") {
118 }
else if(scrollbar_mode ==
"never") {
120 }
else if(scrollbar_mode ==
"auto") {
123 if(!scrollbar_mode.empty() && scrollbar_mode !=
"initial_auto") {
124 ERR_GUI_E <<
"Invalid scrollbar mode '" << scrollbar_mode
125 <<
"' falling back to 'initial_auto'.\n";
135 if(!retval_id.empty()) {
140 ERR_GUI_E <<
"Window builder: retval_id '" << retval_id
141 <<
"' is unknown.\n";
Define the common log macros for the gui toolkit.
static const unsigned BORDER_BOTTOM
static const unsigned BORDER_ALL
unsigned read_flags(const config &cfg)
Returns the placement/resize flags.
static const unsigned HORIZONTAL_ALIGN_RIGHT
unsigned get_border(const std::vector< std::string > &borders)
Returns the border flags.
static const unsigned VERTICAL_GROW_SEND_TO_CLIENT
static const unsigned HORIZONTAL_GROW_SEND_TO_CLIENT
int get_retval(const std::string &retval_id, const int retval, const std::string &id)
Returns the return value for a widget.
static tretval get_retval_by_id(const std::string &id)
Gets the retval for the default buttons.
static const unsigned BORDER_RIGHT
tscrollbar_container::tscrollbar_mode get_scrollbar_mode(const std::string &scrollbar_mode)
Returns the scrollbar mode flags.
Definitions for the interface to Wesnoth Markup Language (WML).
static const unsigned BORDER_TOP
A class inherited from ttext_box that displays its input as stars.
static const unsigned HORIZONTAL_ALIGN_LEFT
static const unsigned VERTICAL_ALIGN_TOP
cl_event GLbitfield flags
static const unsigned VERTICAL_ALIGN_CENTER
unsigned get_v_align(const std::string &v_align)
Returns the vertical alignment.
GLint GLint GLsizei GLsizei GLsizei GLint border
static const unsigned HORIZONTAL_ALIGN_CENTER
std::vector< std::string > split(std::string const &val, const char c, const int flags)
Splits a (comma-)separated string into a vector of pieces.
A config object defines a single node in a WML file, with access to child nodes.
unsigned get_h_align(const std::string &h_align)
Returns the horizontal alignment.
static const unsigned VERTICAL_ALIGN_BOTTOM
GLsizei const GLcharARB ** string
Contains the implementation details for lexical_cast and shouldn't be used directly.
static const unsigned BORDER_LEFT