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
|
Rev | Line | |
---|
[d20ed5] | 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 |
|
---|
| 13 | using namespace std;
|
---|
| 14 |
|
---|
| 15 | class Menu;
|
---|
| 16 |
|
---|
[da09909] | 17 | /**
|
---|
| 18 | * Base class for all kinds of MenuItems
|
---|
| 19 | *
|
---|
| 20 | * This class takes care of checking the triggers and performing appropriate actions.
|
---|
| 21 | */
|
---|
[d20ed5] | 22 | class MenuItem {
|
---|
| 23 | public:
|
---|
| 24 | MenuItem(char,const char*,Menu*);
|
---|
| 25 | virtual ~MenuItem();
|
---|
| 26 |
|
---|
| 27 | virtual void doTrigger()=0;
|
---|
[aa117c] | 28 | virtual bool checkTrigger(char);
|
---|
[d20ed5] | 29 |
|
---|
| 30 | virtual const string formatEntry();
|
---|
| 31 |
|
---|
| 32 | virtual const string getDescription();
|
---|
| 33 | char getTrigger();
|
---|
| 34 |
|
---|
[7cb300] | 35 | void add_to_menu(Menu*);
|
---|
| 36 | bool wasAdded();
|
---|
| 37 |
|
---|
[770138] | 38 | virtual bool isActive();
|
---|
| 39 |
|
---|
[d20ed5] | 40 | protected:
|
---|
| 41 | void setDescription(string);
|
---|
[770138] | 42 |
|
---|
| 43 | private:
|
---|
| 44 | char trigger;
|
---|
| 45 | string *description;
|
---|
| 46 | bool added;
|
---|
[d20ed5] | 47 | };
|
---|
| 48 |
|
---|
| 49 | #endif /* MENUITEM_H_ */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.