X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbd5dd1dfa8aa5d7574e2f3e6d898dc8bb4c89c4..61940a7061d0b5d5122b1e1e939cfa2d72596999:/wxPython/demo/wxListbook.py diff --git a/wxPython/demo/wxListbook.py b/wxPython/demo/wxListbook.py index 9165966368..2186205cb3 100644 --- a/wxPython/demo/wxListbook.py +++ b/wxPython/demo/wxListbook.py @@ -1,12 +1,20 @@ +# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# +# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Bunches of imports that might need to go away for the final roll-out. +# -from wxPython.wx import * +import sys + +import wx -import ColorPanel -import GridSimple -import wxListCtrl -import wxScrolledWindow 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", @@ -26,10 +34,10 @@ colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blu #---------------------------------------------------------------------------- -class TestLB(wxListbook): +class TestLB(wx.Listbook): def __init__(self, parent, id, log): - wxListbook.__init__(self, parent, id, style= - wxLB_DEFAULT + wx.Listbook.__init__(self, parent, id, style= + wx.LB_DEFAULT #wxLB_TOP #wxLB_BOTTOM #wxLB_LEFT @@ -39,13 +47,12 @@ class TestLB(wxListbook): # 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() il.Add(bmp) self.AssignImageList(il) - # Now make a bunch of panels for the list book first = True @@ -56,27 +63,27 @@ class TestLB(wxListbook): 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): - p = wxPanel(self, -1) + p = wx.Panel(self, -1) win = ColorPanel.ColoredPanel(p, color) p.win = win def OnCPSize(evt, win=win): win.SetSize(evt.GetSize()) - EVT_SIZE(p, OnCPSize) + p.Bind(wx.EVT_SIZE, OnCPSize) return p @@ -103,8 +110,6 @@ def runTest(frame, nb, log): #---------------------------------------------------------------------------- - - overview = """\

wxListbook

@@ -122,6 +127,3 @@ if __name__ == '__main__': run.main(['', os.path.basename(sys.argv[0])]) - - -