+
+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_NotebookAllowTabSplit)
+ {
+ m_notebook_style ^= wxAUI_NB_TAB_SPLIT;
+ }
+
+
+
+ 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)))
+ {
+ pane.window->SetWindowStyleFlag(m_notebook_style);
+ pane.window->Refresh();
+ }
+ }
+
+
+}
+
+