+
+ // intercept all menu events and log them in this custom event handler
+ PushEventHandler(new MyEvtHandler(this));
+
+ // create the log text window
+ m_textctrl = new wxTextCtrl(this, -1, _T(""),
+ wxDefaultPosition, wxDefaultSize,
+ wxTE_MULTILINE);
+ m_textctrl->SetEditable(FALSE);
+ m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textctrl));
+
+ wxLogMessage(_T("Brief explanations: the commands or the \"Menu\" menu\n")
+ _T("append/insert/delete items to/from the last menu.\n")
+ _T("The commands from \"Menubar\" menu work with the\n")
+ _T("menubar itself.\n")
+ _T("Right click the band below to test popup menus.\n"));
+}
+
+MyFrame::~MyFrame()
+{
+ delete m_menu;
+
+ // delete the event handler installed in ctor
+ PopEventHandler(TRUE);
+
+ // restore old logger
+ delete wxLog::SetActiveTarget(m_logOld);