]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
wxDataViewCtrl DnD stubs, some reformating
[wxWidgets.git] / src / common / event.cpp
index 0b196d5d72dac8bc42086d0619f80298019ff0ba..72468e1a2e79f63980a546fd2d0410ad7038dd67 100644 (file)
@@ -43,6 +43,8 @@
     #endif // wxUSE_GUI
 #endif
 
+#include "wx/thread.h"
+
 // ----------------------------------------------------------------------------
 // wxWin macros
 // ----------------------------------------------------------------------------
@@ -142,8 +144,6 @@ wxList *wxPendingEvents = (wxList *)NULL;
     wxCriticalSection *wxPendingEventsLocker = (wxCriticalSection *)NULL;
 #endif
 
-#if !WXWIN_COMPATIBILITY_EVENT_TYPES
-
 // common event types are defined here, other event types are defined by the
 // components which use them
 
@@ -155,14 +155,10 @@ DEFINE_EVENT_TYPE(wxEVT_IDLE)
 DEFINE_EVENT_TYPE(wxEVT_SOCKET)
 DEFINE_EVENT_TYPE(wxEVT_TIMER)
 
-#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES
-
 #endif // wxUSE_BASE
 
 #if wxUSE_GUI
 
-#if !WXWIN_COMPATIBILITY_EVENT_TYPES
-
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_BUTTON_CLICKED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKBOX_CLICKED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHOICE_SELECTED)
@@ -316,8 +312,6 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_ENTER)
 DEFINE_EVENT_TYPE(wxEVT_HELP)
 DEFINE_EVENT_TYPE(wxEVT_DETAILED_HELP)
 
-#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES
-
 #endif // wxUSE_GUI
 
 #if wxUSE_BASE
@@ -776,13 +770,6 @@ wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt)
 #endif
 }
 
-#if WXWIN_COMPATIBILITY_2_6
-long wxKeyEvent::KeyCode() const
-{
-    return m_keyCode;
-}
-#endif // WXWIN_COMPATIBILITY_2_6
-
 wxWindowCreateEvent::wxWindowCreateEvent(wxWindow *win)
 {
     SetEventType(wxEVT_CREATE);
@@ -1067,11 +1054,7 @@ wxEvtHandler::~wxEvtHandler()
               it != end;
               ++it )
         {
-#if WXWIN_COMPATIBILITY_EVENT_TYPES
-            wxEventTableEntry *entry = (wxEventTableEntry*)*it;
-#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
             wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)*it;
-#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
 
             if (entry->m_callbackUserData)
                 delete entry->m_callbackUserData;
@@ -1374,17 +1357,8 @@ void wxEvtHandler::Connect( int id, int lastId,
                             wxObject *userData,
                             wxEvtHandler* eventSink )
 {
-#if WXWIN_COMPATIBILITY_EVENT_TYPES
-    wxEventTableEntry *entry = new wxEventTableEntry;
-    entry->m_eventType = eventType;
-    entry->m_id = id;
-    entry->m_lastId = lastId;
-    entry->m_fn = func;
-    entry->m_callbackUserData = userData;
-#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
     wxDynamicEventTableEntry *entry =
         new wxDynamicEventTableEntry(eventType, id, lastId, func, userData, eventSink);
-#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
 
     if (!m_dynamicEvents)
         m_dynamicEvents = new wxList;
@@ -1404,11 +1378,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
     wxList::compatibility_iterator node = m_dynamicEvents->GetFirst();
     while (node)
     {
-#if WXWIN_COMPATIBILITY_EVENT_TYPES
-            wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
-#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
-            wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
-#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
+        wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
 
         if ((entry->m_id == id) &&
             ((entry->m_lastId == lastId) || (lastId == wxID_ANY)) &&
@@ -1436,11 +1406,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
     wxList::compatibility_iterator node = m_dynamicEvents->GetFirst();
     while (node)
     {
-#if WXWIN_COMPATIBILITY_EVENT_TYPES
-        wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
-#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
         wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
-#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
 
         // get next node before (maybe) calling the event handler as it could
         // call Disconnect() invalidating the current node
@@ -1448,17 +1414,10 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
 
         if ((event.GetEventType() == entry->m_eventType) && (entry->m_fn != 0))
         {
-            wxEvtHandler *handler =
-#if !WXWIN_COMPATIBILITY_EVENT_TYPES
-                                    entry->m_eventSink ? entry->m_eventSink
-                                                       :
-#endif
-                                                         this;
-
+            wxEvtHandler *handler = entry->m_eventSink ? entry->m_eventSink
+                                                       : this;
             if ( ProcessEventIfMatches(*entry, handler, event) )
-            {
                 return true;
-            }
         }
     }