The Battle for Wesnoth  1.19.5+dev
Classes | Typedefs | Functions | Variables
gui2::implementation Namespace Reference

Classes

class  placer_horizontal_list
 The placement class for a horizontal list. More...
 
class  placer_vertical_list
 The placement class for a vertical list. More...
 
struct  builder_instance
 
struct  builder_addon_list
 
struct  builder_button
 
struct  builder_chatbox
 
struct  builder_combobox
 
struct  builder_drawing
 
struct  builder_horizontal_scrollbar
 
struct  builder_image
 
struct  builder_label
 
struct  builder_listbox
 
struct  builder_horizontal_listbox
 
struct  builder_grid_listbox
 
struct  builder_matrix
 
struct  builder_menu_button
 
struct  builder_minimap
 
struct  builder_multi_page
 
struct  builder_multiline_text
 
struct  builder_multimenu_button
 
struct  builder_pane
 
struct  builder_panel
 
struct  builder_password_box
 
struct  builder_progress_bar
 
struct  builder_repeating_button
 
struct  builder_rich_label
 
struct  builder_scroll_label
 
struct  builder_scroll_text
 
struct  builder_scrollbar_panel
 
struct  builder_size_lock
 
struct  builder_slider
 
struct  builder_spacer
 
struct  builder_spinner
 
struct  builder_stacked_widget
 
struct  builder_styled_widget
 
struct  builder_tab_container
 
struct  builder_text_box
 
struct  builder_toggle_button
 
struct  builder_toggle_panel
 
struct  tree_node
 
struct  builder_tree_view
 
struct  builder_unit_preview_pane
 
struct  builder_vertical_scrollbar
 
struct  builder_viewport
 
class  builder_window
 

Typedefs

using scrollbar_mode = scrollbar_container::scrollbar_mode
 

Functions

unsigned get_v_align (const std::string &v_align)
 Returns the vertical alignment. More...
 
unsigned get_h_align (const std::string &h_align)
 Returns the horizontal alignment. More...
 
unsigned get_border (const std::vector< std::string > &borders)
 Returns the border flags. More...
 
unsigned read_flags (const config &cfg)
 Returns the placement/resize flags. More...
 
scrollbar_mode get_scrollbar_mode (const std::string &scrollbar_mode)
 Returns the scrollbar mode flags. More...
 
int get_retval (const std::string &retval_id, const int retval, const std::string &id)
 Returns the return value for a widget. More...
 
static widget::visibility parse_visibility (const std::string &str)
 
static std::vector< widget_dataparse_list_data (const config &data, const unsigned int req_cols)
 

Variables

static std::map< std::string, scrollbar_modescrollbar_mode_map
 

Typedef Documentation

◆ scrollbar_mode

Definition at line 31 of file helper.hpp.

Function Documentation

◆ get_border()

unsigned gui2::implementation::get_border ( const std::vector< std::string > &  borders)

Returns the border flags.

Parameters
bordersThe string representing the border flags.
Returns
The border flags.

Definition at line 68 of file helper.cpp.

References border, gui2::grid::BORDER_ALL, gui2::grid::BORDER_BOTTOM, gui2::grid::BORDER_LEFT, gui2::grid::BORDER_RIGHT, and gui2::grid::BORDER_TOP.

Referenced by read_flags().

◆ get_h_align()

unsigned gui2::implementation::get_h_align ( const std::string &  h_align)

Returns the horizontal alignment.

Parameters
h_alignThe string representing the alignment.
Returns
The alignment.

Definition at line 53 of file helper.cpp.

References ERR_GUI_E, gui2::grid::HORIZONTAL_ALIGN_CENTER, gui2::grid::HORIZONTAL_ALIGN_LEFT, and gui2::grid::HORIZONTAL_ALIGN_RIGHT.

Referenced by read_flags(), and gui2::widget::set_horizontal_alignment().

◆ get_retval()

int gui2::implementation::get_retval ( const std::string &  retval_id,
const int  retval,
const std::string &  id 
)

Returns the return value for a widget.

If there's a valid retval_id that will be returned. Else if there's a retval that's returned. Else it falls back to the id.

Definition at line 137 of file helper.cpp.

References ERR_GUI_E, and gui2::window::get_retval_by_id().

Referenced by gui2::implementation::builder_button::build(), gui2::implementation::builder_toggle_button::build(), and gui2::implementation::builder_toggle_panel::build().

◆ get_scrollbar_mode()

scrollbar_mode gui2::implementation::get_scrollbar_mode ( const std::string &  scrollbar_mode)

Returns the scrollbar mode flags.

Parameters
scrollbar_modeThe string representing the scrollbar_mode.
Returns
The scrollbar mode flags.

Definition at line 121 of file helper.cpp.

References gui2::scrollbar_container::AUTO_VISIBLE_FIRST_RUN, ERR_GUI_E, and scrollbar_mode_map.

◆ get_v_align()

unsigned gui2::implementation::get_v_align ( const std::string &  v_align)

Returns the vertical alignment.

Parameters
v_alignThe string representing the alignment.
Returns
The alignment.

Definition at line 38 of file helper.cpp.

References ERR_GUI_E, gui2::grid::VERTICAL_ALIGN_BOTTOM, gui2::grid::VERTICAL_ALIGN_CENTER, and gui2::grid::VERTICAL_ALIGN_TOP.

Referenced by read_flags(), and gui2::widget::set_vertical_alignment().

◆ parse_list_data()

static std::vector<widget_data> gui2::implementation::parse_list_data ( const config data,
const unsigned int  req_cols 
)
static

◆ parse_visibility()

static widget::visibility gui2::implementation::parse_visibility ( const std::string &  str)
static

◆ read_flags()

unsigned gui2::implementation::read_flags ( const config cfg)

Returns the placement/resize flags.

Parameters
cfgThe config to look for flags for.
Returns
The placement/resize flags.

Definition at line 88 of file helper.cpp.

References ERR_GUI_P, get_border(), get_h_align(), get_v_align(), gui2::grid::HORIZONTAL_GROW_SEND_TO_CLIENT, utils::split(), and gui2::grid::VERTICAL_GROW_SEND_TO_CLIENT.

Referenced by gui2::builder_grid::builder_grid().

Variable Documentation

◆ scrollbar_mode_map

std::map<std::string, scrollbar_mode> gui2::implementation::scrollbar_mode_map
static
Initial value:
{
{ "always", scrollbar_mode::ALWAYS_VISIBLE },
{ "never", scrollbar_mode::ALWAYS_INVISIBLE },
{ "auto", scrollbar_mode::AUTO_VISIBLE },
{ "initial_auto", scrollbar_mode::AUTO_VISIBLE_FIRST_RUN },
}

Definition at line 31 of file helper.cpp.

Referenced by get_scrollbar_mode().