]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Notebook.py
moved vararg CRT functions wrappers to a new wxcrtvararg.h header
[wxWidgets.git] / wxPython / demo / Notebook.py
index c9740ce678b5d31bcca99a7b2ef3a55d62e8e31c..f25f06d74f935d28d4f81847dfc1ff309b46a8b6 100644 (file)
@@ -1,7 +1,3 @@
-# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Updated for wx namespace
-# 
 
 import  sys
 
@@ -17,12 +13,14 @@ import  images
 
 class TestNB(wx.Notebook):
     def __init__(self, parent, id, log):
-        wx.Notebook.__init__(self, parent, id, style=
-                            #wxNB_TOP
-                            wx.NB_BOTTOM
-                            #wxNB_LEFT
-                            #wxNB_RIGHT
-                            )
+        wx.Notebook.__init__(self, parent, id, size=(21,21), style=
+                             wx.BK_DEFAULT
+                             #wx.BK_TOP 
+                             #wx.BK_BOTTOM
+                             #wx.BK_LEFT
+                             #wx.BK_RIGHT
+                             # | wx.NB_MULTILINE
+                             )
         self.log = log
 
         win = self.makeColorPanel(wx.BLUE)
@@ -64,17 +62,11 @@ class TestNB(wx.Notebook):
         win = self.makeColorPanel(wx.CYAN)
         self.AddPage(win, "Cyan")
 
-#         win = self.makeColorPanel(wxWHITE)
-#         self.AddPage(win, "White")
+        win = self.makeColorPanel(wx.NamedColour('Midnight Blue'))
+        self.AddPage(win, "Midnight Blue")
 
-#         win = self.makeColorPanel(wxBLACK)
-#         self.AddPage(win, "Black")
-
-        win = self.makeColorPanel(wx.NamedColour('MIDNIGHT BLUE'))
-        self.AddPage(win, "MIDNIGHT BLUE")
-
-        win = self.makeColorPanel(wx.NamedColour('INDIAN RED'))
-        self.AddPage(win, "INDIAN RED")
+        win = self.makeColorPanel(wx.NamedColour('Indian Red'))
+        self.AddPage(win, "Indian Red")
 
         self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
         self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self.OnPageChanging)
@@ -84,13 +76,13 @@ class TestNB(wx.Notebook):
         p = wx.Panel(self, -1)
         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
 
+
     def OnPageChanged(self, event):
         old = event.GetOldSelection()
         new = event.GetSelection()
@@ -116,14 +108,14 @@ def runTest(frame, nb, log):
 
 overview = """\
 <html><body>
-<h2>wxNotebook</h2>
+<h2>wx.Notebook</h2>
 <p>
 This class represents a notebook control, which manages multiple
 windows with associated tabs.
 <p>
-To use the class, create a wxNotebook object and call AddPage or
+To use the class, create a wx.Notebook object and call AddPage or
 InsertPage, passing a window to be used as the page. Do not explicitly
-delete the window for a page that is currently managed by wxNotebook.
+delete the window for a page that is currently managed by wx.Notebook.
 
 """
 
@@ -131,7 +123,7 @@ delete the window for a page that is currently managed by wxNotebook.
 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:])