Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A little competition :-)
Message
From
04/12/2002 23:16:51
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00729533
Message ID:
00729758
Views:
14
>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".
Previous
Reply
Map
View

Click here to load this message in the networking platform