Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do undo and redo in a grid?
Message
De
11/10/2008 12:33:49
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
10/10/2008 03:46:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01353991
Message ID:
01354328
Vues:
23
This message has been marked as the solution to the initial question of the thread.
>Hi all!
>I am finding a example codes for undo and redo action with a grids.
>Please give me some information about that!

You can do this with an array of objects, where each object would be a snapshot of the current state of the whole record - done by Scatter Name ... Memo. After each edit (i.e. either a .lostfocus in a control, or a sufficient number of changes in .interactivechange) you could create a new object and add it to the array. Then on ctrl+U you'd restore from the last object in the array, and decrease the pointer. On redo, you'd increase the pointer and restore from the current object. If there were edits after undo, discard any save objects beyond current pointer. When user saves, discard the whole array.

This being a grid, you may need an array of arrays - one array per row. You can also use collections instead of arrays.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform