Byggern
Menu::Item Struct Reference

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
 
Itemnext = nullptr
 

Detailed Description

Struct containing a sigle menu item.

This struct contains all the necessary information about a menu item.

Member Function Documentation

§ AddAction()

void Menu::Item::AddAction ( void(*)()  fn)

This adds the action (callback) to be called when the menu element is accessed.

Parameters
fnPointer to the callback function.

Member Data Documentation

§ action

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).

§ has_sub_menu

bool Menu::Item::has_sub_menu = false

Decides wether the action points to a sub menu or a cb.

§ label

char* Menu::Item::label = nullptr

This is the label that will show up in the menu.

§ label_length

uint8_t Menu::Item::label_length

This is the length of the label.

§ next

Item* Menu::Item::next = nullptr

This is a pointer to the next menu item in the menu (linked list).


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