OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
OSCR::UI::Menu Class Reference

An interface for handling menus. More...

#include <ui/interfaces.h>

Inheritance diagram for OSCR::UI::Menu:
OSCR::UI::MenuBase OSCR::UI::MenuRenderer

Public Member Functions

 Menu (char const *menuTitle, char const *const menuEntries[], uint8_t entryCount)
 Create a menu interface from an array of choices.
 Menu (__FlashStringHelper const *menuTitle, char const *const menuEntries[], uint8_t entryCount)
 Menu (char const *menuTitle, __FlashStringHelper const *const *menuEntries, uint8_t entryCount)
 Menu (__FlashStringHelper const *menuTitle, __FlashStringHelper const *const *menuEntries, uint8_t entryCount)
 Menu (char const *menuTitle, char *menuEntries[], uint8_t entryCount, uint8_t entryLength=((uint8_t) 31))
 Create a menu interface from an array of choices.
 Menu (__FlashStringHelper const *menuTitle, char *menuEntries[], uint8_t entryCount, uint8_t entryLength=((uint8_t) 31))
Public Member Functions inherited from OSCR::UI::MenuBase
 MenuBase (char const *menuTitle, uint8_t entryCount, MenuMode menuBaseMode, uint8_t entryLength=((uint8_t) 31))
 MenuBase (__FlashStringHelper const *menuTitle, uint8_t entryCount, MenuMode menuBaseMode, uint8_t entryLength=((uint8_t) 31))
Public Member Functions inherited from OSCR::UI::MenuRenderer
 MenuRenderer (char const *menuTitle)
 MenuRenderer (char const *menuTitle, uint16_t entryCount)
 MenuRenderer (__FlashStringHelper const *menuTitle)
 MenuRenderer (__FlashStringHelper const *menuTitle, uint16_t entryCount)
uint16_t getPage ()
uint16_t getPageCount ()
bool isLast ()
uint16_t getPageEntryCount ()
uint16_t getPageEntryOffset ()
uint16_t getEntryIndex ()
void gotoPage (uint16_t page)
void navNext ()
void navPrev ()
void nextPage ()
void prevPage ()
void render ()
uint16_t select ()

Protected Member Functions

void onPageChange ()
Protected Member Functions inherited from OSCR::UI::MenuBase
void setup ()
bool onConfirm ()
Protected Member Functions inherited from OSCR::UI::MenuRenderer
void navigate (NavDir direction)
void onSelectionChange ()

Protected Attributes

char const *const * entries
Protected Attributes inherited from OSCR::UI::MenuBase
MenuMode menuMode
uint8_t entryLengthMax
Protected Attributes inherited from OSCR::UI::MenuRenderer
char title [30] = {}
uint16_t count
uint16_t totalPages
uint16_t pageEntriesLast
uint16_t currentPage = 1
uint16_t selection = 0
bool rendered = false
char pageEntries [((uint8_t) 32)][((uint8_t) 31)]

Detailed Description

An interface for handling menus.

Create a menu interface from an array of choices.

Note
Available memory on embedded microcontrollers is limited. You should consider using OSCR::UI::menu() instead of implementing this class directly.

Constructor & Destructor Documentation

◆ Menu() [1/2]

OSCR::UI::Menu::Menu ( char const * menuTitle,
char const *const menuEntries[],
uint8_t entryCount )

Create a menu interface from an array of choices.

Parameters
menuTitleA flash string to use for the menu title.
menuEntriesAn array of null-terminated flash strings.
entryCountHow many entries are in menuEntries (usually sizeofarray(menuEntries)).

◆ Menu() [2/2]

OSCR::UI::Menu::Menu ( char const * menuTitle,
char * menuEntries[],
uint8_t entryCount,
uint8_t entryLength = ((uint8_t)31) )

Create a menu interface from an array of choices.

Parameters
menuTitleA flash string to use for the menu title.
menuEntriesAn array of null-terminated strings.
entryCountHow many entries are in menuEntries (usually sizeofarray(menuEntries)).
entryLengthMax length of an entry in menuEntries.

Member Function Documentation

◆ onPageChange()

void OSCR::UI::Menu::onPageChange ( )
protectedvirtual

The documentation for this class was generated from the following files:
  • C:/Developer/Projects/OSCR/oscr-firmware/include/ui/interfaces.h
  • ui/interfaces.cpp
  • ui/interfaces/serial/ascii.cpp