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
This commit is contained in:
@@ -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 )
|
||||
|
Reference in New Issue
Block a user