Kevin O's demo modules fixup patch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-12-11 19:55:48 +00:00
parent 0221a4c390
commit 372bde9b72
21 changed files with 76 additions and 72 deletions

View File

@@ -56,7 +56,7 @@ class TestColourSelect(wx.Panel):
# show a button with all default values # show a button with all default values
self.colourDefaults = csel.ColourSelect(self, -1) 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([ buttonSizer.AddMany([
(wx.StaticText(self, -1, "Default Colour/Size"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL), (wx.StaticText(self, -1, "Default Colour/Size"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL),

View File

@@ -43,8 +43,8 @@ class TestPanel(wx.Panel):
cBtnText.SetHelpText("Some helpful text...") cBtnText.SetHelpText("Some helpful text...")
s = wx.BoxSizer(wx.HORIZONTAL) s = wx.BoxSizer(wx.HORIZONTAL)
s.Add(cBtn, 0, wxALL, 5) s.Add(cBtn, 0, wx.ALL, 5)
s.Add(cBtnText, 0, wxALL, 5) s.Add(cBtnText, 0, wx.ALL, 5)
sizer.Add((20,20)) sizer.Add((20,20))
sizer.Add(s) sizer.Add(s)

View File

@@ -247,10 +247,10 @@ class CustomDnDPanel(wx.Panel):
rbox.Add(rb1) rbox.Add(rb1)
rbox.Add(rb2) rbox.Add(rb2)
box.Add(text1, 0, wxALL, 10) box.Add(text1, 0, wx.ALL, 10)
box.Add(rbox, 0, wxALIGN_CENTER) box.Add(rbox, 0, wx.ALIGN_CENTER)
box.Add((10,90)) box.Add((10,90))
box.Add(text2, 0, wxALL, 10) box.Add(text2, 0, wx.ALL, 10)
sizer.Add(box) sizer.Add(box)

View File

@@ -141,8 +141,8 @@ def makeRandomColors(num):
colors = [] colors = []
for i in range(num): for i in range(num):
c = whrandom.choice(colours) c = random.choice(colours)
colors.append(wxNamedColour(c)) colors.append(wx.NamedColour(c))
return colors return colors

View File

@@ -62,16 +62,16 @@ class TestPanel(wx.Panel):
message2 = wx.StaticText(self, -1, txt) message2 = wx.StaticText(self, -1, txt)
message2.SetFont(f1) message2.SetFont(f1)
targetPanel = Tile(self, log, bgColor=wxColour(80,10,10), active=0) targetPanel = Tile(self, log, bgColor=wx.Colour(80,10,10), active=0)
buttonPanel = wxPanel(self ,-1) buttonPanel = wx.Panel(self ,-1)
sizer = wxBoxSizer(wxHORIZONTAL) sizer = wx.BoxSizer(wx.HORIZONTAL)
target = targetPanel.tile target = targetPanel.tile
sizer.Add((0,0), 1) sizer.Add((0,0), 1)
for factor in [0.2, 0.3, 0.4, 0.5, 0.6, 0.7]: 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((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) sizer.Add((0,0),1)
buttonPanel.SetAutoLayout(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) IDLE_COLOR = wx.Colour( 80, 10, 10)
START_COLOR = wx.Colour(200, 70, 50) START_COLOR = wx.Colour(200, 70, 50)
FINAL_COLOR = wx.Colour( 20, 80,240) FINAL_COLOR = wx.Colour( 20, 80,240)

View File

@@ -21,9 +21,9 @@ class HugeTable(gridlib.PyGridTableBase):
gridlib.PyGridTableBase.__init__(self) gridlib.PyGridTableBase.__init__(self)
self.log = log self.log = log
self.odd=wxGridCellAttr() self.odd=gridlib.GridCellAttr()
self.odd.SetBackgroundColour("sky blue") self.odd.SetBackgroundColour("sky blue")
self.even=wxGridCellAttr() self.even=gridlib.GridCellAttr()
self.even.SetBackgroundColour("sea green") self.even.SetBackgroundColour("sea green")
def GetAttr(self, row, col, kind): def GetAttr(self, row, col, kind):

View File

@@ -16,9 +16,9 @@ class MyCustomRenderer(gridlib.PyGridCellRenderer):
gridlib.PyGridCellRenderer.__init__(self) gridlib.PyGridCellRenderer.__init__(self)
def Draw(self, grid, attr, dc, rect, row, col, isSelected): def Draw(self, grid, attr, dc, rect, row, col, isSelected):
dc.SetBackgroundMode(wxSOLID) dc.SetBackgroundMode(wx.SOLID)
dc.SetBrush(wxBrush(wxBLACK, wxSOLID)) dc.SetBrush(wx.Brush(wx.BLACK, wx.SOLID))
dc.SetPen(wxTRANSPARENT_PEN) dc.SetPen(wx.TRANSPARENT_PEN)
dc.DrawRectangleRect(rect) dc.DrawRectangleRect(rect)
dc.SetBackgroundMode(wx.TRANSPARENT) dc.SetBackgroundMode(wx.TRANSPARENT)

View File

@@ -18,7 +18,7 @@ class TestLayoutf(wx.Panel):
wx.Panel.__init__(self, parent, -1) wx.Panel.__init__(self, parent, -1)
self.SetAutoLayout(True) 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 = wx.Window(self, -1, style=wx.SIMPLE_BORDER)
self.panelA.SetBackgroundColour(wx.BLUE) self.panelA.SetBackgroundColour(wx.BLUE)

View File

@@ -42,10 +42,10 @@ class TestPanel(wx.Panel):
text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False)) text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False))
text.SetLabel(msg) text.SetLabel(msg)
w,h = text.GetTextExtent(msg) w,h = text.GetTextExtent(msg)
text.SetSize(wxSize(w,h+1)) text.SetSize(wx.Size(w,h+1))
text.SetForegroundColour(wxBLUE) text.SetForegroundColour(wx.BLUE)
outsideSizer.Add(text, 0, wxEXPAND|wxALL, 5) outsideSizer.Add(text, 0, wx.EXPAND|wx.ALL, 5)
outsideSizer.Add(wxStaticLine(self, -1), 0, wxEXPAND) outsideSizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND)
outsideSizer.Add((20,20)) outsideSizer.Add((20,20))
self.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD, False)) 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((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:", "Drag URLs from your browser to\nthis window:",
style = wx.ALIGN_RIGHT), style = wx.ALIGN_RIGHT),
0, wx.ALIGN_RIGHT ) 0, wx.ALIGN_RIGHT )

View File

@@ -126,9 +126,9 @@ class TestPanel(wx.Panel):
self.Bind(wx.EVT_COMBOBOX, self.OnSelectID, combo) self.Bind(wx.EVT_COMBOBOX, self.OnSelectID, combo)
combo.Select(0) 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) 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)
fgs.Add((10, 10), 0, wx.ALIGN_CENTRE|wx.ALL, 5) fgs.Add((10, 10), 0, wx.ALIGN_CENTRE|wx.ALL, 5)

View File

@@ -15,12 +15,12 @@ class TestPanel(wx.Panel):
self.log = log self.log = log
b = wx.Button(self, 10, "Default Button", (20, 20)) 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.SetDefault()
b.SetSize(b.GetBestSize()) b.SetSize(b.GetBestSize())
b = wx.Button(self, 20, "HELLO AGAIN!", (20, 80), (120, 45)) 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...") b.SetToolTipString("This is a Hello button...")
if 0: # a test case for catching wx.PyAssertionError if 0: # a test case for catching wx.PyAssertionError

View File

@@ -29,7 +29,7 @@ class DragShape:
memDC = wx.MemoryDC() memDC = wx.MemoryDC()
memDC.SelectObject(self.bmp) 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()), (self.bmp.GetWidth(), self.bmp.GetHeight()),
memDC, (0, 0), op, True) memDC, (0, 0), op, True)
@@ -77,8 +77,8 @@ class DragCanvas(wx.ScrolledWindow):
dc.SetTextForeground(wx.RED) dc.SetTextForeground(wx.RED)
dc.SetFont(font) dc.SetFont(font)
dc.DrawText(text, (0, 0)) dc.DrawText(text, (0, 0))
dc.SelectObject(wxNullBitmap) dc.SelectObject(wx.NullBitmap)
mask = wxMaskColour(bmp, bg_colour) mask = wx.MaskColour(bmp, bg_colour)
bmp.SetMask(mask) bmp.SetMask(mask)
shape = DragShape(bmp) shape = DragShape(bmp)
shape.pos = (5, 100) shape.pos = (5, 100)

View File

@@ -38,7 +38,7 @@ if not haveGLCanvas:
elif not haveOpenGL: elif not haveOpenGL:
def runTest(frame, nb, log): def runTest(frame, nb, log):
dlg = wxMessageDialog( dlg = wx.MessageDialog(
frame, 'The OpenGL package was not found. You can get it at\n' frame, 'The OpenGL package was not found. You can get it at\n'
'http://PyOpenGL.sourceforge.net/', 'Sorry', wx.OK | wx.ICON_INFORMATION 'http://PyOpenGL.sourceforge.net/', 'Sorry', wx.OK | wx.ICON_INFORMATION
) )

View File

@@ -24,7 +24,7 @@ class ButtonPanel(wx.Panel):
wx.Panel.__init__(self, parent, -1) wx.Panel.__init__(self, parent, -1)
self.log = log self.log = log
box = wxBoxSizer(wx.VERTICAL) box = wx.BoxSizer(wx.VERTICAL)
box.Add((20, 20)) box.Add((20, 20))
keys = buttonDefs.keys() keys = buttonDefs.keys()
keys.sort() keys.sort()

View File

@@ -219,8 +219,8 @@ class MegaImageRenderer(Grid.PyGridCellRenderer):
dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID)) dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID))
dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID)) dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID))
else: else:
dc.SetBrush(wxBrush(wxWHITE, wxSOLID)) dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID))
dc.SetPen(wxPen(wxWHITE, 1, wxSOLID)) dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID))
dc.DrawRectangleRect(rect) dc.DrawRectangleRect(rect)
#dc.DrawRectangle((rect.x, rect.y), (rect.width, rect.height)) #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), dc.Blit((rect.x+1, rect.y+1), (width, height),
image, image,
(0, 0), wxCOPY, True) (0, 0), wx.COPY, True)
class MegaFontRenderer(Grid.PyGridCellRenderer): class MegaFontRenderer(Grid.PyGridCellRenderer):
@@ -265,8 +265,8 @@ class MegaFontRenderer(Grid.PyGridCellRenderer):
dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID)) dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID))
dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID)) dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID))
else: else:
dc.SetBrush(wxBrush(wxWHITE, wxSOLID)) dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID))
dc.SetPen(wxPen(wxWHITE, 1, wxSOLID)) dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID))
dc.DrawRectangleRect(rect) dc.DrawRectangleRect(rect)
#dc.DrawRectangle((rect.x, rect.y), (rect.width, rect.height)) #dc.DrawRectangle((rect.x, rect.y), (rect.width, rect.height))

View File

@@ -11,6 +11,10 @@ import sys
import wx import wx
import images
import ColorPanel
colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blue", colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blue",
"Coral", "Cornflower Blue", "Cyan", "Dark Grey", "Dark Green", "Coral", "Cornflower Blue", "Cyan", "Dark Grey", "Dark Green",
"Dark Olive Green", "Dark Orchid", "Dark Slate Blue", "Dark Olive Green", "Dark Orchid", "Dark Slate Blue",
@@ -43,7 +47,7 @@ class TestLB(wx.Listbook):
# make an image list using the BlomXX images # make an image list using the BlomXX images
il = wxImageList(32, 32) il = wx.ImageList(32, 32)
for x in range(1, 15): for x in range(1, 15):
f = getattr(images, 'getBlom%02dBitmap' % x) f = getattr(images, 'getBlom%02dBitmap' % x)
bmp = f() bmp = f()
@@ -59,18 +63,18 @@ class TestLB(wx.Listbook):
imID += 1 imID += 1
if imID == il.GetImageCount(): imID = 0 if imID == il.GetImageCount(): imID = 0
if first: if first:
st = wxStaticText(win.win, -1, st = wx.StaticText(win.win, -1,
"You can put nearly any type of window here,\n" "You can put nearly any type of window here,\n"
"and the list can be on any side of the Listbook", "and the list can be on any side of the Listbook",
wxPoint(10, 10)) wx.Point(10, 10))
#st.SetForegroundColour(wxWHITE) #st.SetForegroundColour(wxWHITE)
#st.SetBackgroundColour(wxBLUE) #st.SetBackgroundColour(wxBLUE)
first = False first = False
EVT_LISTBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged) wx.EVT_LISTBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged)
EVT_LISTBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging) wx.EVT_LISTBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging)
def makeColorPanel(self, color): def makeColorPanel(self, color):

View File

@@ -301,7 +301,7 @@ def runTest(frame, nb, log):
# This creates some pens and brushes that the OGL library uses. # This creates some pens and brushes that the OGL library uses.
# It should be called after the app object has been created, but # It should be called after the app object has been created, but
# before OGL is used. # before OGL is used.
wx.OGLInitialize() ogl.OGLInitialize()
win = TestWindow(nb, log, frame) win = TestWindow(nb, log, frame)
return win return win

View File

@@ -79,7 +79,7 @@ class TestPanel(scrolled.wxScrolledPanel):
panel3.SetAutoLayout(1) panel3.SetAutoLayout(1)
panel3.SetupScrolling() panel3.SetupScrolling()
hbox = wxBoxSizer(wxHORIZONTAL) hbox = wx.BoxSizer(wx.HORIZONTAL)
hbox.Add((20,20)) hbox.Add((20,20))
hbox.Add(panel1, 0) hbox.Add(panel1, 0)
hbox.Add((40, 10)) hbox.Add((40, 10))

View File

@@ -13,7 +13,7 @@ BUFFERED = 1
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
class MyCanvas(wx.ScrolledWindow): 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) wx.ScrolledWindow.__init__(self, parent, id, (0, 0), size=size, style=wx.SUNKEN_BORDER)
self.lines = [] self.lines = []

View File

@@ -86,33 +86,33 @@ class PythonSTC(stc.StyledTextCtrl):
elif self.fold_symbols == 1: elif self.fold_symbols == 1:
# Plus for contracted folders, minus for expanded # Plus for contracted folders, minus for expanded
self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_MINUS, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_MINUS, "white", "black");
self.MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_PLUS, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_PLUS, "white", "black");
self.MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_EMPTY, "white", "black");
self.MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_EMPTY, "white", "black");
self.MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_EMPTY, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_EMPTY, "white", "black");
self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_EMPTY, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_EMPTY, "white", "black");
self.MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_EMPTY, "white", "black");
elif self.fold_symbols == 2: elif self.fold_symbols == 2:
# Like a flattened tree control using circular headers and curved joins # Like a flattened tree control using circular headers and curved joins
self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_CIRCLEMINUS, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_CIRCLEMINUS, "white", "#404040");
self.MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_CIRCLEPLUS, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_CIRCLEPLUS, "white", "#404040");
self.MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_VLINE, "white", "#404040");
self.MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNERCURVE, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_LCORNERCURVE, "white", "#404040");
self.MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_CIRCLEPLUSCONNECTED, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_CIRCLEPLUSCONNECTED, "white", "#404040");
self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_CIRCLEMINUSCONNECTED, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_CIRCLEMINUSCONNECTED, "white", "#404040");
self.MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNERCURVE, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_TCORNERCURVE, "white", "#404040");
elif self.fold_symbols == 3: elif self.fold_symbols == 3:
# Like a flattened tree control using square headers # Like a flattened tree control using square headers
self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, "white", "#808080") self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_BOXMINUS, "white", "#808080")
self.MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, "white", "#808080") self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_BOXPLUS, "white", "#808080")
self.MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "white", "#808080") self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_VLINE, "white", "#808080")
self.MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "white", "#808080") self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_LCORNER, "white", "#808080")
self.MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, "white", "#808080") self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_BOXPLUSCONNECTED, "white", "#808080")
self.MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, "white", "#808080") self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_BOXMINUSCONNECTED, "white", "#808080")
self.MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "white", "#808080") self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_TCORNER, "white", "#808080")
self.Bind(stc.EVT_STC_UPDATEUI, self.OnUpdateUI) self.Bind(stc.EVT_STC_UPDATEUI, self.OnUpdateUI)

View File

@@ -71,7 +71,7 @@ class TestValidatorPanel(wx.Panel):
fgs = wx.FlexGridSizer(0, 2) fgs = wx.FlexGridSizer(0, 2)
fgs.Add((1,1)) 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.")) "the type of characters that can be entered."))
fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE)) fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE))
@@ -84,14 +84,14 @@ class TestValidatorPanel(wx.Panel):
fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE)) fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE))
label = wx.StaticText(self, -1, "Digits Only: ") 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(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((1,VSPACE)); fgs.Add((1,VSPACE)) fgs.Add((1,VSPACE)); fgs.Add((1,VSPACE))
fgs.Add((0,0)) fgs.Add((0,0))
b = wx.Button(self, -1, "Test Dialog Validation") 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) fgs.Add(b)
border = wx.BoxSizer() border = wx.BoxSizer()
@@ -174,7 +174,7 @@ class TestValidateDialog(wx.Dialog):
fgs = wx.FlexGridSizer(0, 2) fgs = wx.FlexGridSizer(0, 2)
fgs.Add((1,1)); 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" "These controls must have text entered into them. Each\n"
"one has a validator that is checked when the Okay\n" "one has a validator that is checked when the Okay\n"
"button is clicked.")) "button is clicked."))