fix the event handling in presence of pushed event handlers broken by r55784 (closes #9992)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -332,17 +332,21 @@ doesn't count as having handled the event and the search continues):
|
|||||||
|
|
||||||
<li value="5">
|
<li value="5">
|
||||||
The event is passed to the next event handler, if any, in the event handler
|
The event is passed to the next event handler, if any, in the event handler
|
||||||
chain. This chain can be formed using wxEvtHandler::SetNextHandler() or
|
chain, i.e. the steps (1) to (4) are done for it. This chain can be formed
|
||||||
wxWindow::PushEventHandler() but usually there is no next event handler and
|
using wxEvtHandler::SetNextHandler() or wxWindow::PushEventHandler() but
|
||||||
chaining event handlers using these functions is much less useful now that
|
usually there is no next event handler and chaining event handlers using
|
||||||
Connect() exists so this step will almost never do anything.
|
these functions is much less useful now that Connect() exists so this step
|
||||||
|
will almost never do anything.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li value="6">
|
<li value="6">
|
||||||
If the object is a wxWindow and the event is set to set to propagate (by
|
If the object is a wxWindow and the event is set to propagate (by default
|
||||||
default only wxCommandEvent-derived events are set to propagate), then the
|
only wxCommandEvent-derived events are set to propagate), then the
|
||||||
processing restarts from the step (1) (and excluding the step (7)) for the
|
processing restarts from the step (1) (and excluding the step (7)) for the
|
||||||
parent window.
|
parent window. If this object is not a window but the next handler exists,
|
||||||
|
the event is passed to its parent if it is a window. This ensures that in a
|
||||||
|
common case of (possibly several) non-window event handlers pushed on top
|
||||||
|
of a window, the event eventually reaches the window parent.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li value="7">
|
<li value="7">
|
||||||
|
@@ -1273,6 +1273,13 @@ wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase& entry,
|
|||||||
|
|
||||||
bool wxEvtHandler::TryParent(wxEvent& event)
|
bool wxEvtHandler::TryParent(wxEvent& event)
|
||||||
{
|
{
|
||||||
|
if ( GetNextHandler() )
|
||||||
|
{
|
||||||
|
// the next handler will pass it to wxTheApp if it doesn't process it,
|
||||||
|
// so return from here to avoid doing it again
|
||||||
|
return GetNextHandler()->TryParent(event);
|
||||||
|
}
|
||||||
|
|
||||||
if ( wxTheApp && (this != wxTheApp) )
|
if ( wxTheApp && (this != wxTheApp) )
|
||||||
{
|
{
|
||||||
// Special case: don't pass wxEVT_IDLE to wxApp, since it'll always
|
// Special case: don't pass wxEVT_IDLE to wxApp, since it'll always
|
||||||
|
Reference in New Issue
Block a user