Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding custom optionbuttons to optiongroup
Message
From
25/04/1998 17:23:57
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00091946
Message ID:
00094919
Views:
22
>One possible way of doing this is to set up an OptionGroup subclass that contains cClassLib and cClassName properties. Set these to be the OptionButton you really want to use. Visually design the OPG however you want. Then in the OPG Init() use AddObject() to add the needed number of your buttons, copy the properties from the orginal buttons to the new ones, then RemoveObject() the originals.
>
>>A sligt problem, similar to having to add your own cell controls to a grid; now it's a bit different: I need to have my option buttons in an option group, because of the need to handle keypress individually. OptionGroup doesn't have a keypress of its own, but option buttons do. The trouble is that I'm quite accustomed to have these populated at runtime, like this:

Seems to be the only way. True, I've had to copy some properties from the original buttons (namely the position, because they defaulted to top left corner, and were invisible if added from a in-prg class definition), but it sure works, and wasn't much of a pain to do. Of course, I'll have to pay attention to include dodefault() in any instance's init(). Thanks, saved my day.

I suppose a similar approach can be taken for the other three ugly beasts (commandgroup, pageframe and grid).

back to same old

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

Click here to load this message in the networking platform