#include <BaseRenderers.h>
Public Member Functions | |
TitleWidget (const uint8_t *const *icons, uint8_t maxStateIcons, uint8_t width, uint8_t height, TitleWidget *next=NULL) | |
uint8_t | getCurrentState () const |
const uint8_t * | getCurrentIcon () |
const uint8_t * | getIcon (int num) |
const uint8_t * | getCurrentIcon () |
const uint8_t * | getIcon (int num) |
void | setCurrentState (uint8_t state) |
bool | isChanged () |
void | setChanged (bool ch) |
uint8_t | getWidth () |
uint8_t | getHeight () |
uint8_t | getMaxValue () |
TitleWidget * | getNext () |
void | setNext (TitleWidget *next) |
Title widgets allow for drawing small graphics in the title area, for example connectivity status of the wifi network, if a remote connection to the menu is active. They are in a linked list so as to make storage as efficient as possible. Chain them together using the constructor or setNext(). Image icons should be declared using PGM_TCM rather than prog mem to be compatible with all boards.
Thread / interrupt safety: get/setCurrentState & isChanged can be called from threads / interrupts
Currently, only graphical renderers can use title widgets.
TitleWidget::TitleWidget | ( | const uint8_t *const * | icons, |
uint8_t | maxStateIcons, | ||
uint8_t | width, | ||
uint8_t | height, | ||
TitleWidget * | next = NULL |
||
) |
Construct a widget with its icons and size
|
inline |
Get the current state that the widget represents
|
inline |
gets the current icon data
|
inline |
sets the current state of the widget, there must be an icon for this value
|
inline |
checks if the widget has changed since last drawn.
|
inline |
Sets the changed flag on this widget
|
inline |
gets the width of all the images
|
inline |
gets the height of all the images
|
inline |
the maximum state value - ie number of icons
|
inline |
gets the next widget in the chain or null
|
inline |
sets the next widget in the chain