Changeset 8d9984 for molecuilder/src/Menu/TextMenu.cpp
- Timestamp:
- Mar 25, 2010, 12:01:27 PM (16 years ago)
- Children:
- c3294f, fe3540
- Parents:
- 521e29
- git-author:
- Tillmann Crueger <crueger@…> (03/25/10 11:59:56)
- git-committer:
- Tillmann Crueger <crueger@…> (03/25/10 12:01:27)
- File:
-
- 1 edited
-
molecuilder/src/Menu/TextMenu.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/Menu/TextMenu.cpp
r521e29 r8d9984 11 11 #include "Menu/TextMenu.hpp" 12 12 #include "Menu/MenuItem.hpp" 13 #include "Helpers/Assert.hpp" 13 14 14 15 … … 88 89 } 89 90 91 string TextMenu::getTitle(){ 92 return title; 93 } 94 90 95 void TextMenu::addDefault(MenuItem* _defaultItem) { 91 96 defaultItem = _defaultItem; 92 97 } 98 99 /****************************** Contained Actions ****************/ 100 101 const string TextMenu::LeaveAction::nameBase = "Leave menu: "; 102 103 TextMenu::LeaveAction::LeaveAction(TextMenu* _menu) : 104 Action(nameBase+_menu->getTitle()), 105 menu(_menu) 106 {} 107 108 TextMenu::LeaveAction::~LeaveAction(){} 109 110 bool TextMenu::LeaveAction::canUndo(){ 111 return false; 112 } 113 114 bool TextMenu::LeaveAction::shouldUndo(){ 115 return false; 116 } 117 118 Action::state_ptr TextMenu::LeaveAction::performCall(){ 119 menu->doQuit(); 120 return Action::success; 121 } 122 123 124 Action::state_ptr TextMenu::LeaveAction::performUndo(Action::state_ptr){ 125 ASSERT(0,"Cannot undo leaving a menu"); 126 return Action::success; 127 } 128 129 Action::state_ptr TextMenu::LeaveAction::performRedo(Action::state_ptr){ 130 ASSERT(0,"Cannot redo leaving a menu"); 131 return Action::success; 132 }
Note:
See TracChangeset
for help on using the changeset viewer.
