Dilbert
Firmware for the Dilbert interactive badge.
 All Classes Files Functions Variables Enumerations Macros Pages
MenuApp.h
Go to the documentation of this file.
1 
3 #ifndef _MENUAPP_H_
4 #define _MENUAPP_H_
5 
6 #include "App.h"
7 
13 class MenuApp : public App
14 {
15 public:
16  MenuApp(uint8_t itemSize = 3, uint16_t bgColour = ILI9341_BLACK,
17  uint16_t textColour = ILI9341_WHITE, uint16_t iconColour = ILI9341_YELLOW);
18  virtual ~MenuApp();
19 
20  virtual void create();
21  virtual void onEntry();
22 
23  virtual bool handleButton(IButton *button);
24 
25 protected:
26  void redrawSelectonIcon();
27 
28 protected:
29  uint8_t m_itemSize;
30 
31  uint16_t m_backgroundColour;
32  uint16_t m_textColour;
33  uint16_t m_iconColour;
34 
36 };
37 
38 #endif
virtual void create()
Creates the application.
Definition: MenuApp.cpp:35
uint16_t m_textColour
Text colour.
Definition: MenuApp.h:32
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.
Definition: MenuApp.cpp:18
uint16_t m_iconColour
Selection icon colour.
Definition: MenuApp.h:33
uint8_t m_itemSize
Text size (scaling) for menu item text.
Definition: MenuApp.h:29
void redrawSelectonIcon()
Redraws the selected application icon.
Definition: MenuApp.cpp:123
Provides a menu for launching applications.
Definition: MenuApp.h:13
virtual bool handleButton(IButton *button)
Handle button presses.
Definition: MenuApp.cpp:74
uint8_t m_selectedAppIndex
Index of currently selected item.
Definition: MenuApp.h:35
uint16_t m_backgroundColour
Background colour.
Definition: MenuApp.h:31
virtual void onEntry()
Called when the application is entered.
Definition: MenuApp.cpp:44
Used to encapsulate an individual application.
Definition: App.h:15