The event pre-processing hooks associated with the window should be called
only once during the event processing, we don't need to call TryBefore() for
each and every event handler associated with the window too.
This makes the code slightly simpler and faster and shouldn't change the
behaviour of any existing code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64260
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
The normal order of event table searching is as follows:
-# wxApp::FilterEvent() is called. If it returns anything but @c -1
(default) the processing stops here.
The normal order of event table searching is as follows:
-# wxApp::FilterEvent() is called. If it returns anything but @c -1
(default) the processing stops here.
- -# If the object is disabled (via a call to wxEvtHandler::SetEvtHandlerEnabled)
- the function skips to step (7).
-# TryBefore() is called (this is where wxValidator are taken into
account for wxWindow objects). If this returns @true, the function exits.
-# TryBefore() is called (this is where wxValidator are taken into
account for wxWindow objects). If this returns @true, the function exits.
+ -# If the object is disabled (via a call to wxEvtHandler::SetEvtHandlerEnabled)
+ the function skips to step (7).
-# Dynamic event table of the handlers bound using Bind<>() is
searched. If a handler is found, it is executed and the function
returns @true unless the handler used wxEvent::Skip() to indicate
-# Dynamic event table of the handlers bound using Bind<>() is
searched. If a handler is found, it is executed and the function
returns @true unless the handler used wxEvent::Skip() to indicate
processed, ProcessEvent() on wxTheApp object is called as the last
step.
processed, ProcessEvent() on wxTheApp object is called as the last
step.
- Notice that steps (2)-(6) are performed in ProcessEventHere() which is
+ Notice that steps (3)-(5) are performed in ProcessEventHere() which is
called by this function.
@param event
called by this function.
@param event
This method is called from ProcessEvent(), please see the detailed
description of the event processing logic there.
This method is called from ProcessEvent(), please see the detailed
description of the event processing logic there.
- It is @em not virtual and so may not be overridden but it does call
- virtual TryBefore() which may be overridden.
+ It is @em not virtual and so may not be overridden.
@param event
Event to process.
@param event
Event to process.
+ // Try the hooks which should be called before our own handlers
+ if ( TryBefore(event) )
+ return true;
+
if ( ProcessEventHere(event) )
return true;
if ( ProcessEventHere(event) )
return true;
if ( !GetEvtHandlerEnabled() )
return false;
if ( !GetEvtHandlerEnabled() )
return false;
- // Try the hooks which should be called before our own handlers
- if ( TryBefore(event) )
- return true;
-
// Handle per-instance dynamic event tables first
if ( m_dynamicEvents && SearchDynamicEventTable(event) )
return true;
// Handle per-instance dynamic event tables first
if ( m_dynamicEvents && SearchDynamicEventTable(event) )
return true;