From 2054b6b35f3c82fc500eaf15758debb2a841e6c8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Nov 2014 01:02:27 +0000 Subject: [PATCH] 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 --- samples/menu/menu.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index 3afe190faf..2b7ef8975a 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -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(".");