X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22c2307c2b1cc454846d066f95e4be2e72ce61cd..70dc287a3997b65d954bfbd5861f72696bd3dd27:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 1aac4f55ba..1b259b8126 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -120,6 +120,9 @@ wxList *wxPendingEvents = (wxList *)NULL; // common event types are defined here, other event types are defined by the // components which use them + +const wxEventType wxEVT_FIRST = 10000; +const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000; DEFINE_EVENT_TYPE(wxEVT_NULL) DEFINE_EVENT_TYPE(wxEVT_COMMAND_BUTTON_CLICKED) @@ -779,8 +782,6 @@ void wxEvtHandler::ProcessPendingEvents() #endif } -#endif // wxUSE_BASE - /* * Event table stuff */ @@ -855,8 +856,6 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) return TryParent(event); } -#if wxUSE_BASE - bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event) { wxEventType eventType = event.GetEventType(); @@ -904,7 +903,8 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event) void wxEvtHandler::Connect( int id, int lastId, int eventType, wxObjectEventFunction func, - wxObject *userData ) + wxObject *userData, + wxEvtHandler* eventSink ) { #if WXWIN_COMPATIBILITY_EVENT_TYPES wxEventTableEntry *entry = new wxEventTableEntry; @@ -915,7 +915,7 @@ void wxEvtHandler::Connect( int id, int lastId, entry->m_callbackUserData = userData; #else // !WXWIN_COMPATIBILITY_EVENT_TYPES wxDynamicEventTableEntry *entry = - new wxDynamicEventTableEntry(eventType, id, lastId, func, userData); + new wxDynamicEventTableEntry(eventType, id, lastId, func, userData, eventSink); #endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES if (!m_dynamicEvents) @@ -927,7 +927,8 @@ void wxEvtHandler::Connect( int id, int lastId, bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, wxObjectEventFunction func, - wxObject *userData ) + wxObject *userData, + wxEvtHandler* eventSink ) { if (!m_dynamicEvents) return FALSE; @@ -945,6 +946,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, ((entry->m_lastId == lastId) || (lastId == -1)) && ((entry->m_eventType == eventType) || (eventType == wxEVT_NULL)) && ((entry->m_fn == func) || (func == (wxObjectEventFunction)NULL)) && + ((entry->m_eventSink == eventSink) || (eventSink == (wxEvtHandler*)NULL)) && ((entry->m_callbackUserData == userData) || (userData == (wxObject*)NULL))) { if (entry->m_callbackUserData) @@ -986,7 +988,12 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) event.Skip(FALSE); event.m_callbackUserData = entry->m_callbackUserData; - (this->*((wxEventFunction) (entry->m_fn)))(event); +#if !WXWIN_COMPATIBILITY_EVENT_TYPES + if (entry->m_eventSink) + ((entry->m_eventSink)->*((wxEventFunction) (entry->m_fn)))(event); + else +#endif + (this->*((wxEventFunction) (entry->m_fn)))(event); if ( ! event.GetSkipped() ) return TRUE;