From 0ce53f3226ef5f944a010a737864a72eb8d80f9f Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Thu, 2 Nov 2006 14:16:59 +0000 Subject: [PATCH] wxAuiNotebook window styles implemented git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/aui/auibook.h | 16 ++++++++++------ src/aui/auibook.cpp | 29 ++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index 185df40a66..cea4e8a901 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -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 }; diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 3e35388c51..0a17298d75 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -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, -- 2.45.2