1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
from wxPython.wx import *
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class TestRadioButtons(wxPanel):
|
|
|
|
def __init__(self, parent, log):
|
|
|
|
self.log = log
|
|
|
|
wxPanel.__init__(self, parent, -1)
|
2000-01-31 16:07:04 -05:00
|
|
|
#self.SetBackgroundColour(wxBLUE)
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
|
|
|
|
'six', 'seven', 'eight']
|
|
|
|
|
|
|
|
rb = wxRadioBox(self, 30, "wxRadioBox", wxPoint(35, 30), wxDefaultSize,
|
1999-07-31 03:56:15 -04:00
|
|
|
sampleList, 3, wxRA_SPECIFY_COLS)
|
|
|
|
EVT_RADIOBOX(self, 30, self.EvtRadioBox)
|
2000-01-31 16:07:04 -05:00
|
|
|
#rb.SetBackgroundColour(wxBLUE)
|
|
|
|
rb.SetToolTip(wxToolTip("This is a ToolTip!"))
|
1999-07-31 03:56:15 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
wxRadioButton(self, 32, "wxRadioButton", (235, 35))
|
|
|
|
wxRadioButton(self, 33, "wxRadioButton", (235, 55))
|
1999-07-31 03:56:15 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
rb = wxRadioBox(self, 35, "", wxPoint(35, 120), wxDefaultSize,
|
1999-04-29 23:29:54 -04:00
|
|
|
sampleList, 3, wxRA_SPECIFY_COLS | wxNO_BORDER)
|
2000-01-31 16:07:04 -05:00
|
|
|
EVT_RADIOBOX(self, 35, self.EvtRadioBox)
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
def EvtRadioBox(self, event):
|
|
|
|
self.log.WriteText('EvtRadioBox: %d\n' % event.GetInt())
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
win = TestRadioButtons(nb, log)
|
|
|
|
return win
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
overview = """\
|
|
|
|
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.
|
|
|
|
|
2001-05-18 17:59:59 -04:00
|
|
|
"""
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
|