The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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:
Inheritance graph

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 31 of file selectable_item.hpp.

Constructor & Destructor Documentation

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

Definition at line 34 of file selectable_item.hpp.

Member Function Documentation

virtual unsigned gui2::selectable_item::get_value ( ) const
pure virtual
bool gui2::selectable_item::get_value_bool ( ) const
inline
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::menu_button, and gui2::toggle_button.

Referenced by get_value_bool(), and set_value_bool().

virtual void gui2::selectable_item::set_value ( unsigned  value,
bool  fire_event = false 
)
pure virtual
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: