Library to display menus on TextLCDs. Interaction with functions Up,Down and Select (Buttons or RPG) Based on menu-library from pyeh9

Fork of Menu by Peihsun Yeh

Library to display menus on TextLCDs. Interaction with functions Up,Down and Select (Buttons or RPG) Based on menu-library from pyeh9

Committer:
charly
Date:
Thu Jan 01 23:00:06 2015 +0000
Revision:
4:67097127da6c
Parent:
3:cfc36b42ae75
Child:
5:91b1bc68290b
removed old code for poll method

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pyeh9 1:84d263c8932d 1 #ifndef NAVIGATOR_H
pyeh9 1:84d263c8932d 2 #define NAVIGATOR_H
pyeh9 1:84d263c8932d 3
pyeh9 1:84d263c8932d 4 #include "mbed.h"
pyeh9 1:84d263c8932d 5 #include "Menu.h"
pyeh9 1:84d263c8932d 6 #include "TextLCD.h"
charly 4:67097127da6c 7
charly 4:67097127da6c 8 class Navigator
charly 4:67097127da6c 9 {
charly 4:67097127da6c 10 private:
charly 4:67097127da6c 11
charly 4:67097127da6c 12 int bottom; // the index of the last item of current menu
charly 4:67097127da6c 13 int cursorPos; // what selection the cursor points to
charly 4:67097127da6c 14 int cursorLine; // what line of the lcd the cursor is on. 1 = first line, 2 = second line
charly 4:67097127da6c 15
charly 4:67097127da6c 16 public:
charly 4:67097127da6c 17 Navigator(Menu *, TextLCD_Base *);
charly 4:67097127da6c 18 Menu *activeMenu; // the current menu - can change when RPG is pushed on selection with child menu
charly 4:67097127da6c 19
charly 4:67097127da6c 20 TextLCD_Base *lcd;
charly 4:67097127da6c 21
charly 4:67097127da6c 22 /** no longer used!
charly 4:67097127da6c 23 *
charly 4:67097127da6c 24 */
charly 4:67097127da6c 25 void poll(); // no longer needed!
pyeh9 1:84d263c8932d 26
charly 4:67097127da6c 27 /** Move up one line in menu
charly 4:67097127da6c 28 * call this method when user moves up one line
charly 4:67097127da6c 29 * can be triggered by RPG or Button (PinDetect)
charly 4:67097127da6c 30 */
charly 4:67097127da6c 31 void moveUp();
charly 4:67097127da6c 32
charly 4:67097127da6c 33 /** Move down one line in menu
charly 4:67097127da6c 34 * call this method when user moves down one line
charly 4:67097127da6c 35 * can be triggered by RPG or Button (PinDetect)
charly 4:67097127da6c 36 */
charly 4:67097127da6c 37 void moveDown();
charly 4:67097127da6c 38
charly 4:67097127da6c 39 /** User presses Select Button
charly 4:67097127da6c 40 * call this method when user wans to select an item
charly 4:67097127da6c 41 * can be triggered by RPG or Button (PinDetect)
charly 4:67097127da6c 42 */
charly 4:67097127da6c 43 void select();
charly 4:67097127da6c 44
charly 4:67097127da6c 45 /** print the menu on LCD
charly 4:67097127da6c 46 */
charly 4:67097127da6c 47 void printMenu();
charly 4:67097127da6c 48
charly 4:67097127da6c 49 /** print cursor on the beginning of line
charly 4:67097127da6c 50 */
charly 4:67097127da6c 51 void printCursor();
pyeh9 1:84d263c8932d 52 };
pyeh9 1:84d263c8932d 53
charly 4:67097127da6c 54 #endif