X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ef5cba62e2eb8ec663d5228d5913d4d81d2b9c7..2e49a8074e7c9179b642852ff00ed8fdf0768bb1:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 18972841f9..4a9ade6ccf 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -118,7 +118,7 @@ wxEventHashTable &wxEvtHandler::GetEventHashTable() const wxEventHashTable wxEvtHandler::sm_eventHashTable(wxEvtHandler::sm_eventTable); const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = - { DECLARE_EVENT_TABLE_TERMINATOR() }; + { wxDECLARE_EVENT_TABLE_TERMINATOR() }; // wxUSE_MEMORY_TRACING considers memory freed from the static objects dtors @@ -151,8 +151,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxEventTableEntryModule, wxModule) const wxEventType wxEVT_FIRST = 10000; const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000; +const wxEventType wxEVT_NULL = wxNewEventType(); -DEFINE_EVENT_TYPE(wxEVT_NULL) wxDEFINE_EVENT( wxEVT_IDLE, wxIdleEvent ); #endif // wxUSE_BASE @@ -733,9 +733,9 @@ wxPoint wxMouseEvent::GetLogicalPosition(const wxDC& dc) const wxKeyEvent::wxKeyEvent(wxEventType type) { m_eventType = type; - m_keyCode = 0; + m_keyCode = WXK_NONE; #if wxUSE_UNICODE - m_uniChar = 0; + m_uniChar = WXK_NONE; #endif } @@ -887,8 +887,7 @@ void wxEventHashTable::Clear() delete eTTnode; } - delete[] m_eventTypeTable; - m_eventTypeTable = NULL; + wxDELETEA(m_eventTypeTable); m_size = 0; } @@ -1380,7 +1379,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) // Short circuit the event processing logic if we're requested to process // this event in this handler only, see DoTryChain() for more details. if ( event.ShouldProcessOnlyIn(this) ) - return TryHere(event); + return TryBeforeAndHere(event); // Try to process the event in this handler itself. @@ -1407,23 +1406,11 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) bool wxEvtHandler::ProcessEventLocally(wxEvent& event) { - // First try the hooks which should be called before our own handlers - if ( TryBefore(event) ) - return true; - - // Then try this handler itself, notice that we should not call - // ProcessEvent() on this one as we're already called from it, which - // explains why we do it here and not in DoTryChain() - if ( TryHere(event) ) - return true; - - // Finally try the event handlers chained to this one, - if ( DoTryChain(event) ) - return true; - - // And return false to indicate that we didn't find any handler at this - // level. - return false; + // Try the hooks which should be called before our own handlers and this + // handler itself first. Notice that we should not call ProcessEvent() on + // this one as we're already called from it, which explains why we do it + // here and not in DoTryChain() + return TryBeforeAndHere(event) || DoTryChain(event); } bool wxEvtHandler::DoTryChain(wxEvent& event) @@ -1435,7 +1422,7 @@ bool wxEvtHandler::DoTryChain(wxEvent& event) // ProcessEvent() from which we were called or will be done by it when // we return. // - // However we must call ProcessEvent() and not TryHere() because the + // However we must call ProcessEvent() and not TryHereOnly() because the // existing code (including some in wxWidgets itself) expects the // overridden ProcessEvent() in its custom event handlers pushed on a // window to be called. @@ -1479,7 +1466,7 @@ bool wxEvtHandler::DoTryChain(wxEvent& event) return false; } -bool wxEvtHandler::TryHere(wxEvent& event) +bool wxEvtHandler::TryHereOnly(wxEvent& event) { // If the event handler is disabled it doesn't process any events if ( !GetEvtHandlerEnabled() )