]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxPython wrappers for the new wx.Treebook and wx.Toolbook
authorRobin Dunn <robin@alldunn.com>
Wed, 1 Feb 2006 23:46:43 +0000 (23:46 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 1 Feb 2006 23:46:43 +0000 (23:46 +0000)
classes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Choicebook.py
wxPython/demo/Listbook.py
wxPython/demo/Main.py
wxPython/demo/Notebook.py
wxPython/demo/Toolbook.py [new file with mode: 0644]
wxPython/demo/Treebook.py [new file with mode: 0644]
wxPython/docs/CHANGES.txt
wxPython/include/wx/wxPython/wxPython_int.h
wxPython/src/__controls_rename.i
wxPython/src/_notebook.i
wxPython/wxPython/_controls.py

index de304a996eb0acf1f0cb5c6021ea952c7bf57d07..4b92842e82a5da16170e7e8f65394a867b94a1d0 100644 (file)
@@ -14,8 +14,7 @@ pageTexts = [ "Yet",
 
 class TestCB(wx.Choicebook):
     def __init__(self, parent, id, log):
 
 class TestCB(wx.Choicebook):
     def __init__(self, parent, id, log):
-        wx.Choicebook.__init__(self, parent, id
-                            )
+        wx.Choicebook.__init__(self, parent, id)
         self.log = log
 
         # Now make a bunch of panels for the choice book
         self.log = log
 
         # Now make a bunch of panels for the choice book
index 20115cbf6038e3a153fc0f3f31c21a0d461376af..7c92d02bd31ec2d66ca2e8d3bd19cd9bb50eba23 100644 (file)
@@ -14,11 +14,11 @@ 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
 
index d0711e384f9a3206bd3a37cd5cead146872f94a3..9632a378fcaae1286183666b55b15f413956ffee 100644 (file)
@@ -47,13 +47,8 @@ import images
 _treeList = [
     # new stuff
     ('Recent Additions/Updates', [
 _treeList = [
     # new stuff
     ('Recent Additions/Updates', [
-        'FoldPanelBar',
-        'GIFAnimationCtrl',
-        'HyperLinkCtrl',
-        'MultiSplitterWindow',
-        'Throbber',
-        'GetMouseState',
-        'FloatCanvas',
+        'Treebook',
+        'Toolbook',
         ]),
 
     # managed windows == things with a (optional) caption you can close
         ]),
 
     # managed windows == things with a (optional) caption you can close
@@ -94,7 +89,6 @@ _treeList = [
         'CheckBox',
         'CheckListBox',
         'Choice',
         'CheckBox',
         'CheckListBox',
         'Choice',
-        'Choicebook',
         'ComboBox',
         'Gauge',
         'Grid',
         'ComboBox',
         'Gauge',
         'Grid',
@@ -103,9 +97,7 @@ _treeList = [
         'ListCtrl',
         'ListCtrl_virtual',
         'ListCtrl_edit',
         'ListCtrl',
         'ListCtrl_virtual',
         'ListCtrl_edit',
-        'Listbook',
         'Menu',
         'Menu',
-        'Notebook',
         'PopupMenu',
         'PopupWindow',
         'RadioBox',
         'PopupMenu',
         'PopupWindow',
         'RadioBox',
@@ -127,6 +119,14 @@ _treeList = [
         'TreeCtrl',
         'Validator',
         ]),
         'TreeCtrl',
         'Validator',
         ]),
+    
+    ('"Book" Controls', [
+        'Choicebook',
+        'Listbook',
+        'Notebook',
+        'Toolbook',
+        'Treebook',
+        ]),
 
     ('Custom Controls', [
         'AnalogClockWindow',
 
     ('Custom Controls', [
         'AnalogClockWindow',
index 3f369001f3a121a608d1302c1aaa86466cd2f058..797f453e715981569674e05370f057422914892a 100644 (file)
@@ -13,12 +13,13 @@ import  images
 
 class TestNB(wx.Notebook):
     def __init__(self, parent, id, log):
 
 class TestNB(wx.Notebook):
     def __init__(self, parent, id, log):
-        wx.Notebook.__init__(self, parent, id, size=(21,21),
-                             #style=
-                             #wx.NB_TOP # | wx.NB_MULTILINE
-                             #wx.NB_BOTTOM
-                             #wx.NB_LEFT
-                             #wx.NB_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
 
                              )
         self.log = log
 
diff --git a/wxPython/demo/Toolbook.py b/wxPython/demo/Toolbook.py
new file mode 100644 (file)
index 0000000..1dd87fc
--- /dev/null
@@ -0,0 +1,109 @@
+
+import  wx
+
+import ColorPanel
+import images
+
+colourList = [ "Aquamarine", "Grey", "Blue", "Blue Violet", "Brown", "Cadet Blue",
+               "Coral", "Wheat", #"Cyan", "Dark Grey", "Dark Green",
+               #"Steel Blue",
+               ]
+
+#----------------------------------------------------------------------------
+
+def getNextImageID(count):
+    imID = 0
+    while True:
+        yield imID
+        imID += 1
+        if imID == count:
+            imID = 0
+    
+    
+class TestTB(wx.Toolbook):
+    def __init__(self, parent, id, log):
+        wx.Toolbook.__init__(self, parent, id, style=
+                             wx.BK_DEFAULT
+                             #wx.BK_TOP
+                             #wx.BK_BOTTOM
+                             #wx.BK_LEFT
+                             #wx.BK_RIGHT
+                            )
+        self.log = log
+
+        # make an image list using the LBXX images
+        il = wx.ImageList(32, 32)
+        for x in range(12):
+            f = getattr(images, 'getLB%02dBitmap' % (x+1))
+            bmp = f()
+            il.Add(bmp)
+        self.AssignImageList(il)
+        imageIdGenerator = getNextImageID(il.GetImageCount())
+        
+        # Now make a bunch of panels for the list book
+        first = True
+        for colour in colourList:
+            win = self.makeColorPanel(colour)
+            self.AddPage(win, colour, imageId=imageIdGenerator.next())
+            if first:
+                st = wx.StaticText(win.win, -1,
+                          "You can put nearly any type of window here,\n"
+                          "and the toolbar can be on either side of the Toolbook",
+                          wx.Point(10, 10))
+                first = False
+
+        self.Bind(wx.EVT_TOOLBOOK_PAGE_CHANGED, self.OnPageChanged)
+        self.Bind(wx.EVT_TOOLBOOK_PAGE_CHANGING, self.OnPageChanging)
+
+
+    def makeColorPanel(self, color):
+        p = wx.Panel(self, -1)
+        win = ColorPanel.ColoredPanel(p, color)
+        p.win = win
+        def OnCPSize(evt, win=win):
+            win.SetSize(evt.GetSize())
+        p.Bind(wx.EVT_SIZE, OnCPSize)
+        return p
+
+
+    def OnPageChanged(self, event):
+        old = event.GetOldSelection()
+        new = event.GetSelection()
+        sel = self.GetSelection()
+        self.log.write('OnPageChanged,  old:%d, new:%d, sel:%d\n' % (old, new, sel))
+        event.Skip()
+
+    def OnPageChanging(self, event):
+        old = event.GetOldSelection()
+        new = event.GetSelection()
+        sel = self.GetSelection()
+        self.log.write('OnPageChanging, old:%d, new:%d, sel:%d\n' % (old, new, sel))
+        event.Skip()
+
+#----------------------------------------------------------------------------
+
+def runTest(frame, nb, log):
+    testWin = TestTB(nb, -1, log)
+    return testWin
+
+#----------------------------------------------------------------------------
+
+
+overview = """\
+<html><body>
+<h2>wx.Toolbook</h2>
+<p>
+This class is a control similar to a notebook control, but with a
+wx.Toolbar instead of a set of tabs.
+
+"""
+
+
+
+if __name__ == '__main__':
+    import sys,os
+    import run
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
+
+
+
diff --git a/wxPython/demo/Treebook.py b/wxPython/demo/Treebook.py
new file mode 100644 (file)
index 0000000..d69d41d
--- /dev/null
@@ -0,0 +1,114 @@
+
+import  wx
+
+import ColorPanel
+import images
+
+colourList = [ "Aquamarine", "Grey", "Blue", "Blue Violet", "Brown", "Cadet Blue",
+               "Coral", "Wheat", "Cyan", "Dark Grey", "Dark Green",
+               "Steel Blue",
+               ]
+
+#----------------------------------------------------------------------------
+
+def getNextImageID(count):
+    imID = 0
+    while True:
+        yield imID
+        imID += 1
+        if imID == count:
+            imID = 0
+    
+    
+class TestTB(wx.Treebook):
+    def __init__(self, parent, id, log):
+        wx.Treebook.__init__(self, parent, id, style=
+                             wx.BK_DEFAULT
+                             #wx.BK_TOP
+                             #wx.BK_BOTTOM
+                             #wx.BK_LEFT
+                             #wx.BK_RIGHT
+                            )
+        self.log = log
+
+        # make an image list using the LBXX images
+        il = wx.ImageList(32, 32)
+        for x in range(12):
+            f = getattr(images, 'getLB%02dBitmap' % (x+1))
+            bmp = f()
+            il.Add(bmp)
+        self.AssignImageList(il)
+        imageIdGenerator = getNextImageID(il.GetImageCount())
+        
+        # Now make a bunch of panels for the list book
+        first = True
+        for colour in colourList:
+            win = self.makeColorPanel(colour)
+            self.AddPage(win, colour, imageId=imageIdGenerator.next())
+            if first:
+                st = wx.StaticText(win.win, -1,
+                          "You can put nearly any type of window here,\n"
+                          "and the wx.TreeCtrl can be on either side of the\n"
+                          "Treebook",
+                          wx.Point(10, 10))
+                first = False
+
+            win = self.makeColorPanel(colour)
+            st = wx.StaticText(win.win, -1, "this is a sub-page", (10,10))
+            self.AddSubPage(win, 'a sub-page', imageId=imageIdGenerator.next())
+
+        self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnPageChanged)
+        self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGING, self.OnPageChanging)
+
+
+    def makeColorPanel(self, color):
+        p = wx.Panel(self, -1)
+        win = ColorPanel.ColoredPanel(p, color)
+        p.win = win
+        def OnCPSize(evt, win=win):
+            win.SetSize(evt.GetSize())
+        p.Bind(wx.EVT_SIZE, OnCPSize)
+        return p
+
+
+    def OnPageChanged(self, event):
+        old = event.GetOldSelection()
+        new = event.GetSelection()
+        sel = self.GetSelection()
+        self.log.write('OnPageChanged,  old:%d, new:%d, sel:%d\n' % (old, new, sel))
+        event.Skip()
+
+    def OnPageChanging(self, event):
+        old = event.GetOldSelection()
+        new = event.GetSelection()
+        sel = self.GetSelection()
+        self.log.write('OnPageChanging, old:%d, new:%d, sel:%d\n' % (old, new, sel))
+        event.Skip()
+
+#----------------------------------------------------------------------------
+
+def runTest(frame, nb, log):
+    testWin = TestTB(nb, -1, log)
+    return testWin
+
+#----------------------------------------------------------------------------
+
+
+overview = """\
+<html><body>
+<h2>wx.Treebook</h2>
+<p>
+This class is a control similar to a notebook control, but with a
+wx.TreeCtrl instead of a set of tabs.
+
+"""
+
+
+
+if __name__ == '__main__':
+    import sys,os
+    import run
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
+
+
+
index 6dd2c9a49f1a5a950a136c90b3195300c97de1d4..51214a4173dd0e4385d1898ff55c06717716cec5 100644 (file)
@@ -22,6 +22,9 @@ The following deprecated items have been removed:
 
 wx.EventLoop is now implemented for wxMac.
 
 
 wx.EventLoop is now implemented for wxMac.
 
+Added wxPython wrappers for the new wx.Treebook and wx.Toolbook
+classes. 
+
 
 
 
 
 
 
index fb611c3d7ac30bfe56d691e8dabd10a12540030d..5cc05f5da54882bb9508cfe5b4b64d6c8efa7d5b 100644 (file)
@@ -64,7 +64,9 @@
 #include <wx/taskbar.h>
 #include <wx/tglbtn.h>
 #include <wx/tipwin.h>
 #include <wx/taskbar.h>
 #include <wx/tglbtn.h>
 #include <wx/tipwin.h>
+#include <wx/toolbook.h>
 #include <wx/tooltip.h>
 #include <wx/tooltip.h>
+#include <wx/treebook.h>
 #include <wx/vlbox.h>
 #include <wx/vscroll.h>
 #include <wx/dateevt.h>
 #include <wx/vlbox.h>
 #include <wx/vscroll.h>
 #include <wx/dateevt.h>
index 45cbb2f0f037127030bad9e0a9f702a4e5fff710..4d6dd18ae8cc518a8de656ef89824ea88500eaff 100644 (file)
 %rename(SL_INVERSE)                         wxSL_INVERSE;
 %rename(Slider)                             wxSlider;
 %rename(ToggleButton)                       wxToggleButton;
 %rename(SL_INVERSE)                         wxSL_INVERSE;
 %rename(Slider)                             wxSlider;
 %rename(ToggleButton)                       wxToggleButton;
+%rename(BK_DEFAULT)                         wxBK_DEFAULT;
+%rename(BK_TOP)                             wxBK_TOP;
+%rename(BK_BOTTOM)                          wxBK_BOTTOM;
+%rename(BK_LEFT)                            wxBK_LEFT;
+%rename(BK_RIGHT)                           wxBK_RIGHT;
+%rename(BK_ALIGN_MASK)                      wxBK_ALIGN_MASK;
 %rename(BookCtrlBase)                       wxBookCtrlBase;
 %rename(BookCtrlBaseEvent)                  wxBookCtrlBaseEvent;
 %rename(NB_FIXEDWIDTH)                      wxNB_FIXEDWIDTH;
 %rename(BookCtrlBase)                       wxBookCtrlBase;
 %rename(BookCtrlBaseEvent)                  wxBookCtrlBaseEvent;
 %rename(NB_FIXEDWIDTH)                      wxNB_FIXEDWIDTH;
 %rename(CHB_ALIGN_MASK)                     wxCHB_ALIGN_MASK;
 %rename(Choicebook)                         wxChoicebook;
 %rename(ChoicebookEvent)                    wxChoicebookEvent;
 %rename(CHB_ALIGN_MASK)                     wxCHB_ALIGN_MASK;
 %rename(Choicebook)                         wxChoicebook;
 %rename(ChoicebookEvent)                    wxChoicebookEvent;
+%rename(Treebook)                           wxTreebook;
+%rename(TreebookEvent)                      wxTreebookEvent;
+%rename(Toolbook)                           wxToolbook;
+%rename(ToolbookEvent)                      wxToolbookEvent;
 %rename(TOOL_STYLE_BUTTON)                  wxTOOL_STYLE_BUTTON;
 %rename(TOOL_STYLE_SEPARATOR)               wxTOOL_STYLE_SEPARATOR;
 %rename(TOOL_STYLE_CONTROL)                 wxTOOL_STYLE_CONTROL;
 %rename(TOOL_STYLE_BUTTON)                  wxTOOL_STYLE_BUTTON;
 %rename(TOOL_STYLE_SEPARATOR)               wxTOOL_STYLE_SEPARATOR;
 %rename(TOOL_STYLE_CONTROL)                 wxTOOL_STYLE_CONTROL;
index 3f5e131b6fa48748b8f0dd88bd33128c48f43b28..8f2e0b4846739ab749731c48a186e2e0bd14db81 100644 (file)
@@ -20,6 +20,17 @@ MAKE_CONST_WXSTRING(NotebookNameStr);
 //---------------------------------------------------------------------------
 %newgroup
 
 //---------------------------------------------------------------------------
 %newgroup
 
+
+enum {
+    wxBK_DEFAULT,
+    wxBK_TOP,
+    wxBK_BOTTOM,
+    wxBK_LEFT,
+    wxBK_RIGHT,
+    wxBK_ALIGN_MASK
+};
+
+
 // TODO:  Virtualize this class so other book controls can be derived in Python
 
 MustHaveApp(wxBookCtrlBase);
 // TODO:  Virtualize this class so other book controls can be derived in Python
 
 MustHaveApp(wxBookCtrlBase);
@@ -88,6 +99,17 @@ public:
     virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const/* = 0*/;
 
 
     virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const/* = 0*/;
 
 
+    // get/set size of area between book control area and page area
+    unsigned int GetInternalBorder() const;
+    void SetInternalBorder(unsigned int internalBorder);
+
+    // returns true if we have wxCHB_TOP or wxCHB_BOTTOM style
+    bool IsVertical() const;
+
+    // set/get option to shrink to fit current page
+    void SetShrinkMode(bool shrink);
+    bool GetShrinkMode() const;
+
 
     // remove one page from the control and delete it
     virtual bool DeletePage(size_t n);
 
     // remove one page from the control and delete it
     virtual bool DeletePage(size_t n);
@@ -217,7 +239,7 @@ wx.NB_HITTEST flags.", "");
     // On platforms that support it, get the theme page background colour,
     // else invalid colour
     wxColour GetThemeBackgroundColour() const;
     // On platforms that support it, get the theme page background colour,
     // else invalid colour
     wxColour GetThemeBackgroundColour() const;
-    
+
     static wxVisualAttributes
     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 };
     static wxVisualAttributes
     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 };
@@ -321,9 +343,6 @@ public:
                 long style = 0,
                 const wxString& name = wxPyEmptyString);
 
                 long style = 0,
                 const wxString& name = wxPyEmptyString);
 
-    // returns True if we have wxLB_TOP or wxLB_BOTTOM style
-    bool IsVertical() const;
-
     wxListView* GetListView();
 };
 
     wxListView* GetListView();
 };
 
@@ -387,9 +406,6 @@ public:
                 const wxString& name = wxPyEmptyString);
 
 
                 const wxString& name = wxPyEmptyString);
 
 
-    // returns true if we have wxCHB_TOP or wxCHB_BOTTOM style
-    bool IsVertical() const;
-
     // returns the choice control
     wxChoice* GetChoiceCtrl() const;
 
     // returns the choice control
     wxChoice* GetChoiceCtrl() const;
 
@@ -415,34 +431,171 @@ public:
 //---------------------------------------------------------------------------
 %newgroup;
 
 //---------------------------------------------------------------------------
 %newgroup;
 
-// WXWIN_COMPATIBILITY_2_4
-#if 0
-class wxBookCtrlSizer: public wxSizer
+MustHaveApp(wxTreebook);
+
+class wxTreebook : public wxBookCtrlBase
 {
 public:
 {
 public:
-    %pythonAppend wxBookCtrlSizer "self._setOORInfo(self)"
+    %pythonAppend wxTreebook         "self._setOORInfo(self)"
+    %pythonAppend wxTreebook()       ""
+
+
+    // This ctor creates the tree book control
+    wxTreebook(wxWindow *parent,
+               wxWindowID id,
+               const wxPoint& pos = wxDefaultPosition,
+               const wxSize& size = wxDefaultSize,
+               long style = wxBK_DEFAULT,
+               const wxString& name = wxPyEmptyString);
+
+    %RenameCtor(PreTreebook, wxTreebook());
+
+
+    // Really creates the control
+    bool Create(wxWindow *parent,
+                wxWindowID id,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize,
+                long style = wxBK_DEFAULT,
+                const wxString& name = wxPyEmptyString);
+
+
+    // Notice that page pointer may be NULL in which case the next non NULL
+    // page (usually the first child page of a node) is shown when this page is
+    // selected
+
+    // Inserts a new page just before the page indicated by page.
+    // The new page is placed on the same level as page.
+    virtual bool InsertPage(size_t pos,
+                            wxWindow *page,
+                            const wxString& text,
+                            bool select = false,
+                            int imageId = wxNOT_FOUND);
+
+    // Inserts a new sub-page to the end of children of the page at given pos.
+    %Rename(InsertSubPage,
+            virtual bool, AddSubPage(size_t pos,
+                                     wxWindow *page,
+                                     const wxString& text,
+                                     bool select = false,
+                                     int imageId = wxNOT_FOUND));
+
+    // Adds a new page at top level after all other pages.
+    virtual bool AddPage(wxWindow *page,
+                         const wxString& text,
+                         bool select = false,
+                         int imageId = wxNOT_FOUND);
+
+    // Adds a new child-page to the last top-level page inserted.
+    // Useful when constructing 1 level tree structure.
+    virtual bool AddSubPage(wxWindow *page,
+                            const wxString& text,
+                            bool select = false,
+                            int imageId = wxNOT_FOUND);
+
+    // Deletes the page and ALL its children. Could trigger page selection
+    // change in a case when selected page is removed. In that case its parent
+    // is selected (or the next page if no parent).
+    virtual bool DeletePage(size_t pos);
 
 
-    wxBookCtrlSizer( wxBookCtrlBase *nb );
 
 
-    void RecalcSizes();
-    wxSize CalcMin();
-    wxBookCtrlBase *GetControl();
+    // Tree operations
+    // ---------------
+
+    // Gets the page node state -- node is expanded or collapsed
+    virtual bool IsNodeExpanded(size_t pos) const;
+
+    // Expands or collapses the page node. Returns the previous state.
+    // May generate page changing events (if selected page
+    // is under the collapsed branch, then parent is autoselected).
+    virtual bool ExpandNode(size_t pos, bool expand = true);
+
+    // shortcut for ExpandNode(pos, false)
+    bool CollapseNode(size_t pos);
+
+    // get the parent page or wxNOT_FOUND if this is a top level page
+    int GetPageParent(size_t pos) const;
+
+    // the tree control we use for showing the pages index tree
+    wxTreeCtrl* GetTreeCtrl() const;
+
+};
+
+
+class wxTreebookEvent : public wxBookCtrlBaseEvent
+{
+public:
+    wxTreebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
+                    int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND);
 };
 
 };
 
+%constant wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED;
+%constant wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING;
+%constant wxEventType wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED;
+%constant wxEventType wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED;
 
 
-class wxNotebookSizer: public wxSizer {
+
+%pythoncode {
+    EVT_TREEBOOK_PAGE_CHANGED= wx.PyEventBinder( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, 1 )
+    EVT_TREEBOOK_PAGE_CHANGING= wx.PyEventBinder( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, 1)
+    EVT_TREEBOOK_NODE_COLLAPSED= wx.PyEventBinder( wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED, 1 )
+    EVT_TREEBOOK_NODE_EXPANDED= wx.PyEventBinder( wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED, 1 )
+}
+
+//---------------------------------------------------------------------------
+%newgroup;
+
+MustHaveApp(wxTreebook);
+
+class wxToolbook : public wxBookCtrlBase
+{
 public:
 public:
-    %pythonAppend wxNotebookSizer "self._setOORInfo(self)"
+    %pythonAppend wxToolbook         "self._setOORInfo(self)"
+    %pythonAppend wxToolbook()       ""
+
+
+    // This ctor creates the tree book control
+    wxToolbook(wxWindow *parent,
+               wxWindowID id,
+               const wxPoint& pos = wxDefaultPosition,
+               const wxSize& size = wxDefaultSize,
+               long style = wxBK_DEFAULT,
+               const wxString& name = wxPyEmptyString);
+
+    %RenameCtor(PreToolbook, wxToolbook());
+
+    // quasi ctor
+    bool Create(wxWindow *parent,
+                wxWindowID id,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize,
+                long style = 0,
+                const wxString& name = wxEmptyString);
 
 
-    wxNotebookSizer( wxNotebook *nb );
 
 
-    void RecalcSizes();
-    wxSize CalcMin();
-    wxNotebook *GetNotebook();
+    wxToolBarBase* GetToolBar() const;
+
+    // Not part of the wxBookctrl API, but must be called in OnIdle or
+    // by application to realize the toolbar and select the initial page.
+    void Realize();
+};
+
+
+class wxToolbookEvent : public wxBookCtrlBaseEvent
+{
+public:
+    wxToolbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
+                    int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND);
 };
 
 };
 
-%pythoncode { NotebookSizer.__init__ = wx._deprecated(NotebookSizer.__init__, "NotebookSizer is no longer needed.") }
-%pythoncode { BookCtrlSizer.__init__ = wx._deprecated(BookCtrlSizer.__init__, "BookCtrlSizer is no longer needed.") }
-#endif
+
+%constant wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED;
+%constant wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING;
+
+
+%pythoncode {
+    EVT_TOOLBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, 1)
+    EVT_TOOLBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, 1)
+}
 
 //---------------------------------------------------------------------------
 
 //---------------------------------------------------------------------------
index 36a950ec73db88faded9f01d47b100b683056c08..ddf343e7c08d7a66f52249dd917d3d95a3b0a70c 100644 (file)
@@ -209,6 +209,12 @@ wxToggleButtonPtr = wx._controls.ToggleButtonPtr
 wxPreToggleButton = wx._controls.PreToggleButton
 wxToggleButton_GetClassDefaultAttributes = wx._controls.ToggleButton_GetClassDefaultAttributes
 wxNotebookNameStr = wx._controls.NotebookNameStr
 wxPreToggleButton = wx._controls.PreToggleButton
 wxToggleButton_GetClassDefaultAttributes = wx._controls.ToggleButton_GetClassDefaultAttributes
 wxNotebookNameStr = wx._controls.NotebookNameStr
+wxBK_DEFAULT = wx._controls.BK_DEFAULT
+wxBK_TOP = wx._controls.BK_TOP
+wxBK_BOTTOM = wx._controls.BK_BOTTOM
+wxBK_LEFT = wx._controls.BK_LEFT
+wxBK_RIGHT = wx._controls.BK_RIGHT
+wxBK_ALIGN_MASK = wx._controls.BK_ALIGN_MASK
 wxBookCtrlBase = wx._controls.BookCtrlBase
 wxBookCtrlBasePtr = wx._controls.BookCtrlBasePtr
 wxBookCtrlBase_GetClassDefaultAttributes = wx._controls.BookCtrlBase_GetClassDefaultAttributes
 wxBookCtrlBase = wx._controls.BookCtrlBase
 wxBookCtrlBasePtr = wx._controls.BookCtrlBasePtr
 wxBookCtrlBase_GetClassDefaultAttributes = wx._controls.BookCtrlBase_GetClassDefaultAttributes
@@ -259,6 +265,22 @@ wxChoicebookEvent = wx._controls.ChoicebookEvent
 wxChoicebookEventPtr = wx._controls.ChoicebookEventPtr
 wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wx._controls.wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED
 wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wx._controls.wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING
 wxChoicebookEventPtr = wx._controls.ChoicebookEventPtr
 wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wx._controls.wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED
 wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wx._controls.wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING
+wxTreebook = wx._controls.Treebook
+wxTreebookPtr = wx._controls.TreebookPtr
+wxPreTreebook = wx._controls.PreTreebook
+wxTreebookEvent = wx._controls.TreebookEvent
+wxTreebookEventPtr = wx._controls.TreebookEventPtr
+wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED = wx._controls.wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED
+wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING = wx._controls.wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING
+wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED = wx._controls.wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED
+wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED = wx._controls.wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED
+wxToolbook = wx._controls.Toolbook
+wxToolbookPtr = wx._controls.ToolbookPtr
+wxPreToolbook = wx._controls.PreToolbook
+wxToolbookEvent = wx._controls.ToolbookEvent
+wxToolbookEventPtr = wx._controls.ToolbookEventPtr
+wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED = wx._controls.wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED
+wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING = wx._controls.wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING
 wxTOOL_STYLE_BUTTON = wx._controls.TOOL_STYLE_BUTTON
 wxTOOL_STYLE_SEPARATOR = wx._controls.TOOL_STYLE_SEPARATOR
 wxTOOL_STYLE_CONTROL = wx._controls.TOOL_STYLE_CONTROL
 wxTOOL_STYLE_BUTTON = wx._controls.TOOL_STYLE_BUTTON
 wxTOOL_STYLE_SEPARATOR = wx._controls.TOOL_STYLE_SEPARATOR
 wxTOOL_STYLE_CONTROL = wx._controls.TOOL_STYLE_CONTROL