]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed how the dynamic event tables (used for all Python wx classes,
authorRobin Dunn <robin@alldunn.com>
Tue, 25 Feb 2003 21:22:44 +0000 (21:22 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 25 Feb 2003 21:22:44 +0000 (21:22 +0000)
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

src/common/event.cpp

index 3a27b933f5374a24c33dc25db731431007f40b25..29c728164fbed98d1daf96e482cf9db55614a697 100644 (file)
@@ -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;
             }
         }