Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What parent events are fired?
Message
From
11/02/1997 13:19:44
 
 
To
11/02/1997 11:34:47
Alex Zhadanov
Computer Generated Solutions
New York City, New York, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00020026
Message ID:
00020051
Views:
53
>Hi all!
>I have such question:
>Why some parent form events are fired when child event fired and some not.
>For example KEYPRESS event in form fires also default
>event and we should use NODFAULT to prevent this.
>But INIT event does not fire parent class event and we need to use parentclass::init to make it work.
>Thank in advance. Alex

You are confusing two different things.

Foxpro's base methods, whcih you cannot change, only override.
These are automatically executed unless you put NODEFAULT in your code. These are the "default event" that you refer to.

Parentclass methods are overridden as soon as you put any code (even a blank line or a comment) in a method. In VFP 5 you can use DODEFAULT() to execute the parent method code. In VFP 3 you have to use the ::method() that you already know about.

Even if you call the parent method, you will still end up doing the VFP base method as well. You would normally want to do this because it does the usual behaviour, like entering a value into the control and updating the .value property.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform