bool wxWindowBase::TryParent(wxEvent& event)
{
- // 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 ( event.IsCommandEvent() )
+ // carry on up the parent-child hierarchy if the propgation count hasn't
+ // reached zero yet
+ if ( event.ShouldPropagate() )
{
// honour the requests to stop propagation at this window: this is
// used by the dialogs, for example, to prevent processing the events
{
wxWindow *parent = GetParent();
if ( parent && !parent->IsBeingDeleted() )
+ {
+ wxPropagateOnce propagateOnce(event);
+
return parent->GetEventHandler()->ProcessEvent(event);
+ }
}
}