- NSIS Discussion
- Grouping radio buttons not working
Archive: Grouping radio buttons not working
rsegal
12th March 2003 15:56 UTC
Grouping radio buttons not working
I want to have multiple groups of radio buttons on a custom page I'm creating however things are not working out for me.
Here is the definition of one of the fields from my ini file. It is the first in a group of radio buttons.
[Field 15]
Type=radiobutton
Text=Unknown
Left=190
Right=-1
Top=36
Bottom=43
State=1
Flag=GROUP
This is followed by a few other radio buttons which fall under the same group. This works great, however I have another group of radio buttons following the first group whichc starts off as,
[Field 23]
Type=radiobutton
Text=Unknown
Left=190
Right=-1
Top=97
Bottom=104
Flag=GROUP
All the controls do display but all the radio buttons are grouped together into one larger radio button group whereas I need a few separate smaller groups.
viper0179
12th March 2003 18:05 UTC
Never tried this before, but have you tried to change the flag variable to another setting for the seperate groups?
Joost Verburg
12th March 2003 18:58 UTC
Only the first one should get the GROUP flag. Have a look at the example in Contrib\InstallOptions.
rsegal
12th March 2003 20:30 UTC
The example in the installoptions is easy enough to understand however from what I can tell I have the exact same setup in my ini file only in my case I have a bunch of radio buttons only.
In my ini file I have [Field 15] as the beginning of one set of radio buttons and [Field 23] as the beginning of a new set of radio buttons. So I should have a "GROUP" flag for each of them right?
I did try giving them each a diffent group flag (Flag=GROUP1 and Flag=GROUP2) variable name but that didn't work. I assume NSIS is not setup to handle such things. The radio buttons are all still handled as one big group.
Joost Verburg
12th March 2003 20:39 UTC
GROUP only adds the window style, so there can be no NSIS limitation.
Can you post the whole INI file?
rsegal
12th March 2003 21:59 UTC
The files pretty long so I attached it. Hope you guys can help me solve this one.
Joost Verburg
12th March 2003 22:30 UTC
If you add GROUP flags, everything before the next GROUP flag will be a group. To group radio buttons, the group should only contain radio buttons. So you should add a GROUP flag to the first control after the radio button group too.
rsegal
12th March 2003 22:52 UTC
That was the problem. Everythings good now. Thanks Joost and viper for your help!
Sunjammer
13th March 2003 11:04 UTC
The Archive doesn't seem to contain any Install Options examples, maybe this should be added with some explanation and a screenshot.
rsegal
14th March 2003 17:36 UTC
I thought of an interesting addition to my original problem. Is there an easy way to tell which radio button is selected out of a group of radio buttons without having to query each radio button in the group?
Joost Verburg
14th March 2003 18:04 UTC
Nope, you have to check 'em all. A group is just a window flag, InstallOptions does nothing with it.
rsegal
14th March 2003 21:04 UTC
D'oh!