- menu.Append(Menu_Help_About, "&About");
- menu.Append(Menu_Popup_Submenu, "&Submenu", CreateDummyMenu(NULL));
- menu.Append(Menu_Popup_ToBeDeleted, "To be &deleted");
- menu.Append(Menu_Popup_ToBeChecked, "To be &checked", "", TRUE);
- menu.Append(Menu_Popup_ToBeGreyed, "To be &greyed");
+ for (menuindex = 0; (menuindex < count) && (index == wxNOT_FOUND); ++menuindex)
+ {
+ index = mbar->FindMenuItem(mbar->GetMenu(menuindex)->GetTitle(), label);
+ }
+ if (index == wxNOT_FOUND)
+ {
+ wxLogWarning(_T("No menu item with label '%s'"), label.c_str());
+ }
+ else
+ {
+ wxLogMessage(_T("Menu item %d in menu %lu has label '%s'"),
+ index, (unsigned long)menuindex, label.c_str());
+ }
+ }
+}
+#endif
+
+void MyFrame::ShowContextMenu(const wxPoint& pos)
+{
+ wxMenu menu(_T("Test popup"));
+
+ menu.Append(Menu_Help_About, _T("&About"));
+ menu.Append(Menu_Popup_Submenu, _T("&Submenu"), CreateDummyMenu(NULL));
+ menu.Append(Menu_Popup_ToBeDeleted, _T("To be &deleted"));
+ menu.AppendCheckItem(Menu_Popup_ToBeChecked, _T("To be &checked"));
+ menu.Append(Menu_Popup_ToBeGreyed, _T("To be &greyed"),
+ _T("This menu item should be initially greyed out"));