]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Listbook.py
docstring update
[wxWidgets.git] / wxPython / demo / Listbook.py
index c17359a4beb6c5696b91a8468f2324a002408d8e..56617a0e790b7917eaba905ab52a117d4c48fd85 100644 (file)
@@ -1,6 +1,4 @@
 
 
-import  sys
-
 import  wx
 
 import ColorPanel
 import  wx
 
 import ColorPanel
@@ -8,19 +6,7 @@ import images
 
 colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blue",
                "Coral", "Cornflower Blue", "Cyan", "Dark Grey", "Dark Green",
 
 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",
-               "Dark Slate Grey", "Dark Turquoise", "Dim Grey", "Firebrick",
-               "Forest Green", "Gold", "Goldenrod", "Grey", "Green", "Green Yellow",
-               "Indian Red", "Khaki", "Light Blue", "Light Grey", "Light Steel Blue",
-               "Lime Green", "Magenta", "Maroon", "Medium Aquamarine", "Medium Blue",
-               "Medium Forest Green", "Medium Goldenrod", "Medium Orchid",
-               "Medium Sea Green", "Medium Slate Blue", "Medium Spring Green",
-               "Medium Turquoise", "Medium Violet Red", "Midnight Blue", "Navy",
-               "Orange", "Orange Red", "Orchid", "Pale Green", "Pink", "Plum",
-               "Purple", "Red", "Salmon", "Sea Green", "Sienna", "Sky Blue",
-               "Slate Blue", "Spring Green", "Steel Blue", "Tan", "Thistle",
-               "Turquoise", "Violet", "Violet Red", "Wheat", "White", "Yellow",
-               "Yellow Green"
+               "Dark Olive Green",
                ]
 
 #----------------------------------------------------------------------------
                ]
 
 #----------------------------------------------------------------------------
@@ -28,19 +14,18 @@ colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blu
 class TestLB(wx.Listbook):
     def __init__(self, parent, id, log):
         wx.Listbook.__init__(self, parent, id, style=
 class TestLB(wx.Listbook):
     def __init__(self, parent, id, log):
         wx.Listbook.__init__(self, parent, id, style=
-                            wx.LB_DEFAULT
-                            #wxLB_TOP
-                            #wxLB_BOTTOM
-                            #wxLB_LEFT
-                            #wxLB_RIGHT
+                            wx.BK_DEFAULT
+                            #wx.BK_TOP
+                            #wx.BK_BOTTOM
+                            #wx.BK_LEFT
+                            #wx.BK_RIGHT
                             )
         self.log = log
 
                             )
         self.log = log
 
-
-        # make an image list using the BlomXX images
+        # make an image list using the LBXX images
         il = wx.ImageList(32, 32)
         il = wx.ImageList(32, 32)
-        for x in range(1, 15):
-            f = getattr(images, 'getBlom%02dBitmap' % x)
+        for x in range(12):
+            f = getattr(images, 'getLB%02dBitmap' % (x+1))
             bmp = f()
             il.Add(bmp)
         self.AssignImageList(il)
             bmp = f()
             il.Add(bmp)
         self.AssignImageList(il)
@@ -58,14 +43,10 @@ class TestLB(wx.Listbook):
                           "You can put nearly any type of window here,\n"
                           "and the list can be on any side of the Listbook",
                           wx.Point(10, 10))
                           "You can put nearly any type of window here,\n"
                           "and the list can be on any side of the Listbook",
                           wx.Point(10, 10))
-                #st.SetForegroundColour(wxWHITE)
-                #st.SetBackgroundColour(wxBLUE)
                 first = False
                 first = False
-            
-                
 
 
-        wx.EVT_LISTBOOK_PAGE_CHANGED(self, self.GetId(), self.OnPageChanged)
-        wx.EVT_LISTBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging)
+        self.Bind(wx.EVT_LISTBOOK_PAGE_CHANGED, self.OnPageChanged)
+        self.Bind(wx.EVT_LISTBOOK_PAGE_CHANGING, self.OnPageChanging)
 
 
     def makeColorPanel(self, color):
 
 
     def makeColorPanel(self, color):
@@ -73,6 +54,7 @@ class TestLB(wx.Listbook):
         win = ColorPanel.ColoredPanel(p, color)
         p.win = win
         def OnCPSize(evt, win=win):
         win = ColorPanel.ColoredPanel(p, color)
         p.win = win
         def OnCPSize(evt, win=win):
+            win.SetPosition((0,0))
             win.SetSize(evt.GetSize())
         p.Bind(wx.EVT_SIZE, OnCPSize)
         return p
             win.SetSize(evt.GetSize())
         p.Bind(wx.EVT_SIZE, OnCPSize)
         return p
@@ -115,6 +97,7 @@ wx.ListCtrl instead of a set of tabs.
 if __name__ == '__main__':
     import sys,os
     import run
 if __name__ == '__main__':
     import sys,os
     import run
-    run.main(['', os.path.basename(sys.argv[0])])
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
+