From 372bde9b72b67036482dcc170f6260846e7a3b64 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 11 Dec 2003 19:55:48 +0000 Subject: [PATCH] Kevin O's demo modules fixup patch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/ColourSelect.py | 2 +- wxPython/demo/ContextHelp.py | 4 +-- wxPython/demo/CustomDragAndDrop.py | 6 ++--- wxPython/demo/DrawXXXList.py | 4 +-- wxPython/demo/EventManager.py | 12 ++++----- wxPython/demo/GridHugeTable.py | 4 +-- wxPython/demo/GridStdEdRend.py | 6 ++--- wxPython/demo/Layoutf.py | 2 +- wxPython/demo/URLDragAndDrop.py | 10 +++---- wxPython/demo/wxArtProvider.py | 4 +-- wxPython/demo/wxButton.py | 4 +-- wxPython/demo/wxDragImage.py | 6 ++--- wxPython/demo/wxGLCanvas.py | 2 +- wxPython/demo/wxGrid.py | 2 +- wxPython/demo/wxGrid_MegaExample.py | 10 +++---- wxPython/demo/wxListbook.py | 14 ++++++---- wxPython/demo/wxOGL.py | 2 +- wxPython/demo/wxScrolledPanel.py | 2 +- wxPython/demo/wxScrolledWindow.py | 2 +- wxPython/demo/wxStyledTextCtrl_2.py | 42 ++++++++++++++--------------- wxPython/demo/wxValidator.py | 8 +++--- 21 files changed, 76 insertions(+), 72 deletions(-) diff --git a/wxPython/demo/ColourSelect.py b/wxPython/demo/ColourSelect.py index 8f220642fa..6f2a9e1465 100644 --- a/wxPython/demo/ColourSelect.py +++ b/wxPython/demo/ColourSelect.py @@ -56,7 +56,7 @@ class TestColourSelect(wx.Panel): # show a button with all default values self.colourDefaults = csel.ColourSelect(self, -1) - self.colourDefaults.Bind(csel.EVT_COLOURSELECT, self.OnSelectColour, self.colourDefaults.GetId()) + self.Bind(csel.EVT_COLOURSELECT, self.OnSelectColour, id=self.colourDefaults.GetId()) buttonSizer.AddMany([ (wx.StaticText(self, -1, "Default Colour/Size"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL), diff --git a/wxPython/demo/ContextHelp.py b/wxPython/demo/ContextHelp.py index 561a597a5b..4625330d0a 100644 --- a/wxPython/demo/ContextHelp.py +++ b/wxPython/demo/ContextHelp.py @@ -43,8 +43,8 @@ class TestPanel(wx.Panel): cBtnText.SetHelpText("Some helpful text...") s = wx.BoxSizer(wx.HORIZONTAL) - s.Add(cBtn, 0, wxALL, 5) - s.Add(cBtnText, 0, wxALL, 5) + s.Add(cBtn, 0, wx.ALL, 5) + s.Add(cBtnText, 0, wx.ALL, 5) sizer.Add((20,20)) sizer.Add(s) diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index 2ff049640e..fcb0947287 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -247,10 +247,10 @@ class CustomDnDPanel(wx.Panel): rbox.Add(rb1) rbox.Add(rb2) - box.Add(text1, 0, wxALL, 10) - box.Add(rbox, 0, wxALIGN_CENTER) + box.Add(text1, 0, wx.ALL, 10) + box.Add(rbox, 0, wx.ALIGN_CENTER) box.Add((10,90)) - box.Add(text2, 0, wxALL, 10) + box.Add(text2, 0, wx.ALL, 10) sizer.Add(box) diff --git a/wxPython/demo/DrawXXXList.py b/wxPython/demo/DrawXXXList.py index 1ac1338d11..07adb42961 100644 --- a/wxPython/demo/DrawXXXList.py +++ b/wxPython/demo/DrawXXXList.py @@ -141,8 +141,8 @@ def makeRandomColors(num): colors = [] for i in range(num): - c = whrandom.choice(colours) - colors.append(wxNamedColour(c)) + c = random.choice(colours) + colors.append(wx.NamedColour(c)) return colors diff --git a/wxPython/demo/EventManager.py b/wxPython/demo/EventManager.py index b492ecc599..a846958e4b 100644 --- a/wxPython/demo/EventManager.py +++ b/wxPython/demo/EventManager.py @@ -62,16 +62,16 @@ class TestPanel(wx.Panel): message2 = wx.StaticText(self, -1, txt) message2.SetFont(f1) - targetPanel = Tile(self, log, bgColor=wxColour(80,10,10), active=0) - buttonPanel = wxPanel(self ,-1) - sizer = wxBoxSizer(wxHORIZONTAL) + targetPanel = Tile(self, log, bgColor=wx.Colour(80,10,10), active=0) + buttonPanel = wx.Panel(self ,-1) + sizer = wx.BoxSizer(wx.HORIZONTAL) target = targetPanel.tile sizer.Add((0,0), 1) for factor in [0.2, 0.3, 0.4, 0.5, 0.6, 0.7]: - sizer.Add(Tile(buttonPanel, log, factor-0.05, target), 0, wxALIGN_CENTER) + sizer.Add(Tile(buttonPanel, log, factor-0.05, target), 0, wx.ALIGN_CENTER) sizer.Add((0,0),1) - sizer.Add(Tile(buttonPanel, log, factor, target), 0, wxALIGN_CENTER) + sizer.Add(Tile(buttonPanel, log, factor, target), 0, wx.ALIGN_CENTER) sizer.Add((0,0),1) buttonPanel.SetAutoLayout(1) @@ -137,7 +137,7 @@ class Tile(wx.Panel): -class InnerTile(wxPanel): +class InnerTile(wx.Panel): IDLE_COLOR = wx.Colour( 80, 10, 10) START_COLOR = wx.Colour(200, 70, 50) FINAL_COLOR = wx.Colour( 20, 80,240) diff --git a/wxPython/demo/GridHugeTable.py b/wxPython/demo/GridHugeTable.py index 5e8bf5eb0d..078af65bee 100644 --- a/wxPython/demo/GridHugeTable.py +++ b/wxPython/demo/GridHugeTable.py @@ -21,9 +21,9 @@ class HugeTable(gridlib.PyGridTableBase): gridlib.PyGridTableBase.__init__(self) self.log = log - self.odd=wxGridCellAttr() + self.odd=gridlib.GridCellAttr() self.odd.SetBackgroundColour("sky blue") - self.even=wxGridCellAttr() + self.even=gridlib.GridCellAttr() self.even.SetBackgroundColour("sea green") def GetAttr(self, row, col, kind): diff --git a/wxPython/demo/GridStdEdRend.py b/wxPython/demo/GridStdEdRend.py index ea84545ce8..3e0f2f294b 100644 --- a/wxPython/demo/GridStdEdRend.py +++ b/wxPython/demo/GridStdEdRend.py @@ -16,9 +16,9 @@ class MyCustomRenderer(gridlib.PyGridCellRenderer): gridlib.PyGridCellRenderer.__init__(self) def Draw(self, grid, attr, dc, rect, row, col, isSelected): - dc.SetBackgroundMode(wxSOLID) - dc.SetBrush(wxBrush(wxBLACK, wxSOLID)) - dc.SetPen(wxTRANSPARENT_PEN) + dc.SetBackgroundMode(wx.SOLID) + dc.SetBrush(wx.Brush(wx.BLACK, wx.SOLID)) + dc.SetPen(wx.TRANSPARENT_PEN) dc.DrawRectangleRect(rect) dc.SetBackgroundMode(wx.TRANSPARENT) diff --git a/wxPython/demo/Layoutf.py b/wxPython/demo/Layoutf.py index bc25c3aeef..fcf059819b 100644 --- a/wxPython/demo/Layoutf.py +++ b/wxPython/demo/Layoutf.py @@ -18,7 +18,7 @@ class TestLayoutf(wx.Panel): wx.Panel.__init__(self, parent, -1) self.SetAutoLayout(True) - self.Bind(EVT_BUTTON, self.OnButton, id=ID_Button) + self.Bind(wx.EVT_BUTTON, self.OnButton, id=ID_Button) self.panelA = wx.Window(self, -1, style=wx.SIMPLE_BORDER) self.panelA.SetBackgroundColour(wx.BLUE) diff --git a/wxPython/demo/URLDragAndDrop.py b/wxPython/demo/URLDragAndDrop.py index 95fbbaef32..74b326c241 100644 --- a/wxPython/demo/URLDragAndDrop.py +++ b/wxPython/demo/URLDragAndDrop.py @@ -42,10 +42,10 @@ class TestPanel(wx.Panel): text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) - text.SetSize(wxSize(w,h+1)) - text.SetForegroundColour(wxBLUE) - outsideSizer.Add(text, 0, wxEXPAND|wxALL, 5) - outsideSizer.Add(wxStaticLine(self, -1), 0, wxEXPAND) + text.SetSize(wx.Size(w,h+1)) + text.SetForegroundColour(wx.BLUE) + outsideSizer.Add(text, 0, wx.EXPAND|wx.ALL, 5) + outsideSizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND) outsideSizer.Add((20,20)) self.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD, False)) @@ -55,7 +55,7 @@ class TestPanel(wx.Panel): inSizer.Add((20,20)) inSizer.Add((20,20)) - inSizer.Add(wxStaticText(self, -1, + inSizer.Add(wx.StaticText(self, -1, "Drag URLs from your browser to\nthis window:", style = wx.ALIGN_RIGHT), 0, wx.ALIGN_RIGHT ) diff --git a/wxPython/demo/wxArtProvider.py b/wxPython/demo/wxArtProvider.py index a71c1ad062..02b326680e 100644 --- a/wxPython/demo/wxArtProvider.py +++ b/wxPython/demo/wxArtProvider.py @@ -126,9 +126,9 @@ class TestPanel(wx.Panel): self.Bind(wx.EVT_COMBOBOX, self.OnSelectID, combo) combo.Select(0) - cb = wxCheckBox(self, -1, "Use custom provider") + cb = wx.CheckBox(self, -1, "Use custom provider") fgs.Add(cb, 0, wx.ALIGN_CENTRE|wx.ALL, 5) - self.Bind(EVT_CHECKBOX, self.OnUseCustom, cb) + self.Bind(wx.EVT_CHECKBOX, self.OnUseCustom, cb) fgs.Add((10, 10), 0, wx.ALIGN_CENTRE|wx.ALL, 5) fgs.Add((10, 10), 0, wx.ALIGN_CENTRE|wx.ALL, 5) diff --git a/wxPython/demo/wxButton.py b/wxPython/demo/wxButton.py index b4ac31d997..039ff89e4b 100644 --- a/wxPython/demo/wxButton.py +++ b/wxPython/demo/wxButton.py @@ -15,12 +15,12 @@ class TestPanel(wx.Panel): self.log = log b = wx.Button(self, 10, "Default Button", (20, 20)) - self.Bind(EVT_BUTTON, self.OnClick, b) + self.Bind(wx.EVT_BUTTON, self.OnClick, b) b.SetDefault() b.SetSize(b.GetBestSize()) b = wx.Button(self, 20, "HELLO AGAIN!", (20, 80), (120, 45)) - self.Bind(EVT_BUTTON, self.OnClick, b) + self.Bind(wx.EVT_BUTTON, self.OnClick, b) b.SetToolTipString("This is a Hello button...") if 0: # a test case for catching wx.PyAssertionError diff --git a/wxPython/demo/wxDragImage.py b/wxPython/demo/wxDragImage.py index 4b1764743f..ad8f880a5d 100644 --- a/wxPython/demo/wxDragImage.py +++ b/wxPython/demo/wxDragImage.py @@ -29,7 +29,7 @@ class DragShape: memDC = wx.MemoryDC() memDC.SelectObject(self.bmp) - dc.Blit((self.pos.x, self.pos.y), + dc.Blit((self.pos[0], self.pos[1]), (self.bmp.GetWidth(), self.bmp.GetHeight()), memDC, (0, 0), op, True) @@ -77,8 +77,8 @@ class DragCanvas(wx.ScrolledWindow): dc.SetTextForeground(wx.RED) dc.SetFont(font) dc.DrawText(text, (0, 0)) - dc.SelectObject(wxNullBitmap) - mask = wxMaskColour(bmp, bg_colour) + dc.SelectObject(wx.NullBitmap) + mask = wx.MaskColour(bmp, bg_colour) bmp.SetMask(mask) shape = DragShape(bmp) shape.pos = (5, 100) diff --git a/wxPython/demo/wxGLCanvas.py b/wxPython/demo/wxGLCanvas.py index 3f2a482d17..51c231e22a 100644 --- a/wxPython/demo/wxGLCanvas.py +++ b/wxPython/demo/wxGLCanvas.py @@ -38,7 +38,7 @@ if not haveGLCanvas: elif not haveOpenGL: def runTest(frame, nb, log): - dlg = wxMessageDialog( + dlg = wx.MessageDialog( frame, 'The OpenGL package was not found. You can get it at\n' 'http://PyOpenGL.sourceforge.net/', 'Sorry', wx.OK | wx.ICON_INFORMATION ) diff --git a/wxPython/demo/wxGrid.py b/wxPython/demo/wxGrid.py index efe344be0f..78eae6b678 100644 --- a/wxPython/demo/wxGrid.py +++ b/wxPython/demo/wxGrid.py @@ -24,7 +24,7 @@ class ButtonPanel(wx.Panel): wx.Panel.__init__(self, parent, -1) self.log = log - box = wxBoxSizer(wx.VERTICAL) + box = wx.BoxSizer(wx.VERTICAL) box.Add((20, 20)) keys = buttonDefs.keys() keys.sort() diff --git a/wxPython/demo/wxGrid_MegaExample.py b/wxPython/demo/wxGrid_MegaExample.py index aa77588e51..335db3f5a8 100644 --- a/wxPython/demo/wxGrid_MegaExample.py +++ b/wxPython/demo/wxGrid_MegaExample.py @@ -219,8 +219,8 @@ class MegaImageRenderer(Grid.PyGridCellRenderer): dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID)) dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID)) else: - dc.SetBrush(wxBrush(wxWHITE, wxSOLID)) - dc.SetPen(wxPen(wxWHITE, 1, wxSOLID)) + dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID)) + dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID)) dc.DrawRectangleRect(rect) #dc.DrawRectangle((rect.x, rect.y), (rect.width, rect.height)) @@ -236,7 +236,7 @@ class MegaImageRenderer(Grid.PyGridCellRenderer): dc.Blit((rect.x+1, rect.y+1), (width, height), image, - (0, 0), wxCOPY, True) + (0, 0), wx.COPY, True) class MegaFontRenderer(Grid.PyGridCellRenderer): @@ -265,8 +265,8 @@ class MegaFontRenderer(Grid.PyGridCellRenderer): dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID)) dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID)) else: - dc.SetBrush(wxBrush(wxWHITE, wxSOLID)) - dc.SetPen(wxPen(wxWHITE, 1, wxSOLID)) + dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID)) + dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID)) dc.DrawRectangleRect(rect) #dc.DrawRectangle((rect.x, rect.y), (rect.width, rect.height)) diff --git a/wxPython/demo/wxListbook.py b/wxPython/demo/wxListbook.py index f7be7ba1d5..2186205cb3 100644 --- a/wxPython/demo/wxListbook.py +++ b/wxPython/demo/wxListbook.py @@ -11,6 +11,10 @@ import sys import wx +import images + +import ColorPanel + colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blue", "Coral", "Cornflower Blue", "Cyan", "Dark Grey", "Dark Green", "Dark Olive Green", "Dark Orchid", "Dark Slate Blue", @@ -43,7 +47,7 @@ class TestLB(wx.Listbook): # make an image list using the BlomXX images - il = wxImageList(32, 32) + il = wx.ImageList(32, 32) for x in range(1, 15): f = getattr(images, 'getBlom%02dBitmap' % x) bmp = f() @@ -59,18 +63,18 @@ class TestLB(wx.Listbook): imID += 1 if imID == il.GetImageCount(): imID = 0 if first: - st = wxStaticText(win.win, -1, + st = wx.StaticText(win.win, -1, "You can put nearly any type of window here,\n" "and the list can be on any side of the Listbook", - wxPoint(10, 10)) + wx.Point(10, 10)) #st.SetForegroundColour(wxWHITE) #st.SetBackgroundColour(wxBLUE) first = False - EVT_LISTBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) - EVT_LISTBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging) + wx.EVT_LISTBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) + wx.EVT_LISTBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging) def makeColorPanel(self, color): diff --git a/wxPython/demo/wxOGL.py b/wxPython/demo/wxOGL.py index a096704009..eb7cea9c83 100644 --- a/wxPython/demo/wxOGL.py +++ b/wxPython/demo/wxOGL.py @@ -301,7 +301,7 @@ def runTest(frame, nb, log): # This creates some pens and brushes that the OGL library uses. # It should be called after the app object has been created, but # before OGL is used. - wx.OGLInitialize() + ogl.OGLInitialize() win = TestWindow(nb, log, frame) return win diff --git a/wxPython/demo/wxScrolledPanel.py b/wxPython/demo/wxScrolledPanel.py index 63e1ed03a8..e1eca01c8d 100644 --- a/wxPython/demo/wxScrolledPanel.py +++ b/wxPython/demo/wxScrolledPanel.py @@ -79,7 +79,7 @@ class TestPanel(scrolled.wxScrolledPanel): panel3.SetAutoLayout(1) panel3.SetupScrolling() - hbox = wxBoxSizer(wxHORIZONTAL) + hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add((20,20)) hbox.Add(panel1, 0) hbox.Add((40, 10)) diff --git a/wxPython/demo/wxScrolledWindow.py b/wxPython/demo/wxScrolledWindow.py index 8dcc92b570..753835e374 100644 --- a/wxPython/demo/wxScrolledWindow.py +++ b/wxPython/demo/wxScrolledWindow.py @@ -13,7 +13,7 @@ BUFFERED = 1 #--------------------------------------------------------------------------- class MyCanvas(wx.ScrolledWindow): - def __init__(self, parent, id = -1): + def __init__(self, parent, id = -1, size = wx.DefaultSize): wx.ScrolledWindow.__init__(self, parent, id, (0, 0), size=size, style=wx.SUNKEN_BORDER) self.lines = [] diff --git a/wxPython/demo/wxStyledTextCtrl_2.py b/wxPython/demo/wxStyledTextCtrl_2.py index 642ed9fd85..f9514cf521 100644 --- a/wxPython/demo/wxStyledTextCtrl_2.py +++ b/wxPython/demo/wxStyledTextCtrl_2.py @@ -86,33 +86,33 @@ class PythonSTC(stc.StyledTextCtrl): elif self.fold_symbols == 1: # Plus for contracted folders, minus for expanded - self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_MINUS, "white", "black"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_PLUS, "white", "black"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, "white", "black"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, "white", "black"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_EMPTY, "white", "black"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_EMPTY, "white", "black"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, "white", "black"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_MINUS, "white", "black"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_PLUS, "white", "black"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_EMPTY, "white", "black"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_EMPTY, "white", "black"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_EMPTY, "white", "black"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_EMPTY, "white", "black"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_EMPTY, "white", "black"); elif self.fold_symbols == 2: # Like a flattened tree control using circular headers and curved joins - self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_CIRCLEMINUS, "white", "#404040"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_CIRCLEPLUS, "white", "#404040"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "white", "#404040"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNERCURVE, "white", "#404040"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_CIRCLEPLUSCONNECTED, "white", "#404040"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_CIRCLEMINUSCONNECTED, "white", "#404040"); - self.MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNERCURVE, "white", "#404040"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_CIRCLEMINUS, "white", "#404040"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_CIRCLEPLUS, "white", "#404040"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_VLINE, "white", "#404040"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_LCORNERCURVE, "white", "#404040"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_CIRCLEPLUSCONNECTED, "white", "#404040"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_CIRCLEMINUSCONNECTED, "white", "#404040"); + self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_TCORNERCURVE, "white", "#404040"); elif self.fold_symbols == 3: # Like a flattened tree control using square headers - self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, "white", "#808080") - self.MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, "white", "#808080") - self.MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "white", "#808080") - self.MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "white", "#808080") - self.MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, "white", "#808080") - self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, "white", "#808080") - self.MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "white", "#808080") + self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_BOXMINUS, "white", "#808080") + self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_BOXPLUS, "white", "#808080") + self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_VLINE, "white", "#808080") + self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_LCORNER, "white", "#808080") + self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_BOXPLUSCONNECTED, "white", "#808080") + self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_BOXMINUSCONNECTED, "white", "#808080") + self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_TCORNER, "white", "#808080") self.Bind(stc.EVT_STC_UPDATEUI, self.OnUpdateUI) diff --git a/wxPython/demo/wxValidator.py b/wxPython/demo/wxValidator.py index 755d9920fd..b31b56b8f3 100644 --- a/wxPython/demo/wxValidator.py +++ b/wxPython/demo/wxValidator.py @@ -71,7 +71,7 @@ class TestValidatorPanel(wx.Panel): fgs = wx.FlexGridSizer(0, 2) fgs.Add((1,1)) - fgs.Add(wxStaticText(self, -1, "These controls have validators that limit\n" + fgs.Add(wx.StaticText(self, -1, "These controls have validators that limit\n" "the type of characters that can be entered.")) fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE)) @@ -84,14 +84,14 @@ class TestValidatorPanel(wx.Panel): fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE)) label = wx.StaticText(self, -1, "Digits Only: ") - fgs.Add(label, 0, wx.ALIGN_RIGHT|wxCENTER) + fgs.Add(label, 0, wx.ALIGN_RIGHT|wx.CENTER) fgs.Add(wx.TextCtrl(self, -1, "", validator = MyValidator(DIGIT_ONLY))) fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE)) fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE)) fgs.Add((0,0)) b = wx.Button(self, -1, "Test Dialog Validation") - self.Bind(EVT_BUTTON, self.OnDoDialog, b) + self.Bind(wx.EVT_BUTTON, self.OnDoDialog, b) fgs.Add(b) border = wx.BoxSizer() @@ -174,7 +174,7 @@ class TestValidateDialog(wx.Dialog): fgs = wx.FlexGridSizer(0, 2) fgs.Add((1,1)); - fgs.Add(wxStaticText(self, -1, + fgs.Add(wx.StaticText(self, -1, "These controls must have text entered into them. Each\n" "one has a validator that is checked when the Okay\n" "button is clicked.")) -- 2.45.2