]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/notebook.cpp
added wxHtmlHelpController::AddBook(wxFileName)
[wxWidgets.git] / samples / widgets / notebook.cpp
index 170e535864971cf74af2171824307bff0cf02411..6eb8b1ae6512f4aa80d1772a27eca73094515e27 100644 (file)
@@ -44,7 +44,7 @@
 #include "wx/artprov.h"
 
 #include "widgets.h"
-
+#if 1
 #include "icons/notebook.xpm"
 
 // ----------------------------------------------------------------------------
@@ -280,7 +280,7 @@ NotebookWidgetsPage::NotebookWidgetsPage(wxNotebook *notebook,
     wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
     m_notebook = new wxNotebook(this, NotebookPage_Notebook);
     sizerRight->Add(m_notebook, 1, wxGROW | wxALL, 5);
-    sizerRight->SetMinSize(250, 0);
+    sizerRight->SetMinSize(150, 0);
     m_sizerNotebook = sizerRight; // save it to modify it later
 
     // the 3 panes panes compose the window
@@ -380,18 +380,17 @@ void NotebookWidgetsPage::CreateNotebook()
 
     if ( notebook )
     {
-        int sel = notebook->GetSelection();
+        const int sel = notebook->GetSelection();
+
+        const int count = notebook->GetPageCount();
 
-        int count = notebook->GetPageCount();
+        // recreate the pages
         for ( int n = 0; n < count; n++ )
         {
-            wxNotebookPage *page = notebook->GetPage(0);
-            page->Reparent(m_notebook);
-
-            m_notebook->AddPage(page, notebook->GetPageText(0), FALSE,
-                                notebook->GetPageImage(0));
-
-            notebook->RemovePage(0);
+            m_notebook->AddPage(CreateNewPage(),
+                                notebook->GetPageText(n),
+                                FALSE,
+                                notebook->GetPageImage(n));
         }
 
         m_sizerNotebook->Remove(notebook);
@@ -543,3 +542,4 @@ void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event)
     event.Skip();
 }
 
+#endif