Byggern
|
Struct containing a sigle menu item. More...
#include <menu.h>
Public Member Functions | |
Item (char *label, uint8_t label_length) | |
void | AddAction (void(*fn)()) |
Public Attributes | |
char * | label = nullptr |
uint8_t | label_length |
void * | action = nullptr |
bool | has_sub_menu = false |
Item * | next = nullptr |
Struct containing a sigle menu item.
This struct contains all the necessary information about a menu item.
void Menu::Item::AddAction | ( | void(*)() | fn | ) |
This adds the action (callback) to be called when the menu element is accessed.
fn | Pointer to the callback function. |
void* Menu::Item::action = nullptr |
The action is a pointer to either the cb (callback) function, or it is a pointer to another menu (for instance a sub menu or the parent menu).
bool Menu::Item::has_sub_menu = false |
Decides wether the action points to a sub menu or a cb.
char* Menu::Item::label = nullptr |
This is the label that will show up in the menu.
uint8_t Menu::Item::label_length |
This is the length of the label.
Item* Menu::Item::next = nullptr |
This is a pointer to the next menu item in the menu (linked list).