Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine reason for leaving a control
Message
 
 
À
12/02/2001 17:51:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00474125
Message ID:
00475370
Vues:
48
>Sorry to be obtuse, but I still have a few questions.
>
>Why does issueing NODEFAULT in the lostfocus cause the focus to remain on the current control. (Does this action prevent the subsequent Gotfocus of the newly clicked control from firing?). It also seems like I'm playing dangerously with NODEFAULT since, as far as I'm concerned, it's a black box that could have several functions in addition to the one I'm disabling by not calling it.
>

Issuing NODEFAULT tells VFP not to do the default behavior associated with the event (i.e. LostFocus occurs as the control loses focus). Nodefault prevents that.

>But, assuming I use NODEFAULT to disable exit from a control when the validity check fails, is the following logic correct for the mycontrol.lostfocus() vis-a-vis the UNDO key (and if yes...wouldn't this serve as well for my EXIT key?)
>
>IF UNDO_when_just_fired
>   Reset UNDO_when_just_fired
>   RETURN dodefault()
>ELSE
>   IF this_control's_validitycheck_passes()
>       RETURN dodefault()
>   ELSE
>       NODEFAULT
>   ENDIF
>ENDIF
>
Basically this looks right as fas as I can tell. If you detect the UNDO key, you don't call the validity check. You don't really need to call DODEFAULT() at this point unless you have code up the hierarchy.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform