+
+void MyFrame::OnNotebookFlag(wxCommandEvent& event)
+{
+ int id = event.GetId();
+
+ if (id == ID_NotebookNoCloseButton ||
+ id == ID_NotebookCloseButton ||
+ id == ID_NotebookCloseButtonAll ||
+ id == ID_NotebookCloseButtonActive)
+ {
+ m_notebook_style &= ~(wxAUI_NB_CLOSE_BUTTON |
+ wxAUI_NB_CLOSE_ON_ACTIVE_TAB |
+ wxAUI_NB_CLOSE_ON_ALL_TABS);
+
+ switch (id)
+ {
+ case ID_NotebookNoCloseButton: break;
+ case ID_NotebookCloseButton: m_notebook_style |= wxAUI_NB_CLOSE_BUTTON; break;
+ case ID_NotebookCloseButtonAll: m_notebook_style |= wxAUI_NB_CLOSE_ON_ALL_TABS; break;
+ case ID_NotebookCloseButtonActive: m_notebook_style |= wxAUI_NB_CLOSE_ON_ACTIVE_TAB; break;
+ }
+ }
+
+ if (id == ID_NotebookAllowTabMove)
+ {
+ m_notebook_style ^= wxAUI_NB_TAB_MOVE;
+ }
+ if (id == ID_NotebookAllowTabExternalMove)
+ {
+ m_notebook_style ^= wxAUI_NB_TAB_EXTERNAL_MOVE;
+ }
+ else if (id == ID_NotebookAllowTabSplit)
+ {
+ m_notebook_style ^= wxAUI_NB_TAB_SPLIT;
+ }
+ else if (id == ID_NotebookWindowList)
+ {
+ m_notebook_style ^= wxAUI_NB_WINDOWLIST_BUTTON;
+ }
+ else if (id == ID_NotebookScrollButtons)
+ {
+ m_notebook_style ^= wxAUI_NB_SCROLL_BUTTONS;
+ }
+ else if (id == ID_NotebookTabFixedWidth)
+ {
+ m_notebook_style ^= wxAUI_NB_TAB_FIXED_WIDTH;
+ }
+
+
+ size_t i, count;
+ wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
+ for (i = 0, count = all_panes.GetCount(); i < count; ++i)
+ {
+ wxAuiPaneInfo& pane = all_panes.Item(i);
+ if (pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
+ {
+ wxAuiNotebook* nb = (wxAuiNotebook*)pane.window;
+
+ if (id == ID_NotebookArtGloss)
+ {
+ nb->SetArtProvider(new wxAuiDefaultTabArt);
+ m_notebook_theme = 0;
+ }
+ else if (id == ID_NotebookArtSimple)
+ {
+ nb->SetArtProvider(new wxAuiSimpleTabArt);
+ m_notebook_theme = 1;
+ }
+
+
+ nb->SetWindowStyleFlag(m_notebook_style);
+ nb->Refresh();
+ }
+ }
+
+
+}
+
+