Switched to using True/False in the wxPython lib and demo instead of
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
This commit is contained in:
@@ -24,14 +24,14 @@ class MyValidator(wxPyValidator):
|
||||
if self.flag == ALPHA_ONLY:
|
||||
for x in val:
|
||||
if x not in string.letters:
|
||||
return false
|
||||
return False
|
||||
|
||||
elif self.flag == DIGIT_ONLY:
|
||||
for x in val:
|
||||
if x not in string.digits:
|
||||
return false
|
||||
return False
|
||||
|
||||
return true
|
||||
return True
|
||||
|
||||
|
||||
def OnChar(self, event):
|
||||
@@ -58,7 +58,7 @@ class MyValidator(wxPyValidator):
|
||||
class TestValidatorPanel(wxPanel):
|
||||
def __init__(self, parent):
|
||||
wxPanel.__init__(self, parent, -1)
|
||||
self.SetAutoLayout(true)
|
||||
self.SetAutoLayout(True)
|
||||
VSPACE = 10
|
||||
|
||||
fgs = wxFlexGridSizer(0, 2)
|
||||
@@ -130,30 +130,30 @@ class TextObjectValidator(wxPyValidator):
|
||||
textCtrl.SetBackgroundColour("pink")
|
||||
textCtrl.SetFocus()
|
||||
textCtrl.Refresh()
|
||||
return false
|
||||
return False
|
||||
else:
|
||||
textCtrl.SetBackgroundColour(
|
||||
wxSystemSettings_GetColour(wxSYS_COLOUR_WINDOW))
|
||||
textCtrl.Refresh()
|
||||
return true
|
||||
return True
|
||||
|
||||
|
||||
def TransferToWindow(self):
|
||||
""" Transfer data from validator to window.
|
||||
|
||||
The default implementation returns false, indicating that an error
|
||||
occurred. We simply return true, as we don't do any data transfer.
|
||||
The default implementation returns False, indicating that an error
|
||||
occurred. We simply return True, as we don't do any data transfer.
|
||||
"""
|
||||
return true # Prevent wxDialog from complaining.
|
||||
return True # Prevent wxDialog from complaining.
|
||||
|
||||
|
||||
def TransferFromWindow(self):
|
||||
""" Transfer data from window to validator.
|
||||
|
||||
The default implementation returns false, indicating that an error
|
||||
occurred. We simply return true, as we don't do any data transfer.
|
||||
The default implementation returns False, indicating that an error
|
||||
occurred. We simply return True, as we don't do any data transfer.
|
||||
"""
|
||||
return true # Prevent wxDialog from complaining.
|
||||
return True # Prevent wxDialog from complaining.
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@@ -161,7 +161,7 @@ class TestValidateDialog(wxDialog):
|
||||
def __init__(self, parent):
|
||||
wxDialog.__init__(self, parent, -1, "Validated Dialog")
|
||||
|
||||
self.SetAutoLayout(true)
|
||||
self.SetAutoLayout(True)
|
||||
VSPACE = 10
|
||||
|
||||
fgs = wxFlexGridSizer(0, 2)
|
||||
|
Reference in New Issue
Block a user