Small abstract helper class. More...
#include <selectable_item.hpp>
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) |
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.
|
inlinevirtual |
Definition at line 35 of file selectable_item.hpp.
|
pure virtual |
Is the styled_widget selected?
Implemented in gui2::toggle_panel, gui2::toggle_button, and gui2::menu_button.
Referenced by get_value_bool(), gui2::listbox::order_by_column(), and gui2::tree_view_node::signal_handler_label_left_button_click().
|
inline |
Definition at line 48 of file selectable_item.hpp.
References get_value(), and num_states().
Referenced by gui2::dialogs::preferences_dialog::apply_pixel_scale(), gui2::dialogs::mp_create_game::get_active_mods(), gui2::dialogs::preferences_dialog::initialize_callbacks(), gui2::listbox::list_item_clicked(), gui2::dialogs::mp_create_game::on_mod_toggle(), gui2::dialogs::addon_uninstall_list::post_show(), gui2::tree_view_node::select_node(), gui2::group< T >::set_callback_on_value_change(), gui2::dialogs::language_selection::shown_filter_callback(), gui2::tree_view_node::signal_handler_toggle_left_click(), and gui2::dialogs::editor_edit_pbl::toggle_auth().
|
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().
|
pure virtual |
Select the styled_widget.
Implemented in gui2::menu_button, gui2::toggle_panel, and gui2::toggle_button.
Referenced by gui2::tree_view_node::fold(), gui2::policy::select_action::selection::select(), gui2::tree_view_node::select_node(), set_value_bool(), gui2::tree_view_node::signal_handler_label_left_button_click(), gui2::tree_view_node::tree_view_node(), and gui2::tree_view_node::unfold().
|
inline |
Definition at line 54 of file selectable_item.hpp.
References gui2::event::implementation::fire_event(), num_states(), and set_value().
Referenced by gui2::dialogs::mp_create_game::pre_show(), gui2::dialogs::select_orb_colors::reset_orb_group_two_color(), gui2::dialogs::select_orb_colors::reset_orb_toggle(), gui2::tree_view_node::select_node(), gui2::group< T >::set_members_enabled(), gui2::dialogs::select_orb_colors::setup_orb_group_two_color(), and gui2::dialogs::select_orb_colors::setup_orb_toggle().