The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
gui2::tgroup< T > Class Template Reference

#include <group.hpp>

Public Types

typedef std::pair
< tselectable_ *, T > 
group_type
 
typedef std::vector< group_typegroup_list
 
typedef group_list::iterator group_iterator
 
typedef group_list::const_iterator group_iterator_const
 

Public Member Functions

void add_member (tselectable_ *widget, const T &value)
 Adds a widget/value pair to the group vector. More...
 
void remove_member (tselectable_ *widget)
 Removes a member from the group vector. More...
 
void clear ()
 Clears the entire group of members. More...
 
std::pair< group_iterator,
group_iterator
members ()
 Group member getters. More...
 
std::pair
< group_iterator_const,
group_iterator_const
members () const
 
void group_operator ()
 The default actions to take when clicking on one of the widgets in the group. More...
 
get_active_member_value ()
 Returns the value paired with the currently activiely toggled member of the group. More...
 
void set_member_states (const T &value)
 Sets the toggle values for all widgets besides the one associated with the specified value to false. More...
 

Private Attributes

group_list members_
 

Detailed Description

template<class T>
class gui2::tgroup< T >

Definition at line 29 of file group.hpp.

Member Typedef Documentation

template<class T>
typedef group_list::iterator gui2::tgroup< T >::group_iterator

Definition at line 34 of file group.hpp.

template<class T>
typedef group_list::const_iterator gui2::tgroup< T >::group_iterator_const

Definition at line 35 of file group.hpp.

template<class T>
typedef std::vector<group_type> gui2::tgroup< T >::group_list

Definition at line 33 of file group.hpp.

template<class T>
typedef std::pair<tselectable_*, T> gui2::tgroup< T >::group_type

Definition at line 32 of file group.hpp.

Member Function Documentation

template<class T>
void gui2::tgroup< T >::add_member ( tselectable_ widget,
const T &  value 
)
inline

Adds a widget/value pair to the group vector.

A callback is set that sets all members' toggle states to false when clicked. This happens before individual widget handlers fire, meaning that the clicked widget will remain the only one selected.

Definition at line 43 of file group.hpp.

Referenced by gui2::tlogging::pre_show(), gui2::tunit_create::pre_show(), gui2::taddon_filter_options::register_dir_toggle(), gui2::teditor_edit_side::register_radio_toggle(), gui2::taddon_filter_options::register_sort_toggle(), gui2::tpreferences::setup_radio_toggle(), and gui2::tadvanced_graphics_options::setup_scale_case().

template<class T>
void gui2::tgroup< T >::clear ( )
inline

Clears the entire group of members.

Definition at line 63 of file group.hpp.

Referenced by gui2::taddon_filter_options::post_show(), and gui2::taddon_filter_options::pre_show().

template<class T>
T gui2::tgroup< T >::get_active_member_value ( )
inline
template<class T>
void gui2::tgroup< T >::group_operator ( )
inline

The default actions to take when clicking on one of the widgets in the group.

Definition at line 85 of file group.hpp.

Referenced by gui2::tgroup< SCALING_ALGORITHM >::add_member().

template<class T>
std::pair<group_iterator, group_iterator> gui2::tgroup< T >::members ( )
inline
template<class T>
std::pair<group_iterator_const, group_iterator_const> gui2::tgroup< T >::members ( ) const
inline

Definition at line 76 of file group.hpp.

template<class T>
void gui2::tgroup< T >::remove_member ( tselectable_ widget)
inline

Removes a member from the group vector.

Definition at line 54 of file group.hpp.

template<class T>
void gui2::tgroup< T >::set_member_states ( const T &  value)
inline

Sets the toggle values for all widgets besides the one associated with the specified value to false.

Definition at line 113 of file group.hpp.

Referenced by gui2::tlogging::pre_show(), gui2::tunit_create::pre_show(), and gui2::tadvanced_graphics_options::setup_scale_case().

Member Data Documentation

template<class T>
group_list gui2::tgroup< T >::members_
private

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