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