The Battle for Wesnoth  1.19.7+dev
Public Member Functions | List of all members
gui2::selectable_item Class Referenceabstract

Small abstract helper class. More...

#include <selectable_item.hpp>

Inheritance diagram for gui2::selectable_item:

Public Member Functions

virtual ~selectable_item ()
 
virtual unsigned get_value () const =0
 Is the styled_widget selected? More...
 
virtual void set_value (unsigned value, bool fire_event=false)=0
 Select the styled_widget. More...
 
virtual unsigned num_states () const =0
 The number of states, that is 2 for normal buttons, 3 for tristate buttons. More...
 
bool get_value_bool () const
 
void set_value_bool (bool value, bool fire_event=false)
 

Detailed Description

Small abstract helper class.

Parts of the engine inherit this class so we can have generic selectable items.

Definition at line 32 of file selectable_item.hpp.

Constructor & Destructor Documentation

◆ ~selectable_item()

virtual gui2::selectable_item::~selectable_item ( )
inlinevirtual

Definition at line 35 of file selectable_item.hpp.

Member Function Documentation

◆ get_value()

virtual unsigned gui2::selectable_item::get_value ( ) const
pure virtual

◆ get_value_bool()

bool gui2::selectable_item::get_value_bool ( ) const
inline

◆ num_states()

virtual unsigned gui2::selectable_item::num_states ( ) const
pure virtual

The number of states, that is 2 for normal buttons, 3 for tristate buttons.

Implemented in gui2::toggle_panel, gui2::toggle_button, and gui2::menu_button.

Referenced by get_value_bool(), and set_value_bool().

◆ set_value()

virtual void gui2::selectable_item::set_value ( unsigned  value,
bool  fire_event = false 
)
pure virtual

◆ set_value_bool()

void gui2::selectable_item::set_value_bool ( bool  value,
bool  fire_event = false 
)
inline

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