Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running a GrandParent's code
Message
De
10/07/2000 13:44:10
 
 
À
10/07/2000 12:18:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00390278
Message ID:
00390372
Vues:
8
>Hey Fox Experts -
>I have a dilemma. I am sub-classing a form and in turn the objects within. In one of the objects in the sub-class, I'm modifying the LostFocus method code.
>
>I have copied the LostFocus code from the Parent and dropped it into the sub-class method to make mods to it. Within THAT code is a call to the DODEFAULT() of the Parent's Parent.

It sounds like what you need is the Scope resolution operator- with it, you can specify a class in the hierarchy, and run a method from it:

GrandParent::LostFocus()

But it sounds to me like you only need this because of the way you chose to design your classes- Normally, you would not copy the entire contents of the parent class to modify them, but do your additional programming in the subclass, and call DODEFAULT when necessary. If this is impossible because if the the sequence that your logic needs or the additional programming falls inside of a condition determined by the parent, then you might want to look into using a hook to handle it. In the parent class code, insert a call to an empty custom method where you might need additional code to run in the child class. Then, just fill this method in the child class definition, and leave your LostFocus method alone.
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform