]> git.saurik.com Git - wxWidgets.git/commitdiff
wxAuiNotebook window styles implemented
authorBenjamin Williams <bwilliams@kirix.com>
Thu, 2 Nov 2006 14:16:59 +0000 (14:16 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Thu, 2 Nov 2006 14:16:59 +0000 (14:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/aui/auibook.h
src/aui/auibook.cpp

index 185df40a66fd5033b5d07131bfb575cd8ea6baa3..cea4e8a901ad8ce49da56cfe29807a8d11074f02 100644 (file)
@@ -37,8 +37,8 @@ enum wxAuiNotebookOption
     wxAUI_NB_TAB_SPLIT           = 1 << 4,
     wxAUI_NB_TAB_MOVE            = 1 << 5,
     wxAUI_NB_SCROLL_BUTTONS      = 1 << 6,
-    wxAUI_NB_CLOSE_BUTTON        = 1 << 7,
-    wxAUI_NB_PAGELIST_BUTTON     = 1 << 8,
+    wxAUI_NB_PAGELIST_BUTTON     = 1 << 7,
+    wxAUI_NB_CLOSE_BUTTON        = 1 << 8,
     wxAUI_NB_CLOSE_ON_ACTIVE_TAB = 1 << 9,
     wxAUI_NB_CLOSE_ON_ALL_TABS   = 1 << 10,
     
@@ -337,10 +337,10 @@ public:
     wxAuiNotebook();
 
     wxAuiNotebook(wxWindow* parent,
-                       wxWindowID id = wxID_ANY,
-                       const wxPoint& pos = wxDefaultPosition,
-                       const wxSize& size = wxDefaultSize,
-                       long style = wxAUI_NB_DEFAULT_STYLE);
+                  wxWindowID id = wxID_ANY,
+                  const wxPoint& pos = wxDefaultPosition,
+                  const wxSize& size = wxDefaultSize,
+                  long style = wxAUI_NB_DEFAULT_STYLE);
 
     virtual ~wxAuiNotebook();
 
@@ -363,6 +363,8 @@ public:
 
     bool DeletePage(size_t page);
     bool RemovePage(size_t page);
+    
+    void SetWindowStyleFlag(long style);
 
     bool SetPageText(size_t page, const wxString& text);
     size_t SetSelection(size_t new_page);
@@ -370,6 +372,7 @@ public:
     size_t GetPageCount() const;
     wxWindow* GetPage(size_t page_idx) const;
 
+
     void SetArtProvider(wxAuiTabArt* art);
     wxAuiTabArt* GetArtProvider();
 
@@ -412,6 +415,7 @@ protected:
     unsigned int m_flags;
 
 #ifndef SWIG
+    DECLARE_CLASS(wxAuiNotebook)
     DECLARE_EVENT_TABLE()
 #endif
 };
index 3e35388c5190337fe9aaf826db852b4a8023a61b..0a17298d759d0abb54fdc699bc40541be9de6580 100644 (file)
@@ -42,7 +42,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION)
 
 
-
+IMPLEMENT_CLASS(wxAuiNotebook, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxAuiNotebookEvent, wxEvent)
 
 
@@ -1519,6 +1519,33 @@ wxAuiTabArt* wxAuiNotebook::GetArtProvider()
     return m_tabs.GetArtProvider();
 }
 
+void wxAuiNotebook::SetWindowStyleFlag(long style)
+{
+    wxControl::SetWindowStyleFlag(style);
+    
+    m_flags = (unsigned int)style;
+    
+    // if the control is already initialized
+    if (m_mgr.GetManagedWindow() == (wxWindow*)this)
+    {
+        // let all of the tab children know about the new style
+        
+        wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
+        size_t i, pane_count = all_panes.GetCount();
+        for (i = 0; i < pane_count; ++i)
+        {
+            wxAuiPaneInfo& pane = all_panes.Item(i);
+            if (pane.name == wxT("dummy"))
+                continue;
+            wxAuiTabCtrl* tabctrl = ((wxTabFrame*)pane.window)->m_tabs;
+            tabctrl->SetFlags(m_flags);
+            tabctrl->Refresh();
+            tabctrl->Update();
+        }
+    }
+}
+
+
 bool wxAuiNotebook::AddPage(wxWindow* page,
                             const wxString& caption,
                             bool select,