allow to change the event propagation level (modified patch 743086)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2163,10 +2163,9 @@ bool wxWindowBase::TryValidator(wxEvent& event)
|
|||||||
|
|
||||||
bool wxWindowBase::TryParent(wxEvent& event)
|
bool wxWindowBase::TryParent(wxEvent& event)
|
||||||
{
|
{
|
||||||
// Carry on up the parent-child hierarchy, but only if event is a command
|
// carry on up the parent-child hierarchy if the propgation count hasn't
|
||||||
// event: it wouldn't make sense for a parent to receive a child's size
|
// reached zero yet
|
||||||
// event, for example
|
if ( event.ShouldPropagate() )
|
||||||
if ( event.IsCommandEvent() )
|
|
||||||
{
|
{
|
||||||
// honour the requests to stop propagation at this window: this is
|
// honour the requests to stop propagation at this window: this is
|
||||||
// used by the dialogs, for example, to prevent processing the events
|
// used by the dialogs, for example, to prevent processing the events
|
||||||
@@ -2176,9 +2175,13 @@ bool wxWindowBase::TryParent(wxEvent& event)
|
|||||||
{
|
{
|
||||||
wxWindow *parent = GetParent();
|
wxWindow *parent = GetParent();
|
||||||
if ( parent && !parent->IsBeingDeleted() )
|
if ( parent && !parent->IsBeingDeleted() )
|
||||||
|
{
|
||||||
|
wxPropagateOnce propagateOnce(event);
|
||||||
|
|
||||||
return parent->GetEventHandler()->ProcessEvent(event);
|
return parent->GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return wxEvtHandler::TryParent(event);
|
return wxEvtHandler::TryParent(event);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user