|
Last change
on this file since d20ed5 was d20ed5, checked in by Frederik Heber <heber@…>, 16 years ago |
|
Added basic menu and action framework
- Added action base class
- Added class to make actions from methods
- Added Menu base class
- Added TextMenu class to produce text menus
- Added MenuItem base class for menu items
- Added ActionMenuItem for menu items using an action
- Added SubMenuItem class for menu items presenting a submenu
- Added SeperatorItem class for menu seperators without functioninality
Signed-off-by: Tillmann Crueger <crueger@…>
|
-
Property mode
set to
100644
|
|
File size:
623 bytes
|
| Line | |
|---|
| 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"
|
|---|
| 16 |
|
|---|
| 17 | class MenuItem;
|
|---|
| 18 |
|
|---|
| 19 | class TextMenu : public Menu
|
|---|
| 20 | {
|
|---|
| 21 | public:
|
|---|
| 22 | TextMenu(ostream&,string);
|
|---|
| 23 | virtual ~TextMenu();
|
|---|
| 24 |
|
|---|
| 25 | virtual void addItem(MenuItem*);
|
|---|
| 26 | virtual void removeItem(MenuItem*);
|
|---|
| 27 | virtual void display();
|
|---|
| 28 |
|
|---|
| 29 | virtual void doQuit();
|
|---|
| 30 | virtual bool hasQuit();
|
|---|
| 31 |
|
|---|
| 32 | protected:
|
|---|
| 33 | virtual void showEntry(MenuItem*);
|
|---|
| 34 |
|
|---|
| 35 | private:
|
|---|
| 36 | list<MenuItem*> items;
|
|---|
| 37 | ostream& outputter;
|
|---|
| 38 | string title;
|
|---|
| 39 | bool quit;
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | #endif /* TEXTMENU_H_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.