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
This commit is contained in:
Vadim Zeitlin
2012-04-05 22:27:36 +00:00
parent 4936c09982
commit 525454303e
2 changed files with 5 additions and 1 deletions

View File

@@ -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
-----------------------------------------------------------

View File

@@ -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);
}