Library which creates a serial test console, it supports pages and menu items. The items are added and the pages are added as necessary when the user sets it up. This is a great too for creating an easy to maintain menu system, whether for a test sytem, or anything else.
Dependencies: Terminal
Diff: page.h
- Revision:
- 0:907d2d5e77f7
- Child:
- 3:f308cd7a34ed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/page.h Fri May 01 03:56:34 2015 +0000 @@ -0,0 +1,41 @@ +#ifndef __PAGE_H +#define __PAGE_H +#include "menuitem.h" +#include "Terminal.h" +//this class contains Pages of menu items + +extern Terminal term; +#define MAX_MENUITEMS 15 +#define LEVEL_INDENT 8 +#define DATA_GAP 4 +#define ITEM_ROW_START 3 +#define TERM_LOC_DEBUG 40,24 //x,y for printing debug info +#define TERM_LOC_INPUT 10,23 // X,Y for getting input +#define TERM_LOC_FEEDBACK 10,24 // X,Y for getting input +//class MenuItem; //forward declare + +class Page{ + private: + bool make_active_flag; + public: + Page(); + Page(const char * Name_p); + const char * Name; //reference to the name of the Page + int num_menuitems; + int data_start_x; //starting column for printing the data + MenuItem item[MAX_MENUITEMS]; + char command_letter[MAX_MENUITEMS]; //the character in front of the menuitem + char max_upper_letter_cmd; + char max_lower_letter_cmd; + char max_number_cmd; + int page_num; + bool refresh_required; + MenuItem& add_item(MenuItem const &item_p); + void display(); + void update(); + char * set_active() {make_active_flag = true; return NULL;} //flag the current page to be active + void ack_active() {make_active_flag = false;} //call to clear the set_active flag + bool check_active() {return make_active_flag;} // check to see if this page wants to be active +}; + +#endif \ No newline at end of file