Changes in src/Menu/TextMenu.cpp [f9352d:24a5e0]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Menu/TextMenu.cpp
rf9352d r24a5e0 11 11 #include "Menu/TextMenu.hpp" 12 12 #include "Menu/MenuItem.hpp" 13 #include "Helpers/Assert.hpp"14 13 15 14 … … 52 51 53 52 void TextMenu::showEntry(MenuItem* entry){ 54 if(entry->isActive()==false){ 55 outputter << "("; 56 } 57 outputter << entry->formatEntry(); 58 if(entry->isActive()==false){ 59 outputter << ")"; 60 } 61 outputter << "\n"; 53 outputter << entry->formatEntry() << "\n"; 62 54 } 63 55 … … 82 74 list<MenuItem*>::iterator iter; 83 75 for(iter = items.begin(); iter!=items.end();iter++){ 84 if((*iter)->isActive()){ 85 somethingChosen |= (*iter)->checkTrigger(choice); 86 } 76 somethingChosen |= (*iter)->checkTrigger(choice); 87 77 } 88 78 // see if something was chosen and call default Item if not … … 98 88 } 99 89 100 string TextMenu::getTitle(){101 return title;102 }103 104 90 void TextMenu::addDefault(MenuItem* _defaultItem) { 105 91 defaultItem = _defaultItem; 106 92 } 107 108 /****************************** Contained Actions ****************/109 110 const string TextMenu::LeaveAction::nameBase = "Leave menu: ";111 112 TextMenu::LeaveAction::LeaveAction(TextMenu* _menu) :113 Action(nameBase+_menu->getTitle()),114 menu(_menu)115 {}116 117 TextMenu::LeaveAction::~LeaveAction(){}118 119 bool TextMenu::LeaveAction::canUndo(){120 return false;121 }122 123 bool TextMenu::LeaveAction::shouldUndo(){124 return false;125 }126 127 Action::state_ptr TextMenu::LeaveAction::performCall(){128 menu->doQuit();129 return Action::success;130 }131 132 133 Action::state_ptr TextMenu::LeaveAction::performUndo(Action::state_ptr){134 ASSERT(0,"Cannot undo leaving a menu");135 return Action::success;136 }137 138 Action::state_ptr TextMenu::LeaveAction::performRedo(Action::state_ptr){139 ASSERT(0,"Cannot redo leaving a menu");140 return Action::success;141 }
Note:
See TracChangeset
for help on using the changeset viewer.