tcMenu
Public Member Functions | List of all members
TitleWidget Class Reference

#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 ()
 
TitleWidgetgetNext ()
 
void setNext (TitleWidget *next)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TitleWidget()

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

Member Function Documentation

◆ getCurrentState()

uint8_t TitleWidget::getCurrentState ( ) const
inline

Get the current state that the widget represents

◆ getCurrentIcon()

const uint8_t* TitleWidget::getCurrentIcon ( )
inline

gets the current icon data

◆ setCurrentState()

void TitleWidget::setCurrentState ( uint8_t  state)
inline

sets the current state of the widget, there must be an icon for this value

◆ isChanged()

bool TitleWidget::isChanged ( )
inline

checks if the widget has changed since last drawn.

◆ setChanged()

void TitleWidget::setChanged ( bool  ch)
inline

Sets the changed flag on this widget

◆ getWidth()

uint8_t TitleWidget::getWidth ( )
inline

gets the width of all the images

◆ getHeight()

uint8_t TitleWidget::getHeight ( )
inline

gets the height of all the images

◆ getMaxValue()

uint8_t TitleWidget::getMaxValue ( )
inline

the maximum state value - ie number of icons

◆ getNext()

TitleWidget* TitleWidget::getNext ( )
inline

gets the next widget in the chain or null

◆ setNext()

void TitleWidget::setNext ( TitleWidget next)
inline

sets the next widget in the chain


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