X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/453535a739f649ce43a65fd7e6b9730363bb1b7c..30738aae14dfbce0c492d8696c861947228028c2:/samples/widgets/notebook.cpp diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index 4d6902cb3e..7c9e94a8a8 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -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: