COSA
An Object-Oriented Platform for Arduino Programming
Menu::Walker Class Reference

#include <Menu.hh>

Collaboration diagram for Menu::Walker:
Collaboration graph

Public Types

enum  {
  NO_KEY = 0, SELECT_KEY, LEFT_KEY, DOWN_KEY,
  UP_KEY, RIGHT_KEY
}
 

Public Member Functions

 Walker (LCD::Device *lcd, item_list_P root)
 
void on_key_down (uint8_t nr)
 
void begin (bool flag=true)
 
Menu::type_t type ()
 

Friends

IOStreamoperator<< (IOStream &outs, Walker &walker)
 

Detailed Description

The Menu Walker reacts to key events from the key pad. It maintains a stack with the path to the current position in the menu three.

Definition at line 124 of file Menu.hh.

Member Enumeration Documentation

anonymous enum

Menu walker key index (same as LCDkeypad map for simplicity).

Enumerator
NO_KEY 
SELECT_KEY 
LEFT_KEY 
DOWN_KEY 
UP_KEY 
RIGHT_KEY 

Definition at line 147 of file Menu.hh.

Constructor & Destructor Documentation

Menu::Walker::Walker ( LCD::Device lcd,
item_list_P  root 
)
inline

Construct a menu walker for the given menu.

Parameters
[in]lcddevice.
[in]rootmenu item list.

Definition at line 161 of file Menu.hh.

Member Function Documentation

void Menu::Walker::begin ( bool  flag = true)
inline

Initiate the menu. If the given flag is true the menu state is printed.

Definition at line 192 of file Menu.hh.

void Menu::Walker::on_key_down ( uint8_t  nr)

The menu walker key interpretor. Should be called by a menu controller, i.e. an adapter of controller events to the menu walker key.

Parameters
[in]nrkey number (index in map).

Definition at line 99 of file Menu.cpp.

Menu::type_t Menu::Walker::type ( )

Get current menu item type.

Definition at line 271 of file Menu.cpp.

Friends And Related Function Documentation

IOStream& operator<< ( IOStream outs,
Menu::Walker walker 
)
friend

Print menu walker state, current menu position to given output stream.

Parameters
[in]outsoutput stream.
[in]walkermenu walker.
Returns
output stream

Definition at line 60 of file Menu.cpp.


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