The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
gui2::gui_definition Class Reference

A GUI definiton. More...

Public Types

using styled_widget_definition_map = std::map< std::string, std::map< std::string, styled_widget_definition_ptr >>
 

Public Member Functions

 gui_definition (const config &cfg)
 
void activate () const
 Activates this gui. More...
 
void load_widget_definitions (const std::string &widget_type, const std::vector< styled_widget_definition_ptr > &definitions)
 

Public Attributes

std::string id
 
t_string description
 
styled_widget_definition_map widget_types
 Map of each widget type, by id, and a sub-map of each of the type's definitions, also by id. More...
 
std::map< std::string,
builder_window
window_types
 Map of all known windows (the builder class builds a window). More...
 

Private Member Functions

void read (const config &cfg)
 

Private Attributes

unsigned popup_show_delay_
 
unsigned popup_show_time_
 
unsigned help_show_time_
 
unsigned double_click_time_
 
unsigned repeat_button_repeat_time_
 
std::string sound_button_click_
 
std::string sound_toggle_button_click_
 
std::string sound_toggle_panel_click_
 
std::string sound_slider_adjust_
 
t_string has_helptip_message_
 
std::vector< game_tiptips_
 

Detailed Description

A GUI definiton.

Each GUI contains several widgets, their definitons, and windows and controls the appearance and layout of each.

Multiple GUI definitions may exist, though only a single default one is provided right now.

Definition at line 109 of file settings.cpp.

Member Typedef Documentation

using gui2::gui_definition::styled_widget_definition_map = std::map<std::string, std::map<std::string, styled_widget_definition_ptr>>

Definition at line 139 of file settings.cpp.

Constructor & Destructor Documentation

gui2::gui_definition::gui_definition ( const config cfg)
inlineexplicit

Definition at line 112 of file settings.cpp.

References read().

Member Function Documentation

void gui2::gui_definition::activate ( ) const
void gui2::gui_definition::load_widget_definitions ( const std::string &  widget_type,
const std::vector< styled_widget_definition_ptr > &  definitions 
)

Definition at line 398 of file settings.cpp.

References ERR_GUI_P, gui2::event::find(), wfl::msg(), VALIDATE, vgettext(), and widget_types.

Referenced by read().

void gui2::gui_definition::read ( const config cfg)
private

Parse widget definitions of each registered type.

Parse each window.

Todo:
Regarding sounds: Need to evaluate but probably we want the widget definition be able to:
  • Override the default (and clear it). This will allow toggle buttons in a listbox to sound like a toggle panel.
  • Override the default and above per instance of the widget, some buttons can give a different sound.

Definition at line 311 of file settings.cpp.

References config::child(), config::child_range(), DBG_GUI_P, description, double_click_time_, t_string::empty(), has_helptip_message_, help_show_time_, gui2::tip_of_the_day::load(), load_widget_definitions(), missing_mandatory_wml_key(), popup_show_delay_, popup_show_time_, gui2::registered_widget_types(), gui2::registered_window_types(), repeat_button_repeat_time_, sound_button_click_, sound_slider_adjust_, sound_toggle_button_click_, sound_toggle_panel_click_, tips_, VALIDATE, w, and window_types.

Referenced by gui_definition().

Member Data Documentation

t_string gui2::gui_definition::description

Definition at line 133 of file settings.cpp.

Referenced by read().

unsigned gui2::gui_definition::double_click_time_
private

Definition at line 156 of file settings.cpp.

Referenced by activate(), and read().

t_string gui2::gui_definition::has_helptip_message_
private

Definition at line 164 of file settings.cpp.

Referenced by activate(), and read().

unsigned gui2::gui_definition::help_show_time_
private

Definition at line 155 of file settings.cpp.

Referenced by activate(), and read().

std::string gui2::gui_definition::id

Definition at line 132 of file settings.cpp.

unsigned gui2::gui_definition::popup_show_delay_
private

Definition at line 153 of file settings.cpp.

Referenced by activate(), and read().

unsigned gui2::gui_definition::popup_show_time_
private

Definition at line 154 of file settings.cpp.

Referenced by activate(), and read().

unsigned gui2::gui_definition::repeat_button_repeat_time_
private

Definition at line 157 of file settings.cpp.

Referenced by activate(), and read().

std::string gui2::gui_definition::sound_button_click_
private

Definition at line 159 of file settings.cpp.

Referenced by activate(), and read().

std::string gui2::gui_definition::sound_slider_adjust_
private

Definition at line 162 of file settings.cpp.

Referenced by activate(), and read().

std::string gui2::gui_definition::sound_toggle_button_click_
private

Definition at line 160 of file settings.cpp.

Referenced by activate(), and read().

std::string gui2::gui_definition::sound_toggle_panel_click_
private

Definition at line 161 of file settings.cpp.

Referenced by activate(), and read().

std::vector<game_tip> gui2::gui_definition::tips_
private

Definition at line 166 of file settings.cpp.

Referenced by activate(), and read().

styled_widget_definition_map gui2::gui_definition::widget_types

Map of each widget type, by id, and a sub-map of each of the type's definitions, also by id.

Definition at line 142 of file settings.cpp.

Referenced by load_widget_definitions().

std::map<std::string, builder_window> gui2::gui_definition::window_types

Map of all known windows (the builder class builds a window).

Definition at line 145 of file settings.cpp.

Referenced by read().


The documentation for this class was generated from the following file: