Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can you (I mean can I) programatically subclass a method
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00319562
Message ID:
00319595
Vues:
12
Thanks Evan,
I think I'm gonna try programatically removing the options and adding my option class ala Mikes suggestion. But if I get myself into too much trouble I fall back on something such as you suggested.

-Isaac

>>Maybe I'm missing something here, but if I could put code in the KeyPress, then I would not need to check any other properties. My problem (and I may not be looking at this the right way) is that OptionGroup's do NOT have a KeyPress method. I already have lots of subclassed OptionGroup's that I would have to modify by adding code to the KeyPress method of each option (in each OptionGroup). I'm racking my brain trying to figure out a better way.
>>
>>-Isaac
>>
>>>Couldn't you set a property in the Init method that is read by the KeyPress, and directs it to different methods/procedures?
>>>Mark
>>>
>>>>Is there a way to subclass a method programatically?
>>>>
>>>>In particular, our framework has an OptionGroup class which in the base class has no options. This class has been dropped on many forms and set to various number of options. Now I want to do something in the keypress event which is only in options and not in the option group. Can anyone suggest a way to programatically override the keypress method of the options in the init method of the OptionGroup?
>>>>
>>>>Any suggestions would be graciously attempted.
>>>>
>>>>Thanks,
>>>>-Isaac
>
>Hi Isaac,
>
>1. In your OptionGroup class, add a method called CommonOptionKeyPress. Place the code you want to execute in that method.
>
>2. For each option button, in its KeyPress event, enter the line of code THIS.Parent.CommonOptionKeyPress().
>
>Yes, this requires you to modify each option, but ONLY ONCE. You should never have to modify them again.
>
>HTH,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform