Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing OptionButton
Message
From
07/10/1998 09:40:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
06/10/1998 11:26:20
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00143846
Message ID:
00144551
Views:
19
>>>>define class myoption as optionbutton
>>>> fontname = "Arial"

Isn't this redefinition of Arial with Arial a bit... well, never mind, it's just my personal preference to avoid Arial :)

[major snippage]

>Got the above to work with some minor modifications (such as the names of the buttons being removed and added in the FOR...ENDFOR loop cannot be exactly the same), BUT after saving the form and reopening it, the buttons revert to the standard VFP class. This happens whether I use the standard VFP optiongroup as a starting point or whether I use my own optiongroup as a starting point in the form designer. It's as though VFP won't let me substitute my own optionbuttons for the standard optionbuttons.

It won't and you can't - that's why we do this substitution at runtime. VFP insists on either having your buttons added at design time, like this:

>In the meantime I've created nine optiongroup classes with from 2 to 10 buttons incorporating the event coding I wanted. Unfortunately I'm not able to add my own properties to the buttons, but can work around this limitation.

i.e. by having a group defined at class level, but only the group is your class - the member buttons are base class. You simply can't have a group of your class buttons behaving like default; i.e. if you drop a three-button class on your form, and then in the PEM window you give it a fourth button, this fourth button will be just plain base class button.

This behavior is ugly, I know, and adding new buttons to replace old ones seems to be the only acceptable workaround - and it works at runtime, not design time.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform