Iridescence 1.00
Embedded Graphic Framework
Loading...
Searching...
No Matches
DsSelectionBase Class Referenceabstract

DsSelectionBase is a base class that contains a selection value. More...

#include <ds_selection_base.h>

Inheritance diagram for DsSelectionBase:
[legend]

Public Member Functions

void setSelection (int32_t selection)
 Sets the selection value.
 
int32_t getSelection (void) const
 Returns the selection value.
 
void setOnChangeCallback (const lambda< void(int32_t selection, bool in_motion, bool user_input)> &cb)
 

Protected Member Functions

virtual void getSelectionCount (void)
 
void notifySelectionChange (bool in_motion)
 
virtual int32_t onSelectionChange (int32_t selection)=0
 

Protected Attributes

int32_t mSelectionCount
 
int32_t mSelection
 

Detailed Description

DsSelectionBase is a base class that contains a selection value.

Member Function Documentation

◆ getSelection()

int32_t DsSelectionBase::getSelection ( void  ) const

Returns the selection value.

Returns
Selection. -1 if no selection was made.

◆ setOnChangeCallback()

void DsSelectionBase::setOnChangeCallback ( const lambda< void(int32_t selection, bool in_motion, bool user_input)> &  cb)

Sets the lambda that will receive selection change events.

Parameters
actionLambda of type void(int32_t state, bool user_input) that will be called whenever the selection changes.
  • selection is the new selection.
  • in_motion is true if the control is still in motion and false when the motion stopped and the user lifted the finger off the control.
  • user_input is true if the change happened as a result of the user touching the control or false if the state was changed programatically by calling the setSelection() method.

◆ setSelection()

void DsSelectionBase::setSelection ( int32_t  selection)

Sets the selection value.

Parameters
stateNew selection value. It will be saturated to the number of allowed selections. -1 means no selection is active.

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