TrackList *UndoManager::Redo(double *sel0, double *sel1) { wxASSERT(RedoAvailable()); current++; *sel0 = stack[current]->sel0; *sel1 = stack[current]->sel1; /* if (!RedoAvailable()) { *sel0 = stack[current]->sel0; *sel1 = stack[current]->sel1; } else { current++; *sel0 = stack[current]->sel0; *sel1 = stack[current]->sel1; current--; } */ lastAction = wxT(""); consolidationCount = 0; return stack[current]->tracks; }
const UndoState &UndoManager::Redo(SelectedRegion *selectedRegion) { wxASSERT(RedoAvailable()); current++; *selectedRegion = stack[current]->state.selectedRegion; /* if (!RedoAvailable()) { *sel0 = stack[current]->sel0; *sel1 = stack[current]->sel1; } else { current++; *sel0 = stack[current]->sel0; *sel1 = stack[current]->sel1; current--; } */ lastAction = wxT(""); consolidationCount = 0; return stack[current]->state; }
TrackList *UndoManager::Redo(double *sel0, double *sel1) { wxASSERT(RedoAvailable()); current++; if (!RedoAvailable()) { *sel0 = stack[current]->sel0; *sel1 = stack[current]->sel1; } else { current++; *sel0 = stack[current]->sel0; *sel1 = stack[current]->sel1; current--; } return stack[current]->tracks; }
/** * @brief Clears the redo stack * * Clears the redo stack by deleting all objects it contains * */ void CreationSelectionLayer::ClearRedoStack() { while(!redoStack.empty()) { ElementState *curr = redoStack.top(); redoStack.pop(); if (curr) delete curr; } emit RedoAvailable(false); }
/** * @brief Redoes the last undone selection or deselection * * Redoes the last undone selection or deselection by reverting * to the next state on the redo stack. * */ void CreationSelectionLayer::Redo() { if (!redoStack.empty() && selectedState) { undoStack.push(selectedState); UseState(redoStack.top()); redoStack.pop(); emit UndoAvailable(true); if (redoStack.empty()) emit RedoAvailable(false); } }
void FullDomainSelectionLayer::Undo() { if (!undoStack.empty() && selectedState) { redoStack.push(selectedState); UseState(undoStack.top()); undoStack.pop(); emit RedoAvailable(true); if (undoStack.empty()) emit UndoAvailable(false); } }