tcMenu
Public Types | Public Member Functions | List of all members
DrawableDashboard Class Reference

#include <DrawableDashboard.h>

Inheritance diagram for DrawableDashboard:
CustomDrawing

Public Types

enum  DashboardMode : uint8_t { DASH_ON_RESET_CLICK_EXIT , DASH_ON_RESET_MANUAL_EXIT , DASH_FULLY_MANUAL , DASH_MANUAL_START_CLICK_EXIT }
 

Public Member Functions

 DrawableDashboard (DeviceDrawable *device, BaseGraphicalRenderer *renderer, TitleWidget *widgets, DashboardMode drawingMode)
 
void setBaseColors (color_t screenBgCol, color_t coreFgCol)
 
void setDelegate (DrawableDashboardDelegate *dashDelegate)
 
void clearItems ()
 
void addDrawingItem (MenuItem *theItem, Coord topLeft, DashDrawParameters *params, int numCharsInValue, const char *titleOverrideText=nullptr, int updateTicks=5)
 
void stop ()
 
void reset () override
 
void started (BaseMenuRenderer *currentRenderer) override
 
void renderLoop (unsigned int currentValue, RenderPressMode userClick) override
 
void drawWidgets (bool force)
 
uint8_t getDisplayNumber ()
 

Detailed Description

Drawable Dashboard is a configurable dashboard that can be used to draw a series of menu items in a more configurable dashboard style way. It is possible to further customise the class purely by extending it yourself and handling any drawing in renderLoop() before calling the super implementation in this class.

It is capable of presenting items either with or without titles in a large number of formats. Optionally you can add title widgets to it for them to be presented at the same time.

Member Enumeration Documentation

◆ DashboardMode

Allows you to define how the dashboard will be displayed, and dismissed.

Member Function Documentation

◆ reset()

void DrawableDashboard::reset ( )
overridevirtual

Called when the menu has become inactive, IE after the idle time out has triggered.

Implements CustomDrawing.

◆ started()

void DrawableDashboard::started ( BaseMenuRenderer currentRenderer)
overridevirtual

Called when the display is taken over before any calls to renderLoop. You can set up anything you need here.

Parameters
currentRendererthe renderer object that sent this event.

Implements CustomDrawing.

◆ renderLoop()

void DrawableDashboard::renderLoop ( unsigned int  currentValue,
RenderPressMode  userClick 
)
overridevirtual

actually do the drawing, this is essentially the runloop. Work out what's changed and draw it.

Parameters
currentValueThis is the encoder position if the menu is using an encoder
userClickedthis represents the status of the select button, see RenderPressMode for more details

Implements CustomDrawing.


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