Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I pass the calling object to a procedure?
Message
De
10/12/2001 03:35:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00591907
Message ID:
00591960
Vues:
26
Grigore told you how to do what you asked so, I will suggest other approaches.

Your F_DOUBLECLICK procedure must have a CASE structure of a series of IF statements for the different behaviors, you could subclass your classes so that each object type gets its own streamlined F_DOUBLECLICK method. Another approach is to make an F_DOUBLECLICK class and make subclasses for the different behaviors. You can set a property of your objects to hold a reference to an instance of the subclass with the desired behavior. This second technique allows you to dynamically change the behavior for the doubleclick handler by assigning a new object reference to the object's property at any time.


>Hi Guys,
>
>I'm a VFP 7.0 newbie and need to find out how I pass the calling object's name to a common procedure. I have a form with 20 objects and I want each object to call procedure "f_doubleclick" when the user double clicks on that object. the procedure would act differently based on which object the user clicked on. so the doubleclick event of each object would read "do f_doubleclick" and nothing else.
>
>Thanks for your time,
>
>Nancy
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform