The Battle for Wesnoth  1.19.7+dev
Public Types | Public Member Functions | Public Attributes | List of all members
gui2::builder_widget Struct Referenceabstract

Contains the info needed to instantiate a widget. More...

#include <window_builder.hpp>

Inheritance diagram for gui2::builder_widget:

Public Types

using replacements_map = std::map< std::string, std::shared_ptr< builder_widget > >
 The replacements type is used to define replacement types. More...
 
using optional_replacements = utils::optional_reference< const replacements_map >
 

Public Member Functions

 builder_widget (const config &cfg)
 
virtual ~builder_widget ()
 
virtual std::unique_ptr< widgetbuild () const =0
 
virtual std::unique_ptr< widgetbuild (const replacements_map &replacements) const =0
 

Public Attributes

std::string id
 Parameters for the widget. More...
 
std::string linked_group
 
widget::debug_border debug_border_mode
 
color_t debug_border_color
 

Detailed Description

Contains the info needed to instantiate a widget.

Definition at line 32 of file window_builder.hpp.

Member Typedef Documentation

◆ optional_replacements

Todo:
: evaluate whether to combine the two build() functions with this as the sole parameter.

Definition at line 48 of file window_builder.hpp.

◆ replacements_map

using gui2::builder_widget::replacements_map = std::map<std::string, std::shared_ptr<builder_widget> >

The replacements type is used to define replacement types.

Certain widgets need to build a part of themselves upon instantiation but at the time of the definition it's not yet known what exactly. By using and ‘[instance]’ widget this decision can be postponed until instantiation.

Definition at line 42 of file window_builder.hpp.

Constructor & Destructor Documentation

◆ builder_widget()

gui2::builder_widget::builder_widget ( const config cfg)
explicit

◆ ~builder_widget()

virtual gui2::builder_widget::~builder_widget ( )
inlinevirtual

Definition at line 52 of file window_builder.hpp.

Member Function Documentation

◆ build() [1/2]

virtual std::unique_ptr<widget> gui2::builder_widget::build ( ) const
pure virtual

Implemented in gui2::implementation::builder_window, gui2::implementation::builder_viewport, gui2::implementation::builder_vertical_scrollbar, gui2::implementation::builder_unit_preview_pane, gui2::implementation::builder_tree_view, gui2::implementation::builder_toggle_panel, gui2::implementation::builder_toggle_button, gui2::implementation::builder_text_box, gui2::implementation::builder_tab_container, gui2::implementation::builder_stacked_widget, gui2::implementation::builder_spinner, gui2::implementation::builder_spacer, gui2::implementation::builder_slider, gui2::implementation::builder_size_lock, gui2::implementation::builder_scrollbar_panel, gui2::implementation::builder_scroll_text, gui2::implementation::builder_scroll_label, gui2::implementation::builder_rich_label, gui2::implementation::builder_repeating_button, gui2::implementation::builder_progress_bar, gui2::implementation::builder_password_box, gui2::implementation::builder_panel, gui2::implementation::builder_pane, gui2::implementation::builder_multimenu_button, gui2::implementation::builder_multiline_text, gui2::implementation::builder_multi_page, gui2::implementation::builder_minimap, gui2::implementation::builder_menu_button, gui2::implementation::builder_matrix, gui2::implementation::builder_listbox_base, gui2::implementation::builder_label, gui2::implementation::builder_image, gui2::implementation::builder_horizontal_scrollbar, gui2::implementation::builder_drawing, gui2::implementation::builder_combobox, gui2::implementation::builder_chatbox, gui2::implementation::builder_button, gui2::implementation::builder_addon_list, gui2::implementation::builder_instance, and gui2::builder_grid.

Referenced by gui2::size_lock::finalize().

◆ build() [2/2]

virtual std::unique_ptr<widget> gui2::builder_widget::build ( const replacements_map replacements) const
pure virtual

Member Data Documentation

◆ debug_border_color

color_t gui2::builder_widget::debug_border_color

Definition at line 65 of file window_builder.hpp.

◆ debug_border_mode

widget::debug_border gui2::builder_widget::debug_border_mode

Definition at line 64 of file window_builder.hpp.

Referenced by builder_widget().

◆ id

std::string gui2::builder_widget::id

Parameters for the widget.

Definition at line 61 of file window_builder.hpp.

◆ linked_group

std::string gui2::builder_widget::linked_group

Definition at line 62 of file window_builder.hpp.

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


The documentation for this struct was generated from the following files: