Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Grouping only a few RadioButtons

ratzeputz
Beginner
280 Views
Hi there,
i have a simple question.
I want to have a few parameters for a special type which can be choosen by some radio buttons on a dialog.
So far so good...
For example my type is generated as follows:
type filters
integer ageMin
integer ageMax
character (1) gender
character (1) smoker
end type
what i want to do on the special dialog is, that the user can choose between 2 values for gender and smoker status.
simply 2 radio buttons for each ("M" and "F" for gender and "Y" and "N" for smoker).
My problem is, that all 4 Radiobuttons are grouped togheter...means that if i click one of those buttons, all other buttons are going to a "non checked" state.
Well thats might be ok for some reasons...but i want to group 2 radiobuttons to a pair and only want to "switch" the checked status between them, e.g. if i click on "Y" for smoker, so the buttons for "gender" are not handled at all.
Dont have an idea how to realise that...anyone can help me?
Best Regards
Oliver
edit: DAMN! Did not see the wood because of to much trees :)
Just setting the Group attribute to "true" for the next radiobutton group and all works fine... sorry for the stupid question :)
0 Kudos
2 Replies
anthonyrichards
New Contributor III
280 Views
All you need to do is create a second group box and move two of your four rado buttons to it, leaving two in the original group box.

Make sure all the buttons have the Auto style box elected in Properties. Then when you select one of the buttons in a group of two, the other in the pair will be automatically deselected.
0 Kudos
Paul_Curtis
Valued Contributor I
280 Views
Although you seem to have solved your issue with radio buttons, be aware that your UI design is forced to use the rather limited logic of one-from-several. I have put together many GUIs for very complex problem initialization schemes, with lots of behind-the-scenes inter-item logic, and find in general that it is much better to use separate buttons or checkboxes for each item, and implement your selection or mutual-exclusivity criteria in explicit code in your dialog proc's message loop. This approach can provide much more versatility, and having the logic explicit in your code (rather than implicit in Windows) makes things straightforward to debug or evolve.
0 Kudos
Reply