Base class used by all menus. More...
#include <Menu.h>
Public Member Functions | |
Accessor Methods | |
| uint16_t | x (void) const |
| Upper-left x-coordinate for menu. | |
| uint16_t | y (void) const |
| Upper-left y-coordinate for menu. | |
| uint16_t | width (void) const |
| Width of the menu. | |
| uint16_t | height (void) const |
| Height of the menu. | |
Protected Member Functions | |
Constructors and Destructors | |
| SoloMenu (void) | |
| Creates a full size menu. | |
| SoloMenu (uint16_t x0, uint16_t y0, uint16_t width, uint16_t height) | |
| Creates a menu of the specified size and location. | |
| ~SoloMenu (void)=default | |
| Default Destructor. | |
Button Management | |
| int8_t | _pressButtonIfTouched (void) |
| Protected method checks to see if one of the buttons has been "touched." If so, this method "presses" the button. | |
| void | _register (Button **buttonPtrArray, uint8_t nButtons) |
| Registers an array of buttons with this class. | |
General Methods | |
| virtual void | begin (void) |
| Initializes the Menu object. | |
| virtual void | update (void) |
Updates the Button, Menu, and Label objects managed by this class. | |
| virtual void | show (void)=0 |
| Shows the menu in the TFT. Derived classes will provide specific functionality. | |
| void | loadConfig (void) |
| Loads configuration data from EEPROM, placing it into RAM. | |
| virtual void | checkButtons (void) |
| Check to see if one of the menu's buttons has been pressed. | |
| virtual void | releaseButton (void) |
| Releases the currently pressed button. | |
| static bool | hasScreenBeenTouched (void) |
| Determines if the TFT screen has been touched. | |
Base class used by all menus.
This menu provides the core functionality for the menu system. Each menu displayed on the TFT will derive from this class. The primary responsibility for this class is to manage all Button, Labels, and Submenus, ensuring that requests to update graphics or handle presses to the TFT touch screen are handled properly. All menus are intended to be Singleton objects. Each object uses significant DRAM resources.
|
inlineprotected |
Creates a full size menu.
|
inlineprotected |
Creates a menu of the specified size and location.
| [in] | x0 | Upper left x-coordinate for the menu in the TFT display |
| [in] | y0 | Upper left y-coordinate for the menu in the TFT display |
| [in] | width | Width of this menu in pixels |
| [in] | height | Height of this menu in pixels |
x0 and y0 currently don't do anything.
|
protecteddefault |
Default Destructor.
|
protected |
Protected method checks to see if one of the buttons has been "touched." If so, this method "presses" the button.
ID of the button that was touched. Return value is -1 if no buttons were touched
|
protected |
Registers an array of buttons with this class.
| [in] | buttonPtrArray | An array of pointers to Button objects |
| [in] | nButtons | Number of buttons in buttonPtrArray |
SoloMenu will "manage" buttons that have been registered via this method. Specifically, whenever the SoloMenu::checkButtons method is called, SoloMenu will check to see if a touch on the TFT screen hits one of the registered buttons. If it does, the button will be pressed and/or released as required.
|
virtual |
Initializes the Menu object.
This method calls the begin() methods for all objects managed by this class
Reimplemented in MainMenu, SetupPID_Menu, SetupTempMenu, and SetupVolMenu.
|
virtual |
Check to see if one of the menu's buttons has been pressed.
|
static |
Determines if the TFT screen has been touched.
|
inline |
Height of the menu.
|
inline |
Loads configuration data from EEPROM, placing it into RAM.
|
virtual |
Releases the currently pressed button.
|
pure virtual |
Shows the menu in the TFT. Derived classes will provide specific functionality.
Implemented in MainMenu, SetupPID_Menu, SetupTempMenu, and SetupVolMenu.
|
inlinevirtual |
Updates the Button, Menu, and Label objects managed by this class.
Reimplemented in MainMenu, SetupPID_Menu, SetupTempMenu, and SetupVolMenu.
|
inline |
Width of the menu.
|
inline |
Upper-left x-coordinate for menu.
|
inline |
Upper-left y-coordinate for menu.