From 0a63a7b38f2eedd51a7c68fe01ad013467374194 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jul 2011 12:55:30 +0000 Subject: [PATCH] Use the correct event handler in wxMenuBase::UpdateUI(). Use GetWindow() instead of GetInvokingWindow() to send the event to the associated window for the menus that are part of the menu bar and not only the popup ones. This was broken since r64127 because GetInvokingWindow() is now only used for the popup menus. Closes #13317. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/menucmn.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 32f525d673..d53056d9ee 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -597,17 +597,18 @@ wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const // window will be used. void wxMenuBase::UpdateUI(wxEvtHandler* source) { - if (GetInvokingWindow()) + wxWindow * const win = GetWindow(); + if ( win ) { // Don't update menus if the parent // frame is about to get deleted - wxWindow *tlw = wxGetTopLevelParent( GetInvokingWindow() ); + wxWindow *tlw = wxGetTopLevelParent(win); if (tlw && wxPendingDelete.Member(tlw)) return; } - if ( !source && GetInvokingWindow() ) - source = GetInvokingWindow()->GetEventHandler(); + if ( !source && win ) + source = win->GetEventHandler(); if ( !source ) source = GetEventHandler(); if ( !source ) -- 2.45.2