Hi Craig,
>Create a subclass with several buttons, say 6 or 8. Then do a REMOVEOBJECT() in the OptionGroup.Init for those you don't want. Each individual button can be customized in the class…
I do manipulate the option group
objects programmatically - ex: we have a SetOrder utility that walks trough the tags and customizes an option group accordingly.
Are you advising to do that at the class level? Create a subclass with 8 buttons and the remove some of them in the Init – what for??
What I wanted was my own option group visual class (myOpg - subclassed from the VFP optiongroup base class) “populated” with
my own option buttons (myOpb - subclassed from the VFP optionbutton base class). When I increase the ButtonCount, I’d like that the added buttons to be of myOpb class (so that they’ll inherit, for instance, the autosize property setting of myOpb). Is this possible?
>… You can't rename the buttons because they are members of the class.
OK, I learned that, and it probably should be that way…
It’s probably connected with another weird thing:
I changed some label names in our myBaseForm class
Example: label named
Label1 changed to
lblFormTitle. The caption says “Form Title”.
What happened, was that on all existing forms, the labels that I’ve changed the name, lost their caption!!! Modifying the forms would show the new name for the labels (
lblFormTitle), but the caption went back from let’s say “Maintenance” to “Form Title” - the value set in myBaseForm. I’ve opened the .scx, and in the properties memo there still was the old name
Label1 and caption “Maintenance”. I wrote a little program that walked through all .scx files and replaced all occurrences of the old names (
Label1) with the new names (
lblFormTitle), and that fixed it… The “fix” works only if applied before modifying & saving the forms.
So, the
name property has a special regime:
- you can only change it in the class, not in subclasses, nor in instances.
- if you change it in the class, all properties set in the existing instances are lost.
Am I wrong?
I guess you didn’t experience the behavior I described in Q3?
dz
PS Sorry for the long post...
Doru