1. wxRadioButton & RadioBox
- Posted by Andy <videogamefreak101 at hotmail.com> Dec 18, 2005
- 548 views
I have some trouble with wxRadioButton and RadioBox, I need an example to see how they work, cause I am really confused
2. Re: wxRadioButton & RadioBox
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Dec 18, 2005
- 560 views
Andy wrote: > > I have some trouble with wxRadioButton and RadioBox, I need an example to see > how > they work, cause I am really confused wxRadioButtons aren't wrapped (or documented very well). See here for the official docs on wxRadioButton: http://www.wxwidgets.org/manuals/2.4.2/wx319.htm#wxradiobutton Here's a demo that uses wxRadioBox and wxToggleButton:
-- Created using wxIDE include wxEuphoria.e include wxCheckBox.e include wxButton.e include wxText.e include misc.e without warning global constant RADIO_SELECTIONS = {"One", "Two", "Three"}, ON_OFF = {"Off", "On" }, radio_demo = create( wxFrame, {0, -1, "Radio Demo", 0, 0, 440, 341 }), win = create( wxPanel, {radio_demo, -1, 0, 0, 439, 340 }), radio_box = create( wxRadioBox, {win, -1, "Radio Box", 6, 24, 216, 128, RADIO_SELECTIONS, 0, wxRA_SPECIFY_COLS }), toggle_button = create( wxToggleButton, {win, -1, "On/Off", 275, 74, 90, 30 }), status_button = create( wxButton, {win, -1, "Status", 64, 182 }), status_label = create( wxStaticText, {win, -1, "", 11, 219, 403, 91 }) procedure on_click( atom this, atom event_id, atom id, atom event ) set_label( status_label, sprintf( "Radio Box: %s\nRadio Button: %s", {RADIO_SELECTIONS[get_radio_selection( radio_box ) + 1], ON_OFF[ get_checked( toggle_button ) + 1 ] }) ) end procedure set_event_handler( status_button, -1, wxEVT_COMMAND_BUTTON_CLICKED, routine_id("on_click")) on_click(0,0,0,0) wxMain( radio_demo )