+#endif // 0
+}
+
+void MyFrame::OnTestNormal(wxCommandEvent& WXUNUSED(event))
+{
+ wxLogMessage(_T("Normal item selected"));
+}
+
+void MyFrame::OnTestCheck(wxCommandEvent& event)
+{
+ wxLogMessage(_T("Check item %schecked"),
+ event.IsChecked() ? _T("") : _T("un"));
+}
+
+void MyFrame::OnTestRadio(wxCommandEvent& event)
+{
+ wxLogMessage(_T("Radio item %d selected"),
+ event.GetId() - Menu_Test_Radio1 + 1);
+}
+
+#if USE_LOG_WINDOW
+void MyFrame::LogMenuOpenOrClose(const wxMenuEvent& event, const wxChar *what)
+{
+ wxString msg;
+ msg << _T("A ")
+ << ( event.IsPopup() ? _T("popup ") : _T("") )
+ << _T("menu has been ")
+ << what
+ << _T(".");
+
+ wxLogStatus(this, msg.c_str());
+}
+#endif
+
+void MyFrame::OnUpdateSubMenuNormal(wxUpdateUIEvent& event)
+{
+ event.Enable(false);
+}
+
+void MyFrame::OnUpdateSubMenuCheck(wxUpdateUIEvent& event)
+{
+ event.Enable(true);
+ event.Check(true);
+}
+
+void MyFrame::OnUpdateSubMenuRadio(wxUpdateUIEvent& event)
+{
+ int which = (event.GetId() - Menu_SubMenu_Radio1 + 1);
+ if (which == 2)
+ event.Check(true);
+ else
+ event.Check(false);
+}
+
+#if USE_CONTEXT_MENU
+void MyFrame::OnContextMenu(wxContextMenuEvent& event)
+{
+ wxPoint point = event.GetPosition();
+ // If from keyboard
+ if (point.x == -1 && point.y == -1) {
+ wxSize size = GetSize();
+ point.x = size.x / 2;
+ point.y = size.y / 2;
+ } else {
+ point = ScreenToClient(point);
+ }
+ ShowContextMenu(point);