Log wxMenuEvent::GetMenu() in the menu sample for wxEVT_MENU_{OPEN,CLOSE}.

Show the menu associated with the event, if any, directly in the sample to
make comparing the behaviour of the different ports easier.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-11-11 01:02:27 +00:00
parent d23bd1e32e
commit 2054b6b35f

View File

@ -1240,6 +1240,18 @@ void MyFrame::LogMenuOpenCloseOrHighlight(const wxMenuEvent& event, const wxChar
{
msg << wxT(" (id=") << event.GetId() << wxT(")");
}
else // wxEVT_MENU_{OPEN,CLOSE}
{
wxMenu* const menu = event.GetMenu();
if ( menu )
{
msg << " (menu with title \"" << menu->GetTitle() << "\")";
}
else
{
msg << " (no menu)";
}
}
msg << wxT(".");