TimerWidgets
touchgfx/Application.hpp
A class to handle and manage timer widgets.
Public Functions
void | add(Drawable * w) |
Adds timer widget. | |
void | clear() |
Clears all timer widgets. | |
void | compact() |
Compacts the timer widgets. | |
uint16_t | getCounter(const Drawable * w) const |
Gets a counter for a given timer widget. | |
uint16_t | getNumberOfActiveTimerWidgets() const |
Gets number of active timer widgets. | |
void | remove(const Drawable * w) |
Removes the given timer widget. | |
void | tickActive() |
Tick all active timer widgets. | |
Public Functions Documentation
add
Adds timer widget.
If a timer widget is added from a handleTickEvent(), the timer will not be ticket until the next tick (unless that same widget is already registered, and has not yet been ticked in this tick).
w | The timer widget to add. |
clear
void clear | ( | ) |
Clears all timer widgets.
compact
void compact | ( | ) |
Compacts the timer widgets.
All widgets with a counter of 0 will be removed from the list, and the list will be compacted. Compacting the timer widgets during traversal (in tickActive()) is handled properly.
getCounter
uint16_t getCounter | ( | const Drawable * | w | ) | |
Gets a counter for a given timer widget.
Normally the counter is 1 unless a timer widget has been registered several times.
w | The timer widget to get the counter for. |
The counter.
getNumberOfActiveTimerWidgets
uint16_t getNumberOfActiveTimerWidgets | ( | ) | const |
Gets number of active timer widgets.
The number of active timer widgets.
remove
Removes the given timer widget.
w | The timer widget to remove. |
tickActive
void tickActive | ( | ) |
Tick all active timer widgets.
Adding and removing timer widgets during ticks is supported.