ClickListener
touchgfx/mixins/ClickListener.hpp
Mix-in class that extends a class with a click action event that is called when the class receives a click event.
Template Parameters:
- T specifies the type to extend with the ClickListener behavior.
Inherits from: T
Public Functions
ClickListener() | |
Initializes a new instance of the ClickListener class. | |
virtual void | handleClickEvent(const ClickEvent & event) |
Ensures that the clickEvent is propagated to the super class T and to the clickAction listener. | |
void | setClickAction(GenericCallback< const T <, const ClickEvent & > & callback) |
Associates an action to be performed when the class T is clicked. | |
Protected Attributes
GenericCallback< const T <, const ClickEvent & > * | clickAction |
The callback to be executed when T is clicked. | |
Public Functions Documentation
ClickListener
Initializes a new instance of the ClickListener class.
Make the object touchable.
handleClickEvent
virtual void handleClickEvent | ( | const ClickEvent & | event | ) | |
Ensures that the clickEvent is propagated to the super class T and to the clickAction listener.
Parameters:
event | Information about the click. |
setClickAction
void setClickAction | ( | GenericCallback< const T <, const ClickEvent & > & | callback | ) | |
Associates an action to be performed when the class T is clicked.
Parameters:
callback | The callback to be executed. The callback will be given a reference to T. |
Protected Attributes Documentation
clickAction
GenericCallback< const T <, const ClickEvent & > * clickAction
The callback to be executed when T is clicked.