]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/notebook.cpp
ensure all topic overviews have an horizontal rule with the list of the sections...
[wxWidgets.git] / samples / widgets / notebook.cpp
index 4d6902cb3ec2bd8e1600067ea7852ae9d576d280..7c9e94a8a8020053c573bfe6bdfcc52d8b120c6a 100644 (file)
@@ -86,7 +86,7 @@ enum Orient
 class BookWidgetsPage : public WidgetsPage
 {
 public:
-    BookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist, char* icon[]);
+    BookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist, const char *const icon[]);
     virtual ~BookWidgetsPage();
 
     virtual wxControl *GetWidget() const { return m_book; }
@@ -192,7 +192,7 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-BookWidgetsPage::BookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist, char* icon[])
+BookWidgetsPage::BookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist, const char *const icon[])
                 :WidgetsPage(book, imaglist, icon)
 {
     // init everything
@@ -286,6 +286,8 @@ void BookWidgetsPage::CreateContent()
     sizerTop->Add(sizerMiddle, 0, wxGROW | wxALL, 10);
     sizerTop->Add(m_sizerBook, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
 
+    RecreateBook();
+
     // final initializations
     Reset();
 #if USE_ICONS_IN_BOOK
@@ -293,8 +295,6 @@ void BookWidgetsPage::CreateContent()
 #endif // USE_ICONS_IN_BOOK
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 BookWidgetsPage::~BookWidgetsPage()
@@ -525,7 +525,7 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
 void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event)
 {
     if(m_book)
-        event.SetText( wxString::Format(_T("%d"), m_book->GetPageCount()) );
+        event.SetText( wxString::Format(_T("%u"), unsigned(m_book->GetPageCount())) );
 }
 
 void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event)
@@ -570,7 +570,6 @@ protected:
         return new wxNotebook(this, BookPage_Book,
                               wxDefaultPosition, wxDefaultSize,
                               flags);
-
     }
 
 private:
@@ -652,7 +651,6 @@ protected:
         return new wxListbook(this, BookPage_Book,
                               wxDefaultPosition, wxDefaultSize,
                               flags);
-
     }
 
 private:
@@ -726,7 +724,6 @@ protected:
         return new wxChoicebook(this, BookPage_Book,
                                 wxDefaultPosition, wxDefaultSize,
                                 flags);
-
     }
 
 private: