From 22c2307c2b1cc454846d066f95e4be2e72ce61cd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 26 Jun 2003 13:00:56 +0000 Subject: [PATCH] pass event to validators fisrt, before using the dynamic event table git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/event.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/common/event.cpp b/src/common/event.cpp index 60ebe589a7..1aac4f55ba 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -821,24 +821,25 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) // An event handler can be enabled or disabled if ( GetEvtHandlerEnabled() ) { - // Handle per-instance dynamic event tables first - if ( m_dynamicEvents && SearchDynamicEventTable(event) ) - return TRUE; - + // if we have a validator, it has higher priority than our own event + // table #if wxUSE_VALIDATORS if ( TryValidator(event) ) return TRUE; #endif // wxUSE_VALIDATORS - // Then static per-class event tables - const wxEventTable *table = GetEventTable(); + // Handle per-instance dynamic event tables first + if ( m_dynamicEvents && SearchDynamicEventTable(event) ) + return TRUE; - // Search upwards through the inheritance hierarchy - while (table) + // Then static per-class event tables (and search upwards through the + // inheritance hierarchy) + for ( const wxEventTable *table = GetEventTable(); + table; + table = table->baseTable ) { if ( SearchEventTable((wxEventTable&)*table, event) ) return TRUE; - table = table->baseTable; } } @@ -849,6 +850,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) return TRUE; } + // Finally propagate the event upwards the window chain and/or to the + // application object as necessary return TryParent(event); } -- 2.45.2