merged fixes for accel and command event non propagation from 2.2

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-05-17 23:46:30 +00:00
parent 9416aa89ca
commit 3bdc265d9d
2 changed files with 18 additions and 6 deletions

View File

@@ -943,15 +943,21 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
}
#if wxUSE_GUI
// Carry on up the parent-child hierarchy,
// but only if event is a command event: it wouldn't
// make sense for a parent to receive a child's size event, for example
// Carry on up the parent-child hierarchy, but only if event is a command
// event: it wouldn't make sense for a parent to receive a child's size
// event, for example
if ( m_isWindow && event.IsCommandEvent() )
{
wxWindow *win = (wxWindow *)this;
wxWindow *parent = win->GetParent();
if (parent && !parent->IsBeingDeleted())
return parent->GetEventHandler()->ProcessEvent(event);
// also, don't propagate events beyond the first top level window: it
// doesn't make sense to process dialogs events in the parent frame
if ( !win->IsTopLevel() )
{
wxWindow *parent = win->GetParent();
if (parent && !parent->IsBeingDeleted())
return parent->GetEventHandler()->ProcessEvent(event);
}
}
#endif // wxUSE_GUI