X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1d4dd7add411ebff1ce4a8d1d992e0e43ee26b1..dd38c87578df7a24a491401c943988e2bc89b62b:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 3a27b933f5..b2dc2e82f4 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -390,7 +390,7 @@ wxMouseEvent::wxMouseEvent(wxEventType commandType) void wxMouseEvent::Assign(const wxMouseEvent& event) { m_eventType = event.m_eventType; - + m_x = event.m_x; m_y = event.m_y; @@ -550,7 +550,7 @@ wxKeyEvent::wxKeyEvent(wxEventType type) #endif } -wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt) +wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt) : wxEvent(evt) { m_x = evt.m_x; @@ -565,7 +565,7 @@ wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt) m_scanCode = evt.m_scanCode; m_rawCode = evt.m_rawCode; m_rawFlags = evt.m_rawFlags; - + #if wxUSE_UNICODE m_uniChar = evt.m_uniChar; #endif @@ -656,6 +656,15 @@ wxEvtHandler::~wxEvtHandler() # if !defined(__VISAGECPP__) delete m_eventsLocker; # endif + + // Remove us from wxPendingEvents if necessary. + if(wxPendingEventsLocker) + wxENTER_CRIT_SECT(*wxPendingEventsLocker); + if ( wxPendingEvents ) { + wxPendingEvents->DeleteObject(this); + } + if(wxPendingEventsLocker) + wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); #endif // we only delete object data, not untyped @@ -986,7 +995,8 @@ void wxEvtHandler::Connect( int id, int lastId, if (!m_dynamicEvents) m_dynamicEvents = new wxList; - m_dynamicEvents->Append( (wxObject*) entry ); + // Insert at the front of the list so most recent additions are found first + m_dynamicEvents->Insert( (wxObject*) entry ); } bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, @@ -1052,9 +1062,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) (this->*((wxEventFunction) (entry->m_fn)))(event); - if (event.GetSkipped()) - return FALSE; - else + if ( ! event.GetSkipped() ) return TRUE; } }