diff --git a/wxPython/demo/ActiveXWrapper_Acrobat.py b/wxPython/demo/ActiveXWrapper_Acrobat.py index 6eb972d109..694f875463 100644 --- a/wxPython/demo/ActiveXWrapper_Acrobat.py +++ b/wxPython/demo/ActiveXWrapper_Acrobat.py @@ -62,7 +62,7 @@ class TestPanel(wxPanel): sizer.Add(btnSizer, 0, wxEXPAND) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) EVT_WINDOW_DESTROY(self, self.OnDestroy) @@ -121,7 +121,7 @@ if __name__ == '__main__': app = wxPySimpleApp() frame = TestFrame() - frame.Show(true) + frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/ActiveXWrapper_IE.py b/wxPython/demo/ActiveXWrapper_IE.py index 7a0caee5d0..2e08c8e1a4 100644 --- a/wxPython/demo/ActiveXWrapper_IE.py +++ b/wxPython/demo/ActiveXWrapper_IE.py @@ -101,7 +101,7 @@ class TestPanel(wxWindow): self.location.Append(self.current) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) EVT_SIZE(self, self.OnSize) EVT_WINDOW_DESTROY(self, self.OnDestroy) @@ -230,7 +230,7 @@ if __name__ == '__main__': app = wxPySimpleApp() frame = TestFrame() - frame.Show(true) + frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/ColourSelect.py b/wxPython/demo/ColourSelect.py index 6b083e8e6e..18cdf015a5 100644 --- a/wxPython/demo/ColourSelect.py +++ b/wxPython/demo/ColourSelect.py @@ -25,7 +25,7 @@ class TestColourSelect(wxPanel): def __init__(self, parent, log): self.log = log wxPanel.__init__(self, parent, -1) - self.SetAutoLayout(true) + self.SetAutoLayout(True) mainSizer = wxBoxSizer(wxVERTICAL) self.SetSizer(mainSizer) t = wxStaticText(self, -1, diff --git a/wxPython/demo/ContextHelp.py b/wxPython/demo/ContextHelp.py index 2c2a567ab7..c115f22c44 100644 --- a/wxPython/demo/ContextHelp.py +++ b/wxPython/demo/ContextHelp.py @@ -53,7 +53,7 @@ class TestPanel(wxPanel): border = wxBoxSizer(wxVERTICAL) border.Add(sizer, 0, wxALL, 25) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(border) self.Layout() diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index 4cb3bff9e4..3fb49e5d02 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -139,7 +139,7 @@ class DoodleDropTarget(wxPyDropTarget): def OnDrop(self, x, y): self.log.WriteText("OnDrop: %d %d\n" % (x, y)) - return true + return True def OnDragOver(self, x, y, d): #self.log.WriteText("OnDragOver: %d, %d, %d\n" % (x, y, d)) @@ -154,7 +154,7 @@ class DoodleDropTarget(wxPyDropTarget): - # Called when OnDrop returns true. We need to get the data and + # Called when OnDrop returns True. We need to get the data and # do something with it. def OnData(self, x, y, d): self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d)) @@ -206,7 +206,7 @@ class CustomDnDPanel(wxPanel): def __init__(self, parent, log): wxPanel.__init__(self, parent, -1) - self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false)) + self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False)) # Make the controls text1 = wxStaticText(self, -1, @@ -218,9 +218,9 @@ class CustomDnDPanel(wxPanel): ) rb1 = wxRadioButton(self, -1, "Draw", style=wxRB_GROUP) - rb1.SetValue(true) + rb1.SetValue(True) rb2 = wxRadioButton(self, -1, "Drag") - rb2.SetValue(false) + rb2.SetValue(False) text2 = wxStaticText(self, -1, "The lower window is accepting a\n" @@ -250,7 +250,7 @@ class CustomDnDPanel(wxPanel): sizer.Add(dndsizer, 1, wxEXPAND) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) # Events @@ -270,12 +270,12 @@ class TestPanel(wxPanel): def __init__(self, parent, log): wxPanel.__init__(self, parent, -1) - self.SetAutoLayout(true) + self.SetAutoLayout(True) sizer = wxBoxSizer(wxVERTICAL) msg = "Custom Drag-And-Drop" text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE) - text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false)) + text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) text.SetSize(wxSize(w,h+1)) @@ -306,7 +306,7 @@ if __name__ == '__main__': def OnInit(self): wxInitAllImageHandlers() self.MakeFrame() - return true + return True def MakeFrame(self, event=None): frame = wxFrame(None, -1, "Custom Drag and Drop", size=(550,400)) @@ -317,7 +317,7 @@ if __name__ == '__main__': frame.SetMenuBar(mb) EVT_MENU(frame, 6543, self.MakeFrame) panel = TestPanel(frame, DummyLog()) - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) diff --git a/wxPython/demo/DialogUnits.py b/wxPython/demo/DialogUnits.py index eca857897a..78974eb676 100644 --- a/wxPython/demo/DialogUnits.py +++ b/wxPython/demo/DialogUnits.py @@ -88,13 +88,13 @@ if __name__ == "__main__": # Create an instance of our customized Frame class frame = MyFrame(None, -1, "This is a test") - frame.Show(true) + frame.Show(True) # Tell wxWindows that this is our main window self.SetTopWindow(frame) # Return a success flag - return true + return True app = MyApp(0) # Create an instance of the application class @@ -107,7 +107,7 @@ if __name__ == "__main__": def runTest(frame, nb, log): win = MyFrame(frame, -1, "This is a test") frame.otherWin = win - win.Show(true) + win.Show(True) overview = """\ diff --git a/wxPython/demo/DragAndDrop.py b/wxPython/demo/DragAndDrop.py index da17b09299..e99abc3660 100644 --- a/wxPython/demo/DragAndDrop.py +++ b/wxPython/demo/DragAndDrop.py @@ -8,7 +8,7 @@ class ClipTextPanel(wxPanel): wxPanel.__init__(self, parent, -1) self.log = log - #self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false)) + #self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False)) sizer = wxBoxSizer(wxVERTICAL) sizer.Add(wxStaticText(self, -1, @@ -28,7 +28,7 @@ class ClipTextPanel(wxPanel): EVT_BUTTON(self, 6051, self.OnPaste) EVT_BUTTON(self, 6052, self.OnCopyBitmap) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) @@ -86,7 +86,7 @@ class OtherDropTarget(wxPyDropTarget): def OnDrop(self, x, y): self.log.WriteText("OnDrop: %d %d\n" % (x, y)) - return true + return True def OnData(self, x, y, d): self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d)) @@ -128,7 +128,7 @@ class FileDropPanel(wxPanel): def __init__(self, parent, log): wxPanel.__init__(self, parent, -1) - #self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false)) + #self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False)) sizer = wxBoxSizer(wxVERTICAL) sizer.Add(wxStaticText(self, -1, " \nDrag some files here:"), @@ -148,7 +148,7 @@ class FileDropPanel(wxPanel): self.text2.SetDropTarget(dt) sizer.Add(self.text2, 1, wxEXPAND) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) @@ -166,12 +166,12 @@ class TestPanel(wxPanel): def __init__(self, parent, log): wxPanel.__init__(self, parent, -1) - self.SetAutoLayout(true) + self.SetAutoLayout(True) outsideSizer = wxBoxSizer(wxVERTICAL) msg = "Clipboard / Drag-And-Drop" text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE) - text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false)) + text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) text.SetSize(wxSize(w,h+1)) diff --git a/wxPython/demo/ErrorDialogs.py b/wxPython/demo/ErrorDialogs.py index 18076f8bc1..c94639ff8c 100644 --- a/wxPython/demo/ErrorDialogs.py +++ b/wxPython/demo/ErrorDialogs.py @@ -14,14 +14,14 @@ ID_BUTTON_wxPyNonFatalErrorDialog = 10004 ID_BUTTON_wxPyFatalErrorDialogWithTraceback = 10005 ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback = 10006 -def ErrorDialogsDemoPanelFunc( parent, call_fit = true, set_sizer = true ): +def ErrorDialogsDemoPanelFunc( parent, call_fit = True, set_sizer = True ): item0 = wxBoxSizer( wxVERTICAL ) - + item1 = wxStaticText( parent, ID_TEXT, "Please select one of the buttons below for an example using explicit errors...", wxDefaultPosition, wxDefaultSize, 0 ) item0.AddWindow( item1, 0, wxALIGN_CENTRE|wxALL, 5 ) item2 = wxFlexGridSizer( 0, 2, 0, 0 ) - + item3 = wxButton( parent, ID_BUTTON_wxPyNonFatalError, "wxPyNonFatalError", wxDefaultPosition, wxDefaultSize, 0 ) item2.AddWindow( item3, 0, wxALIGN_CENTRE|wxALL, 5 ) @@ -34,7 +34,7 @@ def ErrorDialogsDemoPanelFunc( parent, call_fit = true, set_sizer = true ): item0.AddWindow( item5, 0, wxALIGN_CENTRE|wxALL, 5 ) item6 = wxFlexGridSizer( 0, 2, 0, 0 ) - + item7 = wxButton( parent, ID_BUTTON_wxPyFatalErrorDialog, "wxPyFatalErrorDialog", wxDefaultPosition, wxDefaultSize, 0 ) item6.AddWindow( item7, 0, wxALIGN_CENTRE|wxALL, 5 ) @@ -51,16 +51,16 @@ def ErrorDialogsDemoPanelFunc( parent, call_fit = true, set_sizer = true ): item0.AddSizer( item6, 0, wxALIGN_CENTRE|wxALL, 5 ) item11 = wxFlexGridSizer( 0, 2, 0, 0 ) - + item0.AddSizer( item11, 0, wxALIGN_CENTRE|wxALL, 5 ) - if set_sizer == true: - parent.SetAutoLayout( true ) + if set_sizer == True: + parent.SetAutoLayout( True ) parent.SetSizer( item0 ) - if call_fit == true: + if call_fit == True: item0.Fit( parent ) item0.SetSizeHints( parent ) - + return item0 # Menu bar functions @@ -106,7 +106,7 @@ class MyPanel(wxPanel): ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback, self.DoDialog) EVT_CLOSE(self,self.OnClose) - + IndexFromID = { ID_BUTTON_wxPyFatalErrorDialog: 3, ID_BUTTON_wxPyFatalErrorDialogWithTraceback: 2, @@ -158,9 +158,9 @@ class MyFrame(wxFrame): class MyApp(wxApp): def OnInit(self): frame = MyFrame() - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True def runTest(pframe, nb, log): panel = MyPanel(nb) diff --git a/wxPython/demo/FontEnumerator.py b/wxPython/demo/FontEnumerator.py index 60810a4760..5775b52eec 100644 --- a/wxPython/demo/FontEnumerator.py +++ b/wxPython/demo/FontEnumerator.py @@ -36,7 +36,7 @@ class TestPanel(wxPanel): def OnSelect(self, evt): face = self.lb1.GetStringSelection() - font = wxFont(28, wxDEFAULT, wxDEFAULT, wxDEFAULT, false, face) + font = wxFont(28, wxDEFAULT, wxDEFAULT, wxDEFAULT, False, face) self.txt.SetFont(font) self.txt.SetSize(self.txt.GetBestSize()) diff --git a/wxPython/demo/GenericButtons.py b/wxPython/demo/GenericButtons.py index 9909df1c03..c3e7ff4039 100644 --- a/wxPython/demo/GenericButtons.py +++ b/wxPython/demo/GenericButtons.py @@ -28,12 +28,12 @@ class TestPanel(wxPanel): b = wxGenButton(self, -1, 'disabled') EVT_BUTTON(self, b.GetId(), self.OnButton) - b.Enable(false) + b.Enable(False) sizer.Add(b) b = wxGenButton(self, -1, 'bigger') EVT_BUTTON(self, b.GetId(), self.OnBiggerButton) - b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false)) + b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, False)) b.SetBezelWidth(5) ###b.SetBestSize() b.SetBackgroundColour("Navy") @@ -50,7 +50,7 @@ class TestPanel(wxPanel): b = wxGenBitmapButton(self, -1, bmp) EVT_BUTTON(self, b.GetId(), self.OnButton) sizer.Add(b) - b.Enable(FALSE) + b.Enable(False) b = wxGenBitmapButton(self, -1, None) EVT_BUTTON(self, b.GetId(), self.OnButton) @@ -79,7 +79,7 @@ class TestPanel(wxPanel): mask = wxMaskColour(bmp, wxBLUE) bmp.SetMask(mask) b.SetBitmapSelected(bmp) - b.SetToggle(true) + b.SetToggle(True) b.SetBestSize() sizer.Add(b) @@ -93,7 +93,7 @@ class TestPanel(wxPanel): mask = wxMaskColour(bmp, wxBLUE) bmp.SetMask(mask) b.SetBitmapSelected(bmp) - b.SetUseFocusIndicator(false) + b.SetUseFocusIndicator(False) b.SetBestSize() sizer.Add(b) diff --git a/wxPython/demo/GridCustEditor.py b/wxPython/demo/GridCustEditor.py index a6a6186cca..50101e4b60 100644 --- a/wxPython/demo/GridCustEditor.py +++ b/wxPython/demo/GridCustEditor.py @@ -87,16 +87,16 @@ class MyCellEditor(wxPyGridCellEditor): def EndEdit(self, row, col, grid): """ - Complete the editing of the current cell. Returns true if the value + Complete the editing of the current cell. Returns True if the value has changed. If necessary, the control may be destroyed. *Must Override* """ self.log.write("MyCellEditor: EndEdit (%d,%d)\n" % (row, col)) - changed = false + changed = False val = self._tc.GetValue() if val != self.startValue: - changed = true + changed = True grid.GetTable().SetValue(row, col, val) # update the table self.startValue = '' @@ -116,7 +116,7 @@ class MyCellEditor(wxPyGridCellEditor): def IsAcceptedKey(self, evt): """ - Return TRUE to allow the given key to start editing: the base class + Return True to allow the given key to start editing: the base class version only checks that the event has no modifiers. F2 is special and will always start the editor. """ @@ -228,7 +228,7 @@ if __name__ == '__main__': import sys app = wxPySimpleApp() frame = TestFrame(None, sys.stdout) - frame.Show(true) + frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/GridCustTable.py b/wxPython/demo/GridCustTable.py index 5e3439cc54..3d4b6b3011 100644 --- a/wxPython/demo/GridCustTable.py +++ b/wxPython/demo/GridCustTable.py @@ -95,7 +95,7 @@ class CustomDataTable(wxPyGridTableBase): if typeName == colType: return true else: - return false + return False def CanSetValueAs(self, row, col, typeName): return self.CanGetValueAs(row, col, typeName) @@ -121,7 +121,7 @@ class CustTableGrid(wxGrid): self.SetRowLabelSize(0) self.SetMargins(0,0) - self.AutoSizeColumns(false) + self.AutoSizeColumns(False) EVT_GRID_CELL_LEFT_DCLICK(self, self.OnLeftDClick) diff --git a/wxPython/demo/GridDragable.py b/wxPython/demo/GridDragable.py index a52fb7a122..ea989c6116 100644 --- a/wxPython/demo/GridDragable.py +++ b/wxPython/demo/GridDragable.py @@ -151,7 +151,7 @@ class DragableGrid(wxGrid): # The second parameter means that the grid is to take ownership of the # table and will destroy it when done. Otherwise you would need to keep # a reference to it and call it's Destroy method later. - self.SetTable(table, true) + self.SetTable(table, True) # Enable Column moving wxGridColMover(self) @@ -187,7 +187,7 @@ if __name__ == '__main__': import sys app = wxPySimpleApp() frame = TestFrame(None, sys.stdout) - frame.Show(true) + frame.Show(True) app.MainLoop() #--------------------------------------------------------------------------- diff --git a/wxPython/demo/GridEnterHandler.py b/wxPython/demo/GridEnterHandler.py index 719c622ef0..d6989fbcfe 100644 --- a/wxPython/demo/GridEnterHandler.py +++ b/wxPython/demo/GridEnterHandler.py @@ -55,7 +55,7 @@ if __name__ == '__main__': import sys app = wxPySimpleApp() frame = TestFrame(None, sys.stdout) - frame.Show(true) + frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/GridHugeTable.py b/wxPython/demo/GridHugeTable.py index 3ddc4e8726..a2084fb6e3 100644 --- a/wxPython/demo/GridHugeTable.py +++ b/wxPython/demo/GridHugeTable.py @@ -23,7 +23,7 @@ class HugeTable(wxPyGridTableBase): return 10000 def IsEmptyCell(self, row, col): - return false + return False def GetValue(self, row, col): return str( (row, col) ) @@ -45,7 +45,7 @@ class HugeTableGrid(wxGrid): # The second parameter means that the grid is to take ownership of the # table and will destroy it when done. Otherwise you would need to keep # a reference to it and call it's Destroy method later. - self.SetTable(table, true) + self.SetTable(table, True) EVT_GRID_CELL_RIGHT_CLICK(self, self.OnRightDown) #added @@ -64,7 +64,7 @@ class TestFrame(wxFrame): wxFrame.__init__(self, parent, -1, "Huge (virtual) Table Demo", size=(640,480)) grid = HugeTableGrid(self, log) - grid.SetReadOnly(5,5, true) + grid.SetReadOnly(5,5, True) #--------------------------------------------------------------------------- @@ -72,7 +72,7 @@ if __name__ == '__main__': import sys app = wxPySimpleApp() frame = TestFrame(None, sys.stdout) - frame.Show(true) + frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/GridSimple.py b/wxPython/demo/GridSimple.py index 6dae441690..645af947eb 100644 --- a/wxPython/demo/GridSimple.py +++ b/wxPython/demo/GridSimple.py @@ -14,7 +14,7 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin): EVT_IDLE(self, self.OnIdle) self.CreateGrid(25, 25) #, wxGrid.wxGridSelectRows) - ##self.EnableEditing(false) + ##self.EnableEditing(False) # simple cell formatting self.SetColSize(3, 200) @@ -26,7 +26,7 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin): self.SetCellFont(0, 0, wxFont(12, wxROMAN, wxITALIC, wxNORMAL)) self.SetCellTextColour(1, 1, wxRED) self.SetCellBackgroundColour(2, 2, wxCYAN) - self.SetReadOnly(3, 3, true) + self.SetReadOnly(3, 3, True) self.SetCellEditor(5, 0, wxGridCellNumberEditor(1,1000)) self.SetCellValue(5, 0, "123") @@ -224,7 +224,7 @@ if __name__ == '__main__': import sys app = wxPySimpleApp() frame = TestFrame(None, sys.stdout) - frame.Show(true) + frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/GridStdEdRend.py b/wxPython/demo/GridStdEdRend.py index 69892a9bde..8e43b41729 100644 --- a/wxPython/demo/GridStdEdRend.py +++ b/wxPython/demo/GridStdEdRend.py @@ -60,7 +60,7 @@ editorDemoData = [ ('wxGridCellBoolEditor', '1', wxGridCellBoolEditor, ()), ('wxGridCellChoiceEditor', 'one', wxGridCellChoiceEditor, (['one', 'two', 'three', 'four', 'kick', 'Microsoft', 'out the', - 'door'], false)), + 'door'], False)), ] @@ -139,15 +139,15 @@ Renderers used together. attr = wxGridCellAttr() attr.SetFont(font) attr.SetBackgroundColour(wxLIGHT_GREY) - attr.SetReadOnly(true) + attr.SetReadOnly(True) attr.SetAlignment(wxRIGHT, -1) self.SetColAttr(renCol, attr) attr.IncRef() self.SetColAttr(edCol, attr) # There is a bug in wxGTK for this method... - self.AutoSizeColumns(true) - self.AutoSizeRows(true) + self.AutoSizeColumns(True) + self.AutoSizeRows(True) EVT_GRID_CELL_LEFT_DCLICK(self, self.OnLeftDClick) @@ -174,7 +174,7 @@ if __name__ == '__main__': import sys app = wxPySimpleApp() frame = TestFrame(None, sys.stdout) - frame.Show(true) + frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/LayoutAnchors.py b/wxPython/demo/LayoutAnchors.py index b201372a7e..04b0c3f92c 100644 --- a/wxPython/demo/LayoutAnchors.py +++ b/wxPython/demo/LayoutAnchors.py @@ -21,38 +21,38 @@ class AnchorsDemoFrame(wxFrame): self._init_utils() self.mainPanel = wxPanel(size = wxSize(320, 160), parent = self, id = wxID_ANCHORSDEMOFRAMEMAINPANEL, name = 'panel1', style = wxTAB_TRAVERSAL | wxCLIP_CHILDREN, pos = wxPoint(0, 0)) - self.mainPanel.SetAutoLayout(true) + self.mainPanel.SetAutoLayout(True) self.okButton = wxButton(label = 'OK', id = wxID_ANCHORSDEMOFRAMEOKBUTTON, parent = self.mainPanel, name = 'okButton', size = wxSize(72, 24), style = 0, pos = wxPoint(240, 128)) - self.okButton.SetConstraints(LayoutAnchors(self.okButton, false, false, true, true)) + self.okButton.SetConstraints(LayoutAnchors(self.okButton, False, False, True, True)) EVT_BUTTON(self.okButton, wxID_ANCHORSDEMOFRAMEOKBUTTON, self.OnOkButtonButton) self.backgroundPanel = wxPanel(size = wxSize(304, 80), parent = self.mainPanel, id = wxID_ANCHORSDEMOFRAMEBACKGROUNDPANEL, name = 'backgroundPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN, pos = wxPoint(8, 40)) self.backgroundPanel.SetBackgroundColour(wxColour(255, 255, 255)) - self.backgroundPanel.SetConstraints(LayoutAnchors(self.backgroundPanel, true, true, true, true)) + self.backgroundPanel.SetConstraints(LayoutAnchors(self.backgroundPanel, True, True, True, True)) self.anchoredPanel = wxPanel(size = wxSize(88, 48), id = wxID_ANCHORSDEMOFRAMEANCHOREDPANEL, parent = self.backgroundPanel, name = 'anchoredPanel', style = wxSIMPLE_BORDER, pos = wxPoint(104, 16)) self.anchoredPanel.SetBackgroundColour(wxColour(0, 0, 222)) - self.anchoredPanel.SetConstraints(LayoutAnchors(self.anchoredPanel, false, false, false, false)) + self.anchoredPanel.SetConstraints(LayoutAnchors(self.anchoredPanel, False, False, False, False)) self.leftCheckBox = wxCheckBox(label = 'Left', id = wxID_ANCHORSDEMOFRAMELEFTCHECKBOX, parent = self.mainPanel, name = 'leftCheckBox', size = wxSize(40, 16), style = 0, pos = wxPoint(8, 8)) - self.leftCheckBox.SetConstraints(LayoutAnchors(self.leftCheckBox, false, true, false, false)) + self.leftCheckBox.SetConstraints(LayoutAnchors(self.leftCheckBox, False, True, False, False)) EVT_CHECKBOX(self.leftCheckBox, wxID_ANCHORSDEMOFRAMELEFTCHECKBOX, self.OnCheckboxCheckbox) self.topCheckBox = wxCheckBox(label = 'Top', id = wxID_ANCHORSDEMOFRAMETOPCHECKBOX, parent = self.mainPanel, name = 'topCheckBox', size = wxSize(40, 16), style = 0, pos = wxPoint(88, 8)) - self.topCheckBox.SetConstraints(LayoutAnchors(self.topCheckBox, false, true, false, false)) + self.topCheckBox.SetConstraints(LayoutAnchors(self.topCheckBox, False, True, False, False)) EVT_CHECKBOX(self.topCheckBox, wxID_ANCHORSDEMOFRAMETOPCHECKBOX, self.OnCheckboxCheckbox) self.rightCheckBox = wxCheckBox(label = 'Right', id = wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, parent = self.mainPanel, name = 'rightCheckBox', size = wxSize(48, 16), style = 0, pos = wxPoint(168, 8)) - self.rightCheckBox.SetConstraints(LayoutAnchors(self.rightCheckBox, false, true, false, false)) + self.rightCheckBox.SetConstraints(LayoutAnchors(self.rightCheckBox, False, True, False, False)) EVT_CHECKBOX(self.rightCheckBox, wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, self.OnCheckboxCheckbox) self.bottomCheckBox = wxCheckBox(label = 'Bottom', id = wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, parent = self.mainPanel, name = 'bottomCheckBox', size = wxSize(56, 16), style = 0, pos = wxPoint(248, 8)) - self.bottomCheckBox.SetConstraints(LayoutAnchors(self.bottomCheckBox, false, true, false, false)) + self.bottomCheckBox.SetConstraints(LayoutAnchors(self.bottomCheckBox, False, True, False, False)) EVT_CHECKBOX(self.bottomCheckBox, wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, self.OnCheckboxCheckbox) self.helpStaticText = wxStaticText(label = 'Select anchor options above, then resize window to see the effect', id = wxID_ANCHORSDEMOFRAMEHELPSTATICTEXT, parent = self.mainPanel, name = 'helpStaticText', size = wxSize(224, 24), style = wxST_NO_AUTORESIZE, pos = wxPoint(8, 128)) - self.helpStaticText.SetConstraints(LayoutAnchors(self.helpStaticText, true, false, true, true)) + self.helpStaticText.SetConstraints(LayoutAnchors(self.helpStaticText, True, False, True, True)) def __init__(self, parent): self._init_ctrls(parent) @@ -71,7 +71,7 @@ class AnchorsDemoFrame(wxFrame): def runTest(frame, nb, log): win = AnchorsDemoFrame(frame) frame.otherWin = win - win.Show(true) + win.Show(True) diff --git a/wxPython/demo/Layoutf.py b/wxPython/demo/Layoutf.py index e5809b60c5..cde4ad405f 100644 --- a/wxPython/demo/Layoutf.py +++ b/wxPython/demo/Layoutf.py @@ -8,7 +8,7 @@ class TestLayoutf(wxPanel): def __init__(self, parent): wxPanel.__init__(self, parent, -1) - self.SetAutoLayout(true) + self.SetAutoLayout(True) EVT_BUTTON(self, 100, self.OnButton) self.panelA = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER) diff --git a/wxPython/demo/MDIDemo.py b/wxPython/demo/MDIDemo.py index fd0d15fdb1..c5298129c1 100644 --- a/wxPython/demo/MDIDemo.py +++ b/wxPython/demo/MDIDemo.py @@ -33,14 +33,14 @@ class MyParentFrame(wxMDIParentFrame): def OnExit(self, evt): - self.Close(true) + self.Close(True) def OnNewWindow(self, evt): self.winCount = self.winCount + 1 win = wxMDIChildFrame(self, -1, "Child Window: %d" % self.winCount) canvas = MyCanvas(win) - win.Show(true) + win.Show(True) def OnEraseBackground(self, evt): @@ -68,9 +68,9 @@ if __name__ == '__main__': def OnInit(self): wxInitAllImageHandlers() frame = MyParentFrame() - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True app = MyApp(0) diff --git a/wxPython/demo/MDISashDemo.py b/wxPython/demo/MDISashDemo.py index dca6516f6a..a5fe68b915 100644 --- a/wxPython/demo/MDISashDemo.py +++ b/wxPython/demo/MDISashDemo.py @@ -44,7 +44,7 @@ class MyParentFrame(wxMDIParentFrame): win.SetOrientation(wxLAYOUT_HORIZONTAL) win.SetAlignment(wxLAYOUT_TOP) win.SetBackgroundColour(wxColour(255, 0, 0)) - win.SetSashVisible(wxSASH_BOTTOM, true) + win.SetSashVisible(wxSASH_BOTTOM, True) self.topWindow = win @@ -55,7 +55,7 @@ class MyParentFrame(wxMDIParentFrame): win.SetOrientation(wxLAYOUT_HORIZONTAL) win.SetAlignment(wxLAYOUT_BOTTOM) win.SetBackgroundColour(wxColour(0, 0, 255)) - win.SetSashVisible(wxSASH_TOP, true) + win.SetSashVisible(wxSASH_TOP, True) self.bottomWindow = win @@ -66,7 +66,7 @@ class MyParentFrame(wxMDIParentFrame): win.SetOrientation(wxLAYOUT_VERTICAL) win.SetAlignment(wxLAYOUT_LEFT) win.SetBackgroundColour(wxColour(0, 255, 0)) - win.SetSashVisible(wxSASH_RIGHT, TRUE) + win.SetSashVisible(wxSASH_RIGHT, True) win.SetExtraBorderSize(10) textWindow = wxTextCtrl(win, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxSUNKEN_BORDER) @@ -81,7 +81,7 @@ class MyParentFrame(wxMDIParentFrame): win.SetOrientation(wxLAYOUT_VERTICAL) win.SetAlignment(wxLAYOUT_LEFT) win.SetBackgroundColour(wxColour(0, 255, 255)) - win.SetSashVisible(wxSASH_RIGHT, TRUE) + win.SetSashVisible(wxSASH_RIGHT, True) self.leftWindow2 = win @@ -113,14 +113,14 @@ class MyParentFrame(wxMDIParentFrame): def OnExit(self, evt): - self.Close(true) + self.Close(True) def OnNewWindow(self, evt): self.winCount = self.winCount + 1 win = wxMDIChildFrame(self, -1, "Child Window: %d" % self.winCount) canvas = MyCanvas(win) - win.Show(true) + win.Show(True) #---------------------------------------------------------------------- @@ -130,9 +130,9 @@ if __name__ == '__main__': def OnInit(self): wxInitAllImageHandlers() frame = MyParentFrame() - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True app = MyApp(0) diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 25aaabfeea..487910e9b5 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -270,8 +270,8 @@ class wxPythonDemo(wxFrame): EVT_ERASE_BACKGROUND(splitter, EmptyHandler) EVT_ERASE_BACKGROUND(splitter2, EmptyHandler) - # Prevent TreeCtrl from displaying all items after destruction when true - self.dying = false + # Prevent TreeCtrl from displaying all items after destruction when True + self.dying = False # Make a File menu self.mainmenu = wxMenuBar() @@ -313,12 +313,14 @@ class wxPythonDemo(wxFrame): self.finddata = wxFindReplaceData() - # set the menu accellerator table... - aTable = wxAcceleratorTable([(wxACCEL_ALT, ord('X'), exitID), - (wxACCEL_CTRL, ord('H'), helpID), - (wxACCEL_CTRL, ord('F'), findID), - (wxACCEL_NORMAL, WXK_F3, findnextID)]) - self.SetAcceleratorTable(aTable) + if 0: + # This is another way to set Accelerators, in addition to + # using the '\t' syntax in the menu items. + aTable = wxAcceleratorTable([(wxACCEL_ALT, ord('X'), exitID), + (wxACCEL_CTRL, ord('H'), helpID), + (wxACCEL_CTRL, ord('F'), findID), + (wxACCEL_NORMAL, WXK_F3, findnextID)]) + self.SetAcceleratorTable(aTable) # Create a TreeCtrl @@ -393,7 +395,7 @@ class wxPythonDemo(wxFrame): #wxLog_SetActiveTarget(wxLogStderr()) #wxLog_SetTraceMask(wxTraceMessages) - self.Show(true) + self.Show(True) # add the windows to the splitter and split it. @@ -548,7 +550,7 @@ class wxPythonDemo(wxFrame): wxFR_NOUPDOWN | wxFR_NOMATCHCASE | wxFR_NOWHOLEWORD) - self.finddlg.Show(true) + self.finddlg.Show(True) def OnFind(self, event): self.nb.SetSelection(1) @@ -590,7 +592,7 @@ class wxPythonDemo(wxFrame): #--------------------------------------------- def OnCloseWindow(self, event): - self.dying = true + self.dying = True self.window = None self.mainmenu = None if hasattr(self, "tbicon"): @@ -635,9 +637,9 @@ class wxPythonDemo(wxFrame): #--------------------------------------------- def OnTaskBarActivate(self, evt): if self.IsIconized(): - self.Iconize(false) + self.Iconize(False) if not self.IsShown(): - self.Show(true) + self.Show(True) self.Raise() #--------------------------------------------- @@ -688,7 +690,7 @@ class MySplashScreen(wxSplashScreen): def OnClose(self, evt): frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)") - frame.Show(true) + frame.Show(True) evt.Skip() # Make sure the default handler runs too... @@ -701,7 +703,7 @@ class MyApp(wxApp): wxInitAllImageHandlers() splash = MySplashScreen() splash.Show() - return true + return True diff --git a/wxPython/demo/OOR.py b/wxPython/demo/OOR.py index 9b4088fb8d..e0e84b0112 100644 --- a/wxPython/demo/OOR.py +++ b/wxPython/demo/OOR.py @@ -30,7 +30,7 @@ class TestPanel(wxPanel): sizer.Add(btns, 0, wxEXPAND|wxALL, 15) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.sizer = sizer # save it for testing later diff --git a/wxPython/demo/PrintFramework.py b/wxPython/demo/PrintFramework.py index faa33469d0..36c3ea5a2b 100644 --- a/wxPython/demo/PrintFramework.py +++ b/wxPython/demo/PrintFramework.py @@ -33,9 +33,9 @@ class MyPrintout(wxPrintout): def HasPage(self, page): self.log.WriteText("wxPrintout.HasPage: %d\n" % page) if page <= 2: - return true + return True else: - return false + return False def GetPageInfo(self): self.log.WriteText("wxPrintout.GetPageInfo\n") @@ -82,7 +82,7 @@ class MyPrintout(wxPrintout): self.canvas.DoDrawing(dc) dc.DrawText("Page: %d" % page, marginX/2, maxY-marginY) - return true + return True #---------------------------------------------------------------------- @@ -117,14 +117,14 @@ class TestPrintPanel(wxPanel): self.box.Add(subbox, 0, wxGROW) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(self.box) def OnPrintSetup(self, event): printerDialog = wxPrintDialog(self) printerDialog.GetPrintDialogData().SetPrintData(self.printData) - printerDialog.GetPrintDialogData().SetSetupDialog(true) + printerDialog.GetPrintDialogData().SetSetupDialog(True) printerDialog.ShowModal(); self.printData = printerDialog.GetPrintDialogData().GetPrintData() printerDialog.Destroy() @@ -144,7 +144,7 @@ class TestPrintPanel(wxPanel): frame.Initialize() frame.SetPosition(self.frame.GetPosition()) frame.SetSize(self.frame.GetSize()) - frame.Show(true) + frame.Show(True) diff --git a/wxPython/demo/RowColSizer.py b/wxPython/demo/RowColSizer.py index 24921ca057..55f6cc17c6 100644 --- a/wxPython/demo/RowColSizer.py +++ b/wxPython/demo/RowColSizer.py @@ -50,7 +50,7 @@ class TestPanel(wxPanel): sizer.AddSpacer(10,10, pos=(13,1)) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) #---------------------------------------------------------------------- diff --git a/wxPython/demo/ScrolledPanel.py b/wxPython/demo/ScrolledPanel.py index 2ff349b8f3..13b5e693a5 100644 --- a/wxPython/demo/ScrolledPanel.py +++ b/wxPython/demo/ScrolledPanel.py @@ -39,7 +39,7 @@ class ScrolledPanel(wxScrolledWindow): # The following is all that is needed to integrate the sizer and the # scrolled window. In this case we will only support vertical scrolling. - self.EnableScrolling(false, true) + self.EnableScrolling(False, True) self.SetScrollRate(0, 20) box.SetVirtualSizeHints(self) EVT_CHILD_FOCUS(self, self.OnChildFocus) diff --git a/wxPython/demo/Sizers.py b/wxPython/demo/Sizers.py index fdbbb5a25c..ab95d06fd7 100644 --- a/wxPython/demo/Sizers.py +++ b/wxPython/demo/Sizers.py @@ -479,16 +479,16 @@ class TestFrame(wxFrame): self.SetStatusText("Resize this frame to see how the sizers respond...") self.sizer.Fit(self) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(self.sizer) EVT_CLOSE(self, self.OnCloseWindow) def OnCloseWindow(self, event): - self.MakeModal(false) + self.MakeModal(False) self.Destroy() def OnButton(self, event): - self.Close(true) + self.Close(True) #---------------------------------------------------------------------- @@ -531,8 +531,8 @@ class TestSelectionPanel(wxPanel): if func: win = TestFrame(self, title, func) win.CentreOnParent(wxBOTH) - win.Show(true) - win.MakeModal(true) + win.Show(True) + win.MakeModal(True) #---------------------------------------------------------------------- @@ -570,15 +570,15 @@ if __name__ == '__main__': self.Destroy() def OnExit(self, event): - self.Close(true) + self.Close(True) class TestApp(wxApp): def OnInit(self): frame = MainFrame() - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True app = TestApp(0) app.MainLoop() diff --git a/wxPython/demo/SlashDot.py b/wxPython/demo/SlashDot.py index b6eb280f0c..eb0ded644e 100644 --- a/wxPython/demo/SlashDot.py +++ b/wxPython/demo/SlashDot.py @@ -201,8 +201,8 @@ class AppFrame(wxFrame): EVT_MENU(self, 212, self.OnViewArticle) self.mainmenu.Append(menu, '&View') menu = wxMenu() - menu.Append(220, '&Internal', 'Use internal text browser',TRUE) - menu.Check(220, true) + menu.Append(220, '&Internal', 'Use internal text browser',True) + menu.Check(220, True) self.UseInternal = 1; EVT_MENU(self, 220, self.OnBrowserInternal) menu.Append(222, '&Settings...', 'External browser Settings') @@ -279,7 +279,7 @@ class AppFrame(wxFrame): if self.UseInternal: self.view = HTMLTextView(self, -1, 'slashdot.org', 'http://slashdot.org') - self.view.Show(true) + self.view.Show(True) else: self.logprint(self.BrowserSettings % ('http://slashdot.org')) #os.system(self.BrowserSettings % ('http://slashdot.org')) @@ -296,7 +296,7 @@ class AppFrame(wxFrame): url = self.url[self.current] if self.UseInternal: self.view = HTMLTextView(self, -1, url, url) - self.view.Show(true) + self.view.Show(True) else: self.logprint(self.BrowserSettings % (url)) os.system(self.BrowserSettings % (url)) @@ -353,9 +353,9 @@ if __name__ == '__main__': class MyApp(wxApp): def OnInit(self): frame = AppFrame(None, -1, "Slashdot Breaking News") - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True app = MyApp(0) app.MainLoop() @@ -368,7 +368,7 @@ if __name__ == '__main__': def runTest(frame, nb, log): win = AppFrame(None, -1, "Slashdot Breaking News") frame.otherWin = win - win.Show(true) + win.Show(True) overview = __doc__ diff --git a/wxPython/demo/SplitTree.py b/wxPython/demo/SplitTree.py index 0791364f15..698d2f639d 100644 --- a/wxPython/demo/SplitTree.py +++ b/wxPython/demo/SplitTree.py @@ -78,14 +78,14 @@ class TestPanel(wxPanel): splitter.SplitVertically(tree, valueWindow, 150) scroller.SetTargetWindow(tree) - scroller.EnableScrolling(FALSE, FALSE) + scroller.EnableScrolling(False, False) valueWindow.SetTreeCtrl(tree) tree.SetCompanionWindow(valueWindow) sizer = wxBoxSizer(wxVERTICAL) sizer.Add(scroller, 1, wxEXPAND|wxALL, 25) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) diff --git a/wxPython/demo/TablePrint.py b/wxPython/demo/TablePrint.py index 682b740dd4..51b075c3da 100644 --- a/wxPython/demo/TablePrint.py +++ b/wxPython/demo/TablePrint.py @@ -31,7 +31,7 @@ class TablePanel(wxPanel): box.Add(btn, 0, wxALIGN_CENTER|wxALL, 15) EVT_BUTTON(self, k, self.OnButton) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(box) def OnButton(self, evt): diff --git a/wxPython/demo/Threads.py b/wxPython/demo/Threads.py index 0476647c38..4c165eeb89 100644 --- a/wxPython/demo/Threads.py +++ b/wxPython/demo/Threads.py @@ -30,11 +30,11 @@ class CalcBarThread: self.val = val def Start(self): - self.keepGoing = self.running = true + self.keepGoing = self.running = True thread.start_new_thread(self.Run, ()) def Stop(self): - self.keepGoing = false + self.keepGoing = False def IsRunning(self): return self.running @@ -57,7 +57,7 @@ class CalcBarThread: if self.val < 0: self.val = 0 if self.val > 300: self.val = 300 - self.running = false + self.running = False #---------------------------------------------------------------------- @@ -172,7 +172,7 @@ class TestFrame(wxFrame): sizer.Add(self.graph, 1, wxEXPAND) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) sizer.Fit(self) EVT_UPDATE_BARGRAPH(self, self.OnUpdate) @@ -194,7 +194,7 @@ class TestFrame(wxFrame): def OnUpdate(self, evt): self.graph.SetValue(evt.barNum, evt.value) - self.graph.Refresh(false) + self.graph.Refresh(False) def OnCloseWindow(self, evt): @@ -217,7 +217,7 @@ class TestFrame(wxFrame): def runTest(frame, nb, log): win = TestFrame(frame, log) frame.otherWin = win - win.Show(true) + win.Show(True) return None #---------------------------------------------------------------------- diff --git a/wxPython/demo/Throbber.py b/wxPython/demo/Throbber.py index 58583c9826..2aadab2f90 100644 --- a/wxPython/demo/Throbber.py +++ b/wxPython/demo/Throbber.py @@ -43,7 +43,7 @@ class TestPanel(wxPanel): self.throbbers['autoreverse']['throbber'] = Throbber(self, -1, images, #size=(36, 36), frameDelay = 0.1, - reverse = true) + reverse = True) self.throbbers['autoreverse']['throbber'].sequence.append(0) self.throbbers['label']['throbber'] = Throbber(self, -1, images, #size=(36, 36), @@ -113,7 +113,7 @@ class TestPanel(wxPanel): flag = wxALIGN_CENTER) self.SetSizer(box) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.Layout() sizer.SetSizeHints(self) sizer.Fit(self) diff --git a/wxPython/demo/URLDragAndDrop.py b/wxPython/demo/URLDragAndDrop.py index d8c934ece2..16b3b96006 100644 --- a/wxPython/demo/URLDragAndDrop.py +++ b/wxPython/demo/URLDragAndDrop.py @@ -30,12 +30,12 @@ class TestPanel(wxPanel): def __init__(self, parent, log): wxPanel.__init__(self, parent, -1) - self.SetAutoLayout(true) + self.SetAutoLayout(True) outsideSizer = wxBoxSizer(wxVERTICAL) msg = "Drag-And-Drop of URLs" text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE) - text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false)) + text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) text.SetSize(wxSize(w,h+1)) @@ -44,7 +44,7 @@ class TestPanel(wxPanel): outsideSizer.Add(wxStaticLine(self, -1), 0, wxEXPAND) outsideSizer.Add(20,20) - self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false)) + self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False)) inSizer = wxFlexGridSizer(2, 2, 5, 5) inSizer.AddGrowableCol(0) diff --git a/wxPython/demo/Unicode.py b/wxPython/demo/Unicode.py index 2e654b6efd..c6910a05c4 100644 --- a/wxPython/demo/Unicode.py +++ b/wxPython/demo/Unicode.py @@ -56,7 +56,7 @@ class TestPanel(wxPanel): else: f = self.GetFont() - font = wxFont(14, f.GetFamily(), f.GetStyle(), wxBOLD, false, + font = wxFont(14, f.GetFamily(), f.GetStyle(), wxBOLD, False, f.GetFaceName(), f.GetEncoding()) self.AddLine(box) @@ -79,7 +79,7 @@ class TestPanel(wxPanel): border = wxBoxSizer(wxVERTICAL) border.Add(box, 1, wxEXPAND|wxALL, 10) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(border) diff --git a/wxPython/demo/XMLtreeview.py b/wxPython/demo/XMLtreeview.py index fccf4a3758..d57642958e 100644 --- a/wxPython/demo/XMLtreeview.py +++ b/wxPython/demo/XMLtreeview.py @@ -11,9 +11,9 @@ try: else: from xml.parsers import pyexpat parsermodule = pyexpat - haveXML = true + haveXML = True except ImportError: - haveXML = false + haveXML = False #---------------------------------------------------------------------- diff --git a/wxPython/demo/demoMainLoop.py b/wxPython/demo/demoMainLoop.py index 23067e9329..3d66c2ae4c 100755 --- a/wxPython/demo/demoMainLoop.py +++ b/wxPython/demo/demoMainLoop.py @@ -54,7 +54,7 @@ class MyFrame(wxFrame): def OnCloseWindow(self, event): - app.keepGoing = false + app.keepGoing = False self.Destroy() def OnIdle(self, event): @@ -104,12 +104,12 @@ class MyApp(wxApp): def OnInit(self): frame = MyFrame(None, -1, "This is a test") - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - self.keepGoing = true + self.keepGoing = True - return true + return True app = MyApp(0) diff --git a/wxPython/demo/hangman.py b/wxPython/demo/hangman.py index 73978372ce..f2e09b5bec 100644 --- a/wxPython/demo/hangman.py +++ b/wxPython/demo/hangman.py @@ -292,7 +292,7 @@ class MyFrame(wxFrame): menubar = wxMenuBar() menubar.Append(menu, "Game") menu = wxMenu() - #menu.Append(1010, "Internal", "Use internal dictionary", TRUE) + #menu.Append(1010, "Internal", "Use internal dictionary", True) menu.Append(1011, "ASCII File...") urls = [ 'wxPython home', 'http://wxPython.org/', 'slashdot.org', 'http://slashdot.org/', @@ -349,7 +349,7 @@ class MyFrame(wxFrame): def OnGameDemo(self, event): frame = HangmanDemoFrame(self.wf, self, -1, wxDefaultPosition, self.GetSize()) - frame.Show(TRUE) + frame.Show(True) def OnDictFile(self, event): fd = wxFileDialog(self) @@ -433,8 +433,8 @@ class MyApp(wxApp): wf = WordFetcher(defaultfile) frame = MyFrame(None, wf) self.SetTopWindow(frame) - frame.Show(TRUE) - return TRUE + frame.Show(True) + return True @@ -458,7 +458,7 @@ def runTest(frame, nb, log): wf = WordFetcher(defaultfile) win = MyFrame(frame, wf) frame.otherWin = win - win.Show(true) + win.Show(True) #---------------------------------------------------------------------- diff --git a/wxPython/demo/infoframe.py b/wxPython/demo/infoframe.py index 99507a6547..7f19771460 100644 --- a/wxPython/demo/infoframe.py +++ b/wxPython/demo/infoframe.py @@ -82,14 +82,14 @@ if __name__ == "__main__": outputWindowClass = wxPyInformationalMessagesFrame def OnInit(self): frame = MyFrame(self.stdioWin) - frame.Show(TRUE) + frame.Show(True) self.SetTopWindow(frame) if isinstance(sys.stdout,wxPyInformationalMessagesFrame): sys.stdout.SetParent(frame) #self.redirectStdio(None)# this is done automatically # by the MyApp(1) call below print "Starting.\n", - return true + return True app = MyApp(1) app.MainLoop() diff --git a/wxPython/demo/pyTree.py b/wxPython/demo/pyTree.py index e463fffa10..72cb2ff317 100644 --- a/wxPython/demo/pyTree.py +++ b/wxPython/demo/pyTree.py @@ -78,7 +78,7 @@ class pyTree(wx.wxTreeCtrl): wx.wxTreeCtrl.__init__(self, parent, id) self.root = self.AddRoot(str(root), -1, -1, wx.wxTreeItemData(root)) if dir(root): - self.SetItemHasChildren(self.root, wx.TRUE) + self.SetItemHasChildren(self.root, wx.True) wx.EVT_TREE_ITEM_EXPANDING(self, self.GetId(), self.OnItemExpanding) wx.EVT_TREE_ITEM_COLLAPSED(self, self.GetId(), self.OnItemCollapsed) wx.EVT_TREE_SEL_CHANGED(self, self.GetId(), self.OnSelChanged) @@ -121,7 +121,7 @@ class pyTree(wx.wxTreeCtrl): new_item = self.AppendItem( item, key, -1, -1, wx.wxTreeItemData(new_obj) ) if dir(new_obj): - self.SetItemHasChildren(new_item, wx.TRUE) + self.SetItemHasChildren(new_item, wx.True) def OnItemCollapsed(self, event): """ @@ -205,9 +205,9 @@ if __name__ == '__main__': def OnInit(self): """OnInit. Boring, boring, boring!""" frame = MyFrame() - frame.Show(wx.TRUE) + frame.Show(wx.True) self.SetTopWindow(frame) - return wx.TRUE + return wx.True app = MyApp(0) app.MainLoop() diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py index 13ec8a7e43..fcf5bd9029 100755 --- a/wxPython/demo/run.py +++ b/wxPython/demo/run.py @@ -51,7 +51,7 @@ class RunDemoApp(wxApp): EVT_MENU(self, 101, self.OnButton) menuBar.Append(menu, "&File") frame.SetMenuBar(menuBar) - frame.Show(true) + frame.Show(True) EVT_CLOSE(frame, self.OnCloseFrame) win = self.demoModule.runTest(frame, frame, Log()) @@ -75,17 +75,17 @@ class RunDemoApp(wxApp): # It was probably a dialog or something that is already # gone, so we're done. frame.Destroy() - return true + return True self.SetTopWindow(frame) self.frame = frame #wxLog_SetActiveTarget(wxLogStderr()) #wxLog_SetTraceMask(wxTraceMessages) - return true + return True def OnButton(self, evt): - self.frame.Close(true) + self.frame.Close(True) def OnCloseFrame(self, evt): diff --git a/wxPython/demo/simple.py b/wxPython/demo/simple.py index beed3ee0cd..6b28148228 100644 --- a/wxPython/demo/simple.py +++ b/wxPython/demo/simple.py @@ -33,7 +33,7 @@ class MyFrame(wxFrame): sizer.Add(text, 0, wxALL, 10) sizer.Add(btn, 0, wxALL, 10) panel.SetSizer(sizer) - panel.SetAutoLayout(true) + panel.SetAutoLayout(True) panel.Layout() EVT_BUTTON(self, btn.GetId(), self.OnButton) @@ -46,6 +46,6 @@ class MyFrame(wxFrame): app = wxPySimpleApp() frame = MyFrame(None, "Simple wxPython App") -frame.Show(true) +frame.Show(True) app.MainLoop() diff --git a/wxPython/demo/viewer_basics.py b/wxPython/demo/viewer_basics.py index 1dca97130d..7916c1bce2 100644 --- a/wxPython/demo/viewer_basics.py +++ b/wxPython/demo/viewer_basics.py @@ -59,11 +59,11 @@ class SecondThreadApp(wxApp): catcher = HiddenCatcher() #self.SetTopWindow(catcher) self.catcher =catcher - return true + return True #--------------------------------------------------------------------------- def add_cone(): frame = VtkFrame(None, -1, "Cone") - frame.Show(true) + frame.Show(True) diff --git a/wxPython/demo/wxCalendar.py b/wxPython/demo/wxCalendar.py index 487eeb39c1..5c14011608 100644 --- a/wxPython/demo/wxCalendar.py +++ b/wxPython/demo/wxCalendar.py @@ -75,7 +75,7 @@ class TestPanel(wxPanel): # set attributes of calendar - self.calend.hide_title = TRUE + self.calend.hide_title = True self.calend.HideGrid() self.calend.SetWeekColor('WHITE', 'BLACK') @@ -91,7 +91,7 @@ class TestPanel(wxPanel): mID = NewId() self.scroll = wxScrollBar(self, mID, wxPoint(100, 240), wxSize(200, 20), wxSB_HORIZONTAL) - self.scroll.SetScrollbar(start_month-1, 1, 12, 1, TRUE) + self.scroll.SetScrollbar(start_month-1, 1, 12, 1, True) EVT_COMMAND_SCROLL(self, mID, self.Scroll) # spin control for year selection @@ -147,8 +147,8 @@ class TestPanel(wxPanel): def TestFrame(self, event): frame = CalendFrame(self, -1, "Test Calendar", self.log) - frame.Show(true) - return true + frame.Show(True) + return True # calendar print preview @@ -171,7 +171,7 @@ class TestPanel(wxPanel): name = event.GetString() self.log.WriteText('EvtComboBox: %s\n' % name) monthval = self.date.FindString(name) - self.scroll.SetScrollbar(monthval, 1, 12, 1, TRUE) + self.scroll.SetScrollbar(monthval, 1, 12, 1, True) self.calend.SetMonth(monthval+1) self.ResetDisplay() @@ -366,8 +366,8 @@ class PrintCalend: self.sel_lst = [] # highlighted selected days self.size = None - self.hide_title = FALSE - self.hide_grid = FALSE + self.hide_title = False + self.hide_grid = False self.set_day = None def SetParms(self): @@ -416,7 +416,7 @@ class PrintCalend: frame.Initialize() frame.SetPosition(self.frame.GetPosition()) frame.SetSize(self.frame.GetSize()) - frame.Show(true) + frame.Show(True) def Print(self): pdd = wxPrintDialogData() @@ -438,7 +438,7 @@ class PrintCalend: if self.preview is None: cal.SetPSize(size[0]/self.pagew, size[1]/self.pageh) - cal.SetPreview(FALSE) + cal.SetPreview(False) else: if self.preview == 1: @@ -454,7 +454,7 @@ class PrintCalend: cal.grid_color = self.grid_color cal.high_color = self.high_color cal.back_color = self.back_color - cal.outer_border = FALSE + cal.outer_border = False cal.font = self.font cal.bold = self.bold @@ -534,9 +534,9 @@ class SetPrintout(wxPrintout): def HasPage(self, page): if page <= self.end_pg: - return true + return True else: - return false + return False def GetPageInfo(self): self.end_pg = self.canvas.GetTotalPages() @@ -594,14 +594,14 @@ class SetPrintout(wxPrintout): self.canvas.SetPageSize(self.psizew, self.psizeh) self.canvas.DoDrawing(dc) - return true + return True class MyApp(wxApp): def OnInit(self): frame = CalendFrame(None, -1, "Test Calendar") - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxCheckBox.py b/wxPython/demo/wxCheckBox.py index 45f82e2f48..e2e81e3f28 100644 --- a/wxPython/demo/wxCheckBox.py +++ b/wxPython/demo/wxCheckBox.py @@ -14,7 +14,7 @@ class TestCheckBox(wxPanel): 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) + cb2.SetValue(True) cb3 = wxCheckBox(self, cID+2, " Pears", wxPoint(65, 80), wxSize(150, 20), wxNO_BORDER) EVT_CHECKBOX(self, cID, self.EvtCheckBox) diff --git a/wxPython/demo/wxCheckListBox.py b/wxPython/demo/wxCheckListBox.py index fd88c3b8ef..434ecf2e06 100644 --- a/wxPython/demo/wxCheckListBox.py +++ b/wxPython/demo/wxCheckListBox.py @@ -45,7 +45,7 @@ class TestPanel(wxPanel): item = wxMenuItem(menu, wxNewId(), "If supported, this is bold") df = wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT) nf = wxFont(df.GetPointSize(), df.GetFamily(), df.GetStyle(), wxBOLD, - false, df.GetFaceName()) + False, df.GetFaceName()) item.SetFont(nf) menu.AppendItem(item) diff --git a/wxPython/demo/wxColourDialog.py b/wxPython/demo/wxColourDialog.py index a949731ff1..c4d42aebbf 100644 --- a/wxPython/demo/wxColourDialog.py +++ b/wxPython/demo/wxColourDialog.py @@ -5,7 +5,7 @@ from wxPython.wx import * def runTest(frame, nb, log): dlg = wxColourDialog(frame) - dlg.GetColourData().SetChooseFull(true) + dlg.GetColourData().SetChooseFull(True) if dlg.ShowModal() == wxID_OK: data = dlg.GetColourData() log.WriteText('You selected: %s\n' % str(data.GetColour().Get())) diff --git a/wxPython/demo/wxDialog.py b/wxPython/demo/wxDialog.py index 242e706c05..615539add3 100644 --- a/wxPython/demo/wxDialog.py +++ b/wxPython/demo/wxDialog.py @@ -84,7 +84,7 @@ class TestDialog(wxDialog): sizer.AddSizer(box, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) sizer.Fit(self) diff --git a/wxPython/demo/wxDragImage.py b/wxPython/demo/wxDragImage.py index 9f39debc3f..5fcecb0d53 100644 --- a/wxPython/demo/wxDragImage.py +++ b/wxPython/demo/wxDragImage.py @@ -9,9 +9,9 @@ class DragShape: def __init__(self, bmp): self.bmp = bmp self.pos = wxPoint(0,0) - self.shown = true + self.shown = True self.text = None - self.fullscreen = false + self.fullscreen = False def HitTest(self, pt): @@ -31,11 +31,11 @@ class DragShape: dc.Blit(self.pos.x, self.pos.y, self.bmp.GetWidth(), self.bmp.GetHeight(), - memDC, 0, 0, op, true) + memDC, 0, 0, op, True) - return true + return True else: - return false + return False @@ -58,7 +58,7 @@ class DragCanvas(wxScrolledWindow): bmp = images.getTestStarBitmap() shape = DragShape(bmp) shape.pos = wxPoint(5, 5) - shape.fullscreen = true + shape.fullscreen = True self.shapes.append(shape) @@ -185,7 +185,7 @@ class DragCanvas(wxScrolledWindow): # reposition and draw the shape self.dragShape.pos = self.dragShape.pos + evt.GetPosition() - self.dragStartPos - self.dragShape.shown = true + self.dragShape.shown = True self.dragShape.Draw(dc) self.dragShape = None @@ -207,7 +207,7 @@ class DragCanvas(wxScrolledWindow): # erase the shape since it will be drawn independently now dc = wxClientDC(self) - self.dragShape.shown = false + self.dragShape.shown = False self.EraseShape(self.dragShape, dc) @@ -228,16 +228,16 @@ class DragCanvas(wxScrolledWindow): # if we have shape and image then move it, posibly highlighting another shape. elif self.dragShape and self.dragImage: onShape = self.FindShape(evt.GetPosition()) - unhiliteOld = false - hiliteNew = false + unhiliteOld = False + hiliteNew = False # figure out what to hilite and what to unhilite if self.hiliteShape: if onShape is None or self.hiliteShape is not onShape: - unhiliteOld = true + unhiliteOld = True if onShape and onShape is not self.hiliteShape and onShape.shown: - hiliteNew = TRUE + hiliteNew = True # if needed, hide the drag image so we can update the window if unhiliteOld or hiliteNew: diff --git a/wxPython/demo/wxEditor.py b/wxPython/demo/wxEditor.py index 2ee5c23c6b..0ae5f8f741 100644 --- a/wxPython/demo/wxEditor.py +++ b/wxPython/demo/wxEditor.py @@ -10,7 +10,7 @@ def runTest(frame, nb, log): box = wxBoxSizer(wxVERTICAL) box.Add(ed, 1, wxALL|wxGROW, 1) win.SetSizer(box) - win.SetAutoLayout(true) + win.SetAutoLayout(True) ed.SetText(["", "This is a simple text editor, the class name is", diff --git a/wxPython/demo/wxFileHistory.py b/wxPython/demo/wxFileHistory.py index 8847e2f679..0da510cf4d 100644 --- a/wxPython/demo/wxFileHistory.py +++ b/wxPython/demo/wxFileHistory.py @@ -37,7 +37,7 @@ class TestPanel(wxPanel): box.Add(t, 0, wxCENTER|wxALL, 5) self.SetSizer(box) - self.SetAutoLayout(true) + self.SetAutoLayout(True) # Make a menu self.menu = m = wxMenu() @@ -46,10 +46,10 @@ class TestPanel(wxPanel): m.Append(wxID_CLOSE, "&Close") m.Append(wxID_SAVE, "&Save") m.Append(wxID_SAVEAS, "Save &as...") - m.Enable(wxID_NEW, false) - m.Enable(wxID_CLOSE, false) - m.Enable(wxID_SAVE, false) - m.Enable(wxID_SAVEAS, false) + m.Enable(wxID_NEW, False) + m.Enable(wxID_CLOSE, False) + m.Enable(wxID_SAVE, False) + m.Enable(wxID_SAVEAS, False) # and a file history self.filehistory = wxFileHistory() diff --git a/wxPython/demo/wxFindReplaceDialog.py b/wxPython/demo/wxFindReplaceDialog.py index 8cebeb60a0..c0217aedec 100644 --- a/wxPython/demo/wxFindReplaceDialog.py +++ b/wxPython/demo/wxFindReplaceDialog.py @@ -25,14 +25,14 @@ class TestPanel(wxPanel): data = wxFindReplaceData() dlg = wxFindReplaceDialog(self, data, "Find") dlg.data = data # save a reference to it... - dlg.Show(true) + dlg.Show(True) def OnShowFindReplace(self, evt): data = wxFindReplaceData() dlg = wxFindReplaceDialog(self, data, "Find & Replace", wxFR_REPLACEDIALOG) dlg.data = data # save a reference to it... - dlg.Show(true) + dlg.Show(True) def OnFind(self, evt): diff --git a/wxPython/demo/wxFloatBar.py b/wxPython/demo/wxFloatBar.py index 593e3b0ab8..ff323abe7e 100644 --- a/wxPython/demo/wxFloatBar.py +++ b/wxPython/demo/wxFloatBar.py @@ -70,7 +70,7 @@ class TestFloatBar(wxFrame): def runTest(frame, nb, log): win = TestFloatBar(frame, log) frame.otherWin = win - win.Show(true) + win.Show(True) #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxFontDialog.py b/wxPython/demo/wxFontDialog.py index 1ac5e985e0..e27ad38d74 100644 --- a/wxPython/demo/wxFontDialog.py +++ b/wxPython/demo/wxFontDialog.py @@ -82,7 +82,7 @@ class TestPanel(wxPanel): def OnSelectFont(self, evt): data = wxFontData() - data.EnableEffects(true) + data.EnableEffects(True) data.SetColour(self.curClr) # set colour data.SetInitialFont(self.curFont) diff --git a/wxPython/demo/wxFrame.py b/wxPython/demo/wxFrame.py index 3eac8d119c..428859beec 100644 --- a/wxPython/demo/wxFrame.py +++ b/wxPython/demo/wxFrame.py @@ -16,7 +16,7 @@ class MyFrame(wxFrame): def OnCloseMe(self, event): - self.Close(true) + self.Close(True) def OnCloseWindow(self, event): self.Destroy() @@ -27,7 +27,7 @@ def runTest(frame, nb, log): win = MyFrame(frame, -1, "This is a wxFrame", size=(350, 200), style = wxDEFAULT_FRAME_STYLE)# | wxFRAME_TOOL_WINDOW ) frame.otherWin = win - win.Show(true) + win.Show(True) #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxGLCanvas.py b/wxPython/demo/wxGLCanvas.py index d1e2c025b5..a4d0194cb0 100644 --- a/wxPython/demo/wxGLCanvas.py +++ b/wxPython/demo/wxGLCanvas.py @@ -1,18 +1,18 @@ from wxPython.wx import * try: from wxPython.glcanvas import * - haveGLCanvas = true + haveGLCanvas = True except ImportError: - haveGLCanvas = false + haveGLCanvas = False try: # The Python OpenGL package can be found at # http://PyOpenGL.sourceforge.net/ from OpenGL.GL import * from OpenGL.GLUT import * - haveOpenGL = true + haveOpenGL = True except ImportError: - haveOpenGL = false + haveOpenGL = False #---------------------------------------------------------------------- @@ -62,7 +62,7 @@ else: c.SetSize((200, 200)) box.Add(c, 0, wxALIGN_CENTER|wxALL, 15) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(box) @@ -71,7 +71,7 @@ else: canvasClass = eval(canvasClassName) frame = wxFrame(None, -1, canvasClassName, size=(400,400)) canvas = canvasClass(frame) - frame.Show(true) + frame.Show(True) @@ -85,7 +85,7 @@ else: class MyCanvasBase(wxGLCanvas): def __init__(self, parent): wxGLCanvas.__init__(self, parent, -1) - self.init = false + self.init = False # initial mouse position self.lastx = self.x = 30 self.lasty = self.y = 30 @@ -110,7 +110,7 @@ else: self.SetCurrent() if not self.init: self.InitGL() - self.init = true + self.init = True self.OnDraw() def OnMouseDown(self, evt): @@ -123,7 +123,7 @@ else: if evt.Dragging() and evt.LeftIsDown(): self.x, self.y = self.lastx, self.lasty self.x, self.y = evt.GetPosition() - self.Refresh(false) + self.Refresh(False) @@ -268,9 +268,9 @@ def _test(): frame = wxFrame(None, -1, "GL Demos", wxDefaultPosition, wxSize(600,300)) #win = ConeCanvas(frame) MySplitter(frame) - frame.Show(TRUE) + frame.Show(True) self.SetTopWindow(frame) - return TRUE + return True app = MyApp(0) app.MainLoop() diff --git a/wxPython/demo/wxGenericDirCtrl.py b/wxPython/demo/wxGenericDirCtrl.py index 6799b1f93f..7f338e67df 100644 --- a/wxPython/demo/wxGenericDirCtrl.py +++ b/wxPython/demo/wxGenericDirCtrl.py @@ -37,7 +37,7 @@ class TestPanel(wxPanel): sz.AddGrowableCol(1) sz.AddGrowableCol(2) self.SetSizer(sz) - self.SetAutoLayout(true) + self.SetAutoLayout(True) #---------------------------------------------------------------------- diff --git a/wxPython/demo/wxGrid.py b/wxPython/demo/wxGrid.py index 47b3b0eb75..365e0125e6 100644 --- a/wxPython/demo/wxGrid.py +++ b/wxPython/demo/wxGrid.py @@ -29,7 +29,7 @@ class ButtonPanel(wxPanel): box.Add(btn, 0, wxALIGN_CENTER|wxALL, 15) EVT_BUTTON(self, k, self.OnButton) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(box) @@ -37,7 +37,7 @@ class ButtonPanel(wxPanel): modName = buttonDefs[evt.GetId()][0] module = __import__(modName) frame = module.TestFrame(None, self.log) - frame.Show(true) + frame.Show(True) #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxHtmlWindow.py b/wxPython/demo/wxHtmlWindow.py index 1e3146396b..dc87749b14 100644 --- a/wxPython/demo/wxHtmlWindow.py +++ b/wxPython/demo/wxHtmlWindow.py @@ -52,9 +52,9 @@ class MyHtmlFilter(wxHtmlFilter): # This method decides if this filter is able to read the file def CanRead(self, fsfile): self.log.write("CanRead: %s\n" % fsfile.GetMimeType()) - return FALSE + return False - # If CanRead returns true then this method is called to actually + # If CanRead returns True then this method is called to actually # read the file and return the contents. def ReadFile(self, fsfile): return "" @@ -114,7 +114,7 @@ class TestHtmlPanel(wxPanel): self.box.Add(subbox, 0, wxGROW) self.SetSizer(self.box) - self.SetAutoLayout(true) + self.SetAutoLayout(True) # A button with this ID is created on the widget test page. EVT_BUTTON(self, wxID_OK, self.OnOk) diff --git a/wxPython/demo/wxIEHtmlWin.py b/wxPython/demo/wxIEHtmlWin.py index dd9cb4479b..1604da40cc 100644 --- a/wxPython/demo/wxIEHtmlWin.py +++ b/wxPython/demo/wxIEHtmlWin.py @@ -68,7 +68,7 @@ class TestPanel(wxWindow): self.location.Append(self.current) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) EVT_SIZE(self, self.OnSize) # Hook up the event handlers for the IE window diff --git a/wxPython/demo/wxIntCtrl.py b/wxPython/demo/wxIntCtrl.py index 8adcb0e307..fb1bcb5ff0 100644 --- a/wxPython/demo/wxIntCtrl.py +++ b/wxPython/demo/wxIntCtrl.py @@ -12,11 +12,11 @@ class TestPanel( wxPanel ): self.set_min = wxCheckBox( panel, -1, "Set minimum value:" ) self.min = wxIntCtrl( panel, size=wxSize( 50, -1 ) ) - self.min.Enable( FALSE ) + self.min.Enable( False ) self.set_max = wxCheckBox( panel, -1, "Set maximum value:" ) self.max = wxIntCtrl( panel, size=wxSize( 50, -1 ) ) - self.max.Enable( FALSE ) + self.max.Enable( False ) self.limit_target = wxCheckBox( panel, -1, "Limit control" ) self.allow_none = wxCheckBox( panel, -1, "Allow empty control" ) @@ -48,7 +48,7 @@ class TestPanel( wxPanel ): outer_box = wxBoxSizer( wxVERTICAL ) outer_box.AddSizer( grid, 0, wxALIGN_CENTRE|wxALL, 20 ) - panel.SetAutoLayout( true ) + panel.SetAutoLayout( True ) panel.SetSizer( outer_box ) outer_box.Fit( panel ) panel.Move( (50,50) ) @@ -169,7 +169,7 @@ Here's the API for wxIntCtrl:
limited
Boolean indicating whether the control prevents values from exceeding the currently set minimum and maximum values (bounds). - If false and bounds are set, out-of-bounds values will + If False and bounds are set, out-of-bounds values will be colored with the current out-of-bounds color.
allow_none @@ -178,7 +178,7 @@ Here's the API for wxIntCtrl:
allow_long
Boolean indicating whether or not the control is allowed to hold - and return a value of type long as well as int. If false, the + and return a value of type long as well as int. If False, the control will be implicitly limited to have a value such that -sys.maxint-1 <= n <= sys.maxint.
@@ -255,7 +255,7 @@ It will return None if no upper bound is currently specified.
SetBounds(min=None,max=None)
This function is a convenience function for setting the min and max values at the same time. The function only applies the maximum bound -if setting the minimum bound is successful, and returns true +if setting the minimum bound is successful, and returns True only if both operations succeed. Note: leaving out an argument will remove the corresponding bound.
GetBounds() @@ -265,14 +265,14 @@ that bound is not set.

IsInBounds(value=None) -
Returns true if no value is specified and the current value +
Returns True if no value is specified and the current value of the control falls within the current bounds. This function can also be called with a value to see if that value would fall within the current bounds of the given control.

SetLimited(bool) -
If called with a value of true, this function will cause the control +
If called with a value of True, this function will cause the control to limit the value to fall within the bounds currently specified. If the control's value currently exceeds the bounds, it will then be limited accordingly. @@ -280,31 +280,31 @@ If called with a value of 0, this function will disable value limiting, but coloring of out-of-bounds values will still take place if bounds have been set for the control.
IsLimited() -
Returns true if the control is currently limiting the +
Returns True if the control is currently limiting the value to fall within the current bounds.

SetNoneAllowed(bool) -
If called with a value of true, this function will cause the control +
If called with a value of True, this function will cause the control to allow the value to be empty, representing a value of None. If called with a value of fakse, this function will prevent the value from being None. If the value of the control is currently None, ie. the control is empty, then the value will be changed to that of the lower bound of the control, or 0 if no lower bound is set.
IsNoneAllowed() -
Returns true if the control currently allows its +
Returns True if the control currently allows its value to be None.

SetLongAllowed(bool) -
If called with a value of true, this function will cause the +
If called with a value of True, this function will cause the control to allow the value to be a long. If called with a value -of false, and the value of the control is currently a long value, +of False, and the value of the control is currently a long value, the value of the control will be adjusted to fall within the size of an integer type, at either the sys.maxint or -sys.maxint-1, for positive and negative values, respectively.
IsLongAllowed() -
Returns true if the control currently allows its +
Returns True if the control currently allows its value to be of type long.

diff --git a/wxPython/demo/wxJoystick.py b/wxPython/demo/wxJoystick.py index 2e13d81010..1c4882f40e 100644 --- a/wxPython/demo/wxJoystick.py +++ b/wxPython/demo/wxJoystick.py @@ -11,7 +11,7 @@ class JoystickTestPanel(wxPanel): style = wxTAB_TRAVERSAL ): wxPanel.__init__(self, parent, id, pos, size, style) - MakeJoystickTestPanel( self, true ) + MakeJoystickTestPanel( self, True ) try: self.stick = wxJoystick() diff --git a/wxPython/demo/wxKeyEvents.py b/wxPython/demo/wxKeyEvents.py index e7574a702a..7e214089f5 100644 --- a/wxPython/demo/wxKeyEvents.py +++ b/wxPython/demo/wxKeyEvents.py @@ -120,11 +120,11 @@ class KeySink(wxWindow): #| wxSUNKEN_BORDER ) self.SetBackgroundColour(wxBLUE) - self.haveFocus = false - self.callSkip = false - self.logKeyDn = true - self.logKeyUp = true - self.logChar = true + self.haveFocus = False + self.callSkip = False + self.logKeyDn = True + self.logKeyUp = True + self.logChar = True EVT_PAINT(self, self.OnPaint) EVT_SET_FOCUS(self, self.OnSetFocus) @@ -164,11 +164,11 @@ class KeySink(wxWindow): def OnSetFocus(self, evt): - self.haveFocus = true + self.haveFocus = True self.Refresh() def OnKillFocus(self, evt): - self.haveFocus = false + self.haveFocus = False self.Refresh() def OnMouse(self, evt): @@ -277,15 +277,15 @@ class TestPanel(wxPanel): cb2 = wxCheckBox(self, -1, "EVT_KEY_UP") EVT_CHECKBOX(self, cb2.GetId(), self.OnKeyUpCB) - cb2.SetValue(true) + cb2.SetValue(True) cb3 = wxCheckBox(self, -1, "EVT_KEY_DOWN") EVT_CHECKBOX(self, cb3.GetId(), self.OnKeyDnCB) - cb3.SetValue(true) + cb3.SetValue(True) cb4 = wxCheckBox(self, -1, "EVT_CHAR") EVT_CHECKBOX(self, cb4.GetId(), self.OnCharCB) - cb4.SetValue(true) + cb4.SetValue(True) buttons = wxBoxSizer(wxHORIZONTAL) buttons.Add(btn, 0, wxALL, 4) diff --git a/wxPython/demo/wxLEDNumberCtrl.py b/wxPython/demo/wxLEDNumberCtrl.py index 22be241dbb..d8907a35c1 100644 --- a/wxPython/demo/wxLEDNumberCtrl.py +++ b/wxPython/demo/wxLEDNumberCtrl.py @@ -17,7 +17,7 @@ class TestPanel(wxPanel): led = wxLEDNumberCtrl(self, -1, (25,100), (280, 50)) led.SetValue("56789") led.SetAlignment(wxLED_ALIGN_RIGHT) - led.SetDrawFaded(false) + led.SetDrawFaded(False) led = wxLEDNumberCtrl(self, -1, (25,175), (280, 50), wxLED_ALIGN_CENTER)# | wxLED_DRAW_FADED) diff --git a/wxPython/demo/wxLayoutConstraints.py b/wxPython/demo/wxLayoutConstraints.py index 8e63a12af2..4ffa033924 100644 --- a/wxPython/demo/wxLayoutConstraints.py +++ b/wxPython/demo/wxLayoutConstraints.py @@ -6,7 +6,7 @@ from wxPython.wx import * class TestLayoutConstraints(wxPanel): def __init__(self, parent): wxPanel.__init__(self, parent, -1) - self.SetAutoLayout(true) + self.SetAutoLayout(True) EVT_BUTTON(self, 100, self.OnButton) self.SetBackgroundColour(wxNamedColour("MEDIUM ORCHID")) diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py index cf101ff08d..bac73eb031 100644 --- a/wxPython/demo/wxListCtrl.py +++ b/wxPython/demo/wxListCtrl.py @@ -109,7 +109,7 @@ class TestListCtrlPanel(wxPanel, wxColumnSorterMixin): # see wxPython/lib/mixins/listctrl.py self.itemDataMap = musicdata wxColumnSorterMixin.__init__(self, 3) - #self.SortListItems(0, true) + #self.SortListItems(0, True) EVT_SIZE(self, self.OnSize) EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected) diff --git a/wxPython/demo/wxMDIWindows.py b/wxPython/demo/wxMDIWindows.py index 91d7a55eb0..7eef8a39c9 100644 --- a/wxPython/demo/wxMDIWindows.py +++ b/wxPython/demo/wxMDIWindows.py @@ -18,7 +18,7 @@ class TestPanel(wxPanel): box.Add(20, 30) box.Add(b1, 0, wxALIGN_CENTER|wxALL, 15) box.Add(b2, 0, wxALIGN_CENTER|wxALL, 15) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(box) diff --git a/wxPython/demo/wxMVCTree.py b/wxPython/demo/wxMVCTree.py index af7760cb9d..808f8870b3 100644 --- a/wxPython/demo/wxMVCTree.py +++ b/wxPython/demo/wxMVCTree.py @@ -29,11 +29,11 @@ def runTest(frame, nb, log): p = wxMVCTree(nb, -1) #f = wxFrame(frame, -1, "wxMVCTree") #p = wxMVCTree(f, -1) - p.SetAssumeChildren(true) + p.SetAssumeChildren(True) p.SetModel(LateFSTreeModel(os.path.normpath(os.getcwd() + os.sep +'..'))) #Uncomment this to enable live filename editing! # p.AddEditor(FileEditor(p)) - p.SetMultiSelect(true) + p.SetMultiSelect(True) EVT_MVCTREE_SEL_CHANGING(p, p.GetId(), selchanging) EVT_MVCTREE_SEL_CHANGED(p, p.GetId(), selchanged) EVT_MVCTREE_ITEM_EXPANDED(p, p.GetId(), expanded) @@ -44,7 +44,7 @@ def runTest(frame, nb, log): return p #frame.otherWin = f - #f.Show(true) + #f.Show(True) #return None diff --git a/wxPython/demo/wxMask.py b/wxPython/demo/wxMask.py index d6680f096c..68b8468a86 100644 --- a/wxPython/demo/wxMask.py +++ b/wxPython/demo/wxMask.py @@ -86,7 +86,7 @@ class TestMaskWindow(wxScrolledWindow): x,y = 120+150*(i%4), 20+100*(i/4) dc.DrawText(text, x, y-20) mdc.SelectObject(self.bmp_withcolourmask) - dc.Blit(x,y, cx,cy, mdc, 0,0, code, true) + dc.Blit(x,y, cx,cy, mdc, 0,0, code, True) i = i + 1 diff --git a/wxPython/demo/wxMenu.py b/wxPython/demo/wxMenu.py index 7727303dbe..bdbf93489b 100644 --- a/wxPython/demo/wxMenu.py +++ b/wxPython/demo/wxMenu.py @@ -151,7 +151,7 @@ check the source for this sample to see how to implement them. def runTest(frame, nb, log): win = MyFrame(frame, -1, log) frame.otherWin = win - win.Show(true) + win.Show(True) #------------------------------------------------------------------- diff --git a/wxPython/demo/wxMimeTypesManager.py b/wxPython/demo/wxMimeTypesManager.py index 5768ba2592..39ba2074dc 100644 --- a/wxPython/demo/wxMimeTypesManager.py +++ b/wxPython/demo/wxMimeTypesManager.py @@ -14,7 +14,7 @@ class MimeTypesTestPanel(wxPanel): style = wxTAB_TRAVERSAL ): wxPanel.__init__(self, parent, id, pos, size, style) - MakeMimeTypesTestPanel( self, true ) + MakeMimeTypesTestPanel( self, True ) # WDR: handler declarations for MimeTypesTestPanel EVT_LISTBOX(self, ID_LISTBOX, self.OnListbox) @@ -34,8 +34,8 @@ class MimeTypesTestPanel(wxPanel): def OnListbox(self, event): mimetype = event.GetString() self.GetInputText().SetValue(mimetype) - self.GetMimeBtn().SetValue(TRUE) - self.GetExtensionBtn().SetValue(FALSE) + self.GetMimeBtn().SetValue(True) + self.GetExtensionBtn().SetValue(False) self.OnLookup() diff --git a/wxPython/demo/wxMiniFrame.py b/wxPython/demo/wxMiniFrame.py index 9d9785c67b..fd7c6c7f45 100644 --- a/wxPython/demo/wxMiniFrame.py +++ b/wxPython/demo/wxMiniFrame.py @@ -14,7 +14,7 @@ class MyMiniFrame(wxMiniFrame): EVT_CLOSE(self, self.OnCloseWindow) def OnCloseMe(self, event): - self.Close(true) + self.Close(True) def OnCloseWindow(self, event): print "OnCloseWindow" @@ -29,7 +29,7 @@ def runTest(frame, nb, log): win.SetSize((200, 200)) win.CenterOnParent(wxBOTH) frame.otherWin = win - win.Show(true) + win.Show(True) #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxOGL.py b/wxPython/demo/wxOGL.py index b2682636a4..17f0015899 100644 --- a/wxPython/demo/wxOGL.py +++ b/wxPython/demo/wxOGL.py @@ -112,10 +112,10 @@ class MyEvtHandler(wxShapeEvtHandler): canvas.PrepareDC(dc) if shape.Selected(): - shape.Select(false, dc) + shape.Select(False, dc) canvas.Redraw(dc) else: - redraw = false + redraw = False shapeList = canvas.GetDiagram().GetShapeList() toUnselect = [] for s in shapeList: @@ -125,11 +125,11 @@ class MyEvtHandler(wxShapeEvtHandler): # shapes too!) and bad things will happen... toUnselect.append(s) - shape.Select(true, dc) + shape.Select(True, dc) if toUnselect: for s in toUnselect: - s.Select(false, dc) + s.Select(False, dc) canvas.Redraw(dc) self.UpdateStatusBar(shape) @@ -209,7 +209,7 @@ class TestWindow(wxShapeCanvas): line.MakeLineControlPoints(2) fromShape.AddLine(line, toShape) self.diagram.AddShape(line) - line.Show(true) + line.Show(True) # for some reason, the shapes have to be moved for the line to show up... fromShape.Move(dc, fromShape.GetX(), fromShape.GetY()) @@ -218,7 +218,7 @@ class TestWindow(wxShapeCanvas): def MyAddShape(self, shape, x, y, pen, brush, text): - shape.SetDraggable(true, true) + shape.SetDraggable(True, True) shape.SetCanvas(self) shape.SetX(x) shape.SetY(y) @@ -227,7 +227,7 @@ class TestWindow(wxShapeCanvas): if text: shape.AddText(text) #shape.SetShadowMode(SHADOW_RIGHT) self.diagram.AddShape(shape) - shape.Show(true) + shape.Show(True) evthandler = MyEvtHandler(self.log, self.frame) evthandler.SetShape(shape) diff --git a/wxPython/demo/wxPopupControl.py b/wxPython/demo/wxPopupControl.py index e05a7800a1..b3b7ad2b7d 100644 --- a/wxPython/demo/wxPopupControl.py +++ b/wxPython/demo/wxPopupControl.py @@ -38,7 +38,7 @@ class TestDateControl(wxPopupControl): # the calendar control txtValue = self.GetValue() dmy = txtValue.split('/') - didSet = false + didSet = False if len(dmy) == 3: date = self.cal.GetDate() d = int(dmy[0]) @@ -48,7 +48,7 @@ class TestDateControl(wxPopupControl): if m >= 0 and m < 12: if y > 1000: self.cal.SetDate(wxDateTimeFromDMY(d,m,y)) - didSet = true + didSet = True if not didSet: self.cal.SetDate(wxDateTime_Today()) diff --git a/wxPython/demo/wxPopupWindow.py b/wxPython/demo/wxPopupWindow.py index 014e21c8a2..0ee3df748c 100644 --- a/wxPython/demo/wxPopupWindow.py +++ b/wxPython/demo/wxPopupWindow.py @@ -55,7 +55,7 @@ class TestPopup(wxPopupWindow): self.ReleaseMouse() def OnRightUp(self, evt): - self.Show(false) + self.Show(False) self.Destroy() @@ -80,7 +80,7 @@ class TestTransientPopup(wxPopupTransientWindow): def ProcessLeftDown(self, evt): self.log.write("ProcessLeftDown\n") - return false + return False def OnDismiss(self): self.log.write("OnDismiss\n") @@ -113,7 +113,7 @@ class TestPanel(wxPanel): sz = btn.GetSize() win.Position(pos, (0, sz.height)) - win.Show(true) + win.Show(True) def OnShowPopupTransient(self, evt): @@ -139,7 +139,7 @@ class TestPanel(wxPanel): sz = btn.GetSize() win.Position(pos, (0, sz.height)) - win.Show(true) + win.Show(True) class TestPopupWithListbox(wxPopupWindow): def __init__(self, parent, style, log): diff --git a/wxPython/demo/wxPrintDialog.py b/wxPython/demo/wxPrintDialog.py index 50da750bd2..183cbe801c 100644 --- a/wxPython/demo/wxPrintDialog.py +++ b/wxPython/demo/wxPrintDialog.py @@ -5,9 +5,9 @@ from wxPython.wx import * def runTest(frame, nb, log): data = wxPrintDialogData() - data.EnablePrintToFile(true) - data.EnablePageNumbers(true) - data.EnableSelection(true) + data.EnablePrintToFile(True) + data.EnablePageNumbers(True) + data.EnableSelection(True) dlg = wxPrintDialog(frame, data) if dlg.ShowModal() == wxID_OK: log.WriteText('\n') diff --git a/wxPython/demo/wxProcess.py b/wxPython/demo/wxProcess.py index 9555e07948..d8104e5e75 100644 --- a/wxPython/demo/wxProcess.py +++ b/wxPython/demo/wxProcess.py @@ -27,9 +27,9 @@ class TestPanel(wxPanel): self.inp = wxTextCtrl(self, -1, '', style=wxTE_PROCESS_ENTER) self.sndBtn = wxButton(self, -1, 'Send') self.termBtn = wxButton(self, -1, 'Close Stream') - self.inp.Enable(false) - self.sndBtn.Enable(false) - self.termBtn.Enable(false) + self.inp.Enable(False) + self.sndBtn.Enable(False) + self.termBtn.Enable(False) # Hook up the events EVT_BUTTON(self, self.exBtn.GetId(), self.OnExecuteBtn) @@ -55,7 +55,7 @@ class TestPanel(wxPanel): sizer.Add(box2, 0, wxEXPAND|wxALL, 10) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) def __del__(self): @@ -73,11 +73,11 @@ class TestPanel(wxPanel): pid = wxExecute(cmd, wxEXEC_ASYNC, self.process) self.log.write('OnExecuteBtn: "%s" pid: %s\n' % (cmd, pid)) - self.inp.Enable(true) - self.sndBtn.Enable(true) - self.termBtn.Enable(true) - self.cmd.Enable(false) - self.exBtn.Enable(false) + self.inp.Enable(True) + self.sndBtn.Enable(True) + self.termBtn.Enable(True) + self.cmd.Enable(False) + self.exBtn.Enable(False) self.inp.SetFocus() @@ -115,11 +115,11 @@ class TestPanel(wxPanel): self.process.Destroy() self.process = None - self.inp.Enable(false) - self.sndBtn.Enable(false) - self.termBtn.Enable(false) - self.cmd.Enable(true) - self.exBtn.Enable(true) + self.inp.Enable(False) + self.sndBtn.Enable(False) + self.termBtn.Enable(False) + self.cmd.Enable(True) + self.exBtn.Enable(True) #---------------------------------------------------------------------- diff --git a/wxPython/demo/wxProgressDialog.py b/wxPython/demo/wxProgressDialog.py index 7e097c0150..09f6c08b56 100644 --- a/wxPython/demo/wxProgressDialog.py +++ b/wxPython/demo/wxProgressDialog.py @@ -11,7 +11,7 @@ def runTest(frame, nb, log): frame, wxPD_CAN_ABORT | wxPD_APP_MODAL) - keepGoing = true + keepGoing = True count = 0 while keepGoing and count < max: count = count + 1 diff --git a/wxPython/demo/wxPyColourChooser.py b/wxPython/demo/wxPyColourChooser.py index c6ae7051bc..c213042aa3 100644 --- a/wxPython/demo/wxPyColourChooser.py +++ b/wxPython/demo/wxPyColourChooser.py @@ -12,7 +12,7 @@ class TestColourChooser(wxPanel): sizer = wxBoxSizer(wxVERTICAL) sizer.Add(chooser, 0, wxALL, 25) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) #--------------------------------------------------------------- diff --git a/wxPython/demo/wxRadioButton.py b/wxPython/demo/wxRadioButton.py index e9a3d23941..2993cec800 100644 --- a/wxPython/demo/wxRadioButton.py +++ b/wxPython/demo/wxRadioButton.py @@ -67,7 +67,7 @@ class TestPanel( wxPanel ): for radio, text in self.group1_ctrls + self.group2_ctrls: radio.SetValue(0) - text.Enable(FALSE) + text.Enable(False) def OnGroup1Select( self, event ): @@ -75,18 +75,18 @@ class TestPanel( wxPanel ): self.log.write('Group1 %s selected\n' % radio_selected.GetLabel() ) for radio, text in self.group1_ctrls: if radio is radio_selected: - text.Enable(TRUE) + text.Enable(True) else: - text.Enable(FALSE) + text.Enable(False) def OnGroup2Select( self, event ): radio_selected = event.GetEventObject() self.log.write('Group2 %s selected\n' % radio_selected.GetLabel() ) for radio, text in self.group2_ctrls: if radio is radio_selected: - text.Enable(TRUE) + text.Enable(True) else: - text.Enable(FALSE) + text.Enable(False) #---------------------------------------------------------------------- diff --git a/wxPython/demo/wxRightTextCtrl.py b/wxPython/demo/wxRightTextCtrl.py index c6ef3b9d2f..7fe10cef6f 100644 --- a/wxPython/demo/wxRightTextCtrl.py +++ b/wxPython/demo/wxRightTextCtrl.py @@ -33,7 +33,7 @@ class TestPanel(wxPanel): sizer.Add(fgs, 0, wxALL, 25) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) diff --git a/wxPython/demo/wxSashWindow.py b/wxPython/demo/wxSashWindow.py index be6a46d7c5..a8b472c2c1 100644 --- a/wxPython/demo/wxSashWindow.py +++ b/wxPython/demo/wxSashWindow.py @@ -31,7 +31,7 @@ class TestSashWindow(wxPanel): win.SetOrientation(wxLAYOUT_HORIZONTAL) win.SetAlignment(wxLAYOUT_TOP) win.SetBackgroundColour(wxColour(255, 0, 0)) - win.SetSashVisible(wxSASH_BOTTOM, true) + win.SetSashVisible(wxSASH_BOTTOM, True) self.topWindow = win @@ -44,7 +44,7 @@ class TestSashWindow(wxPanel): win.SetOrientation(wxLAYOUT_HORIZONTAL) win.SetAlignment(wxLAYOUT_BOTTOM) win.SetBackgroundColour(wxColour(0, 0, 255)) - win.SetSashVisible(wxSASH_TOP, true) + win.SetSashVisible(wxSASH_TOP, True) self.bottomWindow = win @@ -57,7 +57,7 @@ class TestSashWindow(wxPanel): win.SetOrientation(wxLAYOUT_VERTICAL) win.SetAlignment(wxLAYOUT_LEFT) win.SetBackgroundColour(wxColour(0, 255, 0)) - win.SetSashVisible(wxSASH_RIGHT, TRUE) + win.SetSashVisible(wxSASH_RIGHT, True) win.SetExtraBorderSize(10) textWindow = wxTextCtrl(win, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxSUNKEN_BORDER) @@ -74,7 +74,7 @@ class TestSashWindow(wxPanel): win.SetOrientation(wxLAYOUT_VERTICAL) win.SetAlignment(wxLAYOUT_LEFT) win.SetBackgroundColour(wxColour(0, 255, 255)) - win.SetSashVisible(wxSASH_RIGHT, TRUE) + win.SetSashVisible(wxSASH_RIGHT, True) self.leftWindow2 = win diff --git a/wxPython/demo/wxScrolledWindow.py b/wxPython/demo/wxScrolledWindow.py index 9b2b9b26ba..53d8b4a130 100644 --- a/wxPython/demo/wxScrolledWindow.py +++ b/wxPython/demo/wxScrolledWindow.py @@ -16,7 +16,7 @@ class MyCanvas(wxScrolledWindow): self.maxHeight = 1000 self.x = self.y = 0 self.curLine = [] - self.drawing = false + self.drawing = False self.SetBackgroundColour("WHITE") self.SetCursor(wxStockCursor(wxCURSOR_PENCIL)) @@ -88,7 +88,7 @@ class MyCanvas(wxScrolledWindow): dc.SetPen(wxGREEN_PEN) dc.DrawSpline(lst+[(100,100)]) - dc.DrawBitmap(self.bmp, 200, 20, true) + dc.DrawBitmap(self.bmp, 200, 20, True) dc.SetTextForeground(wxColour(0, 0xFF, 0x80)) dc.DrawText("a bitmap", 200, 85) @@ -153,7 +153,7 @@ class MyCanvas(wxScrolledWindow): self.SetXY(event) self.curLine = [] self.CaptureMouse() - self.drawing = true + self.drawing = True elif event.Dragging() and self.drawing: if BUFFERED: @@ -179,7 +179,7 @@ class MyCanvas(wxScrolledWindow): self.lines.append(self.curLine) self.curLine = [] self.ReleaseMouse() - self.drawing = false + self.drawing = False ## This is an example of what to do for the EVT_MOUSEWHEEL event, diff --git a/wxPython/demo/wxSpinCtrl.py b/wxPython/demo/wxSpinCtrl.py index 65683bd9e6..164397d1a0 100644 --- a/wxPython/demo/wxSpinCtrl.py +++ b/wxPython/demo/wxSpinCtrl.py @@ -15,7 +15,7 @@ class TestPanel(wxPanel): sc = wxSpinCtrl(self, -1, "", wxPoint(30, 50), wxSize(80, -1)) sc.SetRange(1,100) sc.SetValue(5) - #sc.Enable(false) + #sc.Enable(False) #---------------------------------------------------------------------- diff --git a/wxPython/demo/wxStaticText.py b/wxPython/demo/wxStaticText.py index 3b0a5ec74c..f143ddb5cb 100644 --- a/wxPython/demo/wxStaticText.py +++ b/wxPython/demo/wxStaticText.py @@ -24,7 +24,7 @@ class TestPanel(wxPanel): str = "This is a different font." text = wxStaticText(self, -1, str, (20, 100)) - font = wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial") + font = wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, False, "Arial") w, h, d, e = self.GetFullTextExtent(str, font) text.SetFont(font) text.SetSize(wxSize(w, h)) diff --git a/wxPython/demo/wxStatusBar.py b/wxPython/demo/wxStatusBar.py index 1c9b45655f..d7241a1b5b 100644 --- a/wxPython/demo/wxStatusBar.py +++ b/wxPython/demo/wxStatusBar.py @@ -10,7 +10,7 @@ class CustomStatusBar(wxStatusBar): wxStatusBar.__init__(self, parent, -1) self.SetFieldsCount(3) self.log = log - self.sizeChanged = false + self.sizeChanged = False EVT_SIZE(self, self.OnSize) EVT_IDLE(self, self.OnIdle) @@ -18,7 +18,7 @@ class CustomStatusBar(wxStatusBar): self.cb = wxCheckBox(self, 1001, "toggle clock") EVT_CHECKBOX(self, 1001, self.OnToggleClock) - self.cb.SetValue(true) + self.cb.SetValue(True) # set the initial position of the checkbox self.Reposition() @@ -52,7 +52,7 @@ class CustomStatusBar(wxStatusBar): # Set a flag so the idle time handler will also do the repositioning. # It is done this way to get around a buglet where GetFieldRect is not # accurate during the EVT_SIZE resulting from a frame maximize. - self.sizeChanged = true + self.sizeChanged = True def OnIdle(self, evt): @@ -65,7 +65,7 @@ class CustomStatusBar(wxStatusBar): rect = self.GetFieldRect(1) self.cb.SetPosition(wxPoint(rect.x+2, rect.y+2)) self.cb.SetSize(wxSize(rect.width-4, rect.height-4)) - self.sizeChanged = false + self.sizeChanged = False @@ -91,7 +91,7 @@ class TestCustomStatusBar(wxFrame): def runTest(frame, nb, log): win = TestCustomStatusBar(frame, log) frame.otherWin = win - win.Show(true) + win.Show(True) #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxStyledTextCtrl_1.py b/wxPython/demo/wxStyledTextCtrl_1.py index 83530d2ece..d23c1a6636 100644 --- a/wxPython/demo/wxStyledTextCtrl_1.py +++ b/wxPython/demo/wxStyledTextCtrl_1.py @@ -74,7 +74,7 @@ class MySTC(wxStyledTextCtrl): % (evt.GetDragAllowMove(), evt.GetDragText())) if debug and evt.GetPosition() < 250: - evt.SetDragAllowMove(false) # you can prevent moving of text (only copy) + evt.SetDragAllowMove(False) # you can prevent moving of text (only copy) evt.SetDragText("DRAGGED TEXT") # you can change what is dragged #evt.SetDragText("") # or prevent the drag with empty text @@ -159,13 +159,13 @@ def runTest(frame, nb, log): s = wxBoxSizer(wxHORIZONTAL) s.Add(ed, 1, wxEXPAND) p.SetSizer(s) - p.SetAutoLayout(true) + p.SetAutoLayout(True) - #ed.SetBufferedDraw(false) + #ed.SetBufferedDraw(False) #ed.StyleClearAll() #ed.SetScrollWidth(800) - #ed.SetWrapMode(true) + #ed.SetWrapMode(True) ed.SetText(demoText) if wxUSE_UNICODE: diff --git a/wxPython/demo/wxStyledTextCtrl_2.py b/wxPython/demo/wxStyledTextCtrl_2.py index 1b0eabb37e..516383f50f 100644 --- a/wxPython/demo/wxStyledTextCtrl_2.py +++ b/wxPython/demo/wxStyledTextCtrl_2.py @@ -51,8 +51,8 @@ class PythonSTC(wxStyledTextCtrl): self.SetProperty("tab.timmy.whinge.level", "1") self.SetMargins(0,0) - self.SetViewWhiteSpace(false) - #self.SetBufferedDraw(false) + self.SetViewWhiteSpace(False) + #self.SetBufferedDraw(False) self.SetEdgeMode(wxSTC_EDGE_BACKGROUND) self.SetEdgeColumn(78) @@ -61,7 +61,7 @@ class PythonSTC(wxStyledTextCtrl): #self.SetFoldFlags(16) ### WHAT IS THIS VALUE? WHAT ARE THE OTHER FLAGS? DOES IT MATTER? self.SetMarginType(2, wxSTC_MARGIN_SYMBOL) self.SetMarginMask(2, wxSTC_MASK_FOLDERS) - self.SetMarginSensitive(2, true) + self.SetMarginSensitive(2, True) self.SetMarginWidth(2, 12) if 0: # simple folder marks, like the old version @@ -165,7 +165,7 @@ class PythonSTC(wxStyledTextCtrl): kw.append("this_is_a_much_much_much_much_much_much_much_longer_value") kw.sort() # Python sorts are case sensitive - self.AutoCompSetIgnoreCase(false) # so this needs to match + self.AutoCompSetIgnoreCase(False) # so this needs to match self.AutoCompShow(0, " ".join(kw)) else: @@ -201,9 +201,9 @@ class PythonSTC(wxStyledTextCtrl): else: self.BraceHighlight(braceAtCaret, braceOpposite) #pt = self.PointFromPosition(braceOpposite) - #self.Refresh(true, wxRect(pt.x, pt.y, 5,5)) + #self.Refresh(True, wxRect(pt.x, pt.y, 5,5)) #print pt - #self.Refresh(false) + #self.Refresh(False) def OnMarginClick(self, evt): @@ -215,22 +215,22 @@ class PythonSTC(wxStyledTextCtrl): lineClicked = self.LineFromPosition(evt.GetPosition()) if self.GetFoldLevel(lineClicked) & wxSTC_FOLDLEVELHEADERFLAG: if evt.GetShift(): - self.SetFoldExpanded(lineClicked, true) - self.Expand(lineClicked, true, true, 1) + self.SetFoldExpanded(lineClicked, True) + self.Expand(lineClicked, True, True, 1) elif evt.GetControl(): if self.GetFoldExpanded(lineClicked): - self.SetFoldExpanded(lineClicked, false) - self.Expand(lineClicked, false, true, 0) + self.SetFoldExpanded(lineClicked, False) + self.Expand(lineClicked, False, True, 0) else: - self.SetFoldExpanded(lineClicked, true) - self.Expand(lineClicked, true, true, 100) + self.SetFoldExpanded(lineClicked, True) + self.Expand(lineClicked, True, True, 100) else: self.ToggleFold(lineClicked) def FoldAll(self): lineCount = self.GetLineCount() - expanding = true + expanding = True # find out if we are folding or unfolding for lineNum in range(lineCount): @@ -245,12 +245,12 @@ class PythonSTC(wxStyledTextCtrl): (level & wxSTC_FOLDLEVELNUMBERMASK) == wxSTC_FOLDLEVELBASE: if expanding: - self.SetFoldExpanded(lineNum, true) - lineNum = self.Expand(lineNum, true) + self.SetFoldExpanded(lineNum, True) + lineNum = self.Expand(lineNum, True) lineNum = lineNum - 1 else: lastChild = self.GetLastChild(lineNum, -1) - self.SetFoldExpanded(lineNum, false) + self.SetFoldExpanded(lineNum, False) if lastChild > lineNum: self.HideLines(lineNum+1, lastChild) @@ -258,7 +258,7 @@ class PythonSTC(wxStyledTextCtrl): - def Expand(self, line, doExpand, force=false, visLevels=0, level=-1): + def Expand(self, line, doExpand, force=False, visLevels=0, level=-1): lastChild = self.GetLastChild(line, level) line = line + 1 while line <= lastChild: @@ -277,16 +277,16 @@ class PythonSTC(wxStyledTextCtrl): if level & wxSTC_FOLDLEVELHEADERFLAG: if force: if visLevels > 1: - self.SetFoldExpanded(line, true) + self.SetFoldExpanded(line, True) else: - self.SetFoldExpanded(line, false) + self.SetFoldExpanded(line, False) line = self.Expand(line, doExpand, force, visLevels-1) else: if doExpand and self.GetFoldExpanded(line): - line = self.Expand(line, true, force, visLevels-1) + line = self.Expand(line, True, force, visLevels-1) else: - line = self.Expand(line, false, force, visLevels-1) + line = self.Expand(line, False, force, visLevels-1) else: line = line + 1; @@ -306,7 +306,7 @@ def runTest(frame, nb, log): s = wxBoxSizer(wxHORIZONTAL) s.Add(ed, 1, wxEXPAND) p.SetSizer(s) - p.SetAutoLayout(true) + p.SetAutoLayout(True) ed.SetText(demoText + open('Main.py').read()) diff --git a/wxPython/demo/wxTextCtrl.py b/wxPython/demo/wxTextCtrl.py index 17376fa053..1045efe3d0 100644 --- a/wxPython/demo/wxTextCtrl.py +++ b/wxPython/demo/wxTextCtrl.py @@ -57,7 +57,7 @@ class TestPanel(wxPanel): t4.SetInsertionPoint(0) t4.SetStyle(44, 47, wxTextAttr("RED", "YELLOW")) points = t4.GetFont().GetPointSize() # get the current size - f = wxFont(points+3, wxROMAN, wxITALIC, wxBOLD, true) + f = wxFont(points+3, wxROMAN, wxITALIC, wxBOLD, True) t4.SetStyle(63, 77, wxTextAttr("BLUE", wxNullColour, f)) l5 = wxStaticText(self, -1, "Test Positions") @@ -86,7 +86,7 @@ class TestPanel(wxPanel): border = wxBoxSizer(wxVERTICAL) border.Add(sizer, 0, wxALL, 25) self.SetSizer(border) - self.SetAutoLayout(true) + self.SetAutoLayout(True) def EvtText(self, event): diff --git a/wxPython/demo/wxTimeCtrl.py b/wxPython/demo/wxTimeCtrl.py index 15450a325d..09465642dd 100644 --- a/wxPython/demo/wxTimeCtrl.py +++ b/wxPython/demo/wxTimeCtrl.py @@ -25,7 +25,7 @@ class TestPanel( wxPanel ): text2 = wxStaticText( panel, 40, "A 24-hour format wxTimeCtrl:") - self.time24 = wxTimeCtrl( panel, 50, fmt24hr=true, name="24 hour control" ) + self.time24 = wxTimeCtrl( panel, 50, fmt24hr=True, name="24 hour control" ) spin2 = wxSpinButton( panel, 60, wxDefaultPosition, wxSize(-1,20), 0 ) self.time24.BindSpinButton( spin2 ) @@ -69,10 +69,10 @@ class TestPanel( wxPanel ): try: from mx import DateTime except ImportError: - self.radioMx.Enable( false ) + self.radioMx.Enable( False ) - panel.SetAutoLayout( true ) + panel.SetAutoLayout( True ) panel.SetSizer( outer_box ) outer_box.Fit( panel ) panel.Move( (50,50) ) @@ -137,7 +137,7 @@ Here's the API for wxTimeCtrl: value = '12:00:00 AM', pos = wxDefaultPosition, size = wxDefaultSize, - fmt24hr = false, + fmt24hr = False, spinButton = None, style = wxTE_PROCESS_TAB, name = "time") @@ -152,7 +152,7 @@ Here's the API for wxTimeCtrl: if wxDefaultSize is specified.
fmt24hr -
If true, control will display time in 24 hour time format; if false, it will +
If True, control will display time in 24 hour time format; if False, it will use 12 hour AM/PM format. SetValue() will adjust values accordingly for the control, based on the format specified.
diff --git a/wxPython/demo/wxToggleButton.py b/wxPython/demo/wxToggleButton.py index 582bb32887..74d34d3f77 100644 --- a/wxPython/demo/wxToggleButton.py +++ b/wxPython/demo/wxToggleButton.py @@ -20,7 +20,7 @@ class TestPanel(wxPanel): EVT_TOGGLEBUTTON(self, b.GetId(), self.OnToggle) buttons.Add(b, flag=wxALL, border=5) - panel.SetAutoLayout(true) + panel.SetAutoLayout(True) panel.SetSizer(buttons) buttons.Fit(panel) panel.Move((50,50)) diff --git a/wxPython/demo/wxToolBar.py b/wxPython/demo/wxToolBar.py index 76c527aa1b..de68b05741 100644 --- a/wxPython/demo/wxToolBar.py +++ b/wxPython/demo/wxToolBar.py @@ -101,7 +101,7 @@ class TestToolBar(wxFrame): def runTest(frame, nb, log): win = TestToolBar(frame, log) frame.otherWin = win - win.Show(true) + win.Show(True) #--------------------------------------------------------------------------- diff --git a/wxPython/demo/wxTreeCtrl.py b/wxPython/demo/wxTreeCtrl.py index 9c34c25a32..e766cd8c2d 100644 --- a/wxPython/demo/wxTreeCtrl.py +++ b/wxPython/demo/wxTreeCtrl.py @@ -161,7 +161,7 @@ class TestTreeCtrlPanel(wxPanel): self.log.WriteText("OnSelChanged: %s\n" % self.tree.GetItemText(self.item)) if wxPlatform == '__WXMSW__': self.log.WriteText("BoundingRect: %s\n" % - self.tree.GetBoundingRect(self.item, true)) + self.tree.GetBoundingRect(self.item, True)) #items = self.tree.GetSelections() #print map(self.tree.GetItemText, items) event.Skip() diff --git a/wxPython/demo/wxValidator.py b/wxPython/demo/wxValidator.py index 77a9525bd4..fc1300229e 100644 --- a/wxPython/demo/wxValidator.py +++ b/wxPython/demo/wxValidator.py @@ -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) diff --git a/wxPython/demo/wxXmlResource.py b/wxPython/demo/wxXmlResource.py index 2d0aa94768..839a9cff1d 100644 --- a/wxPython/demo/wxXmlResource.py +++ b/wxPython/demo/wxXmlResource.py @@ -51,7 +51,7 @@ class TestPanel(wxPanel): sizer.Add(panel, 1, wxEXPAND|wxALL, 5) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) #---------------------------------------------------------------------- diff --git a/wxPython/demo/wxXmlResourceHandler.py b/wxPython/demo/wxXmlResourceHandler.py index 69bcd621e1..531457c651 100644 --- a/wxPython/demo/wxXmlResourceHandler.py +++ b/wxPython/demo/wxXmlResourceHandler.py @@ -153,7 +153,7 @@ class TestPanel(wxPanel): sizer.Add(panel, 1, wxEXPAND|wxALL, 5) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) #---------------------------------------------------------------------- diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index 96e1e6aa11..7e07e02954 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -933,12 +933,6 @@ enum wxHitTest -#define FALSE 0 -#define false 0 -#define TRUE 1 -#define true 1 - - //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 122fc6104c..c151c49251 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -595,14 +595,25 @@ wxPen = wxPyPen wxScrollbar = wxScrollBar wxPoint2D = wxPoint2DDouble +# Use Python's bool constants if available, make aliases if not +try: + True +except NameError: + True = 1==1 + False = 1==0 + + # backwards compatibility -wxNoRefBitmap = wxBitmap -wxPyDefaultPosition = wxDefaultPosition -wxPyDefaultSize = wxDefaultSize -NULL = None +wxNoRefBitmap = wxBitmap +wxPyDefaultPosition = wxDefaultPosition +wxPyDefaultSize = wxDefaultSize +NULL = None wxSystemSettings_GetSystemColour = wxSystemSettings_GetColour wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric +false = FALSE = False +true = TRUE = True + # workarounds for bad wxRTTI names __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' @@ -679,8 +690,8 @@ def wxPy_isinstance(obj, klasses): import types if sys.version[:3] < "2.2" and type(klasses) in [types.TupleType, types.ListType]: for klass in klasses: - if isinstance(obj, klass): return true - return false + if isinstance(obj, klass): return True + return False else: return isinstance(obj, klasses) @@ -770,7 +781,7 @@ class wxPyOnDemandOutputWindow: self.text = wxTextCtrl(self.frame, -1, "", style = wxTE_MULTILINE|wxTE_READONLY) self.frame.SetSize(wxSize(450, 300)) - self.frame.Show(true) + self.frame.Show(True) EVT_CLOSE(self.frame, self.OnCloseWindow) self.text.AppendText(str) @@ -791,7 +802,7 @@ class wxApp(wxPyApp): error = 'wxApp.error' outputWindowClass = wxPyOnDemandOutputWindow - def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=false): + def __init__(self, redirect=_defRedirect, filename=None, useBestVisual=False): wxPyApp.__init__(self) self.stdioWin = None self.saveStdio = (sys.stdout, sys.stderr) @@ -843,7 +854,7 @@ class wxPySimpleApp(wxApp): wxApp.__init__(self, flag) def OnInit(self): wxInitAllImageHandlers() - return true + return True class wxPyWidgetTester(wxApp): @@ -854,11 +865,11 @@ class wxPyWidgetTester(wxApp): def OnInit(self): self.frame = wxFrame(None, -1, "Widget Tester", pos=(0,0), size=self.size) self.SetTopWindow(self.frame) - return true + return True def SetWidget(self, widgetClass, *args): w = apply(widgetClass, (self.frame,) + args) - self.frame.Show(true) + self.frame.Show(True) #---------------------------------------------------------------------------- # DO NOT hold any other references to this object. This is how we diff --git a/wxPython/wxPython/lib/ErrorDialogs.py b/wxPython/wxPython/lib/ErrorDialogs.py index db916fa18a..4bcf9f6dca 100644 --- a/wxPython/wxPython/lib/ErrorDialogs.py +++ b/wxPython/wxPython/lib/ErrorDialogs.py @@ -276,10 +276,10 @@ class wxPythonRExec (rexec.RExec): class wxPyNonFatalErrorDialogWithTraceback(wxDialog): this_exception = 0 populate_function = populate_wxPyNonFatalErrorDialogWithTraceback - no_continue_button = false - fatal = false - modal = true - exitjustreturns = false # really only for testing! + no_continue_button = False + fatal = False + modal = True + exitjustreturns = False # really only for testing! def __init__(self, parent, id, pos=wxPyDefaultPosition, @@ -293,7 +293,7 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog): caption="Python error!", versionname=None, errorname=None, - disable_exit_button=false): + disable_exit_button=False): if self.fatal: whetherNF = "" @@ -309,7 +309,7 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog): wxDialog.__init__(self, parent, id, title, pos, size, style) - self.topsizer = self.populate_function( false,true ) + self.topsizer = self.populate_function( False,True ) self.SetProgramName(programname) self.SetVersion(version) @@ -332,10 +332,10 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog): if not disable_mail_button: EVT_BUTTON(self, wxPyError_ID_MAIL, self.OnMail) else: - self.GetMailButton().Enable(false) + self.GetMailButton().Enable(False) # disable the entry box for an e-mail address by default (NOT PROPERLY DOCUMENTED) if not hasattr(self,"enable_mail_address_box"): - self.FindWindowById(wxPyError_ID_ADDRESS).Enable(false) + self.FindWindowById(wxPyError_ID_ADDRESS).Enable(False) if not disable_exit_button: EVT_BUTTON(self, wxPyError_ID_EXIT, self.OnExit) @@ -415,7 +415,7 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog): self.sizerAroundText.SetItemMinSize (c,w,h) c.SetSize ((w,h)) c.SetSizeHints (w,h,w,h) - c.Refresh()#.SetAutoLayout(FALSE) + c.Refresh()#.SetAutoLayout(False) #^ the reason we need the above seems to be to replace the #faulty GetBestSize of wxTextCtrl... @@ -503,7 +503,7 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog): if self.modal: self.ShowModal() else: - self.Show(true) + self.Show(True) except: if not locals().has_key("c"): @@ -654,8 +654,8 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog): class wxPyFatalErrorDialogWithTraceback(wxPyNonFatalErrorDialogWithTraceback): populate_function = populate_wxPyFatalErrorDialogWithTraceback - no_continue_button = true - fatal = true + no_continue_button = True + fatal = True class wxPyNonFatalErrorDialog(wxPyNonFatalErrorDialogWithTraceback): populate_function = populate_wxPyNonFatalErrorDialog @@ -719,7 +719,7 @@ def _writehtmlmessage(mailto,subject,html,text=None,parent=None,mailfrom=None): def _createhtmlmail (html, text, subject, to=None, mailfrom=None): """Create a mime-message that will render HTML in popular - MUAs, text in better ones (if indeed text is not untrue (e.g. None) + MUAs, text in better ones (if indeed text is not unTrue (e.g. None) """ import MimeWriter, mimetools, cStringIO @@ -849,7 +849,7 @@ def wxPyFatalOrNonFatalError(parent, else: populate_function = populate_wxPyNonFatalError - sizer = populate_function(dlg,false,true) + sizer = populate_function(dlg,False,True) window = dlg.FindWindowById(wxPyError_ID_HTML) window.SetPage(msg) @@ -875,5 +875,5 @@ def wxPyFatalOrNonFatalError(parent, dlg.Destroy() return v else: - dlg.Show(true) + dlg.Show(True) diff --git a/wxPython/wxPython/lib/PythonBitmaps.py b/wxPython/wxPython/lib/PythonBitmaps.py index 79dfb0dcdd..bd06899ba5 100644 --- a/wxPython/wxPython/lib/PythonBitmaps.py +++ b/wxPython/wxPython/lib/PythonBitmaps.py @@ -21,7 +21,7 @@ getwxPythonImage PythonBitmaps - --This takes a single argument. If it tests true, + --This takes a single argument. If it tests True, getPythonPoweredBitmap() is returned, else getwxPythonBitmap() is returned. diff --git a/wxPython/wxPython/lib/buttons.py b/wxPython/wxPython/lib/buttons.py index e739c77659..128ef0a2cc 100644 --- a/wxPython/wxPython/lib/buttons.py +++ b/wxPython/wxPython/lib/buttons.py @@ -36,7 +36,7 @@ import imageutils class wxGenButtonEvent(wxPyCommandEvent): def __init__(self, eventType, ID): wxPyCommandEvent.__init__(self, eventType, ID) - self.isDown = false + self.isDown = False self.theButton = None def SetIsDown(self, isDown): @@ -65,10 +65,10 @@ class wxGenButton(wxPyControl): style = wxNO_BORDER wxPyControl.__init__(self, parent, ID, pos, size, style, validator, name) - self.up = true + self.up = True self.bezelWidth = 2 - self.hasFocus = false - self.useFocusInd = true + self.hasFocus = False + self.useFocusInd = True self.SetLabel(label) self.SetPosition(pos) @@ -133,7 +133,7 @@ class wxGenButton(wxPyControl): return self.IsShown() and self.IsEnabled() - def Enable(self, enable=true): + def Enable(self, enable=True): wxPyControl.Enable(self, enable) self.Refresh() @@ -194,7 +194,7 @@ class wxGenButton(wxPyControl): def _GetLabelSize(self): """ used internally """ w, h = self.GetTextExtent(self.GetLabel()) - return w, h, true + return w, h, True def Notify(self): @@ -277,7 +277,7 @@ class wxGenButton(wxPyControl): def OnLeftDown(self, event): if not self.IsEnabled(): return - self.up = false + self.up = False self.CaptureMouse() self.SetFocus() self.Refresh() @@ -291,7 +291,7 @@ class wxGenButton(wxPyControl): self.ReleaseMouse() if not self.up: # if the button was down when the mouse was released... self.Notify() - self.up = true + self.up = True self.Refresh() event.Skip() @@ -303,18 +303,18 @@ class wxGenButton(wxPyControl): x,y = event.GetPositionTuple() w,h = self.GetClientSizeTuple() if self.up and x=0 and y=0: - self.up = false + self.up = False self.Refresh() return if not self.up and (x<0 or y<0 or x>=w or y>=h): - self.up = true + self.up = True self.Refresh() return event.Skip() def OnGainFocus(self, event): - self.hasFocus = true + self.hasFocus = True dc = wxClientDC(self) w, h = self.GetClientSizeTuple() if self.useFocusInd: @@ -322,7 +322,7 @@ class wxGenButton(wxPyControl): def OnLoseFocus(self, event): - self.hasFocus = false + self.hasFocus = False dc = wxClientDC(self) w, h = self.GetClientSizeTuple() if self.useFocusInd: @@ -331,14 +331,14 @@ class wxGenButton(wxPyControl): def OnKeyDown(self, event): if self.hasFocus and event.KeyCode() == ord(" "): - self.up = false + self.up = False self.Refresh() event.Skip() def OnKeyUp(self, event): if self.hasFocus and event.KeyCode() == ord(" "): - self.up = true + self.up = True self.Notify() self.Refresh() event.Skip() @@ -375,17 +375,17 @@ class wxGenBitmapButton(wxGenButton): def SetBitmapFocus(self, bitmap): """Set bitmap to display when the button has the focus""" self.bmpFocus = bitmap - self.SetUseFocusIndicator(false) + self.SetUseFocusIndicator(False) def SetBitmapSelected(self, bitmap): """Set bitmap to display when the button is selected (pressed down)""" self.bmpSelected = bitmap - def SetBitmapLabel(self, bitmap, createOthers=true): + def SetBitmapLabel(self, bitmap, createOthers=True): """ Set the bitmap to display normally. This is the only one that is required. If - createOthers is true, then the other bitmaps + createOthers is True, then the other bitmaps will be generated on the fly. Currently, only the disabled bitmap is generated. """ @@ -399,8 +399,8 @@ class wxGenBitmapButton(wxGenButton): def _GetLabelSize(self): """ used internally """ if not self.bmpLabel: - return -1, -1, false - return self.bmpLabel.GetWidth()+2, self.bmpLabel.GetHeight()+2, false + return -1, -1, False + return self.bmpLabel.GetWidth()+2, self.bmpLabel.GetHeight()+2, False def DrawLabel(self, dc, width, height, dw=0, dy=0): bmp = self.bmpLabel @@ -433,7 +433,7 @@ class wxGenBitmapTextButton(wxGenBitmapButton): # generic bitmapped button w """ used internally """ w, h = self.GetTextExtent(self.GetLabel()) if not self.bmpLabel: - return w, h, true # if there isn't a bitmap use the size of the text + return w, h, True # if there isn't a bitmap use the size of the text w_bmp = self.bmpLabel.GetWidth()+2 h_bmp = self.bmpLabel.GetHeight()+2 @@ -442,7 +442,7 @@ class wxGenBitmapTextButton(wxGenBitmapButton): # generic bitmapped button w height = h_bmp else: height = h - return width, height, true + return width, height, True def DrawLabel(self, dc, width, height, dw=0, dy=0): diff --git a/wxPython/wxPython/lib/calendar.py b/wxPython/wxPython/lib/calendar.py index 73824409a8..29ba2c753c 100644 --- a/wxPython/wxPython/lib/calendar.py +++ b/wxPython/wxPython/lib/calendar.py @@ -43,7 +43,7 @@ class CalDraw: self.DefParms() def DefParms(self): - self.num_auto = TRUE # auto scale of the cal number day size + self.num_auto = True # auto scale of the cal number day size self.num_size = 12 # default size of calendar if no auto size self.max_num_size = 12 # maximum size for calendar number @@ -52,7 +52,7 @@ class CalDraw: self.num_indent_horz = 0 # points indent from position, used to offset if not centered self.num_indent_vert = 0 - self.week_auto = TRUE # auto scale of week font text + self.week_auto = True # auto scale of week font text self.week_size = 10 self.max_week_size = 12 @@ -70,13 +70,13 @@ class CalDraw: self.font = wxSWISS self.bold = wxNORMAL - self.hide_title = FALSE - self.hide_grid = FALSE - self.outer_border = TRUE + self.hide_title = False + self.hide_grid = False + self.outer_border = True self.title_offset = 0 self.cal_week_scale = 0.7 - self.show_weekend = FALSE + self.show_weekend = False self.cal_type = "NORMAL" def SetWeekColor(self, font_color, week_color): # set font and background color for week title @@ -122,7 +122,7 @@ class CalDraw: self.InitScale() self.DrawBorder() - if self.hide_title is FALSE: + if self.hide_title is False: self.DrawMonth() self.Center() @@ -130,7 +130,7 @@ class CalDraw: self.DrawGrid() self.GetRect() - if self.show_weekend is TRUE: # highlight weekend dates + if self.show_weekend is True: # highlight weekend dates self.SetWeekEnd() self.AddSelect(sel_lst) # overrides the weekend highlight @@ -153,7 +153,7 @@ class CalDraw: self.DC.SetBrush(brush) self.DC.SetPen(wxPen(wxNamedColour(self.border_color), 1)) - if self.outer_border is TRUE: + if self.outer_border is True: rect = wxRect(self.cx_st, self.cy_st, self.sizew, self.sizeh) # full display window area self.DC.DrawRectangle(rect.x, rect.y, rect.width, rect.height) @@ -244,7 +244,7 @@ class CalDraw: rect_w = self.gridx[7]-self.gridx[0] f = wxFont(10, self.font, wxNORMAL, self.bold) # initial font setting - if self.week_auto == TRUE: + if self.week_auto == True: test_size = self.max_week_size # max size test_day = ' Sun ' while test_size > 2: @@ -288,7 +288,7 @@ class CalDraw: def DrawNum(self): # draw the day numbers f = wxFont(10, self.font, wxNORMAL, self.bold) # initial font setting - if self.num_auto == TRUE: + if self.num_auto == True: test_size = self.max_num_size # max size test_day = ' 99 ' while test_size > 2: @@ -361,7 +361,7 @@ class CalDraw: brush = wxBrush(wxNamedColour(sel_color), wxSOLID) self.DC.SetBrush(brush) - if self.hide_grid is FALSE: + if self.hide_grid is False: self.DC.SetPen(wxPen(wxNamedColour(self.grid_color), 0)) else: self.DC.SetPen(wxPen(wxNamedColour(self.back_color), 0)) @@ -383,7 +383,7 @@ class CalDraw: y2 = y1 + self.cheight for i in range(8): - if self.hide_grid is FALSE: + if self.hide_grid is False: self.DC.DrawLine(x1, y1, x1, y2) self.gridx.append(x1) x1 = x1 + self.dl_w @@ -393,7 +393,7 @@ class CalDraw: x2 = x1 + self.cwidth for i in range(8): - if self.hide_grid is FALSE: + if self.hide_grid is False: self.DC.DrawLine(x1, y1, x2, y1) self.gridy.append(y1) if i == 0: @@ -428,10 +428,10 @@ class wxCalendar(wxWindow): self.grid_color = 'BLACK' self.back_color = 'WHITE' - self.hide_grid = FALSE + self.hide_grid = False self.sel_color = 'RED' - self.hide_title = FALSE - self.show_weekend = FALSE + self.hide_title = False + self.show_weekend = False self.cal_type = "NORMAL" self.week_color = 'LIGHT GREY' @@ -459,10 +459,10 @@ class wxCalendar(wxWindow): # control some of the main calendar attributes def HideTitle(self): - self.hide_title = TRUE + self.hide_title = True def HideGrid(self): - self.hide_grid = TRUE + self.hide_grid = True # determine the calendar rectangle click area and draw a selection @@ -605,13 +605,13 @@ class wxCalendar(wxWindow): self.select_list.append(list_val) def ShowWeekEnd(self): - self.show_weekend = TRUE # highlight weekend + self.show_weekend = True # highlight weekend def SetBusType(self): self.cal_type = "BUS" def OnSize(self, evt): - self.Refresh(false) + self.Refresh(False) evt.Skip() def OnPaint(self, event): @@ -684,7 +684,7 @@ class wxCalendar(wxWindow): def SelectDay(self, key): sel_size = 1 self.DrawRect(self.sel_key, self.back_color, sel_size) # clear large selection - if self.hide_grid is FALSE: + if self.hide_grid is False: self.DrawRect(self.sel_key, self.grid_color) self.DrawRect(key, self.sel_color, sel_size) diff --git a/wxPython/wxPython/lib/colourchooser/pycolourbox.py b/wxPython/wxPython/lib/colourchooser/pycolourbox.py index bdf7bfec2a..66a3dace4a 100644 --- a/wxPython/wxPython/lib/colourchooser/pycolourbox.py +++ b/wxPython/wxPython/lib/colourchooser/pycolourbox.py @@ -32,7 +32,7 @@ class PyColourBox(wxPanel): sizer = wxGridSizer(1, 1) sizer.Add(self.colour_box, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL) sizer.SetItemMinSize(self.colour_box, size[0] - 5, size[1] - 5) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) self.Layout() diff --git a/wxPython/wxPython/lib/colourchooser/pycolourchooser.py b/wxPython/wxPython/lib/colourchooser/pycolourchooser.py index 299c6deb3f..b11bfa0519 100644 --- a/wxPython/wxPython/lib/colourchooser/pycolourchooser.py +++ b/wxPython/wxPython/lib/colourchooser/pycolourchooser.py @@ -189,7 +189,7 @@ class wxPyColourChooser(wxPanel): sizer.Add(csizer, 0, wxEXPAND) sizer.Add(10, 1) sizer.Add(vsizer, 0, wxEXPAND) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) @@ -208,10 +208,10 @@ class wxPyColourChooser(wxPanel): """Highlights the selected colour box and updates the solid colour display and colour slider to reflect the choice.""" if hasattr(self, '_old_custom_highlight'): - self._old_custom_highlight.SetHighlight(false) + self._old_custom_highlight.SetHighlight(False) if hasattr(self, '_old_colour_highlight'): - self._old_colour_highlight.SetHighlight(false) - box.SetHighlight(true) + self._old_colour_highlight.SetHighlight(False) + box.SetHighlight(True) self._old_colour_highlight = box self.UpdateColour(box.GetColour()) @@ -219,10 +219,10 @@ class wxPyColourChooser(wxPanel): """Highlights the selected custom colour box and updates the solid colour display and colour slider to reflect the choice.""" if hasattr(self, '_old_colour_highlight'): - self._old_colour_highlight.SetHighlight(false) + self._old_colour_highlight.SetHighlight(False) if hasattr(self, '_old_custom_highlight'): - self._old_custom_highlight.SetHighlight(false) - box.SetHighlight(true) + self._old_custom_highlight.SetHighlight(False) + box.SetHighlight(True) self._old_custom_highlight = box self.UpdateColour(box.GetColour()) @@ -281,13 +281,13 @@ def main(): chooser = wxPyColourChooser(frame, -1) sizer = wxBoxSizer(wxVERTICAL) sizer.Add(chooser, 0, 0) - frame.SetAutoLayout(true) + frame.SetAutoLayout(True) frame.SetSizer(sizer) sizer.Fit(frame) - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True app = App() app.MainLoop() diff --git a/wxPython/wxPython/lib/colourselect.py b/wxPython/wxPython/lib/colourselect.py index db9043d802..fbf1999f37 100644 --- a/wxPython/wxPython/lib/colourselect.py +++ b/wxPython/wxPython/lib/colourselect.py @@ -76,7 +76,7 @@ class ColourSelect(wxButton): def OnClick(self, event): data = wxColourData() - data.SetChooseFull(true) + data.SetChooseFull(True) data.SetColour(self.set_colour_val) dlg = wxColourDialog(self.GetParent(), data) changed = dlg.ShowModal() == wxID_OK diff --git a/wxPython/wxPython/lib/editor/editor.py b/wxPython/wxPython/lib/editor/editor.py index f1d82ff695..77f5c94edf 100644 --- a/wxPython/wxPython/lib/editor/editor.py +++ b/wxPython/wxPython/lib/editor/editor.py @@ -122,7 +122,7 @@ class wxEditor(wxScrolledWindow): if wxPlatform == "__WXMSW__": return wxFont(10, wxMODERN, wxNORMAL, wxNORMAL) else: - return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, false) + return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, False) def UnixKeyHack(self, key): # this will be obsolete when we get the new wxWindows patch @@ -162,7 +162,7 @@ class wxEditor(wxScrolledWindow): if dc.Ok(): self.SetCharDimensions() self.KeepCursorOnScreen() - self.DrawSimpleCursor(0,0,dc, true) + self.DrawSimpleCursor(0,0,dc, True) self.Draw(dc) def OnPaint(self, event): @@ -256,7 +256,7 @@ class wxEditor(wxScrolledWindow): self.DrawSimpleCursor(x, y, dc) - def DrawSimpleCursor(self, xp, yp, dc = None, old=false): + def DrawSimpleCursor(self, xp, yp, dc = None, old=False): if not dc: dc = wxClientDC(self) @@ -353,13 +353,13 @@ class wxEditor(wxScrolledWindow): return len(self.lines) def UnTouchBuffer(self): - self.bufferTouched = FALSE + self.bufferTouched = False def BufferWasTouched(self): return self.bufferTouched def TouchBuffer(self): - self.bufferTouched = TRUE + self.bufferTouched = True ##-------------------------- Mouse scroll timing functions @@ -367,7 +367,7 @@ class wxEditor(wxScrolledWindow): def InitScrolling(self): # we don't rely on the windows system to scroll for us; we just # redraw the screen manually every time - self.EnableScrolling(FALSE, FALSE) + self.EnableScrolling(False, False) self.nextScrollTime = 0 self.SCROLLDELAY = 0.050 # seconds self.scrollTimer = wxTimer(self) @@ -376,12 +376,12 @@ class wxEditor(wxScrolledWindow): def CanScroll(self): if time.time() > self.nextScrollTime: self.nextScrollTime = time.time() + self.SCROLLDELAY - return true + return True else: - return false + return False def SetScrollTimer(self): - oneShot = true + oneShot = True self.scrollTimer.Start(1000*self.SCROLLDELAY/2, oneShot) EVT_TIMER(self, -1, self.OnTimer) @@ -448,7 +448,7 @@ class wxEditor(wxScrolledWindow): def OnMotion(self, event): if event.LeftIsDown() and self.HasCapture(): - self.Selecting = true + self.Selecting = True self.MouseToCursor(event) self.SelectUpdate() @@ -466,8 +466,8 @@ class wxEditor(wxScrolledWindow): if self.SelectEnd is None: self.OnClick() else: - self.Selecting = false - self.SelectNotify(false, self.SelectBegin, self.SelectEnd) + self.Selecting = False + self.SelectNotify(False, self.SelectBegin, self.SelectEnd) self.ReleaseMouse() self.scrollTimer.Stop() @@ -629,8 +629,8 @@ class wxEditor(wxScrolledWindow): def SelectOff(self): self.SelectBegin = None self.SelectEnd = None - self.Selecting = false - self.SelectNotify(false,None,None) + self.Selecting = False + self.SelectNotify(False,None,None) def CopySelection(self, event): selection = self.FindSelection() @@ -836,29 +836,29 @@ class wxEditor(wxScrolledWindow): keySettingFunction(action) if not action.has_key(key): - return false + return False if event.ShiftDown(): if not self.Selecting: - self.Selecting = true + self.Selecting = True self.SelectBegin = (self.cy, self.cx) action[key](event) self.SelectEnd = (self.cy, self.cx) else: action[key](event) if self.Selecting: - self.Selecting = false + self.Selecting = False self.SelectNotify(self.Selecting, self.SelectBegin, self.SelectEnd) self.UpdateView() - return true + return True def MoveSpecialKey(self, event, key): return self.Move(self.SetMoveSpecialFuncs, key, event) def MoveSpecialControlKey(self, event, key): if not event.ControlDown(): - return false + return False return self.Move(self.SetMoveSpecialControlFuncs, key, event) def Dispatch(self, keySettingFunction, key, event): @@ -867,21 +867,21 @@ class wxEditor(wxScrolledWindow): if action.has_key(key): action[key](event) self.UpdateView() - return true - return false + return True + return False def ModifierKey(self, key, event, modifierKeyDown, MappingFunc): if not modifierKeyDown: - return false + return False key = self.UnixKeyHack(key) try: key = chr(key) except: - return false + return False if not self.Dispatch(MappingFunc, key, event): wxBell() - return true + return True def ControlKey(self, event, key): return self.ModifierKey(key, event, event.ControlDown(), self.SetControlFuncs) @@ -891,14 +891,14 @@ class wxEditor(wxScrolledWindow): def SpecialControlKey(self, event, key): if not event.ControlDown(): - return false + return False if not self.Dispatch(self.SetSpecialControlFuncs, key, event): wxBell() - return true + return True def ShiftKey(self, event, key): if not event.ShiftDown(): - return false + return False return self.Dispatch(self.SetShiftFuncs, key, event) def NormalChar(self, event, key): diff --git a/wxPython/wxPython/lib/editor/selection.py b/wxPython/wxPython/lib/editor/selection.py index d57982e75b..9a9ed9b2c8 100644 --- a/wxPython/wxPython/lib/editor/selection.py +++ b/wxPython/wxPython/lib/editor/selection.py @@ -1,5 +1,5 @@ -TRUE = 1 -FALSE = 0 +True = 1 +False = 0 def RestOfLine(sx, width, data, bool): if len(data) == 0 and sx == 0: @@ -10,16 +10,16 @@ def RestOfLine(sx, width, data, bool): def Selection(SelectBegin,SelectEnd, sx, width, line, data): if SelectEnd is None or SelectBegin is None: - return RestOfLine(sx, width, data, FALSE) + return RestOfLine(sx, width, data, False) (bRow, bCol) = SelectBegin (eRow, eCol) = SelectEnd if (eRow < bRow): (bRow, bCol) = SelectEnd (eRow, eCol) = SelectBegin if (line < bRow or eRow < line): - return RestOfLine(sx, width, data, FALSE) + return RestOfLine(sx, width, data, False) if (bRow < line and line < eRow): - return RestOfLine(sx, width, data, TRUE) + return RestOfLine(sx, width, data, True) if (bRow == eRow) and (eCol < bCol): (bCol, eCol) = (eCol, bCol) # selection either starts or ends on this line @@ -31,12 +31,12 @@ def Selection(SelectBegin,SelectEnd, sx, width, line, data): pieces = [] if (sx < bCol): if bCol <= end: - pieces += [(data[sx:bCol], FALSE)] + pieces += [(data[sx:bCol], False)] else: - return [(data[sx:end], FALSE)] - pieces += [(data[max(bCol,sx):min(eCol,end)], TRUE)] + return [(data[sx:end], False)] + pieces += [(data[max(bCol,sx):min(eCol,end)], True)] if (eCol < end): - pieces += [(data[eCol:end], FALSE)] + pieces += [(data[eCol:end], False)] return pieces diff --git a/wxPython/wxPython/lib/evtmgr.py b/wxPython/wxPython/lib/evtmgr.py index eb82231f1f..ef6fab004d 100644 --- a/wxPython/wxPython/lib/evtmgr.py +++ b/wxPython/wxPython/lib/evtmgr.py @@ -267,7 +267,7 @@ class EventManager: def __haveMessageAdapter(self, eventHandler, topicPattern): """ - Return true if there's already a message adapter + Return True if there's already a message adapter with these specs. """ try: @@ -325,7 +325,7 @@ class EventMacroInfo: def eventIsA(self, event, macroList): """ - Return true if the event is one of the given + Return True if the event is one of the given macros. """ eventType = event.GetEventType() @@ -337,7 +337,7 @@ class EventMacroInfo: def macroIsA(self, macro, macroList): """ - Return true if the macro is in the macroList. + Return True if the macro is in the macroList. The added value of this method is that it takes multi-events into account. The macroList parameter will be coerced into a sequence if needed. @@ -348,7 +348,7 @@ class EventMacroInfo: eventList = [] for m in macroList: eventList.extend(self.getEventTypes(m)) - # Return true if every element in testList is in eventList + # Return True if every element in testList is in eventList for element in testList: if element not in eventList: return 0 @@ -357,7 +357,7 @@ class EventMacroInfo: def isMultiEvent(self, macro): """ - Return true if the given macro actually causes + Return True if the given macro actually causes multiple events to be registered. """ return len(self.getEventTypes(macro)) > 1 diff --git a/wxPython/wxPython/lib/fancytext.py b/wxPython/wxPython/lib/fancytext.py index 566e24627d..0767c986e7 100644 --- a/wxPython/wxPython/lib/fancytext.py +++ b/wxPython/wxPython/lib/fancytext.py @@ -13,7 +13,7 @@ encoding, and color. See the example on the bottom for a better idea of how this works. Note that start and end tags for the string are provided if enclose is -true, so for instance, renderToBitmap("X1") will work. +True, so for instance, renderToBitmap("X1") will work. """ # Copyright 2001 Timothy Hochberg diff --git a/wxPython/wxPython/lib/filebrowsebutton.py b/wxPython/wxPython/lib/filebrowsebutton.py index 5a5b35d62c..e9481d5daa 100644 --- a/wxPython/wxPython/lib/filebrowsebutton.py +++ b/wxPython/wxPython/lib/filebrowsebutton.py @@ -64,7 +64,7 @@ class FileBrowseButton(wxPanel): self.fileMask = fileMask self.fileMode = fileMode self.changeCallback = changeCallback - self.callCallback = true + self.callCallback = True # get background to match it @@ -106,7 +106,7 @@ class FileBrowseButton(wxPanel): outsidebox.Add(box, 1, wxEXPAND|wxALL, 3) outsidebox.Fit(self) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer( outsidebox ) self.Layout() if type( size ) == types.TupleType: @@ -195,7 +195,7 @@ class FileBrowseButton(wxPanel): def SetLabel( self, value ): """ Set the label's current text """ rvalue = self.label.SetLabel( value ) - self.Refresh( true ) + self.Refresh( True ) return rvalue @@ -404,7 +404,7 @@ if __name__ == "__main__": ID = wxNewId() innerbox.Add( wxButton( panel, ID,"Change Value", ), 1, wxEXPAND) EVT_BUTTON( self, ID, self.OnChangeValue ) - panel.SetAutoLayout(true) + panel.SetAutoLayout(True) panel.SetSizer( innerbox ) self.history={"c:\\temp":1, "c:\\tmp":1, "r:\\temp":1,"z:\\temp":1} @@ -417,7 +417,7 @@ if __name__ == "__main__": self.history[event.GetString ()]=1 def OnCloseMe(self, event): - self.Close(true) + self.Close(True) def OnChangeLabel( self, event ): self.bottomcontrol.SetLabel( "Label Updated" ) def OnChangeValue( self, event ): @@ -433,9 +433,9 @@ if __name__ == "__main__": wxImage_AddHandler(wxGIFHandler()) frame = DemoFrame(NULL) #frame = RulesPanel(NULL ) - frame.Show(true) + frame.Show(True) self.SetTopWindow(frame) - return true + return True def test( ): app = DemoApp(0) diff --git a/wxPython/wxPython/lib/floatbar.py b/wxPython/wxPython/lib/floatbar.py index 05629e892e..19b0231ebb 100644 --- a/wxPython/wxPython/lib/floatbar.py +++ b/wxPython/wxPython/lib/floatbar.py @@ -50,8 +50,8 @@ else: wxToolBar subclass which can be dragged off its frame and later replaced there. Drag on the toolbar to release it, close it like a normal window to make it return to its original - position. Programmatically, call SetFloatable(true) and then - Float(true) to float, Float(false) to dock. + position. Programmatically, call SetFloatable(True) and then + Float(True) to float, Float(False) to dock. """ def __init__(self,*_args,**_kwargs): @@ -175,7 +175,7 @@ else: newpos = self.parentframe.GetPosition() newpos.y = newpos.y + _DOCKTHRESHOLD * 2 self.floatframe.SetPosition(newpos) - self.floatframe.Show(true) + self.floatframe.Show(True) EVT_CLOSE(self.floatframe, self.OnDock) #EVT_MOVE(self.floatframe, self.OnMove) @@ -208,9 +208,9 @@ else: #homepos = homepos[0], homepos[1] + self.titleheight #floatpos = self.floatframe.GetPositionTuple() #if abs(homepos[0] - floatpos[0]) < 35 and abs(homepos[1] - floatpos[1]) < 35: - # self._SetFauxBarVisible(true) + # self._SetFauxBarVisible(True) #else: - # self._SetFauxBarVisible(false) + # self._SetFauxBarVisible(False) def OnMouse(self, e): @@ -240,7 +240,7 @@ else: if e.Dragging(): if not self.IsFloating(): - self.Float(true) + self.Float(True) self.oldpos = (e.GetX(), e.GetY()) else: if hasattr(self, 'oldpos'): diff --git a/wxPython/wxPython/lib/gridmovers.py b/wxPython/wxPython/lib/gridmovers.py index e55f73a857..3a2c45e909 100644 --- a/wxPython/wxPython/lib/gridmovers.py +++ b/wxPython/wxPython/lib/gridmovers.py @@ -219,8 +219,8 @@ class wxGridColMover(wxEvtHandler): self.ux = self.grid.GetScrollPixelsPerUnit()[0] self.startX = -10 self.cellX = 0 - self.didMove = false - self.isDragging = false + self.didMove = False + self.isDragging = False EVT_MOTION(self,self.OnMouseMove) EVT_LEFT_DOWN(self,self.OnPress) @@ -229,7 +229,7 @@ class wxGridColMover(wxEvtHandler): def OnMouseMove(self,evt): if self.isDragging: if abs(self.startX - evt.m_x) >= 3: - self.didMove = true + self.didMove = True sx,y = self.grid.GetViewStart() w,h = self.lwin.GetClientSizeTuple() x = sx * self.ux @@ -241,12 +241,12 @@ class wxGridColMover(wxEvtHandler): else: x /= self.ux if x != sx: if wxPlatform == '__WXMSW__': - self.colWin.Show(false) + self.colWin.Show(False) self.grid.Scroll(x,y) x,y = self.lwin.ClientToScreenXY(evt.m_x,0) x,y = self.grid.ScreenToClientXY(x,y) if not self.colWin.IsShown(): - self.colWin.Show(true) + self.colWin.Show(True) px = x - self.cellX if px < 0 + self.grid._rlSize: px = 0 + self.grid._rlSize if px > w - self.colWin.GetSizeTuple()[0] + self.grid._rlSize: @@ -265,8 +265,8 @@ class wxGridColMover(wxEvtHandler): evt.Skip() return - self.isDragging = true - self.didMove = false + self.isDragging = True + self.didMove = False col = self.grid.XToCol(px + sx) rect = self.grid.ColToRect(col) self.cellX = px + sx - rect.x @@ -276,14 +276,14 @@ class wxGridColMover(wxEvtHandler): rect.height = size[1] colImg = self._CaptureImage(rect) self.colWin = ColDragWindow(self.grid,colImg,col) - self.colWin.Show(false) + self.colWin.Show(False) self.lwin.CaptureMouse() def OnRelease(self,evt): if self.isDragging: self.lwin.ReleaseMouse() - self.colWin.Show(false) - self.isDragging = false + self.colWin.Show(False) + self.isDragging = False if not self.didMove: px = self.lwin.ClientToScreenXY(self.startX,0)[0] px = self.grid.ScreenToClientXY(px,0)[0] @@ -324,8 +324,8 @@ class wxGridRowMover(wxEvtHandler): self.uy = self.grid.GetScrollPixelsPerUnit()[1] self.startY = -10 self.cellY = 0 - self.didMove = false - self.isDragging = false + self.didMove = False + self.isDragging = False EVT_MOTION(self,self.OnMouseMove) EVT_LEFT_DOWN(self,self.OnPress) @@ -334,7 +334,7 @@ class wxGridRowMover(wxEvtHandler): def OnMouseMove(self,evt): if self.isDragging: if abs(self.startY - evt.m_y) >= 3: - self.didMove = true + self.didMove = True x,sy = self.grid.GetViewStart() w,h = self.lwin.GetClientSizeTuple() y = sy * self.uy @@ -346,12 +346,12 @@ class wxGridRowMover(wxEvtHandler): else: y /= self.uy if y != sy: if wxPlatform == '__WXMSW__': - self.rowWin.Show(false) + self.rowWin.Show(False) self.grid.Scroll(x,y) x,y = self.lwin.ClientToScreenXY(0,evt.m_y) x,y = self.grid.ScreenToClientXY(x,y) if not self.rowWin.IsShown(): - self.rowWin.Show(true) + self.rowWin.Show(True) py = y - self.cellY if py < 0 + self.grid._clSize: py = 0 + self.grid._clSize if py > h - self.rowWin.GetSizeTuple()[1] + self.grid._clSize: @@ -370,8 +370,8 @@ class wxGridRowMover(wxEvtHandler): evt.Skip() return - self.isDragging = true - self.didMove = false + self.isDragging = True + self.didMove = False row = self.grid.YToRow(py + sy) rect = self.grid.RowToRect(row) self.cellY = py + sy - rect.y @@ -381,14 +381,14 @@ class wxGridRowMover(wxEvtHandler): rect.width = size[0] rowImg = self._CaptureImage(rect) self.rowWin = RowDragWindow(self.grid,rowImg,row) - self.rowWin.Show(false) + self.rowWin.Show(False) self.lwin.CaptureMouse() def OnRelease(self,evt): if self.isDragging: self.lwin.ReleaseMouse() - self.rowWin.Show(false) - self.isDragging = false + self.rowWin.Show(False) + self.isDragging = False if not self.didMove: py = self.lwin.ClientToScreenXY(0,self.startY)[1] py = self.grid.ScreenToClientXY(0,py)[1] diff --git a/wxPython/wxPython/lib/infoframe.py b/wxPython/wxPython/lib/infoframe.py index 917a40096f..f98b7fc5a4 100644 --- a/wxPython/wxPython/lib/infoframe.py +++ b/wxPython/wxPython/lib/infoframe.py @@ -187,7 +187,7 @@ class _MyStatusBar(wxStatusBar): self.button2.SetLabel ("Open New File") self.useopenbutton = 1 - self.useopenbutton self.OnSize("") - self.button2.Refresh(TRUE) + self.button2.Refresh(True) self.Refresh() @@ -269,7 +269,7 @@ class wxPyInformationalMessagesFrame: useopenbutton=hasattr(self, "nofile")) self.frame.SetStatusBar(self.frame.sb) - self.frame.Show(true) + self.frame.Show(True) EVT_CLOSE(self.frame, self.OnCloseWindow) if hasattr(self,"nofile"): @@ -341,7 +341,7 @@ class wxPyInformationalMessagesFrame: if m is not None:# and m.__dict__.has_key("__debug__"): m.__dict__["__debug__"] = 0 - if self.frame is not None: # typically true, but, e.g., allows + if self.frame is not None: # typically True, but, e.g., allows # DisableOutput method (which calls this # one) to be called when the frame is not # actually open, so that it is always safe diff --git a/wxPython/wxPython/lib/intctrl.py b/wxPython/wxPython/lib/intctrl.py index 767f87cbad..cf17abdaa4 100644 --- a/wxPython/wxPython/lib/intctrl.py +++ b/wxPython/wxPython/lib/intctrl.py @@ -313,19 +313,19 @@ class wxIntValidator( wxPyValidator ): 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. #---------------------------------------------------------------------------- @@ -373,7 +373,7 @@ class wxIntCtrl(wxTextCtrl): limited Boolean indicating whether the control prevents values from exceeding the currently set minimum and maximum values (bounds). - If false and bounds are set, out-of-bounds values will + If False and bounds are set, out-of-bounds values will be colored with the current out-of-bounds color. allow_none @@ -539,7 +539,7 @@ class wxIntCtrl(wxTextCtrl): """ This function is a convenience function for setting the min and max values at the same time. The function only applies the maximum bound - if setting the minimum bound is successful, and returns true + if setting the minimum bound is successful, and returns True only if both operations succeed. NOTE: leaving out an argument will remove the corresponding bound. """ @@ -558,7 +558,7 @@ class wxIntCtrl(wxTextCtrl): def SetLimited(self, limited): """ - If called with a value of true, this function will cause the control + If called with a value of True, this function will cause the control to limit the value to fall within the bounds currently specified. If the control's value currently exceeds the bounds, it will then be limited accordingly. @@ -581,7 +581,7 @@ class wxIntCtrl(wxTextCtrl): def IsLimited(self): """ - Returns true if the control is currently limiting the + Returns True if the control is currently limiting the value to fall within the current bounds. """ return self.__limited @@ -589,7 +589,7 @@ class wxIntCtrl(wxTextCtrl): def IsInBounds(self, value=None): """ - Returns true if no value is specified and the current value + Returns True if no value is specified and the current value of the control falls within the current bounds. This function can also be called with a value to see if that value would fall within the current bounds of the given control. @@ -607,7 +607,7 @@ class wxIntCtrl(wxTextCtrl): if min is None: min = value if max is None: max = value - # if bounds set, and value is None, return false + # if bounds set, and value is None, return False if value == None and (min is not None or max is not None): return 0 else: @@ -822,7 +822,7 @@ if __name__ == '__main__': hs.AddWindow( self.Cancel, 0, wxALIGN_CENTRE|wxALL, 5 ) vs.AddSizer(hs, 0, wxALIGN_CENTRE|wxALL, 5 ) - self.SetAutoLayout( true ) + self.SetAutoLayout( True ) self.SetSizer( vs ) vs.Fit( self ) vs.SetSizeHints( self ) @@ -842,8 +842,8 @@ if __name__ == '__main__': EVT_BUTTON(self, 10, self.OnClick) except: traceback.print_exc() - return false - return true + return False + return True def OnClick(self, event): dlg = myDialog(self.panel, -1, "test wxIntCtrl") @@ -856,7 +856,7 @@ if __name__ == '__main__': self.frame.Destroy() def Show(self): - self.frame.Show(true) + self.frame.Show(True) try: app = TestApp(0) diff --git a/wxPython/wxPython/lib/layoutf.py b/wxPython/wxPython/lib/layoutf.py index 693efe647f..4e1c20ac08 100644 --- a/wxPython/wxPython/lib/layoutf.py +++ b/wxPython/wxPython/lib/layoutf.py @@ -202,7 +202,7 @@ if __name__=='__main__': wxPyDefaultPosition, wxSize(500, 300)) EVT_CLOSE(self, self.OnCloseWindow) - self.SetAutoLayout(true) + self.SetAutoLayout(True) EVT_BUTTON(self, 100, self.OnButton) EVT_BUTTON(self, 101, self.OnAbout) @@ -234,7 +234,7 @@ if __name__=='__main__': wxStaticText(self.panelD, -1, "Panel D", wxPoint(4, 4)).SetBackgroundColour(wxGREEN) def OnButton(self, event): - self.Close(true) + self.Close(True) def OnAbout(self, event): try: diff --git a/wxPython/wxPython/lib/mixins/rubberband.py b/wxPython/wxPython/lib/mixins/rubberband.py index e4d9ff7709..f71dbf50a9 100644 --- a/wxPython/wxPython/lib/mixins/rubberband.py +++ b/wxPython/wxPython/lib/mixins/rubberband.py @@ -49,7 +49,7 @@ def boxToExtent(box): def pointInBox(x, y, box): """ - Return true if the given point is contained in the box. + Return True if the given point is contained in the box. """ e = boxToExtent(box) return x >= e[0] and x <= e[2] and y >= e[1] and y <= e[3] @@ -57,7 +57,7 @@ def pointInBox(x, y, box): def pointOnBox(x, y, box, thickness=1): """ - Return true if the point is on the outside edge + Return True if the point is on the outside edge of the box. The thickness defines how thick the edge should be. This is necessary for HCI reasons: For example, it's normally very difficult for a user @@ -133,14 +133,14 @@ class RubberBand: def __isMovingCursor(self): """ - Return true if the current cursor is one used to + Return True if the current cursor is one used to mean moving the rubberband. """ return self.__currentCursor == wxCURSOR_HAND def __isSizingCursor(self): """ - Return true if the current cursor is one of the ones + Return True if the current cursor is one of the ones I may use to signify sizing. """ sizingCursors = [wxCURSOR_SIZENESW, diff --git a/wxPython/wxPython/lib/multisash.py b/wxPython/wxPython/lib/multisash.py index 9965bff0b8..9f5602e5a6 100644 --- a/wxPython/wxPython/lib/multisash.py +++ b/wxPython/wxPython/lib/multisash.py @@ -213,8 +213,8 @@ class wxMultiSplit(wxWindow): def CanSize(self,side,view): if self.SizeTarget(side,view): - return true - return false + return True + return False def SizeTarget(self,side,view): if self.direction == side and self.view2 and view == self.view1: @@ -372,20 +372,20 @@ class MultiClient(wxWindow): self.child = childCls(self) self.child.MoveXY(2,2) self.normalColour = self.GetBackgroundColour() - self.selected = false + self.selected = False EVT_SET_FOCUS(self,self.OnSetFocus) EVT_CHILD_FOCUS(self,self.OnChildFocus) def UnSelect(self): if self.selected: - self.selected = false + self.selected = False self.SetBackgroundColour(self.normalColour) self.Refresh() def Select(self): self.GetParent().multiView.UnSelect() - self.selected = true + self.selected = True self.SetBackgroundColour(wxColour(255,255,0)) # Yellow self.Refresh() @@ -432,7 +432,7 @@ class MultiSizer(wxWindow): self.px = None # Previous X self.py = None # Previous Y - self.isDrag = false # In Dragging + self.isDrag = False # In Dragging self.dragTarget = None # View being sized EVT_LEAVE_WINDOW(self,self.OnLeave) @@ -482,7 +482,7 @@ class MultiSizer(wxWindow): def OnPress(self,evt): self.dragTarget = self.GetParent().SizeTarget(not self.side) if self.dragTarget: - self.isDrag = true + self.isDrag = True self.px,self.py = self.ClientToScreenXY(evt.m_x,evt.m_y) self.px,self.py = self.dragTarget.ScreenToClientXY(self.px,self.py) DrawSash(self.dragTarget,self.px,self.py,self.side) @@ -494,7 +494,7 @@ class MultiSizer(wxWindow): if self.isDrag: DrawSash(self.dragTarget,self.px,self.py,self.side) self.ReleaseMouse() - self.isDrag = false + self.isDrag = False if self.side == MV_HOR: self.dragTarget.SizeLeaf(self.GetParent(), self.py,not self.side) @@ -519,7 +519,7 @@ class MultiCreator(wxWindow): self.px = None # Previous X self.py = None # Previous Y - self.isDrag = false # In Dragging + self.isDrag = False # In Dragging EVT_LEAVE_WINDOW(self,self.OnLeave) EVT_ENTER_WINDOW(self,self.OnEnter) @@ -566,7 +566,7 @@ class MultiCreator(wxWindow): evt.Skip() def OnPress(self,evt): - self.isDrag = true + self.isDrag = True parent = self.GetParent() self.px,self.py = self.ClientToScreenXY(evt.m_x,evt.m_y) self.px,self.py = parent.ScreenToClientXY(self.px,self.py) @@ -578,7 +578,7 @@ class MultiCreator(wxWindow): parent = self.GetParent() DrawSash(parent,self.px,self.py,self.side) self.ReleaseMouse() - self.isDrag = false + self.isDrag = False if self.side == MV_HOR: parent.AddLeaf(MV_VER,self.py) @@ -622,8 +622,8 @@ class MultiCloser(wxWindow): size = wxSize(w,h), style = wxCLIP_CHILDREN) - self.down = false - self.entered = false + self.down = False + self.entered = False EVT_LEFT_DOWN(self,self.OnPress) EVT_LEFT_UP(self,self.OnRelease) @@ -633,14 +633,14 @@ class MultiCloser(wxWindow): def OnLeave(self,evt): self.SetCursor(wxStockCursor(wxCURSOR_ARROW)) - self.entered = false + self.entered = False def OnEnter(self,evt): self.SetCursor(wxStockCursor(wxCURSOR_BULLSEYE)) - self.entered = true + self.entered = True def OnPress(self,evt): - self.down = true + self.down = True evt.Skip() def OnRelease(self,evt): @@ -648,7 +648,7 @@ class MultiCloser(wxWindow): self.GetParent().DestroyLeaf() else: evt.Skip() - self.down = false + self.down = False def OnPaint(self,evt): dc = wxPaintDC(self) diff --git a/wxPython/wxPython/lib/mvctree.py b/wxPython/wxPython/lib/mvctree.py index 0e297863be..cdf05f7ada 100644 --- a/wxPython/wxPython/lib/mvctree.py +++ b/wxPython/wxPython/lib/mvctree.py @@ -47,9 +47,9 @@ class MVCTreeNode: if self.kids is None: self.kids = [] self.data = data - self.expanded = false - self.selected = false - self.built = false + self.expanded = False + self.selected = False + self.built = False self.scale = 0 def GetChildren(self): @@ -136,7 +136,7 @@ class Painter: self.bgcolor = wxNamedColour("WHITE") self.fgcolor = wxNamedColour("BLUE") self.linecolor = wxNamedColour("GREY") - self.font = wxFont(9, wxDEFAULT, wxNORMAL, wxNORMAL, false) + self.font = wxFont(9, wxDEFAULT, wxNORMAL, wxNORMAL, False) self.bmp = None def GetFont(self): @@ -239,10 +239,10 @@ class wxTreeModel: raise NotImplementedError def IsEditable(self, node): - return false + return False def SetEditable(self, node): - return false + return False class NodePainter: """ @@ -330,10 +330,10 @@ class BasicTreeModel(wxTreeModel): return not self.children.has_key(node) def IsEditable(self, node): - return false + return False def SetEditable(self, node, bool): - return false + return False class FileEditor(Editor): @@ -374,9 +374,9 @@ class FileEditor(Editor): def _key(self, evt): if evt.KeyCode() == WXK_RETURN: - self.EndEdit(true) + self.EndEdit(True) elif evt.KeyCode() == WXK_ESCAPE: - self.EndEdit(false) + self.EndEdit(False) else: evt.Skip() @@ -385,7 +385,7 @@ class FileEditor(Editor): pos = evt.GetPosition() edsize = self.editcomp.GetSize() if pos.x < 0 or pos.y < 0 or pos.x > edsize.width or pos.y > edsize.height: - self.EndEdit(false) + self.EndEdit(False) class FileWrapper: @@ -408,7 +408,7 @@ class FSTreeModel(BasicTreeModel): fw = FileWrapper(path, path.split(os.sep)[-1]) self._Build(path, fw) self.SetRoot(fw) - self._editable = true + self._editable = True def _Build(self, path, fileWrapper): for name in os.listdir(path): fw = FileWrapper(path, name) @@ -435,7 +435,7 @@ class LateFSTreeModel(FSTreeModel): fw = FileWrapper(pathpart, name) self._Build(path, fw) self.SetRoot(fw) - self._editable = true + self._editable = True self.children = {} self.parents = {} def _Build(self, path, parent): @@ -494,8 +494,8 @@ class Rect: if other.y >= self.y: if other.width + other.x <= self.width + self.x: if other.height + other.y <= self.height + self.y: - return true - return false + return True + return False def __str__(self): return "Rect: " + str([self.x, self.y, self.width, self.height]) @@ -614,7 +614,7 @@ class TreePainter(Painter): if node.expanded: for kid in node.kids: if not self.paintWalk(kid, dc, paintRects): - return false + return False for kid in node.kids: px = (kid.projx - self.tree.layout.NODE_STEP) + 5 py = kid.projy + kid.height/2 @@ -638,7 +638,7 @@ class TreePainter(Painter): if not node.expanded: dc.DrawLine(px, py -2, px, py + 3) dc.DrawLine(px -2, py, px + 3, py) - return true + return True def OnMouse(self, evt): Painter.OnMouse(self, evt) @@ -750,12 +750,12 @@ class wxMVCTree(wxScrolledWindow): painter = None, *args, **kwargs): apply(wxScrolledWindow.__init__, (self, parent, id), kwargs) self.nodemap = {} - self._multiselect = false + self._multiselect = False self._selections = [] - self._assumeChildren = false - self._scrollx = false - self._scrolly = false - self.doubleBuffered = false + self._assumeChildren = False + self._scrollx = False + self._scrolly = False + self.doubleBuffered = False self._lastPhysicalSize = self.GetSize() self._editors = [] if not model: @@ -771,10 +771,10 @@ class wxMVCTree(wxScrolledWindow): if not painter: painter = TreePainter(self) self.painter = painter - self.SetFont(wxFont(9, wxDEFAULT, wxNORMAL, wxNORMAL, false)) + self.SetFont(wxFont(9, wxDEFAULT, wxNORMAL, wxNORMAL, False)) EVT_MOUSE_EVENTS(self, self.OnMouse) EVT_KEY_DOWN(self, self.OnKeyDown) - self.doubleBuffered = true + self.doubleBuffered = True EVT_SIZE(self, self.OnSize) EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) EVT_PAINT(self, self.OnPaint) @@ -783,7 +783,7 @@ class wxMVCTree(wxScrolledWindow): def Refresh(self): if self.doubleBuffered: self.painter.ClearBuffer() - wxScrolledWindow.Refresh(self, false) + wxScrolledWindow.Refresh(self, False) def GetPainter(self): return self.painter @@ -874,7 +874,7 @@ class wxMVCTree(wxScrolledWindow): self._selections = [] self.layoutRoot = MVCTreeNode() self.layoutRoot.data = self.model.GetRoot() - self.layoutRoot.expanded = true + self.layoutRoot.expanded = True self.LoadChildren(self.layoutRoot) self.currentRoot = self.layoutRoot self.offset = [0,0] @@ -895,7 +895,7 @@ class wxMVCTree(wxScrolledWindow): layoutNode.Add(p) p.data = self.GetModel().GetChildAt(layoutNode.data, i) self.nodemap[p.data]=p - layoutNode.built = true + layoutNode.built = True if not self._assumeChildren: for kid in layoutNode.kids: self.LoadChildren(kid) @@ -923,10 +923,10 @@ class wxMVCTree(wxScrolledWindow): return for node in nodeTuple: treenode = self.nodemap[node] - treenode.selected = true + treenode.selected = True for node in self._selections: treenode = self.nodemap[node] - node.selected = false + node.selected = False self._selections = list(nodeTuple) e = wxMVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), nodeTuple[0], nodes = nodeTuple) self.GetEventHandler().ProcessEvent(e) @@ -962,9 +962,9 @@ class wxMVCTree(wxScrolledWindow): e = wxMVCTreeNotifyEvent(wxEVT_MVCTREE_END_EDIT, self.GetId(), node) self.GetEventHandler().ProcessEvent(e) if not e.notify.IsAllowed(): - return false + return False self._currentEditor = None - return true + return True def SetExpanded(self, node, bool): @@ -995,7 +995,7 @@ class wxMVCTree(wxScrolledWindow): def IsExpanded(self, node): return self.nodemap[node].expanded - def AddToSelection(self, nodeOrTuple, enableMulti = true, shiftMulti = false): + def AddToSelection(self, nodeOrTuple, enableMulti = True, shiftMulti = False): nodeTuple = nodeOrTuple if type(nodeOrTuple)!= type(()): nodeTuple = (nodeOrTuple,) @@ -1007,13 +1007,13 @@ class wxMVCTree(wxScrolledWindow): if not (self.IsMultiSelect() and (enableMulti or shiftMulti)): for node in self._selections: treenode = self.nodemap[node] - treenode.selected = false + treenode.selected = False changeparents.append(treenode) node = nodeTuple[0] self._selections = [node] treenode = self.nodemap[node] changeparents.append(treenode) - treenode.selected = true + treenode.selected = True else: if shiftMulti: for node in nodeTuple: @@ -1024,11 +1024,11 @@ class wxMVCTree(wxScrolledWindow): for kid in oldtreenode.parent.kids: if kid == treenode or kid == oldtreenode: found = not found - kid.selected = true + kid.selected = True self._selections.append(kid.data) changeparents.append(kid) elif found: - kid.selected = true + kid.selected = True self._selections.append(kid.data) changeparents.append(kid) else: @@ -1038,7 +1038,7 @@ class wxMVCTree(wxScrolledWindow): except ValueError: self._selections.append(node) treenode = self.nodemap[node] - treenode.selected = true + treenode.selected = True changeparents.append(treenode) e = wxMVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), nodeTuple[0], nodes = nodeTuple) self.GetEventHandler().ProcessEvent(e) @@ -1057,7 +1057,7 @@ class wxMVCTree(wxScrolledWindow): self._selections.remove(node) treenode = self.nodemap[node] changeparents.append(treenode) - treenode.selected = false + treenode.selected = False e = wxMVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), node, nodes = nodeTuple) self.GetEventHandler().ProcessEvent(e) dc = wxClientDC(self) @@ -1101,14 +1101,14 @@ class wxMVCTree(wxScrolledWindow): to paint the control. """ try: - self.EnableScrolling(false, false) + self.EnableScrolling(False, False) if not self.laidOut: self.layout.Layout(self.currentRoot) - self.laidOut = true - self.transformed = false + self.laidOut = True + self.transformed = False if not self.transformed: self.transform.Transform(self.currentRoot, self.offset, self.rotation) - self.transformed = true + self.transformed = True tsize = None tsize = list(self.transform.GetSize()) tsize[0] = tsize[0] + 50 diff --git a/wxPython/wxPython/lib/popupctl.py b/wxPython/wxPython/lib/popupctl.py index 34568d65d8..466e06f77d 100644 --- a/wxPython/wxPython/lib/popupctl.py +++ b/wxPython/wxPython/lib/popupctl.py @@ -18,8 +18,8 @@ class PopButton(wxPyControl): def __init__(self,*_args,**_kwargs): apply(wxPyControl.__init__,(self,) + _args,_kwargs) - self.up = true - self.didDown = false + self.up = True + self.didDown = False self.InitColours() @@ -52,8 +52,8 @@ class PopButton(wxPyControl): def OnLeftDown(self, event): if not self.IsEnabled(): return - self.didDown = true - self.up = false + self.didDown = True + self.up = False self.CaptureMouse() self.GetParent().textCtrl.SetFocus() self.Refresh() @@ -66,9 +66,9 @@ class PopButton(wxPyControl): self.ReleaseMouse() if not self.up: self.Notify() - self.up = true + self.up = True self.Refresh() - self.didDown = false + self.didDown = False event.Skip() def OnMotion(self, event): @@ -79,11 +79,11 @@ class PopButton(wxPyControl): x,y = event.GetPositionTuple() w,h = self.GetClientSizeTuple() if self.up and x=0 and y=0: - self.up = false + self.up = False self.Refresh() return if not self.up and (x<0 or y<0 or x>=w or y>=h): - self.up = true + self.up = True self.Refresh() return event.Skip() @@ -151,7 +151,7 @@ class wxPopupDialog(wxDialog): def SetContent(self,content): self.content = content self.content.Reparent(self.win) - self.content.Show(true) + self.content.Show(True) self.win.SetClientSize(self.content.GetSize()) self.SetSize(self.win.GetSize()) @@ -221,7 +221,7 @@ class wxPopupControl(wxPyControl): def SetPopupContent(self,content): if not self.pop: self.content = content - self.content.Show(false) + self.content.Show(False) else: self.pop.SetContent(content) diff --git a/wxPython/wxPython/lib/printout.py b/wxPython/wxPython/lib/printout.py index 6f80e86639..56814081dc 100644 --- a/wxPython/wxPython/lib/printout.py +++ b/wxPython/wxPython/lib/printout.py @@ -45,14 +45,14 @@ class PrintBase: fcolour = font["Colour"] return wxColour(fcolour[0], fcolour[1], fcolour[2]) - def OutTextRegion(self, textout, txtdraw = TRUE): + def OutTextRegion(self, textout, txtdraw = True): textlines = textout.split('\n') y = copy.copy(self.y) + self.pt_space_before for text in textlines: remain = 'X' while remain != "": vout, remain = self.SetFlow(text, self.region) - if self.draw == TRUE and txtdraw == TRUE: + if self.draw == True and txtdraw == True: test_out = self.TestFull(vout) if self.align == wxALIGN_LEFT: self.DC.DrawText(test_out, self.indent+self.pcell_left_margin, y) @@ -128,7 +128,7 @@ class PrintBase: text = text + val return text - def OutTextPageWidth(self, textout, y_out, align, indent, txtdraw = TRUE): + def OutTextPageWidth(self, textout, y_out, align, indent, txtdraw = True): textlines = textout.split('\n') y = copy.copy(y_out) @@ -140,7 +140,7 @@ class PrintBase: remain = 'X' while remain != "": vout, remain = self.SetFlow(text, pagew) - if self.draw == TRUE and txtdraw == TRUE: + if self.draw == True and txtdraw == True: test_out = vout if align == wxALIGN_LEFT: self.DC.DrawText(test_out, indent, y) @@ -355,21 +355,21 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.data_cnt = self.page_index[self.page-1] - self.draw = TRUE + self.draw = True self.PrintHeader() self.PrintFooter() self.OutPage() def GetTotalPages(self): self.data_cnt = 0 - self.draw = FALSE + self.draw = False self.page_index = [0] cnt = 0 while 1: test = self.OutPage() self.page_index.append(self.data_cnt) - if test == FALSE: + if test == False: break cnt = cnt + 1 @@ -383,23 +383,23 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): if self.label != []: # check if header defined self.PrintLabel() else: - return FALSE + return False for val in self.data: try: row_val = self.data[self.data_cnt] except: self.FinishDraw() - return FALSE + return False - max_y = self.PrintRow(row_val, FALSE) # test to see if row will fit in remaining space + max_y = self.PrintRow(row_val, False) # test to see if row will fit in remaining space test = max_y + self.space if test > self.y_end: break self.ColourRowCells(max_y-self.y+self.space) # colour the row/column - max_y = self.PrintRow(row_val, TRUE) # row fits - print text + max_y = self.PrintRow(row_val, True) # row fits - print text self.DrawGridLine() # top line of cell self.y = max_y + self.space @@ -411,9 +411,9 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.FinishDraw() if self.data_cnt == len(self.data): # last value in list - return FALSE + return False - return TRUE + return True def PrintLabel(self): @@ -431,7 +431,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.align = wxALIGN_LEFT - max_out = self.OutTextRegion(vtxt, TRUE) + max_out = self.OutTextRegion(vtxt, True) if max_out > max_y: max_y = max_out self.col = self.col + 1 @@ -440,7 +440,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.y = max_y + self.label_space def PrintHeader(self): # print the header array - if self.draw == FALSE: + if self.draw == False: return for val in self.parent.header: @@ -457,10 +457,10 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): else: addtext = "" - self.OutTextPageWidth(text+addtext, self.pheader_margin, val["Align"], header_indent, TRUE) + self.OutTextPageWidth(text+addtext, self.pheader_margin, val["Align"], header_indent, True) def PrintFooter(self): # print the header array - if self.draw == FALSE: + if self.draw == False: return footer_pos = self.parent.page_height * self.pheight - self.pfooter_margin + self.vertical_offset @@ -484,7 +484,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): else: addtext = "" - self.OutTextPageWidth(text+addtext, footer_pos, val["Align"], footer_indent, TRUE) + self.OutTextPageWidth(text+addtext, footer_pos, val["Align"], footer_indent, True) def LabelColorRow(self, colour): @@ -494,7 +494,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.DC.DrawRectangle(self.column[0], self.y, self.end_x-self.column[0]+1, height) def ColourRowCells(self, height): - if self.draw == FALSE: + if self.draw == False: return col = 0 @@ -512,7 +512,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.DC.DrawRectangle(start_x, self.y, width, height) col = col + 1 - def PrintRow(self, row_val, draw = TRUE, align = wxALIGN_LEFT): + def PrintRow(self, row_val, draw = True, align = wxALIGN_LEFT): self.SetPrintFont(self.text_font) self.pt_space_before = self.text_pt_space_before # set the point spacing @@ -565,7 +565,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.DrawColumns() # draw all vertical lines def DrawGridLine(self): - if self.draw == TRUE: + if self.draw == True: try: size = self.row_line_size[self.data_cnt] except: @@ -583,7 +583,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.DC.DrawLine(self.column[0], y_out, self.end_x, y_out) def DrawColumns(self): - if self.draw == TRUE: + if self.draw == True: col = 0 for val in self.column: try: @@ -879,7 +879,7 @@ class PrintTable: if self.parentFrame: frame.SetPosition(self.preview_frame_pos) frame.SetSize(self.preview_frame_size) - frame.Show(true) + frame.Show(True) def Print(self): pdd = wxPrintDialogData() @@ -905,7 +905,7 @@ class PrintTable: if self.preview is None: table.SetPSize(size[0]/self.page_width, size[1]/self.page_height) table.SetPTSize(size[0], size[1]) - table.SetPreview(FALSE) + table.SetPreview(False) else: if self.preview == 1: table.scale = self.scale @@ -933,9 +933,9 @@ class PrintTable: def HasPage(self, page): if page <= self.page_total: - return true + return True else: - return false + return False def SetPage(self, page): self.page = page @@ -1025,7 +1025,7 @@ class SetPrintout(wxPrintout): end = self.canvas.HasPage(page) return end except: - return true + return True def GetPageInfo(self): try: @@ -1084,7 +1084,7 @@ class SetPrintout(wxPrintout): self.canvas.SetPageSize(self.psizew, self.psizeh) self.canvas.DoDrawing(dc) - return true + return True diff --git a/wxPython/wxPython/lib/pubsub.py b/wxPython/wxPython/lib/pubsub.py index 0a6b995b3d..c2b6968094 100644 --- a/wxPython/wxPython/lib/pubsub.py +++ b/wxPython/wxPython/lib/pubsub.py @@ -299,7 +299,7 @@ class Topic: def matches(self, aTopic): """ Consider myself to be a topic pattern, - and return true if I match the given specific + and return True if I match the given specific topic. For example, a = ('sports') b = ('sports','baseball') @@ -326,7 +326,7 @@ class Topic: def __eq__(self, aTopic): """ - Return true if I equal the given topic. We're considered + Return True if I equal the given topic. We're considered equal if our tuples are equal. """ if type(self) != type(aTopic): @@ -337,7 +337,7 @@ class Topic: def __ne__(self, aTopic): """ - Return false if I equal the given topic. + Return False if I equal the given topic. """ return not self == aTopic diff --git a/wxPython/wxPython/lib/rpcMixin.py b/wxPython/wxPython/lib/rpcMixin.py index a243cc2db7..2ca4695689 100644 --- a/wxPython/wxPython/lib/rpcMixin.py +++ b/wxPython/wxPython/lib/rpcMixin.py @@ -387,8 +387,8 @@ if __name__ == '__main__': self.frame = rpcFrame(NULL, -1, "wxPython RPCDemo", wxDefaultPosition, wxSize(300,300), rpcHost='localhost',rpcPort=port) - self.frame.Show(TRUE) - return TRUE + self.frame.Show(True) + return True def testcon(port): diff --git a/wxPython/wxPython/lib/sheet.py b/wxPython/wxPython/lib/sheet.py index 4826a5a3ff..06d7ffd749 100644 --- a/wxPython/wxPython/lib/sheet.py +++ b/wxPython/wxPython/lib/sheet.py @@ -20,26 +20,26 @@ class CTextCellEditor(wxTextCtrl): key = evt.GetKeyCode() if key == WXK_DOWN: self._grid.DisableCellEditControl() # Commit the edit - self._grid.MoveCursorDown(false) # Change the current cell + self._grid.MoveCursorDown(False) # Change the current cell elif key == WXK_UP: self._grid.DisableCellEditControl() # Commit the edit - self._grid.MoveCursorUp(false) # Change the current cell + self._grid.MoveCursorUp(False) # Change the current cell elif key == WXK_LEFT: self._grid.DisableCellEditControl() # Commit the edit - self._grid.MoveCursorLeft(false) # Change the current cell + self._grid.MoveCursorLeft(False) # Change the current cell elif key == WXK_RIGHT: self._grid.DisableCellEditControl() # Commit the edit - self._grid.MoveCursorRight(false) # Change the current cell - + self._grid.MoveCursorRight(False) # Change the current cell + evt.Skip() # Continue event - + #--------------------------------------------------------------------------- class CCellEditor(wxPyGridCellEditor): """ Custom cell editor """ def __init__(self, grid): wxPyGridCellEditor.__init__(self) self._grid = grid # Save a reference to the grid - + def Create(self, parent, id, evtHandler): """ Create the actual edit control. Must derive from wxControl. Must Override @@ -68,7 +68,7 @@ class CCellEditor(wxPyGridCellEditor): """ # Call base class method. self.base_PaintBackground(self, rect, attr) - + def BeginEdit(self, row, col, grid): """ Fetch the value from the table and prepare edit control to begin editing. Set the focus to the edit control. Must Override. @@ -76,19 +76,19 @@ class CCellEditor(wxPyGridCellEditor): self._startValue = grid.GetTable().GetValue(row, col) self._tc.SetValue(self._startValue) self._tc.SetFocus() - + # Select the text when initiating an edit so that subsequent typing # replaces the contents. self._tc.SetSelection(0, self._tc.GetLastPosition()) - + def EndEdit(self, row, col, grid): - """ Commit editing the current cell. Returns true if the value has changed. + """ Commit editing the current cell. Returns True if the value has changed. If necessary, the control may be destroyed. Must Override. """ - changed = false # Assume value not changed + changed = False # Assume value not changed val = self._tc.GetValue() # Get value in edit control if val != self._startValue: # Compare - changed = true # If different then changed is true + changed = True # If different then changed is True grid.GetTable().SetValue(row, col, val) # Update the table self._startValue = '' # Clear the class' start value self._tc.SetValue('') # Clear contents of the edit control @@ -101,7 +101,7 @@ class CCellEditor(wxPyGridCellEditor): self._tc.SetInsertionPointEnd() def IsAcceptedKey(self, evt): - """ Return true to allow the given key to start editing. The base class + """ Return True to allow the given key to start editing. The base class version only checks that the event has no modifiers. F2 is special and will always start the editor. """ @@ -117,7 +117,7 @@ class CCellEditor(wxPyGridCellEditor): if key in [WXK_NUMPAD0, WXK_NUMPAD1, WXK_NUMPAD2, WXK_NUMPAD3, WXK_NUMPAD4, WXK_NUMPAD5, WXK_NUMPAD6, WXK_NUMPAD7, WXK_NUMPAD8, WXK_NUMPAD9]: ch = chr(ord('0') + key - WXK_NUMPAD0) - + elif key == WXK_BACK: # Empty text control when init w/ back key ch = "" # Handle normal keys @@ -125,7 +125,7 @@ class CCellEditor(wxPyGridCellEditor): ch = chr(key) if not evt.ShiftDown(): ch = ch.lower() - + if ch is not None: # If are at this point with a key, self._tc.SetValue(ch) # replace the contents of the text control. self._tc.SetInsertionPointEnd() # Move to the end so that subsequent keys are appended @@ -150,7 +150,7 @@ class CCellEditor(wxPyGridCellEditor): class CSheet(wxGrid): def __init__(self, parent): wxGrid.__init__(self, parent, -1) - + # Init variables self._lastCol = -1 # Init last cell column clicked self._lastRow = -1 # Init last cell row clicked @@ -159,7 +159,7 @@ class CSheet(wxGrid): self.RegisterDataType(wxGRID_VALUE_STRING, wxGridCellStringRenderer(), CCellEditor(self)) - + self.CreateGrid(4, 3) # By default start with a 4 x 3 grid self.SetColLabelSize(18) # Default sizes and alignment self.SetRowLabelSize(50) @@ -167,8 +167,8 @@ class CSheet(wxGrid): self.SetColSize(0, 75) # Default column sizes self.SetColSize(1, 75) self.SetColSize(2, 75) - - # Sink events + + # Sink events EVT_GRID_CELL_LEFT_CLICK( self, self.OnLeftClick) EVT_GRID_CELL_RIGHT_CLICK( self, self.OnRightClick) EVT_GRID_CELL_LEFT_DCLICK( self, self.OnLeftDoubleClick) @@ -183,7 +183,7 @@ class CSheet(wxGrid): # Save the last cell coordinates self._lastRow, self._lastCol = event.GetRow(), event.GetCol() event.Skip() - + def OnRowSize(self, event): event.Skip() @@ -192,48 +192,48 @@ class CSheet(wxGrid): def OnCellChange(self, event): event.Skip() - + def OnLeftClick(self, event): """ Override left-click behavior to prevent left-click edit initiation """ # Save the cell clicked currCell = (event.GetRow(), event.GetCol()) - + # Suppress event if same cell clicked twice in a row. # This prevents a single-click from initiating an edit. if currCell != (self._lastRow, self._lastCol): event.Skip() - + def OnRightClick(self, event): """ Move grid cursor when a cell is right-clicked """ self.SetGridCursor( event.GetRow(), event.GetCol() ) event.Skip() - + def OnLeftDoubleClick(self, event): """ Initiate the cell editor on a double-click """ # Move grid cursor to double-clicked cell if self.CanEnableCellControl(): self.SetGridCursor( event.GetRow(), event.GetCol() ) - self.EnableCellEditControl(true) # Show the cell editor + self.EnableCellEditControl(True) # Show the cell editor event.Skip() def OnRangeSelect(self, event): """ Track which cells are selected so that copy/paste behavior can be implemented """ - # If a single cell is selected, then Selecting() returns false (0) + # If a single cell is selected, then Selecting() returns False (0) # and range coords are entire grid. In this case cancel previous selection. - # If more than one cell is selected, then Selecting() is true (1) + # If more than one cell is selected, then Selecting() is True (1) # and range accurately reflects selected cells. Save them. - # If more cells are added to a selection, selecting remains true (1) + # If more cells are added to a selection, selecting remains True (1) self._selected = None if event.Selecting(): self._selected = ((event.GetTopRow(), event.GetLeftCol()), (event.GetBottomRow(), event.GetRightCol())) event.Skip() - + def Copy(self): """ Copy the currently selected cells to the clipboard """ # TODO: raise an error when there are no cells selected? if self._selected == None: return ((r1, c1), (r2, c2)) = self._selected - + # Build a string to put on the clipboard # (Is there a faster way to do this in Python?) crlf = chr(13) + chr(10) @@ -245,7 +245,7 @@ class CSheet(wxGrid): s += tab s += self.GetCellValue(row, c2) s += crlf - + # Put the string on the clipboard if wxTheClipboard.Open(): wxTheClipboard.Clear() @@ -261,15 +261,15 @@ class CSheet(wxGrid): wxTheClipboard.Close() if not success: return # Exit on failure s = td.GetText() # Get the text - + crlf = chr(13) + chr(10) # CrLf characters tab = chr(9) # Tab character - + rows = s.split(crlf) # split into rows rows = rows[0:-1] # leave out last element, which is always empty for i in range(0, len(rows)): # split rows into elements rows[i] = rows[i].split(tab) - + # Get the starting and ending cell range to paste into if self._selected == None: # If no cells selected... r1 = self.GetGridCursorRow() # Start the paste at the current location @@ -278,7 +278,7 @@ class CSheet(wxGrid): c2 = self.GetNumberCols()-1 else: # If cells selected, only paste there ((r1, c1), (r2, c2)) = self._selected - + # Enter data into spreadsheet cells one at a time r = r1 # Init row and column counters c = c1 @@ -306,8 +306,8 @@ class CSheet(wxGrid): def SetNumberRows(self, numRows=1): """ Set the number of rows in the sheet """ # Check for non-negative number - if numRows < 0: return false - + if numRows < 0: return False + # Adjust number of rows curRows = self.GetNumberRows() if curRows < numRows: @@ -315,13 +315,13 @@ class CSheet(wxGrid): elif curRows > numRows: self.DeleteRows(numRows, curRows - numRows) - return true + return True def SetNumberCols(self, numCols=1): """ Set the number of columns in the sheet """ # Check for non-negative number - if numCols < 0: return false - + if numCols < 0: return False + # Adjust number of rows curCols = self.GetNumberCols() if curCols < numCols: @@ -329,4 +329,4 @@ class CSheet(wxGrid): elif curCols > numCols: self.DeleteCols(numCols, curCols - numCols) - return true + return True diff --git a/wxPython/wxPython/lib/shell.py b/wxPython/wxPython/lib/shell.py index ad1a3868b0..c6cab9deea 100644 --- a/wxPython/wxPython/lib/shell.py +++ b/wxPython/wxPython/lib/shell.py @@ -58,11 +58,11 @@ class PyShellInput(wxPanel): tid =wxNewId() self.entry =wxTextCtrl(self, tid, style = wxTE_MULTILINE) EVT_CHAR(self.entry, self.OnChar) - self.entry.SetFont(wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false)) + self.entry.SetFont(wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, False)) sizer =wxBoxSizer(wxVERTICAL) sizer.AddMany([(self.label, 0, wxEXPAND), (self.entry, 1, wxEXPAND)]) self.SetSizer(sizer) - self.SetAutoLayout(true) + self.SetAutoLayout(True) EVT_SET_FOCUS(self, self.OnSetFocus) # when in "continuation" mode, # two consecutive newlines are required @@ -153,7 +153,7 @@ class PyShellOutput(wxPanel): self.client =self.html # used in OnSize() self.text =self.intro self.html.SetPage(self.text) - self.html.SetAutoLayout(TRUE) + self.html.SetAutoLayout(True) self.line_buffer ="" # refreshes are annoying self.in_batch =0 @@ -328,7 +328,7 @@ if __name__ == '__main__': """Demonstrates usage of both default and customized shells""" def OnInit(self): frame = MyFrame() - frame.Show(TRUE) + frame.Show(True) self.SetTopWindow(frame) ## PyShellInput.PS1 =" let's get some work done..." ## PyShellInput.PS2 =" ok, what do you really mean?" @@ -344,8 +344,8 @@ if __name__ == '__main__': ## "
<-- move this sash to see html debug output
\n" ## PyShellOutput.html_debug =1 ## frame = MyFrame(title="Customized wxPython Shell") -## frame.Show(TRUE) - return TRUE +## frame.Show(True) + return True app = MyApp(0) app.MainLoop() diff --git a/wxPython/wxPython/lib/splashscreen.py b/wxPython/wxPython/lib/splashscreen.py index 19159beccf..b1ec425319 100644 --- a/wxPython/wxPython/lib/splashscreen.py +++ b/wxPython/wxPython/lib/splashscreen.py @@ -57,7 +57,7 @@ class SplashScreen(wxFrame): EVT_PAINT(self, self.OnPaint) EVT_ERASE_BACKGROUND(self, self.OnEraseBG) - self.Show(true) + self.Show(True) class SplashTimer(wxTimer): @@ -73,16 +73,16 @@ class SplashScreen(wxFrame): def OnPaint(self, event): dc = wxPaintDC(self) - dc.DrawBitmap(self.bitmap, 0,0, false) + dc.DrawBitmap(self.bitmap, 0,0, False) def OnEraseBG(self, event): pass def OnSplashExitDefault(self, event=None): - self.Close(true) + self.Close(True) def OnCloseWindow(self, event=None): - self.Show(false) + self.Show(False) self.timer.Stop() del self.timer self.Destroy() @@ -100,12 +100,12 @@ if __name__ == "__main__": wxImage_AddHandler(wxPNGHandler()) wxImage_AddHandler(wxGIFHandler()) self.splash = SplashScreen(NULL, bitmapfile="splashscreen.jpg", callback=self.OnSplashExit) - self.splash.Show(true) + self.splash.Show(True) self.SetTopWindow(self.splash) - return true + return True def OnSplashExit(self, event=None): print "Yay! Application callback worked!" - self.splash.Close(true) + self.splash.Close(True) del self.splash ### Build working windows here... def test(sceneGraph=None): diff --git a/wxPython/wxPython/lib/stattext.py b/wxPython/wxPython/lib/stattext.py index 7b2467c891..d93b16d156 100644 --- a/wxPython/wxPython/lib/stattext.py +++ b/wxPython/wxPython/lib/stattext.py @@ -96,7 +96,7 @@ class wxGenStaticText(wxPyControl): def AcceptsFocus(self): """Overridden base class virtual.""" - return false + return False def OnPaint(self, event): diff --git a/wxPython/wxPython/lib/throbber.py b/wxPython/wxPython/lib/throbber.py index 7f887c0016..3211ce699e 100644 --- a/wxPython/wxPython/lib/throbber.py +++ b/wxPython/wxPython/lib/throbber.py @@ -132,9 +132,9 @@ class Throbber(wxPanel): def Draw(self, dc): - dc.DrawBitmap(self.submaps[self.sequence[self.current]], 0, 0, true) + dc.DrawBitmap(self.submaps[self.sequence[self.current]], 0, 0, True) if self.overlay and self.showOverlay: - dc.DrawBitmap(self.overlay, self.overlayX, self.overlayY, true) + dc.DrawBitmap(self.overlay, self.overlayX, self.overlayY, True) if self.label and self.showLabel: dc.DrawText(self.label, self.labelX, self.labelY) dc.SetTextForeground(wxWHITE) @@ -195,7 +195,7 @@ class Throbber(wxPanel): def Running(self): - """Returns true if the animation is running""" + """Returns True if the animation is running""" return not self.event.isSet() diff --git a/wxPython/wxPython/lib/timectrl.py b/wxPython/wxPython/lib/timectrl.py index 5eada574c8..322e68a4b8 100644 --- a/wxPython/wxPython/lib/timectrl.py +++ b/wxPython/wxPython/lib/timectrl.py @@ -474,7 +474,7 @@ class wxTimeCtrl(wxTextCtrl): selection = sel_start != sel_to _dbg('sel_start=', sel_start, 'sel_to =', sel_to) if not selection: - self.__bSelection = false # predict unselection of entire region + self.__bSelection = False # predict unselection of entire region _dbg('keycode = ', key) _dbg('pos = ', pos) @@ -806,7 +806,7 @@ if __name__ == '__main__': sizer.AddWindow( self.tc, 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5 ) sizer.AddWindow( sb, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 ) - self.SetAutoLayout( true ) + self.SetAutoLayout( True ) self.SetSizer( sizer ) sizer.Fit( self ) sizer.SetSizeHints( self ) @@ -830,11 +830,11 @@ if __name__ == '__main__': try: frame = wxFrame(NULL, -1, "wxTimeCtrl Test", wxPoint(20,20), wxSize(100,100) ) panel = TestPanel(frame, -1, wxPoint(-1,-1), fmt24hr=fmt24hr, test_mx = test_mx) - frame.Show(true) + frame.Show(True) except: traceback.print_exc() - return false - return true + return False + return True try: app = MyApp(0) diff --git a/wxPython/wxPython/lib/wxPlotCanvas.py b/wxPython/wxPython/lib/wxPlotCanvas.py index f3495e5d60..15d8248a5a 100644 --- a/wxPython/wxPython/lib/wxPlotCanvas.py +++ b/wxPython/wxPython/lib/wxPlotCanvas.py @@ -428,7 +428,7 @@ if __name__ == '__main__': """As of this writing, printing support in wxPython is shaky at best. Are you sure you want to do this?""", "Danger!", wx.wxYES_NO) if d.ShowModal() == wx.wxID_YES: - psdc = wx.wxPostScriptDC("out.ps", wx.TRUE, self) + psdc = wx.wxPostScriptDC("out.ps", wx.True, self) self.client.redraw(psdc) def OnFileExit(self, event): @@ -454,9 +454,9 @@ Are you sure you want to do this?""", "Danger!", wx.wxYES_NO) class MyApp(wx.wxApp): def OnInit(self): frame = AppFrame(wx.NULL, -1, "wxPlotCanvas") - frame.Show(wx.TRUE) + frame.Show(wx.True) self.SetTopWindow(frame) - return wx.TRUE + return wx.True app = MyApp(0) diff --git a/wxPython/wxPython/lib/wxpTag.py b/wxPython/wxPython/lib/wxpTag.py index 4a6d9c3c3e..1981f5b02d 100644 --- a/wxPython/wxPython/lib/wxpTag.py +++ b/wxPython/wxPython/lib/wxpTag.py @@ -162,18 +162,18 @@ class wxpTagHandler(wxHtmlWinTagHandler): obj = apply(self.ctx.classObj, (parent,), self.ctx.kwargs) - obj.Show(true) + obj.Show(True) # add it to the HtmlWindow self.GetParser().GetContainer().InsertCell(wxHtmlWidgetCell(obj, self.ctx.floatWidth)) self.ctx = None - return true + return True def HandleParamTag(self, tag): if not tag.HasParam('NAME'): - return false + return False name = tag.GetParam('NAME') value = "" @@ -209,7 +209,7 @@ class wxpTagHandler(wxHtmlWinTagHandler): pass self.ctx.kwargs[str(name)] = value - return false + return False #---------------------------------------------------------------------- diff --git a/wxPython/wxPython/tools/XRCed/panel.py b/wxPython/wxPython/tools/XRCed/panel.py index feb9459629..3753a96903 100644 --- a/wxPython/wxPython/tools/XRCed/panel.py +++ b/wxPython/wxPython/tools/XRCed/panel.py @@ -17,7 +17,7 @@ class Panel(wxNotebook): wxNotebook.__init__(self, parent, id) global panel g.panel = panel = self - self.modified = false + self.modified = False # List of child windows self.pages = [] @@ -25,14 +25,14 @@ class Panel(wxNotebook): self.page1 = wxScrolledWindow(self, -1) sizer = wxBoxSizer() sizer.Add(wxBoxSizer()) # dummy sizer - self.page1.SetAutoLayout(true) + self.page1.SetAutoLayout(True) self.page1.SetSizer(sizer) self.AddPage(self.page1, 'Properties') # Second page self.page2 = wxScrolledWindow(self, -1) sizer = wxBoxSizer() sizer.Add(wxBoxSizer()) # dummy sizer - self.page2.SetAutoLayout(true) + self.page2.SetAutoLayout(True) self.page2.SetSizer(sizer) # Cache for already used panels self.pageCache = {} # cached property panels @@ -75,7 +75,7 @@ class Panel(wxNotebook): wxDefaultSize, wxSUNKEN_BORDER) html.SetPage(g.helpText) sizer.Add(html, 1, wxEXPAND) - g.conf.panic = false + g.conf.panic = False else: sizer.Add(wxStaticText(self.page1, -1, 'Select a tree item.')) else: @@ -103,7 +103,7 @@ class Panel(wxNotebook): sizer.Add(page, 0, wxEXPAND | wxTOP, 5) self.page1.Layout() size = self.page1.GetSizer().GetMinSize() - self.page1.SetScrollbars(1, 1, size.x, size.y, 0, 0, true) + self.page1.SetScrollbars(1, 1, size.x, size.y, 0, 0, True) # Second page # Create if does not exist @@ -125,17 +125,17 @@ class Panel(wxNotebook): self.AddPage(self.page2, 'Style') self.page2.Layout() size = self.page2.GetSizer().GetMinSize() - self.page2.SetScrollbars(1, 1, size.x, size.y, 0, 0, true) + self.page2.SetScrollbars(1, 1, size.x, size.y, 0, 0, True) else: # Remove page if exists if self.GetPageCount() == 2: self.SetSelection(0) self.page1.Refresh() self.RemovePage(1) - self.modified = false + self.modified = False def Clear(self): self.SetData(None) - self.modified = false + self.modified = False # If some parameter has changed def IsModified(self): return self.modified @@ -164,7 +164,7 @@ class ParamPage(wxPanel): xxx = self.xxx param = evt.GetEventObject().GetName() w = self.controls[param] - w.Enable(true) + w.Enable(True) objElem = xxx.element if evt.IsChecked(): # Ad new text node in order of allParams @@ -179,12 +179,12 @@ class ParamPage(wxPanel): else: xxx.params[param] = xxxParam(elem) # Find place to put new element: first present element after param - found = false + found = False paramStyles = xxx.allParams + xxx.styles for p in paramStyles[paramStyles.index(param) + 1:]: # Content params don't have same type if xxx.params.has_key(p) and p != 'content': - found = true + found = True break if found: nextTextElem = xxx.params[p].node @@ -196,10 +196,10 @@ class ParamPage(wxPanel): xxx.params[param].remove() del xxx.params[param] w.SetValue('') - w.modified = false # mark as not changed - w.Enable(false) + w.modified = False # mark as not changed + w.Enable(False) # Set modified flag (provokes undo storing is necessary) - panel.SetModified(true) + panel.SetModified(True) def Apply(self): xxx = self.xxx if self.controlName: @@ -235,7 +235,7 @@ class ParamPage(wxPanel): for k,v,e in state[1]: self.controls[k].SetValue(v) self.controls[k].Enable(e) - if e: self.controls[k].modified = true + if e: self.controls[k].modified = True if self.controlName: self.controlName.SetValue(state[2]) @@ -282,34 +282,34 @@ class PropPage(ParamPage): (control, 0, wxALIGN_CENTER_VERTICAL) ]) self.controls[param] = control topSizer.Add(sizer, 1, wxALL | wxEXPAND, 3) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(topSizer) topSizer.Fit(self) def SetValues(self, xxx): self.xxx = xxx self.origChecks = [] self.origControls = [] - # Set values, checkboxes to false, disable defaults + # Set values, checkboxes to False, disable defaults if xxx.hasName: self.controlName.SetValue(xxx.name) self.origName = xxx.name for param in xxx.allParams: w = self.controls[param] - w.modified = false + w.modified = False try: value = xxx.params[param].value() - w.Enable(true) + w.Enable(True) w.SetValue(value) if not param in xxx.required: - self.checks[param].SetValue(true) - self.origChecks.append((param, true)) - self.origControls.append((param, value, true)) + self.checks[param].SetValue(True) + self.origChecks.append((param, True)) + self.origControls.append((param, value, True)) except KeyError: - self.checks[param].SetValue(false) + self.checks[param].SetValue(False) w.SetValue('') - w.Enable(false) - self.origChecks.append((param, false)) - self.origControls.append((param, '', false)) + w.Enable(False) + self.origChecks.append((param, False)) + self.origControls.append((param, '', False)) ################################################################################ @@ -333,7 +333,7 @@ class StylePage(ParamPage): self.checks[param] = check self.controls[param] = control topSizer.Add(sizer, 1, wxALL | wxEXPAND, 3) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(topSizer) topSizer.Fit(self) # Set data for a cahced page @@ -346,7 +346,7 @@ class StylePage(ParamPage): check = self.checks[param] check.SetValue(present) w = self.controls[param] - w.modified = false + w.modified = False if present: value = xxx.params[param].value() else: diff --git a/wxPython/wxPython/tools/XRCed/params.py b/wxPython/wxPython/tools/XRCed/params.py index f983748bec..023a590951 100644 --- a/wxPython/wxPython/tools/XRCed/params.py +++ b/wxPython/wxPython/tools/XRCed/params.py @@ -22,15 +22,15 @@ buttonSize = (55,-1) class PPanel(wxPanel): def __init__(self, parent, name): wxPanel.__init__(self, parent, -1, name=name) - self.modified = self.freeze = false + self.modified = self.freeze = False def Enable(self, value): # Something strange is going on with enable so we make sure... for w in self.GetChildren(): w.Enable(value) wxPanel.Enable(self, value) def SetModified(self): - self.modified = true - g.panel.SetModified(true) + self.modified = True + g.panel.SetModified(True) # Common method to set modified state def OnChange(self, evt): if self.freeze: return @@ -48,7 +48,7 @@ class ParamBinaryOr(PPanel): sizer.Add(self.text, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 5) self.button = wxButton(self, self.ID_BUTTON_CHOICES, 'Edit...', size=buttonSize) sizer.Add(self.button, 0, wxALIGN_CENTER_VERTICAL) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) EVT_BUTTON(self, self.ID_BUTTON_CHOICES, self.OnButtonChoices) @@ -56,9 +56,9 @@ class ParamBinaryOr(PPanel): def GetValue(self): return self.text.GetValue() def SetValue(self, value): - self.freeze = true + self.freeze = True self.text.SetValue(value) - self.freeze = false + self.freeze = False def OnButtonChoices(self, evt): dlg = wxDialog(self, -1, 'Choices') topSizer = wxBoxSizer(wxVERTICAL) @@ -84,7 +84,7 @@ class ParamBinaryOr(PPanel): sizer.Add(0, 0, 1) sizer.Add(wxButton(dlg, wxID_CANCEL, 'Cancel')) topSizer.Add(sizer, 0, wxALL | wxEXPAND, 10) - dlg.SetAutoLayout(true) + dlg.SetAutoLayout(True) dlg.SetSizer(topSizer) topSizer.Fit(dlg) dlg.Center() @@ -143,23 +143,23 @@ class ParamColour(PPanel): sizer.Add(self.text, 0, wxRIGHT, 5) self.button = wxPanel(self, self.ID_BUTTON, wxDefaultPosition, wxSize(20, 20)) sizer.Add(self.button, 0, wxGROW) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) - self.textModified = false + self.textModified = False EVT_PAINT(self.button, self.OnPaintButton) EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange) EVT_LEFT_DOWN(self.button, self.OnLeftDown) def GetValue(self): return self.text.GetValue() def SetValue(self, value): - self.freeze = true + self.freeze = True if not value: value = '#FFFFFF' self.text.SetValue(str(value)) # update text ctrl colour = wxColour(int(value[1:3], 16), int(value[3:5], 16), int(value[5:7], 16)) self.button.SetBackgroundColour(colour) self.button.Refresh() - self.freeze = false + self.freeze = False def OnPaintButton(self, evt): dc = wxPaintDC(self.button) dc.SetBrush(wxTRANSPARENT_BRUSH) @@ -203,15 +203,15 @@ class ParamFont(PPanel): sizer.Add(self.text, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 5) self.button = wxButton(self, self.ID_BUTTON_SELECT, 'Select...', size=buttonSize) sizer.Add(self.button, 0, wxALIGN_CENTER_VERTICAL) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) - self.textModified = false + self.textModified = False EVT_BUTTON(self, self.ID_BUTTON_SELECT, self.OnButtonSelect) EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange) def OnChange(self, evt): PPanel.OnChange(self, evt) - self.textModified = true + self.textModified = True def _defaultValue(self): return ['12', 'default', 'normal', 'normal', '0', '', ''] def GetValue(self): @@ -223,11 +223,11 @@ class ParamFont(PPanel): return self._defaultValue() return self.value def SetValue(self, value): - self.freeze = true # disable other handlers + self.freeze = True # disable other handlers if not value: value = self._defaultValue() self.value = value self.text.SetValue(str(value)) # update text ctrl - self.freeze = false + self.freeze = False def OnButtonSelect(self, evt): if self.textModified: # text has newer value try: @@ -244,23 +244,23 @@ class ParamFont(PPanel): face = '' enc = wxFONTENCODING_DEFAULT # Fall back to default if exceptions - error = false + error = False try: try: size = int(self.value[0]) - except ValueError: error = true + except ValueError: error = True try: family = fontFamiliesXml2wx[self.value[1]] - except KeyError: error = true + except KeyError: error = True try: style = fontStylesXml2wx[self.value[2]] - except KeyError: error = true + except KeyError: error = True try: weight = fontWeightsXml2wx[self.value[3]] - except KeyError: error = true + except KeyError: error = True try: underlined = int(self.value[4]) - except ValueError: error = true + except ValueError: error = True face = self.value[5] mapper = wxFontMapper() if not self.value[6]: enc = mapper.CharsetToEncoding(self.value[6]) except IndexError: - error = true + error = True if error: wxLogError('Invalid font specification') if enc == wxFONTENCODING_DEFAULT: enc = wxFONTENCODING_SYSTEM font = wxFont(size, family, style, weight, underlined, face, enc) @@ -280,7 +280,7 @@ class ParamFont(PPanel): # Add ignored flags self.SetValue(value) self.SetModified() - self.textModified = false + self.textModified = False dlg.Destroy() ################################################################################ @@ -293,17 +293,17 @@ class ParamInt(PPanel): self.spin = wxSpinCtrl(self, self.ID_SPIN_CTRL, size=wxSize(50,-1)) self.SetBackgroundColour(g.panel.GetBackgroundColour()) sizer.Add(self.spin) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) EVT_SPINCTRL(self, self.ID_SPIN_CTRL, self.OnChange) def GetValue(self): return str(self.spin.GetValue()) def SetValue(self, value): - self.freeze = true + self.freeze = True if not value: value = 0 self.spin.SetValue(int(value)) - self.freeze = false + self.freeze = False class ParamText(PPanel): def __init__(self, parent, name, textWidth=260): @@ -314,16 +314,16 @@ class ParamText(PPanel): self.SetBackgroundColour(g.panel.GetBackgroundColour()) self.text = wxTextCtrl(self, self.ID_TEXT_CTRL, size=wxSize(textWidth,-1)) sizer.Add(self.text, 0, wxALIGN_CENTER_VERTICAL) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange) def GetValue(self): return self.text.GetValue() def SetValue(self, value): - self.freeze = true # disable other handlers + self.freeze = True # disable other handlers self.text.SetValue(value) - self.freeze = false # disable other handlers + self.freeze = False # disable other handlers class ParamAccel(ParamText): def __init__(self, parent, name): @@ -345,7 +345,7 @@ class ContentDialog(wxDialogPtr): # Set list items for v in value: self.list.Append(v) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.GetSizer().Fit(self) # Callbacks self.ID_BUTTON_APPEND = XMLID('BUTTON_APPEND') @@ -398,7 +398,7 @@ class ContentCheckListDialog(wxDialogPtr): self.list.Append(v) self.list.Check(i, ch) i += 1 - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.GetSizer().Fit(self) # Callbacks self.ID_BUTTON_APPEND = XMLID('BUTTON_APPEND') @@ -455,15 +455,15 @@ class ParamContent(PPanel): sizer.Add(self.text, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 5) self.button = wxButton(self, self.ID_BUTTON_EDIT, 'Edit...', size=buttonSize) sizer.Add(self.button, 0, wxALIGN_CENTER_VERTICAL) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) - self.textModified = false + self.textModified = False EVT_BUTTON(self, self.ID_BUTTON_EDIT, self.OnButtonEdit) EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange) def OnChange(self, evt): PPanel.OnChange(self, evt) - self.textModified = true + self.textModified = True def GetValue(self): if self.textModified: # text has newer value try: @@ -473,11 +473,11 @@ class ParamContent(PPanel): return [] return self.value def SetValue(self, value): - self.freeze = true + self.freeze = True if not value: value = [] self.value = value self.text.SetValue(str(value)) # update text ctrl - self.freeze = false + self.freeze = False def OnButtonEdit(self, evt): if self.textModified: # text has newer value try: @@ -493,7 +493,7 @@ class ParamContent(PPanel): # Add ignored flags self.SetValue(value) self.SetModified() - self.textModified = false + self.textModified = False dlg.Destroy() # CheckList content @@ -515,7 +515,7 @@ class ParamContentCheckList(ParamContent): # Add ignored flags self.SetValue(value) self.SetModified() - self.textModified = false + self.textModified = False dlg.Destroy() class IntListDialog(wxDialogPtr): @@ -533,7 +533,7 @@ class IntListDialog(wxDialogPtr): wxLogError('Invalid item type') else: self.list.Append(str(v)) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.GetSizer().Fit(self) # Callbacks self.ID_BUTTON_ADD = XMLID('BUTTON_ADD') @@ -550,10 +550,10 @@ class IntListDialog(wxDialogPtr): i = self.list.FindString(s) if i == -1: # ignore non-unique # Find place to insert - found = false + found = False for i in range(self.list.Number()): if int(self.list.GetString(i)) > v: - found = true + found = True break if found: self.list.InsertItems([s], i) else: self.list.Append(s) @@ -584,7 +584,7 @@ class ParamIntList(ParamContent): # Add ignored flags self.SetValue(value) self.SetModified() - self.textModified = false + self.textModified = False dlg.Destroy() # Boxless radiobox @@ -599,15 +599,15 @@ class RadioBox(PPanel): button = wxRadioButton(self, -1, i, name=i) topSizer.Add(button) EVT_RADIOBUTTON(self, button.GetId(), self.OnRadioChoice) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(topSizer) topSizer.Fit(self) def SetStringSelection(self, value): - self.freeze = true + self.freeze = True for i in self.choices: self.FindWindowByName(i).SetValue(i == value) self.value = value - self.freeze = false + self.freeze = False def OnRadioChoice(self, evt): if self.freeze: return if evt.GetSelection(): @@ -649,24 +649,24 @@ class ParamFile(PPanel): sizer.Add(self.text, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 5) self.button = wxButton(self, self.ID_BUTTON_BROWSE, 'Browse...',size=buttonSize) sizer.Add(self.button, 0, wxALIGN_CENTER_VERTICAL) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) - self.textModified = false + self.textModified = False EVT_BUTTON(self, self.ID_BUTTON_BROWSE, self.OnButtonBrowse) EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange) def OnChange(self, evt): PPanel.OnChange(self, evt) - self.textModified = true + self.textModified = True def GetValue(self): if self.textModified: # text has newer value return self.text.GetValue() return self.value def SetValue(self, value): - self.freeze = true + self.freeze = True self.value = value self.text.SetValue(value) # update text ctrl - self.freeze = false + self.freeze = False def OnButtonBrowse(self, evt): if self.textModified: # text has newer value self.value = self.text.GetValue() @@ -682,7 +682,7 @@ class ParamFile(PPanel): common = os.path.commonprefix([curpath, dlg.GetPath()]) self.SetValue(dlg.GetPath()[len(common):]) self.SetModified() - self.textModified = false + self.textModified = False dlg.Destroy() class ParamBitmap(PPanel): @@ -692,15 +692,15 @@ class ParamBitmap(PPanel): # Perform initialization with class pointer wxPanelPtr.__init__(self, w.this) self.thisown = 1 - self.modified = self.freeze = false + self.modified = self.freeze = False self.SetBackgroundColour(g.panel.GetBackgroundColour()) self.radio_std = self.FindWindowByName('RADIO_STD') self.radio_file = self.FindWindowByName('RADIO_FILE') self.combo = self.FindWindowByName('COMBO_STD') self.text = self.FindWindowByName('TEXT_FILE') self.button = self.FindWindowByName('BUTTON_BROWSE') - self.textModified = false - self.SetAutoLayout(true) + self.textModified = False + self.SetAutoLayout(True) self.GetSizer().SetMinSize((260, -1)) self.GetSizer().Fit(self) EVT_RADIOBUTTON(self, XMLID('RADIO_STD'), self.OnRadioStd) @@ -717,18 +717,18 @@ class ParamBitmap(PPanel): self.SetValue(['','']) def updateRadios(self): if self.value[0]: - self.radio_std.SetValue(true) - self.text.Enable(false) - self.button.Enable(false) - self.combo.Enable(true) + self.radio_std.SetValue(True) + self.text.Enable(False) + self.button.Enable(False) + self.combo.Enable(True) else: - self.radio_file.SetValue(true) - self.text.Enable(true) - self.button.Enable(true) - self.combo.Enable(false) + self.radio_file.SetValue(True) + self.text.Enable(True) + self.button.Enable(True) + self.combo.Enable(False) def OnChange(self, evt): PPanel.OnChange(self, evt) - self.textModified = true + self.textModified = True def OnCombo(self, evt): PPanel.OnChange(self, evt) self.value[0] = self.combo.GetValue() @@ -737,7 +737,7 @@ class ParamBitmap(PPanel): return [self.combo.GetValue(), self.text.GetValue()] return self.value def SetValue(self, value): - self.freeze = true + self.freeze = True if not value: self.value = ['', ''] else: @@ -745,7 +745,7 @@ class ParamBitmap(PPanel): self.combo.SetValue(self.value[0]) self.text.SetValue(self.value[1]) # update text ctrl self.updateRadios() - self.freeze = false + self.freeze = False def OnButtonBrowse(self, evt): if self.textModified: # text has newer value self.value[1] = self.text.GetValue() @@ -761,7 +761,7 @@ class ParamBitmap(PPanel): common = os.path.commonprefix([curpath, dlg.GetPath()]) self.SetValue(['', dlg.GetPath()[len(common):]]) self.SetModified() - self.textModified = false + self.textModified = False dlg.Destroy() paramDict = { diff --git a/wxPython/wxPython/tools/XRCed/tree.py b/wxPython/wxPython/tools/XRCed/tree.py index 2ce3f359cc..7f83fc27fa 100644 --- a/wxPython/wxPython/tools/XRCed/tree.py +++ b/wxPython/wxPython/tools/XRCed/tree.py @@ -161,12 +161,12 @@ class XML_Tree(wxTreeCtrl): EVT_LEFT_DCLICK(self, self.OnDClick) EVT_RIGHT_DOWN(self, self.OnRightDown) - self.needUpdate = false + self.needUpdate = False self.pendingHighLight = None - self.ctrl = self.shift = false + self.ctrl = self.shift = False self.dom = None # Create image list - il = wxImageList(16, 16, true) + il = wxImageList(16, 16, True) self.rootImage = il.AddIcon(images.getTreeRootIcon()) xxxObject.image = il.AddIcon(images.getTreeDefaultIcon()) xxxPanel.image = il.AddIcon(images.getTreePanelIcon()) @@ -296,7 +296,7 @@ class XML_Tree(wxTreeCtrl): if IsObject(n): self.AddNode(newItem, treeObj, n) return newItem - + # Remove leaf of tree, return it's data object def RemoveLeaf(self, leaf): xxx = self.GetPyData(leaf) @@ -367,7 +367,7 @@ class XML_Tree(wxTreeCtrl): if g.testWin: if g.testWin.highLight: g.testWin.highLight.Remove() - self.needUpdate = true + self.needUpdate = True status = 'Changes were applied' g.frame.SetStatusText(status) # Generate view @@ -382,11 +382,11 @@ class XML_Tree(wxTreeCtrl): self.pendingHighLight = self.selection # Check if item is in testWin subtree def IsHighlatable(self, item): - if item == g.testWin.item: return false + if item == g.testWin.item: return False while item != self.root: item = self.GetItemParent(item) - if item == g.testWin.item: return true - return false + if item == g.testWin.item: return True + return False # Highlight selected item def HighLight(self, item): self.pendingHighLight = None @@ -419,7 +419,7 @@ class XML_Tree(wxTreeCtrl): return # Show item in bold if g.testWin: # Reset old - self.SetItemBold(g.testWin.item, false) + self.SetItemBold(g.testWin.item, False) self.CreateTestWin(item) # Maybe an error occured, so we need to test if g.testWin: self.SetItemBold(g.testWin.item) @@ -515,20 +515,20 @@ class XML_Tree(wxTreeCtrl): testWin.CreateStatusBar() testWin.panel = testWin testWin.SetPosition(pos) - testWin.Show(true) + testWin.Show(True) elif xxx.__class__ == xxxPanel: # Create new frame if not testWin: testWin = g.testWin = wxFrame(g.frame, -1, 'Panel: ' + name, pos=pos) testWin.panel = res.LoadPanel(testWin, self.stdName) testWin.SetClientSize(testWin.panel.GetSize()) - testWin.Show(true) + testWin.Show(True) elif xxx.__class__ == xxxDialog: testWin = g.testWin = res.LoadDialog(None, self.stdName) testWin.panel = testWin testWin.Layout() testWin.SetPosition(pos) - testWin.Show(true) + testWin.Show(True) elif xxx.__class__ == xxxMenuBar: testWin = g.testWin = wxFrame(g.frame, -1, 'MenuBar: ' + name, pos=pos) testWin.panel = None @@ -536,7 +536,7 @@ class XML_Tree(wxTreeCtrl): testWin.CreateStatusBar() testWin.menuBar = res.LoadMenuBar(self.stdName) testWin.SetMenuBar(testWin.menuBar) - testWin.Show(true) + testWin.Show(True) elif xxx.__class__ == xxxToolBar: testWin = g.testWin = wxFrame(g.frame, -1, 'ToolBar: ' + name, pos=pos) testWin.panel = None @@ -544,7 +544,7 @@ class XML_Tree(wxTreeCtrl): testWin.CreateStatusBar() testWin.toolBar = res.LoadToolBar(testWin, self.stdName) testWin.SetToolBar(testWin.toolBar) - testWin.Show(true) + testWin.Show(True) wxMemoryFSHandler_RemoveFile('xxx.xrc') testWin.item = item EVT_CLOSE(testWin, self.OnCloseTestWin) @@ -556,7 +556,7 @@ class XML_Tree(wxTreeCtrl): wxEndBusyCursor() def OnCloseTestWin(self, evt): - self.SetItemBold(g.testWin.item, false) + self.SetItemBold(g.testWin.item, False) g.testWinPos = g.testWin.GetPosition() g.testWin.Destroy() g.testWin = None @@ -586,14 +586,14 @@ class XML_Tree(wxTreeCtrl): item = self.GetFirstChild(item, 0)[0] for k in range(i): item = self.GetNextSibling(item) return item - + # True if next item should be inserted after current (vs. appended to it) def NeedInsert(self, item): xxx = self.GetPyData(item) - if item == self.root: return false # root item - if xxx.hasChildren and not self.GetChildrenCount(item, false): - return false - return not (self.IsExpanded(item) and self.GetChildrenCount(item, false)) + if item == self.root: return False # root item + if xxx.hasChildren and not self.GetChildrenCount(item, False): + return False + return not (self.IsExpanded(item) and self.GetChildrenCount(item, False)) # Pull-down def OnRightDown(self, evt): @@ -616,7 +616,7 @@ class XML_Tree(wxTreeCtrl): self.shift = evt.ShiftDown() # and Shift too m = wxMenu() # create menu if self.ctrl: - needInsert = true + needInsert = True else: needInsert = self.NeedInsert(item) if item == self.root or needInsert and self.GetItemParent(item) == self.root: @@ -641,9 +641,9 @@ class XML_Tree(wxTreeCtrl): else: SetMenu(m, pullDownMenu.controls) if xxx.__class__ == xxxNotebook: - m.Enable(m.FindItem('sizer'), false) + m.Enable(m.FindItem('sizer'), False) elif not (xxx.isSizer or xxx.parent and xxx.parent.isSizer): - m.Enable(pullDownMenu.ID_NEW_SPACER, false) + m.Enable(pullDownMenu.ID_NEW_SPACER, False) # Select correct label for create menu if not needInsert: if self.shift: @@ -688,5 +688,5 @@ class XML_Tree(wxTreeCtrl): if isinstance(xxx, xxxBoxSizer): self.SetItemImage(item, xxx.treeImage()) # Set global modified state - g.frame.modified = true + g.frame.modified = True diff --git a/wxPython/wxPython/tools/XRCed/undo.py b/wxPython/wxPython/tools/XRCed/undo.py index b424304a34..ef9083cdc7 100644 --- a/wxPython/wxPython/tools/XRCed/undo.py +++ b/wxPython/wxPython/tools/XRCed/undo.py @@ -20,13 +20,13 @@ class UndoManager: undoObj = self.undo.pop() undoObj.undo() self.redo.append(undoObj) - g.frame.modified = true + g.frame.modified = True g.frame.SetStatusText('Undone') def Redo(self): undoObj = self.redo.pop() undoObj.redo() self.undo.append(undoObj) - g.frame.modified = true + g.frame.modified = True g.frame.SetStatusText('Redone') def Clear(self): for i in self.undo: i.destroy() @@ -37,7 +37,7 @@ class UndoManager: return not not self.undo def CanRedo(self): return not not self.redo - + class UndoCutDelete: def __init__(self, itemIndex, parent, elem): self.itemIndex = itemIndex @@ -56,7 +56,7 @@ class UndoCutDelete: # Update testWin if needed if g.testWin and g.tree.IsHighlatable(item): if g.conf.autoRefresh: - g.tree.needUpdate = true + g.tree.needUpdate = True g.tree.pendingHighLight = item else: g.tree.pendingHighLight = None @@ -72,7 +72,7 @@ class UndoCutDelete: # Remove highlight, update testWin if g.testWin.highLight: g.testWin.highLight.Remove() - g.tree.needUpdate = true + g.tree.needUpdate = True self.elem = g.tree.RemoveLeaf(item) g.tree.Unselect() g.panel.Clear() @@ -102,7 +102,7 @@ class UndoPasteCreate: # Remove highlight, update testWin if g.testWin.highLight: g.testWin.highLight.Remove() - g.tree.needUpdate = true + g.tree.needUpdate = True def redo(self): item = g.tree.InsertNode(g.tree.ItemAtFullIndex(self.itemParentIndex), self.parent, self.elem, @@ -114,7 +114,7 @@ class UndoPasteCreate: # Update testWin if needed if g.testWin and g.tree.IsHighlatable(item): if g.conf.autoRefresh: - g.tree.needUpdate = true + g.tree.needUpdate = True g.tree.pendingHighLight = item else: g.tree.pendingHighLight = None @@ -134,7 +134,7 @@ class UndoEdit: g.testWin.highLight.Remove() g.tree.pendingHighLight = selected if g.testWin: - g.tree.needUpdate = true + g.tree.needUpdate = True def undo(self): # Restore selection selected = g.tree.ItemAtFullIndex(self.selectedIndex) diff --git a/wxPython/wxPython/tools/XRCed/xrced.py b/wxPython/wxPython/tools/XRCed/xrced.py index dc2b5b9973..452446d33b 100644 --- a/wxPython/wxPython/tools/XRCed/xrced.py +++ b/wxPython/wxPython/tools/XRCed/xrced.py @@ -19,7 +19,7 @@ Options: -v Print version info. """ - + from globals import * @@ -73,7 +73,7 @@ class ScrolledMessageDialog(wxDialog): text.SetConstraints(Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok))) text.SetSize((w * 80 + 30, h * 40)) ok.SetConstraints(Layoutf('b=b5#1;x%w50#1;w!80;h!25', (self,))) - self.SetAutoLayout(TRUE) + self.SetAutoLayout(True) self.Fit() self.CenterOnScreen(wxBOTH) @@ -88,7 +88,7 @@ class Frame(wxFrame): self.SetIcon(images.getIconIcon()) # Idle flag - self.inIdle = false + self.inIdle = False # Make menus menuBar = wxMenuBar() @@ -119,7 +119,7 @@ class Frame(wxFrame): menu = wxMenu() self.ID_EMBED_PANEL = wxNewId() menu.Append(self.ID_EMBED_PANEL, '&Embed Panel', - 'Toggle embedding properties panel in the main window', true) + 'Toggle embedding properties panel in the main window', True) menu.Check(self.ID_EMBED_PANEL, conf.embedPanel) menu.AppendSeparator() self.ID_TEST = wxNewId() @@ -128,7 +128,7 @@ class Frame(wxFrame): menu.Append(self.ID_REFRESH, '&Refresh\tCtrl-R', 'Refresh test window') self.ID_AUTO_REFRESH = wxNewId() menu.Append(self.ID_AUTO_REFRESH, '&Auto-refresh\tCtrl-A', - 'Toggle auto-refresh mode', true) + 'Toggle auto-refresh mode', True) menu.Check(self.ID_AUTO_REFRESH, conf.autoRefresh) menuBar.Append(menu, '&View') @@ -163,7 +163,7 @@ class Frame(wxFrame): tb.AddSimpleTool(self.ID_REFRESH, images.getRefreshBitmap(), 'Refresh', 'Refresh view') tb.AddSimpleTool(self.ID_AUTO_REFRESH, images.getAutoRefreshBitmap(), - 'Auto-refresh', 'Toggle auto-refresh mode', true) + 'Auto-refresh', 'Toggle auto-refresh mode', True) if wxPlatform == '__WXGTK__': tb.AddSeparator() # otherwise auto-refresh sticks in status line tb.ToggleTool(self.ID_AUTO_REFRESH, conf.autoRefresh) @@ -221,7 +221,7 @@ class Frame(wxFrame): (conf.panelWidth, conf.panelHeight)) self.miniFrame = miniFrame sizer2 = wxBoxSizer() - miniFrame.SetAutoLayout(true) + miniFrame.SetAutoLayout(True) miniFrame.SetSizer(sizer2) EVT_CLOSE(self.miniFrame, self.OnCloseMiniFrame) # Create panel for parameters @@ -233,10 +233,10 @@ class Frame(wxFrame): else: panel = Panel(miniFrame) sizer2.Add(panel, 1, wxEXPAND) - miniFrame.Show(true) + miniFrame.Show(True) splitter.Initialize(tree) sizer.Add(splitter, 1, wxEXPAND) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(sizer) # Init pull-down menu data @@ -441,14 +441,14 @@ class Frame(wxFrame): selected = tree.selection if not selected: return # key pressed event xxx = tree.GetPyData(selected) - self.clipboard = xxx.element.cloneNode(true) + self.clipboard = xxx.element.cloneNode(True) self.SetStatusText('Copied') def OnPaste(self, evt): selected = tree.selection if not selected: return # key pressed event # For pasting with Ctrl pressed - if evt.GetId() == pullDownMenu.ID_PASTE_SIBLING: appendChild = false + if evt.GetId() == pullDownMenu.ID_PASTE_SIBLING: appendChild = False else: appendChild = not tree.NeedInsert(selected) xxx = tree.GetPyData(selected) if not appendChild: @@ -456,47 +456,47 @@ class Frame(wxFrame): nextItem = tree.GetNextSibling(selected) parentLeaf = tree.GetItemParent(selected) # Expanded container (must have children) - elif tree.IsExpanded(selected) and tree.GetChildrenCount(selected, false): + elif tree.IsExpanded(selected) and tree.GetChildrenCount(selected, False): # Insert as first child nextItem = tree.GetFirstChild(selected, 0)[0] parentLeaf = selected else: - # No children or unexpanded item - appendChild stays true + # No children or unexpanded item - appendChild stays True nextItem = wxTreeItemId() # no next item parentLeaf = selected parent = tree.GetPyData(parentLeaf).treeObject() # Create a copy of clipboard element - elem = self.clipboard.cloneNode(true) + elem = self.clipboard.cloneNode(True) # Tempopary xxx object to test things xxx = MakeXXXFromDOM(parent, elem) # Check compatibility - error = false + error = False # Top-level x = xxx.treeObject() if x.__class__ in [xxxDialog, xxxFrame, xxxMenuBar]: # Top-level classes - if parent.__class__ != xxxMainNode: error = true + if parent.__class__ != xxxMainNode: error = True elif x.__class__ == xxxToolBar: # Toolbar can be top-level of child of panel or frame - if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame]: error = true + if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame]: error = True elif x.__class__ == xxxPanel and parent.__class__ == xxxMainNode: pass elif x.__class__ == xxxSpacer: - if not parent.isSizer: error = true + if not parent.isSizer: error = True elif x.__class__ == xxxSeparator: - if not parent.__class__ in [xxxMenu, xxxToolBar]: error = true + if not parent.__class__ in [xxxMenu, xxxToolBar]: error = True elif x.__class__ == xxxTool: - if parent.__class__ != xxxToolBar: error = true + if parent.__class__ != xxxToolBar: error = True elif x.__class__ == xxxMenu: - if not parent.__class__ in [xxxMainNode, xxxMenuBar, xxxMenu]: error = true + if not parent.__class__ in [xxxMainNode, xxxMenuBar, xxxMenu]: error = True elif x.__class__ == xxxMenuItem: - if not parent.__class__ in [xxxMenuBar, xxxMenu]: error = true - elif x.isSizer and parent.__class__ == xxxNotebook: error = true + if not parent.__class__ in [xxxMenuBar, xxxMenu]: error = True + elif x.isSizer and parent.__class__ == xxxNotebook: error = True else: # normal controls can be almost anywhere if parent.__class__ == xxxMainNode or \ - parent.__class__ in [xxxMenuBar, xxxMenu]: error = true + parent.__class__ in [xxxMenuBar, xxxMenu]: error = True if error: if parent.__class__ == xxxMainNode: parentClass = 'root' else: parentClass = parent.className @@ -517,7 +517,7 @@ class Frame(wxFrame): elem = xxx.child.element # replace # This may help garbage collection xxx.child.parent = None - isChildContainer = false + isChildContainer = False # Parent is sizer or notebook, child is not child container if parent.isSizer and not isChildContainer and not isinstance(xxx, xxxSpacer): # Create sizer item element @@ -540,11 +540,11 @@ class Frame(wxFrame): # Update view? if g.testWin and tree.IsHighlatable(newItem): if conf.autoRefresh: - tree.needUpdate = true + tree.needUpdate = True tree.pendingHighLight = newItem else: tree.pendingHighLight = None - self.modified = true + self.modified = True self.SetStatusText('Pasted') def OnCutDelete(self, evt): @@ -567,7 +567,7 @@ class Frame(wxFrame): # Remove highlight, update testWin if g.testWin.highLight: g.testWin.highLight.Remove() - tree.needUpdate = true + tree.needUpdate = True # Prepare undo data panel.Apply() index = tree.ItemFullIndex(selected) @@ -576,11 +576,11 @@ class Frame(wxFrame): undoMan.RegisterUndo(UndoCutDelete(index, parent, elem)) if evt.GetId() == wxID_CUT: if self.clipboard: self.clipboard.unlink() - self.clipboard = elem.cloneNode(true) + self.clipboard = elem.cloneNode(True) tree.pendingHighLight = None tree.Unselect() panel.Clear() - self.modified = true + self.modified = True self.SetStatusText(status) def OnSelect(self, evt): @@ -609,7 +609,7 @@ class Frame(wxFrame): # Widen self.SetDimensions(pos.x, pos.y, size.x + sizePanel.x, size.y) self.splitter.SplitVertically(tree, panel, conf.sashPos) - self.miniFrame.Show(false) + self.miniFrame.Show(False) else: conf.sashPos = self.splitter.GetSashPosition() pos = self.GetPosition() @@ -618,9 +618,9 @@ class Frame(wxFrame): self.splitter.Unsplit(panel) sizer = self.miniFrame.GetSizer() panel.Reparent(self.miniFrame) - panel.Show(true) + panel.Show(True) sizer.Add(panel, 1, wxEXPAND) - self.miniFrame.Show(true) + self.miniFrame.Show(True) self.miniFrame.SetDimensions(conf.panelX, conf.panelY, conf.panelWidth, conf.panelHeight) wxYield() @@ -642,7 +642,7 @@ class Frame(wxFrame): if g.testWin: # (re)create tree.CreateTestWin(g.testWin.item) - tree.needUpdate = false + tree.needUpdate = False def OnAutoRefresh(self, evt): conf.autoRefresh = evt.IsChecked() @@ -684,7 +684,7 @@ Homepage: http://xrced.sourceforge.net\ def OnCreate(self, evt): selected = tree.selection - if tree.ctrl: appendChild = false + if tree.ctrl: appendChild = False else: appendChild = not tree.NeedInsert(selected) xxx = tree.GetPyData(selected) if not appendChild: @@ -699,7 +699,7 @@ Homepage: http://xrced.sourceforge.net\ parentLeaf = tree.GetItemParent(selected) # Expanded container (must have children) elif tree.shift and tree.IsExpanded(selected) \ - and tree.GetChildrenCount(selected, false): + and tree.GetChildrenCount(selected, False): nextItem = tree.GetFirstChild(selected, 0)[0] parentLeaf = selected else: @@ -731,7 +731,7 @@ Homepage: http://xrced.sourceforge.net\ # Update view? if g.testWin and tree.IsHighlatable(newItem): if conf.autoRefresh: - tree.needUpdate = true + tree.needUpdate = True tree.pendingHighLight = newItem else: tree.pendingHighLight = None @@ -765,7 +765,7 @@ Homepage: http://xrced.sourceforge.net\ def OnIdle(self, evt): if self.inIdle: return # Recursive call protection - self.inIdle = true + self.inIdle = True if tree.needUpdate: if conf.autoRefresh: if g.testWin: @@ -774,12 +774,12 @@ Homepage: http://xrced.sourceforge.net\ tree.CreateTestWin(g.testWin.item) wxYield() self.SetStatusText('') - tree.needUpdate = false + tree.needUpdate = False elif tree.pendingHighLight: tree.HighLight(tree.pendingHighLight) else: evt.Skip() - self.inIdle = false + self.inIdle = False # We don't let close panel window def OnCloseMiniFrame(self, evt): @@ -807,7 +807,7 @@ Homepage: http://xrced.sourceforge.net\ self.clipboard.unlink() self.clipboard = None undoMan.Clear() - self.modified = false + self.modified = False tree.Clear() panel.Clear() if g.testWin: @@ -822,7 +822,7 @@ Homepage: http://xrced.sourceforge.net\ def Open(self, path): if not os.path.exists(path): wxLogError('File does not exists: %s' % path) - return false + return False # Try to read the file try: f = open(path) @@ -852,8 +852,8 @@ Homepage: http://xrced.sourceforge.net\ inf = sys.exc_info() wxLogError(traceback.format_exception(inf[0], inf[1], None)[-1]) wxLogError('Error reading file: %s' % path) - return false - return true + return False + return True def Indent(self, node, indent = 0): # Copy child list because it will change soon @@ -880,22 +880,22 @@ Homepage: http://xrced.sourceforge.net\ f = open(path, 'w') # Make temporary copy for formatting it # !!! We can't clone dom node, it works only once - #self.domCopy = tree.dom.cloneNode(true) + #self.domCopy = tree.dom.cloneNode(True) self.domCopy = MyDocument() - mainNode = self.domCopy.appendChild(tree.mainNode.cloneNode(true)) + mainNode = self.domCopy.appendChild(tree.mainNode.cloneNode(True)) self.Indent(mainNode) self.domCopy.writexml(f, encoding=tree.rootObj.params['encoding'].value()) f.close() self.domCopy.unlink() self.domCopy = None - self.modified = false - panel.SetModified(false) + self.modified = False + panel.SetModified(False) except: wxLogError('Error writing file: %s' % path) raise def AskSave(self): - if not (self.modified or panel.IsModified()): return true + if not (self.modified or panel.IsModified()): return True flags = wxICON_EXCLAMATION | wxYES_NO | wxCANCEL | wxCENTRE dlg = wxMessageDialog( self, 'File is modified. Save before exit?', 'Save before too late?', flags ) @@ -904,12 +904,12 @@ Homepage: http://xrced.sourceforge.net\ if say == wxID_YES: self.OnSaveOrSaveAs(wxCommandEvent(wxID_SAVE)) # If save was successful, modified flag is unset - if not self.modified: return true + if not self.modified: return True elif say == wxID_NO: - self.modified = false - panel.SetModified(false) - return true - return false + self.modified = False + panel.SetModified(False) + return True + return False def SaveUndo(self): pass # !!! @@ -935,7 +935,7 @@ class App(wxApp): usage() sys.exit(0) elif o == '-d': - debug = true + debug = True elif o == '-v': print 'XRCed version', version sys.exit(0) @@ -944,10 +944,10 @@ class App(wxApp): # Settings global conf conf = g.conf = wxConfig(style = wxCONFIG_USE_LOCAL_FILE) - conf.autoRefresh = conf.ReadInt('autorefresh', true) + conf.autoRefresh = conf.ReadInt('autorefresh', True) pos = conf.ReadInt('x', -1), conf.ReadInt('y', -1) size = conf.ReadInt('width', 800), conf.ReadInt('height', 600) - conf.embedPanel = conf.ReadInt('embedPanel', true) + conf.embedPanel = conf.ReadInt('embedPanel', True) conf.sashPos = conf.ReadInt('sashPos', 200) if not conf.embedPanel: conf.panelX = conf.ReadInt('panelX', -1) @@ -962,17 +962,17 @@ class App(wxApp): wxInitAllImageHandlers() # Create main frame frame = Frame(pos, size) - frame.Show(true) + frame.Show(True) # Load resources from XRC file (!!! should be transformed to .py later?) frame.res = wxXmlResource('') frame.res.Load(os.path.join(basePath, 'xrced.xrc')) # Load file after showing if args: - conf.panic = false + conf.panic = False frame.open = frame.Open(args[0]) - return true + return True def OnExit(self): # Write config @@ -994,7 +994,7 @@ class App(wxApp): wc.Flush() def main(): - app = App(0, useBestVisual=false) + app = App(0, useBestVisual=False) app.MainLoop() app.OnExit() global conf diff --git a/wxPython/wxPython/tools/XRCed/xxx.py b/wxPython/wxPython/tools/XRCed/xxx.py index b7ddcf8a6e..c84131f889 100644 --- a/wxPython/wxPython/tools/XRCed/xxx.py +++ b/wxPython/wxPython/tools/XRCed/xxx.py @@ -138,7 +138,7 @@ class xxxParamContentCheckList(xxxNode): l = [] for s,ch in value: itemElem = g.tree.dom.createElement('item') - # Add checked only if true + # Add checked only if True if ch: itemElem.setAttribute('checked', '1') itemText = g.tree.dom.createTextNode(s) itemElem.appendChild(itemText) @@ -171,10 +171,10 @@ class xxxParamBitmap(xxxParam): # Classes to interface DOM objects class xxxObject: # Default behavior - hasChildren = false # has children elements? - hasStyle = true # almost everyone - hasName = true # has name attribute? - isSizer = hasChild = false + hasChildren = False # has children elements? + hasStyle = True # almost everyone + hasName = True # has name attribute? + isSizer = hasChild = False allParams = None # Some nodes have no parameters # Style parameters (all optional) styles = ['fg', 'bg', 'font', 'enabled', 'focused', 'hidden', 'tooltip'] @@ -286,7 +286,7 @@ class xxxParamFont(xxxObject, xxxNode): ################################################################################ class xxxContainer(xxxObject): - hasChildren = true + hasChildren = True # Simulate normal parameter for encoding class xxxEncoding: @@ -301,7 +301,7 @@ class xxxEncoding: class xxxMainNode(xxxContainer): allParams = ['encoding'] required = ['encoding'] - hasStyle = hasName = false + hasStyle = hasName = False def __init__(self, dom): xxxContainer.__init__(self, None, dom.documentElement) self.className = 'XML tree' @@ -324,7 +324,7 @@ class xxxDialog(xxxContainer): winStyles = ['wxDEFAULT_DIALOG_STYLE', 'wxSTAY_ON_TOP', 'wxDIALOG_MODAL', 'wxDIALOG_MODELESS', 'wxCAPTION', 'wxSYSTEM_MENU', 'wxRESIZE_BORDER', 'wxRESIZE_BOX', - 'wxTHICK_FRAME', + 'wxTHICK_FRAME', 'wxNO_3D', 'wxTAB_TRAVERSAL', 'wxCLIP_CHILDREN'] styles = ['fg', 'bg', 'font', 'enabled', 'focused', 'hidden', 'exstyle', 'tooltip'] @@ -335,7 +335,7 @@ class xxxFrame(xxxContainer): paramDict = {'centered': ParamBool} required = ['title'] winStyles = ['wxDEFAULT_FRAME_STYLE', 'wxDEFAULT_DIALOG_STYLE', - 'wxSTAY_ON_TOP', + 'wxSTAY_ON_TOP', 'wxCAPTION', 'wxSYSTEM_MENU', 'wxRESIZE_BORDER', 'wxRESIZE_BOX', 'wxMINIMIZE_BOX', 'wxMAXIMIZE_BOX', 'wxFRAME_FLOAT_ON_PARENT', 'wxFRAME_TOOL_WINDOW', @@ -348,12 +348,12 @@ class xxxTool(xxxObject): allParams = ['bitmap', 'bitmap2', 'toggle', 'tooltip', 'longhelp'] required = ['bitmap'] paramDict = {'bitmap2': ParamBitmap, 'toggle': ParamBool} - hasStyle = false + hasStyle = False class xxxToolBar(xxxContainer): - allParams = ['bitmapsize', 'margins', 'packing', 'separation', + allParams = ['bitmapsize', 'margins', 'packing', 'separation', 'pos', 'size', 'style'] - hasStyle = false + hasStyle = False paramDict = {'bitmapsize': ParamPosSize, 'margins': ParamPosSize, 'packing': ParamInt, 'separation': ParamInt, 'style': ParamNonGenericStyle} @@ -411,7 +411,7 @@ class xxxSlider(xxxObject): class xxxGauge(xxxObject): allParams = ['range', 'pos', 'size', 'style', 'value', 'shadow', 'bezel'] - paramDict = {'range': ParamInt, 'value': ParamInt, + paramDict = {'range': ParamInt, 'value': ParamInt, 'shadow': ParamInt, 'bezel': ParamInt} winStyles = ['wxGA_HORIZONTAL', 'wxGA_VERTICAL', 'wxGA_PROGRESSBAR', 'wxGA_SMOOTH'] @@ -521,14 +521,14 @@ class xxxCheckList(xxxObject): 'wxLC_USER_TEXT', 'wxLC_EDIT_LABELS', 'wxLC_NO_HEADER', 'wxLC_SINGLE_SEL', 'wxLC_SORT_ASCENDING', 'wxLC_SORT_DESCENDING'] paramDict = {'content': ParamContentCheckList} - + ################################################################################ # Sizers class xxxSizer(xxxContainer): - hasName = hasStyle = false + hasName = hasStyle = False paramDict = {'orient': ParamOrient} - isSizer = true + isSizer = True class xxxBoxSizer(xxxSizer): allParams = ['orient'] @@ -589,8 +589,8 @@ class xxxFlexGridSizer(xxxGridSizer): # Container with only one child. # Not shown in tree. class xxxChildContainer(xxxObject): - hasName = hasStyle = false - hasChild = true + hasName = hasStyle = False + hasChild = True def __init__(self, parent, element): xxxObject.__init__(self, parent, element) # Must have one child with 'object' tag, but we don't check it @@ -635,7 +635,7 @@ class xxxNotebookPage(xxxChildContainer): self.child.allParams.remove('size') class xxxSpacer(xxxObject): - hasName = hasStyle = false + hasName = hasStyle = False allParams = ['size', 'option', 'flag', 'border'] paramDict = {'option': ParamInt} default = {'size': '0,0'} @@ -655,10 +655,10 @@ class xxxMenuItem(xxxObject): allParams = ['label', 'bitmap', 'accel', 'help', 'checkable', 'radio', 'enabled', 'checked'] default = {'label': ''} - hasStyle = false + hasStyle = False class xxxSeparator(xxxObject): - hasName = hasStyle = false + hasName = hasStyle = False ################################################################################ # Unknown control @@ -675,7 +675,7 @@ xxxDict = { 'wxFrame': xxxFrame, 'tool': xxxTool, 'wxToolBar': xxxToolBar, - + 'wxBitmap': xxxBitmap, 'wxIcon': xxxIcon, @@ -707,7 +707,7 @@ xxxDict = { 'wxCalendarCtrl': xxxCalendarCtrl, 'wxGenericDirCtrl': xxxGenericDirCtrl, 'wxSpinCtrl': xxxSpinCtrl, - + 'wxBoxSizer': xxxBoxSizer, 'wxStaticBoxSizer': xxxStaticBoxSizer, 'wxGridSizer': xxxGridSizer, @@ -752,7 +752,7 @@ def MakeXXXFromDOM(parent, element): return klass(parent, element) # Make empty DOM element -def MakeEmptyDOM(className): +def MakeEmptyDOM(className): elem = g.tree.dom.createElement('object') elem.setAttribute('class', className) # Set required and default parameters