ho to implement Undo/Redo in a Matlab App
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Develop Apps Using App Designer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
