Call wxEvtHandler::TryBefore() only once from ProcessEvent().

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
This commit is contained in:
Vadim Zeitlin
2010-05-09 14:55:21 +00:00
parent c0c05e79b2
commit 255ea4a702
2 changed files with 8 additions and 9 deletions

View File

@@ -1361,6 +1361,10 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
}
}
// Try the hooks which should be called before our own handlers
if ( TryBefore(event) )
return true;
if ( ProcessEventHere(event) )
return true;
@@ -1381,10 +1385,6 @@ bool wxEvtHandler::ProcessEventHere(wxEvent& event)
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;