Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regarding Tip: Control Valid() Fires Even When Read-Only
Message
 
To
25/04/2003 14:08:03
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00781549
Message ID:
00781638
Views:
18
Thanks for the help. Do you see any pitfalls in this approach?

1. Add new property to baseclass called LRETURN and set value to .NULL.
2. Add code to GotFocus() to reset value back to .NULL.
3. In the Valid() put the following:
    IF THIS.READONLY
        * Set lReturn so a subclass knows that a STOP occurred.
        THIS.lReturn = .T.
        RETURN (THIS.lReturn)
    ENDIF
4. Each time I subclass this control, I'll need to put the following in the Valid(), if available validation is necessary:
    DODEFAULT()

    IF ISNULL(THIS.lreturn)
*!*	* Do necessary validation for this subclass such as:
*!*	IF EMPTY(THIS.VALUE)
*!*	    * Set lReturn so a subclass knows that a STOP occurred.
*!*	    THIS.lreturn = .F.
*!*	    RETURN (THIS.lreturn)
*!*	ENDIF
    ELSE
        * A return value was assigned by parent class.  Use it.
	RETURN (THIS.lReturn)
    ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform