gcc /vc6 workarounds
[wxWidgets.git] / src / common / xti.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/xti.cpp
3 // Purpose: runtime metadata information (extended class info
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 27/07/03
7 // RCS-ID: $Id$
8 // Copyright: (c) 1997 Julian Smart
9 // (c) 2003 Stefan Csomor
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
14 #pragma implementation "xti.h"
15 #endif
16
17 // For compilers that support precompilation, includes "wx.h".
18 #include "wx/wxprec.h"
19
20 #ifdef __BORLANDC__
21 #pragma hdrstop
22 #endif
23
24 #ifndef WX_PRECOMP
25 #include "wx/hash.h"
26 #include "wx/object.h"
27 #include "wx/xti.h"
28 #endif
29
30 #include "wx/xml/xml.h"
31 #include "wx/tokenzr.h"
32 #include "wx/list.h"
33 #include <string.h>
34
35 #if wxUSE_EXTENDED_RTTI
36
37 #include "wx/beforestd.h"
38 #include <map>
39 #include <string>
40 #include "wx/afterstd.h"
41
42 using namespace std ;
43
44 // ----------------------------------------------------------------------------
45 // Enum Support
46 // ----------------------------------------------------------------------------
47
48 wxEnumData::wxEnumData( wxEnumMemberData* data )
49 {
50 m_members = data ;
51 for ( m_count = 0; m_members[m_count].m_name ; m_count++)
52 {} ;
53 }
54
55 bool wxEnumData::HasEnumMemberValue(const wxChar *name, int *value)
56 {
57 int i;
58 for (i = 0; m_members[i].m_name ; i++ )
59 {
60 if (!strcmp(name, m_members[i].m_name))
61 {
62 if ( value )
63 *value = m_members[i].m_value;
64 return true ;
65 }
66 }
67 return false ;
68 }
69
70 int wxEnumData::GetEnumMemberValue(const wxChar *name)
71 {
72 int i;
73 for (i = 0; m_members[i].m_name ; i++ )
74 {
75 if (!strcmp(name, m_members[i].m_name))
76 {
77 return m_members[i].m_value;
78 }
79 }
80 return 0 ;
81 }
82
83 const wxChar *wxEnumData::GetEnumMemberName(int value)
84 {
85 int i;
86 for (i = 0; m_members[i].m_name ; i++)
87 if (value == m_members[i].m_value)
88 return m_members[i].m_name;
89
90 return wxT("") ;
91 }
92
93 int wxEnumData::GetEnumMemberValueByIndex( int idx )
94 {
95 // we should cache the count in order to avoid out-of-bounds errors
96 return m_members[idx].m_value ;
97 }
98
99 const char * wxEnumData::GetEnumMemberNameByIndex( int idx )
100 {
101 // we should cache the count in order to avoid out-of-bounds errors
102 return m_members[idx].m_name ;
103 }
104
105 // ----------------------------------------------------------------------------
106 // Type Information
107 // ----------------------------------------------------------------------------
108 // ----------------------------------------------------------------------------
109 // value streaming
110 // ----------------------------------------------------------------------------
111
112 // streamer specializations
113 // for all built-in types
114
115 // bool
116
117 template<> void wxStringReadValue(const wxString &s , bool &data )
118 {
119 int intdata ;
120 wxSscanf(s, _T("%d"), &intdata ) ;
121 data = bool(intdata) ;
122 }
123
124 template<> void wxStringWriteValue(wxString &s , const bool &data )
125 {
126 s = wxString::Format("%d", data ) ;
127 }
128
129 // char
130
131 template<> void wxStringReadValue(const wxString &s , char &data )
132 {
133 int intdata ;
134 wxSscanf(s, _T("%d"), &intdata ) ;
135 data = char(intdata) ;
136 }
137
138 template<> void wxStringWriteValue(wxString &s , const char &data )
139 {
140 s = wxString::Format("%d", data ) ;
141 }
142
143 // unsigned char
144
145 template<> void wxStringReadValue(const wxString &s , unsigned char &data )
146 {
147 int intdata ;
148 wxSscanf(s, _T("%d"), &intdata ) ;
149 data = (unsigned char)(intdata) ;
150 }
151
152 template<> void wxStringWriteValue(wxString &s , const unsigned char &data )
153 {
154 s = wxString::Format("%d", data ) ;
155 }
156
157 // int
158
159 template<> void wxStringReadValue(const wxString &s , int &data )
160 {
161 wxSscanf(s, _T("%d"), &data ) ;
162 }
163
164 template<> void wxStringWriteValue(wxString &s , const int &data )
165 {
166 s = wxString::Format("%d", data ) ;
167 }
168
169 // unsigned int
170
171 template<> void wxStringReadValue(const wxString &s , unsigned int &data )
172 {
173 wxSscanf(s, _T("%d"), &data ) ;
174 }
175
176 template<> void wxStringWriteValue(wxString &s , const unsigned int &data )
177 {
178 s = wxString::Format("%d", data ) ;
179 }
180
181 // long
182
183 template<> void wxStringReadValue(const wxString &s , long &data )
184 {
185 wxSscanf(s, _T("%ld"), &data ) ;
186 }
187
188 template<> void wxStringWriteValue(wxString &s , const long &data )
189 {
190 s = wxString::Format("%ld", data ) ;
191 }
192
193 // unsigned long
194
195 template<> void wxStringReadValue(const wxString &s , unsigned long &data )
196 {
197 wxSscanf(s, _T("%ld"), &data ) ;
198 }
199
200 template<> void wxStringWriteValue(wxString &s , const unsigned long &data )
201 {
202 s = wxString::Format("%ld", data ) ;
203 }
204
205 // float
206
207 template<> void wxStringReadValue(const wxString &s , float &data )
208 {
209 wxSscanf(s, _T("%f"), &data ) ;
210 }
211
212 template<> void wxStringWriteValue(wxString &s , const float &data )
213 {
214 s = wxString::Format("%f", data ) ;
215 }
216
217 // double
218
219 template<> void wxStringReadValue(const wxString &s , double &data )
220 {
221 wxSscanf(s, _T("%lf"), &data ) ;
222 }
223
224 template<> void wxStringWriteValue(wxString &s , const double &data )
225 {
226 s = wxString::Format("%lf", data ) ;
227 }
228
229 // wxString
230
231 template<> void wxStringReadValue(const wxString &s , wxString &data )
232 {
233 data = s ;
234 }
235
236 template<> void wxStringWriteValue(wxString &s , const wxString &data )
237 {
238 s = data ;
239 }
240
241 // built-ins
242 //
243
244 template<> const wxTypeInfo* wxGetTypeInfo( void * )
245 {
246 static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ;
247 return &s_typeInfo ;
248 }
249
250 template<> const wxTypeInfo* wxGetTypeInfo( bool * )
251 {
252 static wxBuiltInTypeInfo s_typeInfo( wxT_BOOL , &wxToStringConverter<bool> , &wxFromStringConverter<bool>) ;
253 return &s_typeInfo ;
254 }
255
256 template<> const wxTypeInfo* wxGetTypeInfo( char * )
257 {
258 static wxBuiltInTypeInfo s_typeInfo( wxT_CHAR , &wxToStringConverter<char> , &wxFromStringConverter<char>) ;
259 return &s_typeInfo ;
260 }
261
262 template<> const wxTypeInfo* wxGetTypeInfo( unsigned char * )
263 {
264 static wxBuiltInTypeInfo s_typeInfo( wxT_UCHAR , &wxToStringConverter< unsigned char > , &wxFromStringConverter<unsigned char>) ;
265 return &s_typeInfo ;
266 }
267
268 template<> const wxTypeInfo* wxGetTypeInfo( int * )
269 {
270 static wxBuiltInTypeInfo s_typeInfo( wxT_CHAR , &wxToStringConverter<int> , &wxFromStringConverter<int>) ;
271 return &s_typeInfo ;
272 }
273
274 template<> const wxTypeInfo* wxGetTypeInfo( unsigned int * )
275 {
276 static wxBuiltInTypeInfo s_typeInfo( wxT_UCHAR , &wxToStringConverter<unsigned int> , &wxFromStringConverter<unsigned int>) ;
277 return &s_typeInfo ;
278 }
279
280 template<> const wxTypeInfo* wxGetTypeInfo( long * )
281 {
282 static wxBuiltInTypeInfo s_typeInfo( wxT_LONG , &wxToStringConverter<long> , &wxFromStringConverter<long>) ;
283 return &s_typeInfo ;
284 }
285
286 template<> const wxTypeInfo* wxGetTypeInfo( unsigned long * )
287 {
288 static wxBuiltInTypeInfo s_typeInfo( wxT_ULONG , &wxToStringConverter<unsigned long> , &wxFromStringConverter<unsigned long>) ;
289 return &s_typeInfo ;
290 }
291
292 template<> const wxTypeInfo* wxGetTypeInfo( float * )
293 {
294 static wxBuiltInTypeInfo s_typeInfo( wxT_FLOAT , &wxToStringConverter<float> , &wxFromStringConverter<float>) ;
295 return &s_typeInfo ;
296 }
297
298 template<> const wxTypeInfo* wxGetTypeInfo( double * )
299 {
300 static wxBuiltInTypeInfo s_typeInfo( wxT_DOUBLE , &wxToStringConverter<double> , &wxFromStringConverter<double>) ;
301 return &s_typeInfo ;
302 }
303
304 template<> const wxTypeInfo* wxGetTypeInfo( wxString * )
305 {
306 static wxBuiltInTypeInfo s_typeInfo( wxT_STRING , &wxToStringConverter<wxString> , &wxFromStringConverter<wxString>) ;
307 return &s_typeInfo ;
308 }
309
310 // this are compiler induced specialization which are never used anywhere
311
312 WX_ILLEGAL_TYPE_SPECIALIZATION( char const * )
313 WX_ILLEGAL_TYPE_SPECIALIZATION( char * )
314 WX_ILLEGAL_TYPE_SPECIALIZATION( unsigned char * )
315 WX_ILLEGAL_TYPE_SPECIALIZATION( int * )
316 WX_ILLEGAL_TYPE_SPECIALIZATION( bool * )
317 WX_ILLEGAL_TYPE_SPECIALIZATION( long * )
318 WX_ILLEGAL_TYPE_SPECIALIZATION( wxString * )
319
320 WX_COLLECTION_TYPE_INFO( wxString , wxArrayString ) ;
321
322 template<> void wxCollectionToVariantArray( wxArrayString const &theArray, wxxVariantArray &value)
323 {
324 wxArrayCollectionToVariantArray( theArray , value ) ;
325 }
326
327 wxTypeInfoMap *wxTypeInfo::sm_typeTable = NULL ;
328
329 wxTypeInfo *wxTypeInfo::FindType(const wxChar *typeName)
330 {
331 return (wxTypeInfo *)sm_typeTable->find(typeName)->second;
332 }
333
334 wxClassTypeInfo::wxClassTypeInfo( wxTypeKind kind , wxClassInfo* classInfo , converterToString_t to , converterFromString_t from ) :
335 wxTypeInfo( kind , to , from , classInfo->GetClassName() )
336 { wxASSERT_MSG( kind == wxT_OBJECT_PTR || kind == wxT_OBJECT , wxT("Illegal Kind for Enum Type")) ; m_classInfo = classInfo ;}
337
338 wxDelegateTypeInfo::wxDelegateTypeInfo( int eventType , wxClassInfo* eventClass , converterToString_t to , converterFromString_t from ) :
339 wxTypeInfo ( wxT_DELEGATE , to , from , wxEmptyString )
340 { m_eventClass = eventClass ; m_eventType = eventType ;}
341
342 void wxTypeInfo::Register()
343 {
344 if ( sm_typeTable == NULL )
345 sm_typeTable = new wxTypeInfoMap() ;
346
347 if( !m_name.IsEmpty() )
348 (*sm_typeTable)[m_name] = this ;
349 }
350
351 void wxTypeInfo::Unregister()
352 {
353 if( !m_name.IsEmpty() )
354 sm_typeTable->erase(m_name);
355 }
356
357 // removing header dependancy on string tokenizer
358
359 void wxSetStringToArray( const wxString &s , wxArrayString &array )
360 {
361 wxStringTokenizer tokenizer(s, wxT("| \t\n"), wxTOKEN_STRTOK);
362 wxString flag;
363 array.Clear() ;
364 while (tokenizer.HasMoreTokens())
365 {
366 array.Add(tokenizer.GetNextToken()) ;
367 }
368 }
369
370 // ----------------------------------------------------------------------------
371 // wxClassInfo
372 // ----------------------------------------------------------------------------
373
374 const wxPropertyAccessor *wxClassInfo::FindAccessor(const char *PropertyName) const
375 {
376 const wxPropertyInfo* info = FindPropertyInfo( PropertyName ) ;
377
378 if ( info )
379 return info->GetAccessor() ;
380
381 return NULL ;
382 }
383
384 const wxPropertyInfo *wxClassInfo::FindPropertyInfoInThisClass (const char *PropertyName) const
385 {
386 const wxPropertyInfo* info = GetFirstProperty() ;
387
388 while( info )
389 {
390 if ( strcmp( info->GetName() , PropertyName ) == 0 )
391 return info ;
392 info = info->GetNext() ;
393 }
394
395 return 0;
396 }
397
398 const wxPropertyInfo *wxClassInfo::FindPropertyInfo (const char *PropertyName) const
399 {
400 const wxPropertyInfo* info = FindPropertyInfoInThisClass( PropertyName ) ;
401 if ( info )
402 return info ;
403
404 const wxClassInfo** parents = GetParents() ;
405 for ( int i = 0 ; parents[i] ; ++ i )
406 {
407 if ( ( info = parents[i]->FindPropertyInfo( PropertyName ) ) != NULL )
408 return info ;
409 }
410
411 return 0;
412 }
413
414 const wxHandlerInfo *wxClassInfo::FindHandlerInfoInThisClass (const char *PropertyName) const
415 {
416 const wxHandlerInfo* info = GetFirstHandler() ;
417
418 while( info )
419 {
420 if ( strcmp( info->GetName() , PropertyName ) == 0 )
421 return info ;
422 info = info->GetNext() ;
423 }
424
425 return 0;
426 }
427
428 const wxHandlerInfo *wxClassInfo::FindHandlerInfo (const char *PropertyName) const
429 {
430 const wxHandlerInfo* info = FindHandlerInfoInThisClass( PropertyName ) ;
431
432 if ( info )
433 return info ;
434
435 const wxClassInfo** parents = GetParents() ;
436 for ( int i = 0 ; parents[i] ; ++ i )
437 {
438 if ( ( info = parents[i]->FindHandlerInfo( PropertyName ) ) != NULL )
439 return info ;
440 }
441
442 return 0;
443 }
444
445 wxObjectStreamingCallback wxClassInfo::GetStreamingCallback() const
446 {
447 if ( m_streamingCallback )
448 return m_streamingCallback ;
449
450 wxObjectStreamingCallback retval = NULL ;
451 const wxClassInfo** parents = GetParents() ;
452 for ( int i = 0 ; parents[i] && retval == NULL ; ++ i )
453 {
454 retval = parents[i]->GetStreamingCallback() ;
455 }
456 return retval ;
457 }
458
459 bool wxClassInfo::BeforeWriteObject( const wxObject *obj, wxWriter *streamer , wxPersister *persister , wxxVariantArray &metadata) const
460 {
461 wxObjectStreamingCallback sb = GetStreamingCallback() ;
462 if ( sb )
463 return (*sb)(obj , streamer , persister , metadata ) ;
464
465 return true ;
466 }
467
468 void wxClassInfo::SetProperty(wxObject *object, const char *propertyName, const wxxVariant &value) const
469 {
470 const wxPropertyAccessor *accessor;
471
472 accessor = FindAccessor(propertyName);
473 wxASSERT(accessor->HasSetter());
474 accessor->SetProperty( object , value ) ;
475 }
476
477 wxxVariant wxClassInfo::GetProperty(wxObject *object, const char *propertyName) const
478 {
479 const wxPropertyAccessor *accessor;
480
481 accessor = FindAccessor(propertyName);
482 wxASSERT(accessor->HasGetter());
483 wxxVariant result ;
484 accessor->GetProperty(object,result);
485 return result ;
486 }
487
488 wxxVariantArray wxClassInfo::GetPropertyCollection(wxObject *object, const wxChar *propertyName) const
489 {
490 const wxPropertyAccessor *accessor;
491
492 accessor = FindAccessor(propertyName);
493 wxASSERT(accessor->HasGetter());
494 wxxVariantArray result ;
495 accessor->GetPropertyCollection(object,result);
496 return result ;
497 }
498
499 void wxClassInfo::AddToPropertyCollection(wxObject *object, const wxChar *propertyName , const wxxVariant& value) const
500 {
501 const wxPropertyAccessor *accessor;
502
503 accessor = FindAccessor(propertyName);
504 wxASSERT(accessor->HasAdder());
505 accessor->AddToPropertyCollection( object , value ) ;
506 }
507
508 void wxClassInfo::GetProperties( wxPropertyInfoMap &map ) const
509 {
510 const wxPropertyInfo *pi = GetFirstProperty() ;
511 while( pi )
512 {
513 if ( map.find( pi->GetName() ) == map.end() )
514 map[pi->GetName()] = (wxPropertyInfo*) pi ;
515
516 pi = pi->GetNext() ;
517 }
518
519 const wxClassInfo** parents = GetParents() ;
520 for ( int i = 0 ; parents[i] ; ++ i )
521 {
522 parents[i]->GetProperties( map ) ;
523 }
524 }
525
526 /*
527 VARIANT TO OBJECT
528 */
529
530 wxObject* wxxVariant::GetAsObject()
531 {
532 const wxClassTypeInfo *ti = dynamic_cast<const wxClassTypeInfo*>( m_data->GetTypeInfo() ) ;
533 if ( ti )
534 return ti->GetClassInfo()->VariantToInstance(*this) ;
535 else
536 return NULL ;
537 }
538
539 // ----------------------------------------------------------------------------
540 // wxDynamicObject support
541 // ----------------------------------------------------------------------------
542 //
543 // Dynamic Objects are objects that have a real superclass instance and carry their
544 // own attributes in a hash map. Like this it is possible to create the objects and
545 // stream them, as if their class information was already available from compiled data
546
547 struct wxDynamicObject::wxDynamicObjectInternal
548 {
549 map<string,wxxVariant> m_properties ;
550 } ;
551
552 // instantiates this object with an instance of its superclass
553 wxDynamicObject::wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info)
554 {
555 m_superClassInstance = superClassInstance ;
556 m_classInfo = info ;
557 m_data = new wxDynamicObjectInternal ;
558 }
559
560 wxDynamicObject::~wxDynamicObject()
561 {
562 delete m_data ;
563 delete m_superClassInstance ;
564 }
565
566 void wxDynamicObject::SetProperty (const wxChar *propertyName, const wxxVariant &value)
567 {
568 wxASSERT_MSG(m_classInfo->FindPropertyInfoInThisClass(propertyName),wxT("Accessing Unknown Property in a Dynamic Object") ) ;
569 m_data->m_properties[propertyName] = value ;
570 }
571
572 wxxVariant wxDynamicObject::GetProperty (const wxChar *propertyName) const
573 {
574 wxASSERT_MSG(m_classInfo->FindPropertyInfoInThisClass(propertyName),wxT("Accessing Unknown Property in a Dynamic Object") ) ;
575 return m_data->m_properties[propertyName] ;
576 }
577
578 // ----------------------------------------------------------------------------
579 // wxDynamiClassInfo
580 // ----------------------------------------------------------------------------
581
582 wxDynamicClassInfo::wxDynamicClassInfo( const wxChar *unitName, const wxChar *className , const wxClassInfo* superClass ) :
583 wxClassInfo( unitName, className , new const wxClassInfo*[2])
584 {
585 GetParents()[0] = superClass ;
586 GetParents()[1] = NULL ;
587 }
588
589 wxDynamicClassInfo::~wxDynamicClassInfo()
590 {
591 delete[] GetParents() ;
592 }
593
594 wxObject *wxDynamicClassInfo::AllocateObject() const
595 {
596 wxObject* parent = GetParents()[0]->AllocateObject() ;
597 return new wxDynamicObject( parent , this ) ;
598 }
599
600 void wxDynamicClassInfo::Create (wxObject *object, int paramCount, wxxVariant *params) const
601 {
602 wxDynamicObject *dynobj = dynamic_cast< wxDynamicObject *>( object ) ;
603 wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::Create on an object other than wxDynamicObject") ) ;
604 GetParents()[0]->Create( dynobj->GetSuperClassInstance() , paramCount , params ) ;
605 }
606
607 // get number of parameters for constructor
608 int wxDynamicClassInfo::GetCreateParamCount() const
609 {
610 return GetParents()[0]->GetCreateParamCount() ;
611 }
612
613 // get i-th constructor parameter
614 const wxChar* wxDynamicClassInfo::GetCreateParamName(int i) const
615 {
616 return GetParents()[0]->GetCreateParamName( i ) ;
617 }
618
619 void wxDynamicClassInfo::SetProperty(wxObject *object, const char *propertyName, const wxxVariant &value) const
620 {
621 wxDynamicObject* dynobj = dynamic_cast< wxDynamicObject * >( object ) ;
622 wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ;
623 if ( FindPropertyInfoInThisClass(propertyName) )
624 dynobj->SetProperty( propertyName , value ) ;
625 else
626 GetParents()[0]->SetProperty( dynobj->GetSuperClassInstance() , propertyName , value ) ;
627 }
628
629 wxxVariant wxDynamicClassInfo::GetProperty(wxObject *object, const char *propertyName) const
630 {
631 wxDynamicObject* dynobj = dynamic_cast< wxDynamicObject * >( object ) ;
632 wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ;
633 if ( FindPropertyInfoInThisClass(propertyName) )
634 return dynobj->GetProperty( propertyName ) ;
635 else
636 return GetParents()[0]->GetProperty( dynobj->GetSuperClassInstance() , propertyName ) ;
637 }
638
639 void wxDynamicClassInfo::AddProperty( const wxChar *propertyName , const wxTypeInfo* typeInfo )
640 {
641 new wxPropertyInfo( m_firstProperty , this , propertyName , typeInfo , new wxGenericPropertyAccessor( propertyName ) , wxxVariant() ) ;
642 }
643
644 void wxDynamicClassInfo::AddHandler( const wxChar *handlerName , wxObjectEventFunction address , const wxClassInfo* eventClassInfo )
645 {
646 new wxHandlerInfo( m_firstHandler , handlerName , address , eventClassInfo ) ;
647 }
648
649 // removes an existing runtime-property
650 void wxDynamicClassInfo::RemoveProperty( const wxChar *propertyName )
651 {
652 }
653
654 // removes an existing runtime-handler
655 void wxDynamicClassInfo::RemoveHandler( const wxChar *handlerName )
656 {
657 }
658
659 // ----------------------------------------------------------------------------
660 // wxGenericPropertyAccessor
661 // ----------------------------------------------------------------------------
662
663 struct wxGenericPropertyAccessor::wxGenericPropertyAccessorInternal
664 {
665 char filler ;
666 } ;
667
668 wxGenericPropertyAccessor::wxGenericPropertyAccessor( const wxString& propertyName )
669 : wxPropertyAccessor( NULL , NULL , NULL , NULL )
670 {
671 m_data = new wxGenericPropertyAccessorInternal ;
672 m_propertyName = propertyName ;
673 m_getterName = wxT("Get")+propertyName ;
674 m_setterName = wxT("Set")+propertyName ;
675 }
676
677 wxGenericPropertyAccessor::~wxGenericPropertyAccessor()
678 {
679 delete m_data ;
680 }
681 void wxGenericPropertyAccessor::SetProperty(wxObject *object, const wxxVariant &value) const
682 {
683 wxDynamicObject* dynobj = dynamic_cast< wxDynamicObject * >( object ) ;
684 wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ;
685 dynobj->SetProperty(m_propertyName , value ) ;
686 }
687
688 void wxGenericPropertyAccessor::GetProperty(const wxObject *object, wxxVariant& value) const
689 {
690 const wxDynamicObject* dynobj = dynamic_cast< const wxDynamicObject * >( object ) ;
691 wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ;
692 value = dynobj->GetProperty( m_propertyName ) ;
693 }
694 #endif