Library of menu structure

Dependents:   lcd_menu

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Navigator.h Source File

Navigator.h

00001 #ifndef NAVIGATOR_H
00002 #define NAVIGATOR_H
00003 
00004 #include "mbed.h"
00005 #include "Menu.h"
00006 #include "TextLCD.h"
00007 #include "RPG.h"
00008 
00009 class Navigator {   
00010     private: 
00011                
00012     public:
00013         Navigator(Menu *, RPG &, TextLCD *);
00014         Menu *activeMenu; // the current menu - can change when RPG is pushed on selection with child menu
00015         RPG rpg;
00016         TextLCD *lcd; 
00017         
00018         bool lastButton, button;
00019         int direction;  // 1 = CW, -1 = CCW
00020         
00021         int bottom;     // the index of the last item of current menu
00022         int cursorPos;  // what selection the cursor points to
00023         int cursorLine; // what line of the lcd the cursor is on. 1 = first line, 2 = second line
00024         
00025         void poll();    // repeatedly call this function to determine if RPG is being used
00026         void moveUp();
00027         void moveDown();
00028         void printMenu();
00029         void printCursor();
00030 };
00031 
00032 #endif