+/* static */ bool
+wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase& entry,
+ wxEvtHandler *handler,
+ wxEvent& event)
+{
+ int tableId1 = entry.m_id,
+ tableId2 = entry.m_lastId;
+
+ // match only if the event type is the same and the id is either -1 in
+ // the event table (meaning "any") or the event id matches the id
+ // specified in the event table either exactly or by falling into
+ // range between first and last
+ if ((tableId1 == wxID_ANY) ||
+ (tableId2 == wxID_ANY && tableId1 == event.GetId()) ||
+ (tableId2 != wxID_ANY &&
+ (event.GetId() >= tableId1 && event.GetId() <= tableId2)))
+ {
+ event.Skip(false);
+ event.m_callbackUserData = entry.m_callbackUserData;
+
+#if wxUSE_EXCEPTIONS
+ if ( wxTheApp )
+ {
+ // call the handler via wxApp method which allows the user to catch
+ // any exceptions which may be thrown by any handler in the program
+ // in one place
+ wxTheApp->HandleEvent(handler, (wxEventFunction)entry.m_fn, event);
+ }
+ else
+#endif // wxUSE_EXCEPTIONS
+ {
+ // no need for an extra virtual function call
+ (handler->*((wxEventFunction) (entry.m_fn)))(event);
+ }
+
+ if (!event.GetSkipped())
+ return true;
+ }
+
+ return false;
+}