From: Robin Dunn Date: Tue, 25 Feb 2003 21:22:44 +0000 (+0000) Subject: Changed how the dynamic event tables (used for all Python wx classes, X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/923092017673fc1ff2408ec3f8f20d7b2f35cf0f Changed how the dynamic event tables (used for all Python wx classes, C++ wx classes typically use static event tables) are searched such that they behave from a Python perspective more like the static tables in C++. Namely that if there are identical event bindings in a base Python class and a derived Python class that the one in the derived class will be found first and that if Skip is called that the one in the base class will still be found instead of skipping directly to the static stable in the C++ class. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/event.cpp b/src/common/event.cpp index 3a27b933f5..29c728164f 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -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 @@ -986,7 +986,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 +1053,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) (this->*((wxEventFunction) (entry->m_fn)))(event); - if (event.GetSkipped()) - return FALSE; - else + if ( ! event.GetSkipped() ) return TRUE; } }