+ EVT_CLOSE(MyFrame::OnClose)
+ EVT_SIZE(MyFrame::OnSize)
+END_EVENT_TABLE()
+
+// Note that MDI_NEW_WINDOW and MDI_ABOUT commands get passed
+// to the parent window for processing, so no need to
+// duplicate event handlers here.
+BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame)
+ EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit)
+ EVT_MENU(MDI_REFRESH, MyChild::OnRefresh)
+ EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle)
+ EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition)
+ EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize)
+
+#if wxUSE_CLIPBOARD
+ EVT_MENU(wxID_PASTE, MyChild::OnPaste)
+ EVT_UPDATE_UI(wxID_PASTE, MyChild::OnUpdatePaste)
+#endif // wxUSE_CLIPBOARD
+
+ EVT_SIZE(MyChild::OnSize)
+ EVT_MOVE(MyChild::OnMove)
+
+ EVT_CLOSE(MyChild::OnClose)
+END_EVENT_TABLE()
+
+BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
+ EVT_MOUSE_EVENTS(MyCanvas::OnEvent)
+END_EVENT_TABLE()
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// MyApp
+// ---------------------------------------------------------------------------
+
+// Initialise this in OnInit, not statically
+bool MyApp::OnInit()
+{
+ if ( !wxApp::OnInit() )
+ return false;
+
+ // Create the main frame window
+
+ frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("MDI Demo"),
+ wxDefaultPosition, wxSize(500, 400),
+ wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL);
+#if 0
+ // Experimental: change the window menu
+ wxMenu* windowMenu = new wxMenu;
+ windowMenu->Append(5000, _T("My menu item!"));
+ frame->SetWindowMenu(windowMenu);