Small abstract helper class. More...
#include <selectable.hpp>
Public Member Functions | |
virtual | ~tselectable_ () |
virtual unsigned | get_value () const =0 |
Is the control selected? More... | |
virtual void | set_value (const unsigned)=0 |
Select the control. 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 (const bool value) |
virtual void | set_callback_state_change (std::function< void(twidget &)> callback)=0 |
When the user does something to change the widget state this event is fired. More... | |
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.hpp.
|
inlinevirtual |
Definition at line 35 of file selectable.hpp.
|
pure virtual |
Is the control selected?
Implemented in gui2::ttoggle_panel, gui2::tcombobox, and gui2::ttoggle_button.
Referenced by get_value_bool(), gui2::taddon_list::on_order_button_click(), gui2::tlistbox::order_by_column(), and gui2::ttree_view_node::signal_handler_label_left_button_click().
|
inline |
Definition at line 48 of file selectable.hpp.
References get_value(), and num_states().
Referenced by gui2::tpreferences::animate_map_toggle_callback(), gui2::disambiguate_widget_value(), gui2::tlobby_main::game_filter_reload(), gui2::tpreferences::initialize_members(), gui2::tlobby_main::player_filter_callback(), gui2::taddon_uninstall_list::post_show(), gui2::tfield< T, W, CT >::save(), gui2::ttree_view_node::select_node(), gui2::setup_pref_toggle_button(), gui2::ttree_view_node::signal_handler_left_button_click(), gui2::tpreferences::single_toggle_callback(), gui2::tlobby_main::skip_replay_changed_callback(), gui2::tpreferences::toggle_slider_pair_callback(), and gui2::tlobby_main::update_playerlist().
|
pure virtual |
The number of states, that is 2 for normal buttons, 3 for tristate buttons.
Implemented in gui2::ttoggle_panel, gui2::tcombobox, and gui2::ttoggle_button.
Referenced by get_value_bool(), and set_value_bool().
|
pure virtual |
When the user does something to change the widget state this event is fired.
Most of the time it will be a left click on the widget.
Implemented in gui2::ttoggle_panel, gui2::tcombobox, and gui2::ttoggle_button.
Referenced by gui2::tfield_bool::init_specialized(), and gui2::taddon_list::register_sort_button().
|
pure virtual |
Select the control.
Implemented in gui2::ttoggle_panel, gui2::tcombobox, and gui2::ttoggle_button.
Referenced by gui2::ttree_view_node::fold(), gui2::taddon_list::on_order_button_click(), gui2::tlistbox::order_by_column(), gui2::policy::select_action::tselect::select(), gui2::ttree_view_node::select_node(), set_value_bool(), gui2::ttree_view_node::signal_handler_label_left_button_click(), gui2::ttree_view_node::ttree_view_node(), and gui2::ttree_view_node::unfold().
|
inline |
Definition at line 54 of file selectable.hpp.
References num_states(), and set_value().
Referenced by gui2::ttree_view_node::select_node(), and gui2::tselect_orb_colors::setup_orb_group().