Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A little competition :-)
Message
De
04/12/2002 23:16:51
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00729533
Message ID:
00729758
Vues:
15
>PROC Refresh
>WITH This
> DO CASE
> CASE ISNULL(.xyz)
> * nothing to do
> CASE .xyz = .T.
> * set enabled state to the same value of forms editmode
> .Enabled = ThisForm.lEditMode
> CASE .xyz = .F.
> * set enabled state to the opposite value of forms editmode
> .Enabled = (NOT ThisForm.lEditMode)
>ENDWITH
>ENDPROC
>
>
>Now the question: What is a good, proper, correct name of the property "xyz"?

I go with what some others have aluded to ... Have a "mode" property.

I think you're off on the wrong foot with "THISFORM.lEditMode"; this basically implies that the form can only have 2 modes ("editing" and "not editing"). I can think of several:

1) Browsing
2) Editing (or updating, or replacing)
3) Deleting
4) Adding (or Inserting, or Appending)
5) Initializing
6) Terminating

The button(s) are enabled/disabled based on the form's "mode".

A given "mode" doesn't always have to be obvious: pressing Delete while Browsing causes a mode change to "Deleting" and then back to "Browsing".
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform