From: Vadim Zeitlin Date: Thu, 5 Apr 2012 22:27:36 +0000 (+0000) Subject: Set the menu itself as event object for EVT_MENU_{OPEN,CLOSED} in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/525454303e200c514b6c1078284b86fb73572852 Set the menu itself as event object for EVT_MENU_{OPEN,CLOSED} in wxMSW. Make wxMSW consistent with the other ports and set the menu itself, not the window it is attached to, as the event object for the menu open/close events. See #1595. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index bb0a2ba45c..3319dd013b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -207,6 +207,10 @@ Changes in behaviour not resulting in compilation errors, please read this! behaved differently in wxMSW and wxGTK/wxOSX before) if more than one item is selected in a control with wxDV_MULTIPLE style. +- wxEVT_COMMAND_MENU_SELECTED, MENU_OPEN and CLOSE events returned a menu from + GetEventObject() in all ports but the frame the menu was attached to in wxMSW. + Now all ports return the menu that was opened or closed as the event object. + Changes in behaviour which may result in compilation errors ----------------------------------------------------------- diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 40babb6805..f61c8f5f0c 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -854,7 +854,7 @@ bool wxFrame::DoSendMenuOpenCloseEvent(wxEventType evtType, wxMenu* menu, bool popup) { wxMenuEvent event(evtType, popup ? wxID_ANY : 0, menu); - event.SetEventObject(this); + event.SetEventObject(menu); return HandleWindowEvent(event); }