The Battle for Wesnoth  1.15.0+dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::field_bool Class Reference

Specialized field class for boolean. More...

#include <field.hpp>

Inheritance diagram for gui2::field_bool:
Inheritance graph

Public Member Functions

 field_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value, const std::function< void(const bool)> &callback_save_value, const std::function< void(widget &)> &callback_change, const bool initial_fire)
 
 field_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(widget &)> &callback_change, const bool initial_fire)
 
- Public Member Functions inherited from gui2::field< bool, selectable_item >
 field (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value, const std::function< void(CT)> &callback_save_value)
 Constructor. More...
 
 field (const std::string &id, const bool mandatory, bool &linked_variable)
 Constructor. More...
 
 field (const std::string &id, const bool mandatory, const bool &value)
 Constructor. More...
 
void widget_restore (window &window)
 Inherited from field_base. More...
 
void set_widget_value (window &window, CT value)
 Sets the value of the field. More...
 
void set_cache_value (CT value)
 Sets the value of the field. More...
 
void widget_save (window &window)
 Inherited from field_base. More...
 
bool get_widget_value (window &window)
 Gets the value of the field. More...
 
- Public Member Functions inherited from gui2::field_base
 field_base (const std::string &id, const bool mandatory)
 Constructor. More...
 
virtual ~field_base ()
 
void attach_to_window (window &window)
 Attaches the field to a window. More...
 
void widget_init (window &window)
 Initializes the widget. More...
 
void widget_finalize (window &window)
 Finalizes the widget. More...
 
void detach_from_window ()
 Detaches the field from a window. More...
 
void widget_set_enabled (window &window, const bool enable, const bool sync)
 Enables a widget. More...
 
const std::string & id () const
 
bool is_mandatory () const
 
styled_widgetget_widget ()
 
const styled_widgetget_widget () const
 

Private Member Functions

void init_specialized (window &window)
 Overridden from field_base. More...
 

Private Attributes

std::function< void(widget &)> callback_change_
 
const bool initial_fire_
 

Detailed Description

Specialized field class for boolean.

Definition at line 544 of file field.hpp.

Constructor & Destructor Documentation

◆ field_bool() [1/2]

gui2::field_bool::field_bool ( const std::string &  id,
const bool  mandatory,
const std::function< bool()> &  callback_load_value,
const std::function< void(const bool)> &  callback_save_value,
const std::function< void(widget &)> &  callback_change,
const bool  initial_fire 
)
inline

Definition at line 547 of file field.hpp.

◆ field_bool() [2/2]

gui2::field_bool::field_bool ( const std::string &  id,
const bool  mandatory,
bool &  linked_variable,
const std::function< void(widget &)> &  callback_change,
const bool  initial_fire 
)
inline

Definition at line 560 of file field.hpp.

Member Function Documentation

◆ init_specialized()

void gui2::field_bool::init_specialized ( window window)
inlineprivatevirtual

Overridden from field_base.

Reimplemented from gui2::field_base.

Definition at line 573 of file field.hpp.

References gui2::event::connect_signal_notify_modified(), and gui2::window::find().

Member Data Documentation

◆ callback_change_

std::function<void(widget&)> gui2::field_bool::callback_change_
private

Definition at line 586 of file field.hpp.

◆ initial_fire_

const bool gui2::field_bool::initial_fire_
private

Definition at line 588 of file field.hpp.


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