+ 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();
+ }
+ }
+}
+void wxWriter::WriteAllProperties( const wxObject * obj , const wxClassInfo* ci , wxPersister *persister, wxWriterInternalPropertiesData * data )
+{
+ const wxPropertyInfo *pi = ci->GetFirstProperty() ;
+ while( pi )
+ {
+ // this property was not written yet in this object and we don't get a veto
+ if ( data->m_writtenProperties.find( pi->GetName() ) == data->m_writtenProperties.end() )
+ {
+ data->m_writtenProperties[ pi->GetName() ] = 1 ;
+ DoBeginWriteProperty( pi ) ;
+ if ( pi->GetTypeInfo()->GetKind() == wxT_COLLECTION )
+ {
+ wxxVariantArray data = pi->GetAccessor()->GetPropertyCollection(obj) ;
+ const wxTypeInfo * elementType = dynamic_cast< const wxCollectionTypeInfo* >( pi->GetTypeInfo() )->GetElementType() ;
+ for ( size_t i = 0 ; i < data.GetCount() ; ++i )
+ {
+ DoBeginWriteElement() ;
+ wxxVariant value = data[i] ;
+ if ( persister->BeforeWriteProperty( this , pi , value ) )
+ {
+ const wxClassTypeInfo* cti = dynamic_cast< const wxClassTypeInfo* > ( elementType ) ;
+ if ( cti )
+ {
+ const wxClassInfo* pci = cti->GetClassInfo() ;
+ wxObject *vobj = pci->VariantToInstance( value ) ;
+ WriteObject( vobj , (vobj ? vobj->GetClassInfo() : pci ) , persister , cti->GetKind()== wxT_OBJECT ) ;
+ }
+ else
+ {
+ DoWriteSimpleType( value ) ;
+ }
+ }
+ DoEndWriteElement() ;
+ }
+ }
+ else
+ {
+ const wxDelegateTypeInfo* dti = dynamic_cast< const wxDelegateTypeInfo* > ( pi->GetTypeInfo() ) ;
+ if ( dti )
+ {
+ const wxObject* sink = 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") ) ;
+
+ FindConnectEntry( evSource , dti , sink , handler ) ;
+ if ( persister->BeforeWriteDelegate( this , obj , ci , pi , sink , handler ) )
+ {
+ if ( sink != NULL && handler != NULL )
+ {
+ wxASSERT_MSG( IsObjectKnown( sink ) , wxT("Streaming delegates for not already streamed objects not yet supported") ) ;
+ DoWriteDelegate( obj , ci , pi , sink , GetObjectID( sink ) , sink->GetClassInfo() , handler ) ;
+ }
+ }
+ }
+ else
+ {
+ wxxVariant value = pi->GetAccessor()->GetProperty(obj) ;
+ if ( persister->BeforeWriteProperty( this , pi , value ) )
+ {
+ const wxClassTypeInfo* cti = dynamic_cast< const wxClassTypeInfo* > ( pi->GetTypeInfo() ) ;
+ if ( cti )
+ {
+ const wxClassInfo* pci = cti->GetClassInfo() ;
+ wxObject *vobj = pci->VariantToInstance( value ) ;
+ WriteObject( vobj , (vobj ? vobj->GetClassInfo() : pci ) , persister , cti->GetKind()== wxT_OBJECT ) ;
+ }
+ else
+ {
+ DoWriteSimpleType( value ) ;
+ }
+ }
+ }
+ }
+ DoEndWriteProperty( pi ) ;
+ }
+ pi = pi->GetNext() ;
+ }
+ // in case this object is wxDynamic object we have to hand over the streaming
+ // of the properties of the superclasses to the real super class instance
+ const wxDynamicObject* dynobj = dynamic_cast< const wxDynamicObject* > (obj ) ;
+ if ( dynobj )
+ obj = dynobj->GetSuperClassInstance() ;
+ const wxClassInfo** parents = ci->GetParents() ;
+ for ( int i = 0 ; parents[i] ; ++ i )