Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make undo and redo action in a table?
Message
 
 
À
16/02/2006 03:35:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01096632
Message ID:
01096711
Vues:
16
>The simplest idea which comes to mind is to have a textbox with two properties: uCurValue and uPrevValue. In the GotFocus you would do
>this.uPrevValue = this.value
>
>and in InteractiveChange you would update uCurValue. Then you can code Redo/Undo buttons.
>
>Hi.
>Thanks your ideas. However, that do redo or undo with only one level. In the other hand, when we work with a grid, we will lost much time to write code for textbox in many colunms.
>Canh.

Hi Canh,

The general approach to Data Entry is not to use Grids for Data Entry, but rather normal controls. Grids are usualy for viewing information only.

You can also create your textbox class and use it instead of normal textbox in a grid's column. You can substitute the regular textbox with your own textbox in run-time by code or you can specify MemberClass property. In MereMortals framework the special grid textbox is put in design-time by using grid's builder (very convenient).

Here is one approach to substituting textbox in run-time, in VFP8+ it could be done differently:

How do I add event code to Grid Controls built at run-time? FAQ #7967

You can also use buffering mode for your tables (views) [In fact, you must use buffering], then Undo will be easy. However, for Redo you still will need some place holder. You may try to play with oCurRecord, where you would use SCATTER NAME oCurRecord (oCurRecord would be your form's or grid's property).
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform