Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NODEFAULT doesn't work in all events?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00597789
Message ID:
00597802
Vues:
20
>I have 2 events that where I try to suppress VFP's native behavior with DODEFAULT, and it doesn't work.
> 1. In a form.Refresh method
> 2. In a combo.DropDown event... I want to invoke a mover box instead.
>
>In the first case, I put some specific code in my form (the SCX) plus a DODEFAULT() to execute the standard code in my form class. What happens, is the DODEFAULT() executes the class code and then refreshes the form, and then the code in my form finishes and refreshes the form again. Since refreshing is a slow process, I don't want to do it twice. I tried putting NODEFAULT in the form as well as in the class, but it doesn't work. I tried MyFormClass::Refresh() instead, but that still refreshes twice.
>
>I could always create a "REFRESH_CODE" in my class, or (worse) I could copy the class code to my form and completely defeat the principle of OOP.
>
>Am I missing something obvious, or is it that DODEFAULT only works in specific methods where the documentation specifies it?

Tom,

After reading your lines 10 times, this is my response :

I guess that maybe you're not aware of how Refresh exactly works, or what causes it to work ...;)
I would say that there is no way to prevent the Refresh from happening, because a Refresh just happens. How to understand this sentense ? when you make a change to a form, you want to see this, right ? now when a NoDefault() would "help", then what ? What it comes to in the end (IMO) is that the Refresh method is only there for you to have some code executed when the refresh happens, and it can't influence behaviour. Well, never put code in there, because that will slow down your Refresh (one byte is enough).

Only when you have several subsequent changes, only the last is useful. That's what you meant, right ? well, have YourForm.LockScreen = .T. until you're ready for showing the changes, and then perform YourForm.LockScreen = .F.

HTH,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform