Kanzi  3.9.7
Kanzi Engine API
kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass > Class Template Reference

Implementation class for ToggleButtonGroupConcept. More...

#include <kanzi/ui/node/concept/toggle_button_group.hpp>

Inheritance diagram for kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >:
[legend]

Public Member Functions

optional< size_t > getCurrentButtonIndex () const
 Returns the value of the CurrentButtonIndexProperty. More...
 
optional< size_t > registerButton (Node &button, size_t index)
 Registers a Toggle Button to the Toggle Button Group with a preset index. More...
 
optional< size_t > registerButton (Node &button)
 Registers a Toggle Button to the Toggle Button Group and automatically assigns an index for that Toggle Button. More...
 
void setCurrentButtonIndex (optional< size_t > index)
 Sets the value of the CurrentButtonIndexProperty. More...
 
 ToggleButtonGroupConceptImpl (Domain *domain, string_view name)
 Constructor. More...
 
void unregisterButton (size_t index)
 Unregisters from the Toggle Button Group a Toggle Button with the given index. More...
 

Static Public Member Functions

static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Protected Member Functions

TDerivedClass * getThisObject ()
 Internal accessor for the Curiously Recurring Template Pattern. More...
 
const TDerivedClass * getThisObject () const
 Internal accessor for the Curiously Recurring Template Pattern. More...
 
TBaseClass::LayoutVectorType measureOverride (typename TBaseClass::LayoutVectorType availableSize) override
 Node2D::measureOverride or Node3D::measureOverride implementation. More...
 
virtual void onDetached () override
 Node::onDetached implementation. More...
 
virtual void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 Node::onNodePropertyChanged implementation. More...
 
bool toggleOnRegisteredButton (Node &button)
 Toggles on passed button if it has more than 1 toggle states. More...
 

Protected Attributes

unordered_map< size_t, Node & > m_buttons
 List of Toggle Buttons registered to the Toggle Button Group. More...
 
size_t m_nextFreeIndex
 Counter for the next available index number that the Toggle Button Group assigns to a Toggle Button that you register without a predefined index. More...
 
optional< size_t > m_oldButtonIndex
 The index of the Toggle Button last time Kanzi toggled on a Toggle Button in the Toggle Button Group. More...
 

Additional Inherited Members

- Public Attributes inherited from kanzi::ToggleButtonGroupConcept
unsigned int m_nextFreeId
 
- Static Public Attributes inherited from kanzi::ToggleButtonGroupConcept
static MessageType< ToggledMessageArgumentsToggledMessage
 
static PropertyType< int > CurrentButtonIndexProperty
 Reports the index of the Toggle Button that is toggled on. More...
 
- Static Protected Member Functions inherited from kanzi::ToggleButtonGroupConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Detailed Description

template<class TBaseClass, class TDerivedClass>
class kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >

Implementation class for ToggleButtonGroupConcept.

Constructor & Destructor Documentation

template<typename TBaseClass , typename TDerivedClass >
kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::ToggleButtonGroupConceptImpl ( Domain domain,
string_view  name 
)
explicit

Constructor.

Member Function Documentation

template<typename TBaseClass , typename TDerivedClass >
PropertyTypeEditorInfoSharedPtr kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::makeEditorInfo ( )
static
template<typename TBaseClass , typename TDerivedClass >
optional< size_t > kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::registerButton ( Node button,
size_t  index 
)

Registers a Toggle Button to the Toggle Button Group with a preset index.

Fails if the index is already in use in that Toggle Button Group.

Parameters
buttonThe Toggle Button to register to the Toggle Button Group.
indexThe index to use to register the button. The index cannot already be in use in the Toggle Button Group.
Returns
If the registration was successful, the index, otherwise nullopt.
Since
Kanzi 3.9.0
template<typename TBaseClass , typename TDerivedClass >
optional< size_t > kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::registerButton ( Node button)

Registers a Toggle Button to the Toggle Button Group and automatically assigns an index for that Toggle Button.

Parameters
buttonThe Toggle Button to register to the Toggle Button Group.
Returns
The index that Kanzi assigned to the Toggle Button during the registration, or nullopt if the registration failed.
Since
Kanzi 3.9.0
template<typename TBaseClass , typename TDerivedClass >
void kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::unregisterButton ( size_t  index)

Unregisters from the Toggle Button Group a Toggle Button with the given index.

Parameters
indexThe index of the Toggle Button to unregister from the Toggle Button Group.
Since
Kanzi 3.9.0
template<typename TBaseClass , typename TDerivedClass >
optional< size_t > kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::getCurrentButtonIndex ( ) const

Returns the value of the CurrentButtonIndexProperty.

Returns
The value of the CurrentButtonIndexProperty, or nullopt if the property does not have a value.
See also
setCurrentButtonIndex()
Since
Kanzi 3.9.0
template<typename TBaseClass , typename TDerivedClass >
void kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::setCurrentButtonIndex ( optional< size_t >  index)

Sets the value of the CurrentButtonIndexProperty.

Parameters
indexThe index of the Toggle Button in the Toggle Button Group that you want to toggle on. To toggle off all Toggle Buttons in the Toggle Button Group, pass nullopt.
See also
getCurrentButtonIndex()
Since
Kanzi 3.9.0
template<typename TBaseClass, typename TDerivedClass >
TBaseClass::LayoutVectorType kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::measureOverride ( typename TBaseClass::LayoutVectorType  availableSize)
overrideprotected
template<typename TBaseClass , typename TDerivedClass >
void kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::onDetached ( )
overrideprotectedvirtual

Node::onDetached implementation.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::onNodePropertyChanged ( AbstractPropertyType  propertyType,
PropertyNotificationReason  reason 
)
overrideprotectedvirtual

Node::onNodePropertyChanged implementation.

template<class TBaseClass, class TDerivedClass>
TDerivedClass* kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::getThisObject ( )
inlineprotected

Internal accessor for the Curiously Recurring Template Pattern.

template<class TBaseClass, class TDerivedClass>
const TDerivedClass* kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::getThisObject ( ) const
inlineprotected

Internal accessor for the Curiously Recurring Template Pattern.

template<typename TBaseClass , typename TDerivedClass >
bool kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::toggleOnRegisteredButton ( Node button)
protected

Toggles on passed button if it has more than 1 toggle states.

Parameters
buttonButton that Toggle Button Group toggles on.
Returns
Returns true if button is toggle on succesfully, otherwise false.

Member Data Documentation

template<class TBaseClass, class TDerivedClass>
unordered_map<size_t, Node&> kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::m_buttons
protected

List of Toggle Buttons registered to the Toggle Button Group.

template<class TBaseClass, class TDerivedClass>
optional<size_t> kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::m_oldButtonIndex
protected

The index of the Toggle Button last time Kanzi toggled on a Toggle Button in the Toggle Button Group.

template<class TBaseClass, class TDerivedClass>
size_t kanzi::ToggleButtonGroupConceptImpl< TBaseClass, TDerivedClass >::m_nextFreeIndex
protected

Counter for the next available index number that the Toggle Button Group assigns to a Toggle Button that you register without a predefined index.


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