Kanzi  3.9.5
Kanzi Engine API
kanzi::ButtonConcept Class Reference

Button nodes provide an area that receives keyboard 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 keyboard 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

◆ makeEditorInfo()

static PropertyTypeEditorInfoSharedPtr kanzi::ButtonConcept::makeEditorInfo ( )
static

◆ measure2D()

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

Measure function for a Node2D button.

Member Data Documentation

◆ IsPressedProperty

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()

◆ LongPressIntervalProperty

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()

◆ PressOnHoverProperty

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()

◆ AutoClickIntervalProperty

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()

◆ ToggleStateProperty

PropertyType<int> kanzi::ButtonConcept::ToggleStateProperty
static

Sets the toggle state of a Button.

The default value is 0.

See also
ButtonConceptImpl::setToggleState(), ButtonConceptImpl::getToggleState()

◆ ToggleStateCountProperty

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()

◆ IndexInGroupProperty

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()

◆ ClickedMessage

MessageType<ClickedMessageArguments> kanzi::ButtonConcept::ClickedMessage
static

◆ PressedMessage

MessageType<PressedMessageArguments> kanzi::ButtonConcept::PressedMessage
static

◆ CanceledMessage

MessageType<CanceledMessageArguments> kanzi::ButtonConcept::CanceledMessage
static

◆ PointerEnteredMessage

MessageType<PointerEnteredMessageArguments> kanzi::ButtonConcept::PointerEnteredMessage
static

◆ PointerLeftMessage

MessageType<PointerLeftMessageArguments> kanzi::ButtonConcept::PointerLeftMessage
static

◆ LongPressMessage

MessageType<LongPressMessageArguments> kanzi::ButtonConcept::LongPressMessage
static

◆ ToggledOnMessage

MessageType<ToggledOnMessageArguments> kanzi::ButtonConcept::ToggledOnMessage
static

◆ ToggledOffMessage

MessageType<ToggledOffMessageArguments> kanzi::ButtonConcept::ToggledOffMessage
static

◆ ToggleStateChangedMessage

MessageType<ToggleStateChangedMessageArguments> kanzi::ButtonConcept::ToggleStateChangedMessage
static

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