Ignore:
Timestamp:
Mar 26, 2010, 3:13:31 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
0f7883, 71910a, abd4a1
Parents:
cbc639
Message:

Added mechanism that deactivates undo and redo menupoint if not applicable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/Actions/ActionHistory.cpp

    rcbc639 r770138  
    3434  Action::state_ptr oldState = elem.action->redo(elem.state);
    3535  history.push_back(HistoryElement(elem.action,oldState));
     36}
     37
     38bool ActionHistory::hasUndo(){
     39  return history.size()>0;
     40}
     41
     42bool ActionHistory::hasRedo(){
     43  return yrotsih.size()>0;
    3644}
    3745
     
    7381}
    7482
     83bool ActionHistory::UndoAction::isActive(){
     84  return hist->hasUndo();
     85}
     86
    7587Action::state_ptr ActionHistory::UndoAction::performCall(){
    7688  hist->undoLast();
     
    103115}
    104116
     117bool ActionHistory::RedoAction::isActive(){
     118  return hist->hasRedo();
     119}
     120
    105121Action::state_ptr ActionHistory::RedoAction::performCall(){
    106122  hist->redoLast();
Note: See TracChangeset for help on using the changeset viewer.