ho to implement Undo/Redo in a Matlab App
Ältere Kommentare anzeigen
I am after a good snippet code that would allow to have some Undo/Redo function.
I have found this intersiting one: uiundo - Matlab's undocumented undo/redo manager - Undocumented Matlab But it seems that uiundo might be removed at some point. I am happy to keep exploring this method, but I would like to find something more general in term of time history.
How to capture previous actions/values from the gui? Should I implement something like having a private property:
app.Data
app.DataBackwardStep
app.DataForwardStep
on new action:
- DataBackwardStep(end+1) = app.Data
on undo:
- app.DataForwardStep = app.Data
- app.Data = app.DataBackwardStep(end-1)
- app.DataBackwardStep(end) = [ ]
on redo
- app.Data = app.DataForwardStep
- DataBackwardStep(end+1) = app.Data
happy to see what others have already implemented
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Entering Commands finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
