gigawidgets 0.3.55
A wxWidgets-style UI library for the Arduino Giga Display Shield.
 
Loading...
Searching...
No Matches
ui::CoreEventHandlers< T > Class Template Referenceabstract

Virtual function definitions for default event handler functions. More...

#include <event_handlers.hpp>

Inheritance diagram for ui::CoreEventHandlers< T >:
ui::EventHandlers< Widget > ui::EventHandlers< T > ui::Widget ui::Image ui::MultiChildWidget ui::SingleChildWidget ui::Text ui::Collection ui::Blink ui::Body ui::Box ui::Panel ui::Column ui::Row ui::Input ui::Keyboard

Public Member Functions

virtual void onpress (std::function< void(T &, const Event &)> callback)=0
 Register a touchscreen event handler that triggers on press.
 
virtual void onrelease (std::function< void(T &, const Event &)> callback)=0
 Register a touchscreen event handler that triggers when the widget stops being pressed.
 
virtual void onblur (std::function< void(T &, const Event &)> callback)=0
 Register a touchscreen event handler that triggers when the widget stops being pressed.
 
virtual void onhold (std::function< void(T &, const Event &, time_t)> callback)=0
 Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
 
void onclick (std::function< void(T &, const Event &)> callback)
 Register a touchscreen event handler that triggers on release.
 

Detailed Description

template<class T>
class ui::CoreEventHandlers< T >

Virtual function definitions for default event handler functions.

Template Parameters
TThe derived class.

Member Function Documentation

◆ onblur()

template<class T >
virtual void ui::CoreEventHandlers< T >::onblur ( std::function< void(T &, const Event &)>  callback)
pure virtual

Register a touchscreen event handler that triggers when the widget stops being pressed.

Parameters
callbackA callback function that is called when a widget stops being pressed after previously receiving a "press" event.
Note
Only one event handler for each type of event (press, hold, release, blur) is allowed per widget.

◆ onclick()

template<class T >
void ui::CoreEventHandlers< T >::onclick ( std::function< void(T &, const Event &)>  callback)
inline

Register a touchscreen event handler that triggers on release.

This is identical to the onrelease() function.

Parameters
callbackA callback function that is called when this widget receives a "release" event.
Note
Only one event handler for each type of event (press, hold, release, blur) is allowed per widget.

◆ onhold()

template<class T >
virtual void ui::CoreEventHandlers< T >::onhold ( std::function< void(T &, const Event &, time_t)>  callback)
pure virtual

Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.

Parameters
callbackA callback function that is called when this widget has been continuously pressed for a while.
Note
Only one event handler for each type of event (press, hold, release, blur) is allowed per widget.

◆ onpress()

template<class T >
virtual void ui::CoreEventHandlers< T >::onpress ( std::function< void(T &, const Event &)>  callback)
pure virtual

Register a touchscreen event handler that triggers on press.

Parameters
callbackA callback function that is called when this widget receives a "press" event.
Note
Only one event handler for each type of event (press, hold, release, blur) is allowed per widget.

◆ onrelease()

template<class T >
virtual void ui::CoreEventHandlers< T >::onrelease ( std::function< void(T &, const Event &)>  callback)
pure virtual

Register a touchscreen event handler that triggers when the widget stops being pressed.

Parameters
callbackA callback function that is called when this widget receives a "release" event.
Note
Only one event handler for each type of event (press, hold, release, blur) is allowed per widget.

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