source: molecuilder/src/Menu/MenuItem.hpp@ 0f55b2

Last change on this file since 0f55b2 was 770138, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Added mechanism that deactivates undo and redo menupoint if not applicable

  • Property mode set to 100644
File size: 773 bytes
Line 
1/*
2 * MenuItem.h
3 *
4 * Created on: Dec 10, 2009
5 * Author: crueger
6 */
7
8#ifndef MENUITEM_H_
9#define MENUITEM_H_
10
11#include <string>
12
13using namespace std;
14
15class Menu;
16
17/**
18 * Base class for all kinds of MenuItems
19 *
20 * This class takes care of checking the triggers and performing appropriate actions.
21 */
22class MenuItem {
23public:
24 MenuItem(char,const char*,Menu*);
25 virtual ~MenuItem();
26
27 virtual void doTrigger()=0;
28 virtual bool checkTrigger(char);
29
30 virtual const string formatEntry();
31
32 virtual const string getDescription();
33 char getTrigger();
34
35 void add_to_menu(Menu*);
36 bool wasAdded();
37
38 virtual bool isActive();
39
40protected:
41 void setDescription(string);
42
43private:
44 char trigger;
45 string *description;
46 bool added;
47};
48
49#endif /* MENUITEM_H_ */
Note: See TracBrowser for help on using the repository browser.