Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regarding Tip: Control Valid() Fires Even When Read-Only
Message
 
À
25/04/2003 14:08:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00781549
Message ID:
00781638
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform