|
Last change
on this file since fab853 was da09909, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Improved documentation for menu framework.
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Rev | Line | |
|---|
| [d20ed5] | 1 | /*
|
|---|
| 2 | * TextMenu.h
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Dec 10, 2009
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef TEXTMENU_H_
|
|---|
| 9 | #define TEXTMENU_H_
|
|---|
| 10 |
|
|---|
| 11 | #include <list>
|
|---|
| 12 | #include <ostream>
|
|---|
| 13 | #include <string>
|
|---|
| 14 |
|
|---|
| 15 | #include "Menu/Menu.hpp"
|
|---|
| [da09909] | 16 | #include "defs.hpp"
|
|---|
| [d20ed5] | 17 |
|
|---|
| 18 | class MenuItem;
|
|---|
| 19 |
|
|---|
| [da09909] | 20 | /**
|
|---|
| 21 | * Used to produce any kind of text menu
|
|---|
| 22 | *
|
|---|
| 23 | * All Items are displayed and user is prompted for a key. The item corresponding to that key is then activated.
|
|---|
| 24 | */
|
|---|
| [d20ed5] | 25 | class TextMenu : public Menu
|
|---|
| 26 | {
|
|---|
| 27 | public:
|
|---|
| [da09909] | 28 | TextMenu(ostream& _outputter, string _title, char _spacer=STD_MENU_TITLE_SPACER,int _length=STD_MENU_LENGTH);
|
|---|
| [d20ed5] | 29 | virtual ~TextMenu();
|
|---|
| 30 |
|
|---|
| 31 | virtual void addItem(MenuItem*);
|
|---|
| 32 | virtual void removeItem(MenuItem*);
|
|---|
| 33 | virtual void display();
|
|---|
| 34 |
|
|---|
| [da09909] | 35 | /**
|
|---|
| 36 | * Call doQuit if you want to return from this menu.
|
|---|
| 37 | */
|
|---|
| [d20ed5] | 38 | virtual void doQuit();
|
|---|
| [da09909] | 39 | /**
|
|---|
| 40 | * Check wether someone has chosen to quit
|
|---|
| 41 | */
|
|---|
| [d20ed5] | 42 | virtual bool hasQuit();
|
|---|
| 43 |
|
|---|
| 44 | protected:
|
|---|
| 45 | virtual void showEntry(MenuItem*);
|
|---|
| 46 |
|
|---|
| 47 | private:
|
|---|
| 48 | list<MenuItem*> items;
|
|---|
| 49 | ostream& outputter;
|
|---|
| 50 | string title;
|
|---|
| [7cb300] | 51 | char spacer;
|
|---|
| 52 | int length;
|
|---|
| 53 |
|
|---|
| [d20ed5] | 54 | bool quit;
|
|---|
| 55 | };
|
|---|
| 56 |
|
|---|
| 57 | #endif /* TEXTMENU_H_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.