Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie Form Buttons
Message
 
 
À
02/11/1999 17:43:34
Jimmy Ditta
Twin City Electronics
Monroe, Louisiane, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00285790
Message ID:
00285813
Vues:
16
>>>What's the easiest way to put a "save to database" button and a "cancel" button on a form?
>>>
>>>JD
>>
>>All my data is saved implicitly. That is no change is ever canceled unless the user explicitly clicks my Cancel button. My Exit button class has 1 line of code: ThisForm.QueryUnload(). My Cancel button has 2 lines of code:
>>
>>ThisForm.lCanceled = .t.
>>ThisForm.QueryUnload()
>>
>>By default, my form baseclass property, lCanceled, is set to False. In my form's QueryUnload method, I test the form's lCanceled property. If true, I call the form's RevertTables method. If not canceled, I call the form's UpdateTables method.
>>
>>On my data entry form, all I have to do is drop my Cancel and Exit button on the form.
>
>
>I guess what i'm asking is how to do your last statement. The rest of the stuff I kinda halfway understood. (Remember, I'm new to this!)
>
>Thanks
>JD

For every application, a copy of my base class is placed in the Classes folder of my application tree:

Apps\AppName
Apps\AppName\Classes
............\Forms
............\Data && except Data usually ends up on a server

In the AppName folder is where my project resides. I created my baseclass by creating a new classlib [create classlib class_name]. I then used the Class Browser to subclass almost all of the VFP native classes. I then started customizing each class by changing the default properties, adding properties and methods, adding code to some of the methods.

After I created my command button class, I then created several subclasses based on that button: Exit, Cancel, Printer [to bring up the GetPrinter() dialogue box so the user can change printers], Undo [so the user can revert changes to the current record or table without exiting (Canceling) the form], etc.

You might want to invest in a commercial framework someone else has developed and work through that. There are several that advertise in the UT Partnership area. You could also post another question soliciting recommendations from those that have purchased such frameworks.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform