true/false or TRUE/FALSE to prepare for the new boolean type and constants being added to Python. Added code to wx.py to test for the existence of the new constants and to create suitable values if not present. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
54 lines
1.3 KiB
Python
54 lines
1.3 KiB
Python
|
|
from wxPython.wx import *
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class TestCheckBox(wxPanel):
|
|
def __init__(self, parent, log):
|
|
self.log = log
|
|
wxPanel.__init__(self, parent, -1)
|
|
|
|
wxStaticText(self, -1, "This example uses the wxCheckBox control.",
|
|
wxPoint(10, 10))
|
|
|
|
cID = NewId()
|
|
cb1 = wxCheckBox(self, cID, " Apples", wxPoint(65, 40), wxSize(150, 20), wxNO_BORDER)
|
|
cb2 = wxCheckBox(self, cID+1, " Oranges", wxPoint(65, 60), wxSize(150, 20), wxNO_BORDER)
|
|
cb2.SetValue(True)
|
|
cb3 = wxCheckBox(self, cID+2, " Pears", wxPoint(65, 80), wxSize(150, 20), wxNO_BORDER)
|
|
|
|
EVT_CHECKBOX(self, cID, self.EvtCheckBox)
|
|
EVT_CHECKBOX(self, cID+1, self.EvtCheckBox)
|
|
EVT_CHECKBOX(self, cID+2, self.EvtCheckBox)
|
|
|
|
|
|
def EvtCheckBox(self, event):
|
|
self.log.WriteText('EvtCheckBox: %d\n' % event.Checked())
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
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).
|
|
|
|
"""
|