+void ListbookWidgetsPage::OnPageChanged(wxListbookEvent& event)
+{
+ wxLogMessage(_T("Listbook page changed from %d to %d (currently %d)."),
+ event.GetOldSelection(),
+ event.GetSelection(),
+ m_book->GetSelection());
+
+ event.Skip();
+}
+
+#endif // wxUSE_LISTBOOK
+
+#if wxUSE_CHOICEBOOK
+
+#include "icons/choicebk.xpm"
+#include "wx/choicebk.h"
+
+// ----------------------------------------------------------------------------
+// ChoicebookWidgetsPage
+// ----------------------------------------------------------------------------
+
+class ChoicebookWidgetsPage : public BookWidgetsPage
+{
+public:
+ ChoicebookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist)
+ : BookWidgetsPage(book, imaglist, choicebk_xpm)
+ {
+ RecreateBook();
+ }
+ virtual ~ChoicebookWidgetsPage() {}
+
+protected:
+
+ // event handlers
+ void OnPageChanging(wxChoicebookEvent& event);
+ void OnPageChanged(wxChoicebookEvent& event);
+
+ // (re)create book
+ virtual wxBookCtrlBase *CreateBook(long flags)
+ {
+ return new wxChoicebook(this, BookPage_Book,
+ wxDefaultPosition, wxDefaultSize,
+ flags);
+ }
+
+private:
+ DECLARE_EVENT_TABLE()
+ DECLARE_WIDGETS_PAGE(ChoicebookWidgetsPage)
+};
+
+// ----------------------------------------------------------------------------
+// event table
+// ----------------------------------------------------------------------------
+
+BEGIN_EVENT_TABLE(ChoicebookWidgetsPage, BookWidgetsPage)
+ EVT_CHOICEBOOK_PAGE_CHANGING(wxID_ANY, ChoicebookWidgetsPage::OnPageChanging)
+ EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, ChoicebookWidgetsPage::OnPageChanged)
+END_EVENT_TABLE()
+
+IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, _T("Choicebook"),
+ GENERIC_CTRLS | BOOK_CTRLS
+ );
+
+void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event)
+{
+ wxLogMessage(_T("Choicebook page changing from %d to %d (currently %d)."),
+ event.GetOldSelection(),
+ event.GetSelection(),
+ m_book->GetSelection());
+
+ event.Skip();
+}
+
+void ChoicebookWidgetsPage::OnPageChanged(wxChoicebookEvent& event)
+{
+ wxLogMessage(_T("Choicebook page changed from %d to %d (currently %d)."),
+ event.GetOldSelection(),
+ event.GetSelection(),
+ m_book->GetSelection());
+
+ event.Skip();
+}
+
+#endif // wxUSE_CHOICEBOOK
+
+#endif // wxUSE_BOOKCTRL