2 from wxPython
.wx
import *
4 #---------------------------------------------------------------------------
6 class TestRadioButtons(wxPanel
):
7 def __init__(self
, parent
, log
):
9 wxPanel
.__init
__(self
, parent
, -1)
11 sampleList
= ['zero', 'one', 'two', 'three', 'four', 'five',
12 'six', 'seven', 'eight']
14 rb
= wxRadioBox(self
, 30, "wxRadioBox", wxPoint(35, 30), wxDefaultSize
,
15 sampleList
, 3, wxRA_SPECIFY_COLS
)
16 EVT_RADIOBOX(self
, 30, self
.EvtRadioBox
)
19 rb
= wxRadioBox(self
, 30, "", wxPoint(35, 120), wxDefaultSize
,
20 sampleList
, 3, wxRA_SPECIFY_COLS | wxNO_BORDER
)
21 EVT_RADIOBOX(self
, 30, self
.EvtRadioBox
)
24 def EvtRadioBox(self
, event
):
25 self
.log
.WriteText('EvtRadioBox: %d\n' % event
.GetInt())
27 #---------------------------------------------------------------------------
29 def runTest(frame
, nb
, log
):
30 win
= TestRadioButtons(nb
, log
)
33 #---------------------------------------------------------------------------
46 A radio box item is used to select one of number of mutually exclusive choices. It is displayed as a vertical column or horizontal row of labelled buttons.
49 ----------------------
53 wxRadioBox(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "radioBox")
55 Constructor, creating and showing a radiobox.
60 parent = Parent window. Must not be NULL.
62 id = Window identifier. A value of -1 indicates a default value.
64 label = Label for the static box surrounding the radio buttons.
66 pos = Window position. If the position (-1, -1) is specified then a default position is chosen.
68 size = Window size. If the default size (-1, -1) is specified then a default size is chosen.
70 n = Number of choices with which to initialize the radiobox.
72 choices = An array of choices with which to initialize the radiobox.
74 majorDimension = Specifies the maximum number of rows (if style contains wxRA_SPECIFY_ROWS) or columns (if style contains wxRA_SPECIFY_COLS) for a two-dimensional radiobox.
76 style = Window style. See wxRadioBox.
78 validator = Window validator.