- wxLogStatus(this, _T("A %smenu has been %s."),
- event.IsPopup() ? _T("popup ") : _T(""), 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);
+}
+
+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);