Library for creating menu systems in displays.
MenuNode Class Reference
MenuNode represents an entry in a menu. More...
#include <Menu.h>
Inherited by Menu.
Public Types | |
typedef void(* | SelectionChange )(MenuNode *) |
Defines a pointer to a functions that is called when the node is selected. | |
Public Member Functions | |
MenuNode (EnterMenuNode, SelectionChange, char *) | |
Constructs a new MenuNode object. | |
char * | getName () |
Gets the name of the node. | |
virtual void | enter () |
Enters this instance of MenuNode and ultimatley calls the entered callback function. | |
bool | isSelected () |
Determines wheter tgis instance is selected. | |
void | select () |
Selects this instance of MenuNode in its containing Menu and called the selected call back function. | |
Friends | |
class | Menu |
Detailed Description
MenuNode represents an entry in a menu.
Each menu node is instantiated with two callbacks, one for selecting the node and one for entering the node. Methods are provided for determining whether the node is selected and retrieving the row number set by the containing menu.
Definition at line 13 of file Menu.h.
Member Typedef Documentation
typedef void(* SelectionChange)(MenuNode *) |
Constructor & Destructor Documentation
MenuNode | ( | EnterMenuNode | enterAction, |
SelectionChange | selectionChangeAct, | ||
char * | newname | ||
) |
Constructs a new MenuNode object.
The constructor takes two function pointers as arguments both of which must take a single argument of a MenuNode pointer.
void enterNode(MenuNode *node) { } void selectNode(MenuNode *node) { } main() { MenuNode *node = new MenuNode(&enterNode, &selectNode, "name"); }
- Parameters:
-
EnterMenuNode A pointer to a callback fuction called when the node is entered. SelectionChange A pointer to a callback fuction called when the node is selected. name The name of the MenuNode.
Member Function Documentation
void enter | ( | ) | [virtual] |
char * getName | ( | ) |
bool isSelected | ( | ) |
Generated on Wed Jul 13 2022 20:05:17 by 1.7.2