extended streaming-out for event handlers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		| @@ -117,6 +117,45 @@ void wxWriter::WriteAllProperties( const wxObject * obj , const wxClassInfo* ci | |||||||
|                 { |                 { | ||||||
|                     const wxObject* sink = NULL ; |                     const wxObject* sink = NULL ; | ||||||
|                     const wxHandlerInfo *handler = NULL ; |                     const wxHandlerInfo *handler = NULL ; | ||||||
|  |                      | ||||||
|  |                     const wxWindow * evSource = dynamic_cast<const wxWindow *>(obj) ; | ||||||
|  |                     wxASSERT_MSG( evSource , wxT("Illegal Object Class (Non-Window) as Event Source") ) ; | ||||||
|  |  | ||||||
|  |                     wxList *dynamicEvents = evSource->GetDynamicEventTable() ; | ||||||
|  |  | ||||||
|  |                     if ( dynamicEvents ) | ||||||
|  |                     { | ||||||
|  |                         wxList::compatibility_iterator node = dynamicEvents->GetFirst(); | ||||||
|  |                         while (node) | ||||||
|  |                         { | ||||||
|  |                             wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); | ||||||
|  |  | ||||||
|  |                             // find the match | ||||||
|  |                             if ( entry->m_fn && (dti->GetEventType() == entry->m_eventType) && | ||||||
|  |                                 (entry->m_id == -1 || | ||||||
|  |                                 (entry->m_lastId == -1 && evSource->GetId() == entry->m_id) || | ||||||
|  |                                 (entry->m_lastId != -1 && | ||||||
|  |                                 (evSource->GetId()  >= entry->m_id && evSource->GetId() <= entry->m_lastId) ) ) && | ||||||
|  |                                 entry->m_eventSink | ||||||
|  |                                 ) | ||||||
|  |                             { | ||||||
|  |                                 sink = entry->m_eventSink ; | ||||||
|  |                                 const wxClassInfo* sinkClassInfo = sink->GetClassInfo() ; | ||||||
|  |                                 const wxHandlerInfo* sinkHandler = sinkClassInfo->GetFirstHandler() ; | ||||||
|  |                                 while ( sinkHandler ) | ||||||
|  |                                 { | ||||||
|  |                                     if ( sinkHandler->GetEventFunction() == entry->m_fn ) | ||||||
|  |                                     { | ||||||
|  |                                         handler = sinkHandler ; | ||||||
|  |                                         break ; | ||||||
|  |                                     } | ||||||
|  |                                     sinkHandler = sinkHandler->GetNext() ; | ||||||
|  |                                 } | ||||||
|  |                                 break ; | ||||||
|  |                             } | ||||||
|  |                             node = node->GetNext(); | ||||||
|  |                         } | ||||||
|  |                         } | ||||||
|                     if ( persister->BeforeWriteDelegate( obj , ci , pi , sink , handler ) ) |                     if ( persister->BeforeWriteDelegate( obj , ci , pi , sink , handler ) ) | ||||||
|                     { |                     { | ||||||
|                         if ( sink != NULL && handler != NULL ) |                         if ( sink != NULL && handler != NULL ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user