+
+//-----------------------------------------------------------------------------
+// MyFrame
+//-----------------------------------------------------------------------------
+
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+ // File menu
+ EVT_MENU_RANGE(ID_BOOK_NOTEBOOK, ID_BOOK_MAX, MyFrame::OnType)
+ EVT_MENU_RANGE(ID_ORIENT_DEFAULT, ID_ORIENT_MAX, MyFrame::OnOrient)
+ EVT_MENU(ID_SHOW_IMAGES, MyFrame::OnShowImages)
+ EVT_MENU(ID_MULTI, MyFrame::OnMulti)
+ EVT_MENU(wxID_EXIT, MyFrame::OnExit)
+
+ // Operations menu
+ EVT_MENU(ID_ADD_PAGE, MyFrame::OnAddPage)
+ EVT_MENU(ID_ADD_PAGE_NO_SELECT, MyFrame::OnAddPageNoSelect)
+ EVT_MENU(ID_INSERT_PAGE, MyFrame::OnInsertPage)
+ EVT_MENU(ID_DELETE_CUR_PAGE, MyFrame::OnDeleteCurPage)
+ EVT_MENU(ID_DELETE_LAST_PAGE, MyFrame::OnDeleteLastPage)
+ EVT_MENU(ID_NEXT_PAGE, MyFrame::OnNextPage)
+ EVT_MENU(ID_GO_HOME, MyFrame::OnGoHome)
+
+#if wxUSE_HELP
+ EVT_MENU(ID_CONTEXT_HELP, MyFrame::OnContextHelp)
+#endif // wxUSE_HELP
+ EVT_MENU(ID_HITTEST, MyFrame::OnHitTest)
+
+ // Book controls
+#if wxUSE_NOTEBOOK
+ EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, MyFrame::OnNotebook)
+ EVT_NOTEBOOK_PAGE_CHANGING(wxID_ANY, MyFrame::OnNotebook)
+#endif
+#if wxUSE_LISTBOOK
+ EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, MyFrame::OnListbook)
+ EVT_LISTBOOK_PAGE_CHANGING(wxID_ANY, MyFrame::OnListbook)
+#endif
+#if wxUSE_CHOICEBOOK
+ EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, MyFrame::OnChoicebook)
+ EVT_CHOICEBOOK_PAGE_CHANGING(wxID_ANY, MyFrame::OnChoicebook)
+#endif
+#if wxUSE_TREEBOOK
+ EVT_TREEBOOK_PAGE_CHANGED(wxID_ANY, MyFrame::OnTreebook)
+ EVT_TREEBOOK_PAGE_CHANGING(wxID_ANY, MyFrame::OnTreebook)
+
+ EVT_MENU(ID_ADD_SUB_PAGE, MyFrame::OnAddSubPage)
+ EVT_MENU(ID_ADD_PAGE_BEFORE, MyFrame::OnAddPageBefore)
+ EVT_UPDATE_UI_RANGE(ID_ADD_PAGE_BEFORE, ID_ADD_SUB_PAGE,
+ MyFrame::OnUpdateTreeMenu)
+#endif
+#if wxUSE_TOOLBOOK
+ EVT_TOOLBOOK_PAGE_CHANGED(wxID_ANY, MyFrame::OnToolbook)
+ EVT_TOOLBOOK_PAGE_CHANGING(wxID_ANY, MyFrame::OnToolbook)
+#endif
+
+ // Update title in idle time
+ EVT_IDLE(MyFrame::OnIdle)
+END_EVENT_TABLE()
+
+MyFrame::MyFrame()
+ : wxFrame(NULL, wxID_ANY, wxString(wxT("wxWidgets book controls sample")))