+#endif // wxUSE_NOTEBOOK
+
+#if wxUSE_LISTBOOK
+
+#include "icons/listbook.xpm"
+#include "wx/listbook.h"
+
+// ----------------------------------------------------------------------------
+// ListbookWidgetsPage
+// ----------------------------------------------------------------------------
+
+class ListbookWidgetsPage : public BookWidgetsPage
+{
+public:
+ ListbookWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist)
+ : BookWidgetsPage(book, imaglist, listbook_xpm)
+ {
+ RecreateBook();
+ }
+ virtual ~ListbookWidgetsPage() {}
+
+protected:
+
+ // event handlers
+ void OnPageChanging(wxListbookEvent& event);
+ void OnPageChanged(wxListbookEvent& event);
+
+ // (re)create book
+ virtual wxBookCtrlBase *CreateBook(long flags)
+ {
+ return new wxListbook(this, BookPage_Book,
+ wxDefaultPosition, wxDefaultSize,
+ flags);
+
+ }
+
+private:
+ DECLARE_EVENT_TABLE()
+ DECLARE_WIDGETS_PAGE(ListbookWidgetsPage)
+};
+
+// ----------------------------------------------------------------------------
+// event table
+// ----------------------------------------------------------------------------
+
+BEGIN_EVENT_TABLE(ListbookWidgetsPage, BookWidgetsPage)
+ EVT_LISTBOOK_PAGE_CHANGING(wxID_ANY, ListbookWidgetsPage::OnPageChanging)
+ EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, ListbookWidgetsPage::OnPageChanged)
+END_EVENT_TABLE()
+
+IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, _T("Listbook"),
+ GENERIC_CTRLS | BOOK_CTRLS
+ );
+
+void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event)
+{
+ wxLogMessage(_T("Listbook page changing from %d to %d (currently %d)."),
+ event.GetOldSelection(),
+ event.GetSelection(),
+ m_book->GetSelection());
+
+ event.Skip();
+}
+
+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