Dilbert
Firmware for the Dilbert interactive badge.
 All Classes Files Functions Variables Enumerations Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MenuApp Class Reference

Provides a menu for launching applications. More...

#include <MenuApp.h>

Inheritance diagram for MenuApp:
Inheritance graph
[legend]
Collaboration diagram for MenuApp:
Collaboration graph
[legend]

Public Member Functions

 MenuApp (uint8_t itemSize=3, uint16_t bgColour=ILI9341_BLACK, uint16_t textColour=ILI9341_WHITE, uint16_t iconColour=ILI9341_YELLOW)
 Creates a new menu application. More...
 
virtual void create ()
 Creates the application. More...
 
virtual void onEntry ()
 Called when the application is entered. More...
 
virtual bool handleButton (IButton *button)
 Handle button presses. More...
 
- Public Member Functions inherited from App
 App (char *name)
 Creates a new instance of a badge application. More...
 
char * name ()
 Gets the name of the application. More...
 
void setBackgroundColour (uint16_t colour)
 Sets the background fill colour of the display for this application. More...
 
virtual void run ()
 Called in a loop while the application is active. More...
 
virtual void exit ()
 Exits the application.
 
virtual void onExit ()
 Called when the application exits. More...
 
virtual void destroy ()
 Destroys the application. More...
 

Protected Member Functions

void redrawSelectonIcon ()
 Redraws the selected application icon.
 

Protected Attributes

uint8_t m_itemSize
 Text size (scaling) for menu item text.
 
uint16_t m_backgroundColour
 Background colour.
 
uint16_t m_textColour
 Text colour.
 
uint16_t m_iconColour
 Selection icon colour.
 
uint8_t m_selectedAppIndex
 Index of currently selected item.
 
- Protected Attributes inherited from App
Dilbertm_badge
 Pointer to badge driver.
 
AppManagerm_manager
 Pointer to application manager.
 
char * m_name
 Name of application.
 
bool m_ready
 If the application has been created.
 
uint16_t m_backgroundColour
 Background colour.
 

Detailed Description

Provides a menu for launching applications.

Author
Dan Nixon

Constructor & Destructor Documentation

MenuApp::MenuApp ( uint8_t  itemSize = 3,
uint16_t  bgColour = ILI9341_BLACK,
uint16_t  textColour = ILI9341_WHITE,
uint16_t  iconColour = ILI9341_YELLOW 
)

Creates a new menu application.

Parameters
itemSizeSize of text for menu items (multiples of 8 pixels)
bgColourBackground colour
textColourText colour
iconColourCUrrent app selection colour

Member Function Documentation

void MenuApp::create ( )
virtual

Creates the application.

Memory allocations should be performed here.

Reimplemented from App.

bool MenuApp::handleButton ( IButton *  button)
virtual

Handle button presses.

Parameters
buttonButton that has changed
Returns
True if the button was handled in this function

Reimplemented from App.

void MenuApp::onEntry ( )
virtual

Called when the application is entered.

Initial state should be set here, particularly for the display.

Reimplemented from App.


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