General information
Category:
Object Oriented Programming
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only