]> git.saurik.com Git - wxWidgets.git/commit
Fix recently broken forwarding of events between event handlers.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 2 Jun 2010 11:58:31 +0000 (11:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 2 Jun 2010 11:58:31 +0000 (11:58 +0000)
commitbbdee10d5f9d3aea0bd329d629d16f172038f48c
tree8f7e8746d6f7e4ab0b8e38f07543880aa6c65135
parentce6b1014bfc5a1451149fa19a95772be3b57236a
Fix recently broken forwarding of events between event handlers.

After the recent changes to the event processing logic, forwarding an event
from one event handler to another one stopped working correctly because the
per-event "process here only" flag prevented it from following the event
handler chain after forwarding. This notably broke keyboard navigation in
wxComboCtrl under MSW in wx itself and probably quite a few of other things in
user code.

Fix this by replacing the boolean flag with a pointer to the handler to which
the processing of this event should be restricted. This allows the full
processing to still take place if an event is forwarded to another handler.
So wxEvent::ShouldProcessHereOnly() is now called ShouldProcessOnlyIn() and
takes a wxEvtHandler parameter.

This made appear a problem in wxScrollHelperEvtHandler code that was hidden by
the bug above: the events were still processed multiple times in it. To fix
this, also add wxEvent::DidntHonourProcessOnlyIn() and take it into account in
the base class code. Did I mention that wxScrollHelperEvtHandler must die?

Add another unit test checking that forwarding works correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/event.h
src/common/event.cpp
src/generic/scrlwing.cpp
tests/events/propagation.cpp