Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::ButtonConcept Class Reference

Button nodes provide an area that receives key and touch input which Kanzi translates to state events. More...

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

Inheritance diagram for kanzi::ButtonConcept:
[legend]

Classes

class  CanceledMessageArguments
 
class  ClickedMessageArguments
 
class  LongPressMessageArguments
 
class  PointerEnteredMessageArguments
 
class  PointerLeftMessageArguments
 
class  PressedMessageArguments
 
class  ToggledOffMessageArguments
 Message arguments used by the ToggledOffMessage. More...
 
class  ToggledOnMessageArguments
 Message arguments used by the ToggledOnMessage. More...
 
class  ToggleStateChangedMessageArguments
 Message arguments used by the ToggleStateChangedMessage. More...
 

Static Public Member Functions

static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Static Public Attributes

Properties
static PropertyType< bool > IsPressedProperty
 Indicates whether the button is in the down state. More...
 
static PropertyType< float > LongPressIntervalProperty
 Sets the amount of time in milliseconds that the user must hold the button pressed down for Kanzi to recognize it as a long-press gesture. More...
 
static PropertyType< bool > PressOnHoverProperty
 Indicates whether hovering the pointer over the button sets the button in the down state. More...
 
static PropertyType< float > AutoClickIntervalProperty
 Sets the time in milliseconds after which a button that the user keeps pressed down sends the ButtonConcept::ClickedMessage. More...
 
static PropertyType< int > ToggleStateProperty
 Sets the toggle state of a Button. More...
 
static PropertyType< int > ToggleStateCountProperty
 Sets the number of toggle states of a Button. More...
 
static PropertyType< int > IndexInGroupProperty
 Sets the predefined index of a Button in the Toggle Button Group to which that Button is registered. More...
 
Messages
static MessageType< ClickedMessageArgumentsClickedMessage
 
static MessageType< PressedMessageArgumentsPressedMessage
 
static MessageType< CanceledMessageArgumentsCanceledMessage
 
static MessageType< PointerEnteredMessageArgumentsPointerEnteredMessage
 
static MessageType< PointerLeftMessageArgumentsPointerLeftMessage
 
static MessageType< LongPressMessageArgumentsLongPressMessage
 
static MessageType< ToggledOnMessageArgumentsToggledOnMessage
 
static MessageType< ToggledOffMessageArgumentsToggledOffMessage
 
static MessageType< ToggleStateChangedMessageArgumentsToggleStateChangedMessage
 

Static Protected Member Functions

static Vector2 measure2D (Node2D *button, Vector2 availableSize)
 Measure function for a Node2D button. More...
 

Detailed Description

Button nodes provide an area that receives key and touch input which Kanzi translates to state events.

In addition to the area that receives input, the Toggle Button nodes provide a toggled state.

To disable a Button node set the Node::EnabledProperty to false. A disabled Button does not produce user events. To visually indicate the disabled state of a Button node, create a state manager and use the Node::EffectivelyEnabledProperty as its controller property. When Kanzi disables a Button node, it cancels the pressed state. Kanzi preserves the toggled state of a Toggle Button node when that Toggle Button is disabled.

Member Function Documentation

static PropertyTypeEditorInfoSharedPtr kanzi::ButtonConcept::makeEditorInfo ( )
static
static Vector2 kanzi::ButtonConcept::measure2D ( Node2D button,
Vector2  availableSize 
)
staticprotected

Measure function for a Node2D button.

Member Data Documentation

PropertyType<bool> kanzi::ButtonConcept::IsPressedProperty
static

Indicates whether the button is in the down state.

Whether the button is in down state. The default value is false.

See also
setIsPressed(), isIsPressed()
PropertyType<float> kanzi::ButtonConcept::LongPressIntervalProperty
static

Sets the amount of time in milliseconds that the user must hold the button pressed down for Kanzi to recognize it as a long-press gesture.

To disable the long-press gesture, set to 0. The default value is 0.0f.

See also
setLongPressInterval(), getLongPressInterval()
PropertyType<bool> kanzi::ButtonConcept::PressOnHoverProperty
static

Indicates whether hovering the pointer over the button sets the button in the down state.

The default value is false.

See also
setPressOnHover(), isPressOnHover()
PropertyType<float> kanzi::ButtonConcept::AutoClickIntervalProperty
static

Sets the time in milliseconds after which a button that the user keeps pressed down sends the ButtonConcept::ClickedMessage.

While the user holds the button down, the button keeps sending the ClickedMessage at the time interval set by this property. To disable the behavior, set to 0. The default value is 0.0f.

See also
setAutoClickInterval(), getAutoClickInterval()
PropertyType<int> kanzi::ButtonConcept::ToggleStateProperty
static

Sets the toggle state of a Button.

To update the toggle state with a binding, use a ToSourceBinding or TwoWayBinding. When the toggle state changes, the Button internally overrides any one-way binding that targets this property. The default value is 0.

See also
ButtonConceptImpl::setToggleState(), ButtonConceptImpl::getToggleState()
PropertyType<int> kanzi::ButtonConcept::ToggleStateCountProperty
static

Sets the number of toggle states of a Button.

The default value is 0.

See also
ButtonConceptImpl::setToggleStateCount(), ButtonConceptImpl::getToggleStateCount()
PropertyType<int> kanzi::ButtonConcept::IndexInGroupProperty
static

Sets the predefined index of a Button in the Toggle Button Group to which that Button is registered.

If a Button does not have local value set for this property, it is not registered to the Toggle Button Group. Multiple Buttons in a Toggle Button Group cannot have the same index. When the value of this property is -1, the Toggle Button Group automatically assigns an index for the Button.

The default value is -1.

See also
ButtonConceptImpl::setIndexInGroup(), ButtonConceptImpl::getIndexInGroup()
MessageType<ClickedMessageArguments> kanzi::ButtonConcept::ClickedMessage
static
MessageType<PressedMessageArguments> kanzi::ButtonConcept::PressedMessage
static
MessageType<CanceledMessageArguments> kanzi::ButtonConcept::CanceledMessage
static
MessageType<PointerEnteredMessageArguments> kanzi::ButtonConcept::PointerEnteredMessage
static
MessageType<PointerLeftMessageArguments> kanzi::ButtonConcept::PointerLeftMessage
static
MessageType<LongPressMessageArguments> kanzi::ButtonConcept::LongPressMessage
static
MessageType<ToggledOnMessageArguments> kanzi::ButtonConcept::ToggledOnMessage
static
MessageType<ToggledOffMessageArguments> kanzi::ButtonConcept::ToggledOffMessage
static
MessageType<ToggleStateChangedMessageArguments> kanzi::ButtonConcept::ToggleStateChangedMessage
static

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