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
This commit is contained in:
@@ -821,24 +821,25 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
|
|||||||
// An event handler can be enabled or disabled
|
// An event handler can be enabled or disabled
|
||||||
if ( GetEvtHandlerEnabled() )
|
if ( GetEvtHandlerEnabled() )
|
||||||
{
|
{
|
||||||
// Handle per-instance dynamic event tables first
|
// if we have a validator, it has higher priority than our own event
|
||||||
if ( m_dynamicEvents && SearchDynamicEventTable(event) )
|
// table
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
#if wxUSE_VALIDATORS
|
#if wxUSE_VALIDATORS
|
||||||
if ( TryValidator(event) )
|
if ( TryValidator(event) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif // wxUSE_VALIDATORS
|
#endif // wxUSE_VALIDATORS
|
||||||
|
|
||||||
// Then static per-class event tables
|
// Handle per-instance dynamic event tables first
|
||||||
const wxEventTable *table = GetEventTable();
|
if ( m_dynamicEvents && SearchDynamicEventTable(event) )
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
// Search upwards through the inheritance hierarchy
|
// Then static per-class event tables (and search upwards through the
|
||||||
while (table)
|
// inheritance hierarchy)
|
||||||
|
for ( const wxEventTable *table = GetEventTable();
|
||||||
|
table;
|
||||||
|
table = table->baseTable )
|
||||||
{
|
{
|
||||||
if ( SearchEventTable((wxEventTable&)*table, event) )
|
if ( SearchEventTable((wxEventTable&)*table, event) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
table = table->baseTable;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -849,6 +850,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Finally propagate the event upwards the window chain and/or to the
|
||||||
|
// application object as necessary
|
||||||
return TryParent(event);
|
return TryParent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user