[Solved] HOWTO group wxRadioButton's?

BlitzMax Forums/Brucey's Modules/[Solved] HOWTO group wxRadioButton's?

MOBii(Posted 2016) [#1]
Someone got the wxRadioButton to work?


if I only tab over the wxRadioButton it get turned on
If I stand on the wxRadioButton and wxRadioButton.setValue(0) it turn the wxRadioButton off and then because I stand on the wxRadioButton it turn itself on again!


I can get those function to work:
wxRadioButton.getValue()
wxRadioButton.setValue(1/0)
(If not focused/stand on)


New wxRadioButton.Create(wxWindow(po), id, Txt, _x, _y, _w, _h, _style)
_style:
Const wxRB_GROUP:Int = $0004
Const wxRB_SINGLE:Int = $0008

If I put wxRB_GROUP How can I group wxRadioButton's together?


I test set, but no success:
wxRadioButton.SetName("grp1")


the wxRadioBox function work's for me and it look like wxRB_SINGLE is not working in Windows.

Shall I drop wxRadioButton and only use wxRadioBox That work perfectly?

I was hoping on a button I could set in a on/off state (like a wxCheckBox button)


Henri(Posted 2016) [#2]
Hi,

normally if I group radiobuttons I create a container/panel for the group and create radiobuttons with that container set as parent and with style set to 0. This makes radiobuttons behave as intented (only one in group can be selected at any time). wxRadioBox seems to do the same with a more visual style. Of Course the container/panel can be customized.

-Henri


MOBii(Posted 2016) [#3]
Thank thee Henri very much!
I almost decided to remove the wxRadioButton from the project!

I am glad wxRadioButton worked!

the wxRadioButton Pro:
You can place them wherever you like
Don't block key events

the wxRadioBox Pro:
Simpler End code