Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Menu/TextMenu.cpp

    rf9352d r24a5e0  
    1111#include "Menu/TextMenu.hpp"
    1212#include "Menu/MenuItem.hpp"
    13 #include "Helpers/Assert.hpp"
    1413
    1514
     
    5251
    5352void 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";
    6254}
    6355
     
    8274    list<MenuItem*>::iterator iter;
    8375    for(iter = items.begin(); iter!=items.end();iter++){
    84       if((*iter)->isActive()){
    85         somethingChosen |= (*iter)->checkTrigger(choice);
    86       }
     76      somethingChosen |= (*iter)->checkTrigger(choice);
    8777    }
    8878    // see if something was chosen and call default Item if not
     
    9888}
    9989
    100 string TextMenu::getTitle(){
    101   return title;
    102 }
    103 
    10490void TextMenu::addDefault(MenuItem* _defaultItem) {
    10591  defaultItem = _defaultItem;
    10692}
    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.