2003-12-09 01:23:28 +00:00
|
|
|
# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net)
|
|
|
|
#
|
|
|
|
# o Updated for wx namespace
|
|
|
|
#
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
import wx
|
1999-04-30 03:29:54 +00:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
class TestCheckBox(wx.Panel):
|
1999-04-30 03:29:54 +00:00
|
|
|
def __init__(self, parent, log):
|
|
|
|
self.log = log
|
2003-12-09 01:23:28 +00:00
|
|
|
wx.Panel.__init__(self, parent, -1)
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
wx.StaticText(self, -1, "This example uses the wxCheckBox control.", (10, 10))
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
cID = wx.NewId()
|
|
|
|
cb1 = wx.CheckBox(self, cID, " Apples", (65, 40), (150, 20), wx.NO_BORDER)
|
|
|
|
cb2 = wx.CheckBox(self, cID+1, " Oranges", (65, 60), (150, 20), wx.NO_BORDER)
|
2003-03-25 06:35:27 +00:00
|
|
|
cb2.SetValue(True)
|
2003-12-09 01:23:28 +00:00
|
|
|
cb3 = wx.CheckBox(self, cID+2, " Pears", (65, 80), (150, 20), wx.NO_BORDER)
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
self.Bind(wx.EVT_CHECKBOX, self.EvtCheckBox, cb1)
|
|
|
|
self.Bind(wx.EVT_CHECKBOX, self.EvtCheckBox, cb2)
|
|
|
|
self.Bind(wx.EVT_CHECKBOX, self.EvtCheckBox, cb3)
|
1999-04-30 03:29:54 +00:00
|
|
|
|
|
|
|
def EvtCheckBox(self, event):
|
2003-11-12 21:34:20 +00:00
|
|
|
self.log.WriteText('EvtCheckBox: %d\n' % event.IsChecked())
|
1999-04-30 03:29:54 +00:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
win = TestCheckBox(nb, log)
|
|
|
|
return win
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
overview = """\
|
|
|
|
A checkbox is a labelled box which is either on (checkmark is visible) or off (no checkmark).
|
|
|
|
|
|
|
|
"""
|
2003-07-02 23:13:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys,os
|
|
|
|
import run
|
|
|
|
run.main(['', os.path.basename(sys.argv[0])])
|
|
|
|
|