source: molecuilder/src/Menu/TextMenu.hpp@ fab853

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
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#include "defs.hpp"
17
18class MenuItem;
19
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 */
25class TextMenu : public Menu
26{
27public:
28 TextMenu(ostream& _outputter, string _title, char _spacer=STD_MENU_TITLE_SPACER,int _length=STD_MENU_LENGTH);
29 virtual ~TextMenu();
30
31 virtual void addItem(MenuItem*);
32 virtual void removeItem(MenuItem*);
33 virtual void display();
34
35 /**
36 * Call doQuit if you want to return from this menu.
37 */
38 virtual void doQuit();
39 /**
40 * Check wether someone has chosen to quit
41 */
42 virtual bool hasQuit();
43
44protected:
45 virtual void showEntry(MenuItem*);
46
47private:
48 list<MenuItem*> items;
49 ostream& outputter;
50 string title;
51 char spacer;
52 int length;
53
54 bool quit;
55};
56
57#endif /* TEXTMENU_H_ */
Note: See TracBrowser for help on using the repository browser.