In the screenshot below you'll see that I have a set of radio buttons inside a single wxStaticBox. I have nested two wxPanels inside the box in order to have the controls on the left take up the same amount of space as the controls on the right. According to standard UX rules, when one of the radio buttons on the right is selected, the previously selected radio button in the group, whether it's on the right or the left, should be deselected. As you can see from the screenshot, this does not happen if the previously selected radio button is on the opposite side from the newly selected radio button.
Is there a way to get all the radio buttons in the same group even though they're in separate containers?
How to span radio button group across multiple containers Topic is solved
-
- Experienced Solver
- Posts: 74
- Joined: Sat May 06, 2017 1:40 pm
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: How to span radio button group across multiple containers
It might be easier to use a grid sizer or flex grid sizer instead of 2 panels. In that case, the buttons would work automatically.
If you really want to use 2 separate panels, you'll have to handle the wxEVT_RADIOBUTTON event and when a button is selected in one panel, set all of the buttons in the other panel to be unselected.
If you really want to use 2 separate panels, you'll have to handle the wxEVT_RADIOBUTTON event and when a button is selected in one panel, set all of the buttons in the other panel to be unselected.