xtiprop.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/xtiprop.h
  3. // Purpose: XTI properties
  4. // Author: Stefan Csomor
  5. // Modified by: Francesco Montorsi
  6. // Created: 27/07/03
  7. // Copyright: (c) 1997 Julian Smart
  8. // (c) 2003 Stefan Csomor
  9. // Licence: wxWindows licence
  10. /////////////////////////////////////////////////////////////////////////////
  11. #ifndef _XTIPROP_H_
  12. #define _XTIPROP_H_
  13. #include "wx/defs.h"
  14. #if wxUSE_EXTENDED_RTTI
  15. #include "wx/xti.h"
  16. #include "wx/any.h"
  17. /*
  18. class WXDLLIMPEXP_BASE wxObject;
  19. class WXDLLIMPEXP_BASE wxClassInfo;
  20. class WXDLLIMPEXP_BASE wxDynamicClassInfo;
  21. */
  22. class WXDLLIMPEXP_BASE wxHashTable;
  23. class WXDLLIMPEXP_BASE wxHashTable_Node;
  24. class WXDLLIMPEXP_BASE wxEvent;
  25. class WXDLLIMPEXP_BASE wxEvtHandler;
  26. // ----------------------------------------------------------------------------
  27. // Property Accessors
  28. //
  29. // wxPropertySetter/Getter/CollectionGetter/CollectionAdder are all property
  30. // accessors which are managed by wxPropertyAccessor class which in turn is
  31. // handled by wxPropertyInfo.
  32. // ----------------------------------------------------------------------------
  33. class WXDLLIMPEXP_BASE wxPropertySetter
  34. {
  35. public:
  36. wxPropertySetter( const wxString name ) { m_name = name; }
  37. virtual ~wxPropertySetter() {}
  38. virtual void Set( wxObject *object, const wxAny &variantValue ) const = 0;
  39. const wxString& GetName() const { return m_name; }
  40. private:
  41. wxString m_name;
  42. };
  43. class WXDLLIMPEXP_BASE wxPropertyGetter
  44. {
  45. public:
  46. wxPropertyGetter( const wxString name ) { m_name = name; }
  47. virtual ~wxPropertyGetter() {}
  48. virtual void Get( const wxObject *object, wxAny& result) const = 0;
  49. const wxString& GetName() const { return m_name; }
  50. private:
  51. wxString m_name;
  52. };
  53. class WXDLLIMPEXP_BASE wxPropertyCollectionGetter
  54. {
  55. public:
  56. wxPropertyCollectionGetter( const wxString name ) { m_name = name; }
  57. virtual ~wxPropertyCollectionGetter() {}
  58. virtual void Get( const wxObject *object, wxAnyList& result) const = 0;
  59. const wxString& GetName() const { return m_name; }
  60. private:
  61. wxString m_name;
  62. };
  63. template<typename coll_t> void WXDLLIMPEXP_BASE \
  64. wxCollectionToVariantArray( const coll_t& coll, wxAnyList& result );
  65. class WXDLLIMPEXP_BASE wxPropertyCollectionAdder
  66. {
  67. public:
  68. wxPropertyCollectionAdder( const wxString name ) { m_name = name; }
  69. virtual ~wxPropertyCollectionAdder() {}
  70. virtual void Add( wxObject *object, const wxAny &variantValue ) const= 0;
  71. const wxString& GetName() const { return m_name; }
  72. private:
  73. wxString m_name;
  74. };
  75. #define wxPROPERTY_SETTER( property, Klass, valueType, setterMethod ) \
  76. class wxPropertySetter##property : public wxPropertySetter \
  77. { \
  78. public: \
  79. wxINFUNC_CLASS_TYPE_FIX(Klass) \
  80. wxPropertySetter##property() : wxPropertySetter( wxT(#setterMethod) ) {} \
  81. virtual ~wxPropertySetter##property() {} \
  82. \
  83. void Set( wxObject *object, const wxAny &variantValue ) const \
  84. { \
  85. Klass *obj = dynamic_cast<Klass*>(object); \
  86. valueType tempobj; \
  87. if ( variantValue.GetAs(&tempobj) ) \
  88. obj->setterMethod(tempobj); \
  89. else \
  90. obj->setterMethod(*wxANY_AS(variantValue, valueType*)); \
  91. } \
  92. };
  93. #define wxPROPERTY_GETTER( property, Klass, valueType, gettermethod ) \
  94. class wxPropertyGetter##property : public wxPropertyGetter \
  95. { \
  96. public: \
  97. wxINFUNC_CLASS_TYPE_FIX(Klass) \
  98. wxPropertyGetter##property() : wxPropertyGetter( wxT(#gettermethod) ) {} \
  99. virtual ~wxPropertyGetter##property() {} \
  100. \
  101. void Get( const wxObject *object, wxAny &result) const \
  102. { \
  103. const Klass *obj = dynamic_cast<const Klass*>(object); \
  104. result = wxAny( obj->gettermethod() ); \
  105. } \
  106. };
  107. #define wxPROPERTY_COLLECTION_ADDER( property, Klass, valueType, addermethod ) \
  108. class wxPropertyCollectionAdder##property : public wxPropertyCollectionAdder \
  109. { \
  110. public: \
  111. wxINFUNC_CLASS_TYPE_FIX(Klass) \
  112. wxPropertyCollectionAdder##property() : wxPropertyCollectionAdder( wxT(#addermethod) ) {} \
  113. virtual ~wxPropertyCollectionAdder##property() {} \
  114. \
  115. void Add( wxObject *object, const wxAny &variantValue ) const \
  116. { \
  117. Klass *obj = dynamic_cast<Klass*>(object); \
  118. valueType tempobj; \
  119. if ( variantValue.GetAs(&tempobj) ) \
  120. obj->addermethod(tempobj); \
  121. else \
  122. obj->addermethod(*wxANY_AS(variantValue, valueType*)); \
  123. } \
  124. };
  125. #define wxPROPERTY_COLLECTION_GETTER( property, Klass, valueType, gettermethod ) \
  126. class wxPropertyCollectionGetter##property : public wxPropertyCollectionGetter \
  127. { \
  128. public: \
  129. wxINFUNC_CLASS_TYPE_FIX(Klass) \
  130. wxPropertyCollectionGetter##property() : wxPropertyCollectionGetter( wxT(#gettermethod) ) {} \
  131. virtual ~wxPropertyCollectionGetter##property() {} \
  132. \
  133. void Get( const wxObject *object, wxAnyList &result) const \
  134. { \
  135. const Klass *obj = dynamic_cast<const Klass*>(object); \
  136. wxCollectionToVariantArray( obj->gettermethod(), result ); \
  137. } \
  138. };
  139. class WXDLLIMPEXP_BASE wxPropertyAccessor
  140. {
  141. public:
  142. wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter,
  143. wxPropertyCollectionAdder *adder, wxPropertyCollectionGetter *collectionGetter )
  144. { m_setter = setter; m_getter = getter; m_adder = adder;
  145. m_collectionGetter = collectionGetter; }
  146. virtual ~wxPropertyAccessor() {}
  147. // Setting a simple property (non-collection)
  148. virtual void SetProperty(wxObject *object, const wxAny &value) const
  149. {
  150. if ( m_setter )
  151. m_setter->Set( object, value );
  152. else
  153. wxLogError( wxGetTranslation("SetProperty called w/o valid setter") );
  154. }
  155. // Getting a simple property (non-collection)
  156. virtual void GetProperty(const wxObject *object, wxAny &result) const
  157. {
  158. if ( m_getter )
  159. m_getter->Get( object, result );
  160. else
  161. wxLogError( wxGetTranslation("GetProperty called w/o valid getter") );
  162. }
  163. // Adding an element to a collection property
  164. virtual void AddToPropertyCollection(wxObject *object, const wxAny &value) const
  165. {
  166. if ( m_adder )
  167. m_adder->Add( object, value );
  168. else
  169. wxLogError( wxGetTranslation("AddToPropertyCollection called w/o valid adder") );
  170. }
  171. // Getting a collection property
  172. virtual void GetPropertyCollection( const wxObject *obj, wxAnyList &result) const
  173. {
  174. if ( m_collectionGetter )
  175. m_collectionGetter->Get( obj, result);
  176. else
  177. wxLogError( wxGetTranslation("GetPropertyCollection called w/o valid collection getter") );
  178. }
  179. virtual bool HasSetter() const { return m_setter != NULL; }
  180. virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL; }
  181. virtual bool HasGetter() const { return m_getter != NULL; }
  182. virtual bool HasAdder() const { return m_adder != NULL; }
  183. virtual const wxString& GetCollectionGetterName() const
  184. { return m_collectionGetter->GetName(); }
  185. virtual const wxString& GetGetterName() const
  186. { return m_getter->GetName(); }
  187. virtual const wxString& GetSetterName() const
  188. { return m_setter->GetName(); }
  189. virtual const wxString& GetAdderName() const
  190. { return m_adder->GetName(); }
  191. protected:
  192. wxPropertySetter *m_setter;
  193. wxPropertyCollectionAdder *m_adder;
  194. wxPropertyGetter *m_getter;
  195. wxPropertyCollectionGetter* m_collectionGetter;
  196. };
  197. class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor
  198. {
  199. public:
  200. wxGenericPropertyAccessor( const wxString &propName );
  201. virtual ~wxGenericPropertyAccessor();
  202. void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName),
  203. const wxString& newName )
  204. {
  205. wxASSERT( oldName == m_propertyName ); m_propertyName = newName;
  206. }
  207. virtual bool HasSetter() const { return true; }
  208. virtual bool HasGetter() const { return true; }
  209. virtual bool HasAdder() const { return false; }
  210. virtual bool HasCollectionGetter() const { return false; }
  211. virtual const wxString& GetGetterName() const
  212. { return m_getterName; }
  213. virtual const wxString& GetSetterName() const
  214. { return m_setterName; }
  215. virtual void SetProperty(wxObject *object, const wxAny &value) const;
  216. virtual void GetProperty(const wxObject *object, wxAny &value) const;
  217. // Adding an element to a collection property
  218. virtual void AddToPropertyCollection(wxObject *WXUNUSED(object),
  219. const wxAny &WXUNUSED(value)) const
  220. {
  221. wxLogError( wxGetTranslation("AddToPropertyCollection called on a generic accessor") );
  222. }
  223. // Getting a collection property
  224. virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj),
  225. wxAnyList &WXUNUSED(result)) const
  226. {
  227. wxLogError ( wxGetTranslation("GetPropertyCollection called on a generic accessor") );
  228. }
  229. private:
  230. struct wxGenericPropertyAccessorInternal;
  231. wxGenericPropertyAccessorInternal* m_data;
  232. wxString m_propertyName;
  233. wxString m_setterName;
  234. wxString m_getterName;
  235. };
  236. typedef long wxPropertyInfoFlags;
  237. enum
  238. {
  239. // will be removed in future releases
  240. wxPROP_DEPRECATED = 0x00000001,
  241. // object graph property, will be streamed with priority (after constructor properties)
  242. wxPROP_OBJECT_GRAPH = 0x00000002,
  243. // this will only be streamed out and in as enum/set, the internal representation
  244. // is still a long
  245. wxPROP_ENUM_STORE_LONG = 0x00000004,
  246. // don't stream out this property, needed eg to avoid streaming out children
  247. // that are always created by their parents
  248. wxPROP_DONT_STREAM = 0x00000008
  249. };
  250. // ----------------------------------------------------------------------------
  251. // Property Support
  252. //
  253. // wxPropertyInfo is used to inquire of the property by name. It doesn't
  254. // provide access to the property, only information about it. If you
  255. // want access, look at wxPropertyAccessor.
  256. // ----------------------------------------------------------------------------
  257. class WXDLLIMPEXP_BASE wxPropertyInfo
  258. {
  259. friend class /* WXDLLIMPEXP_BASE */ wxDynamicClassInfo;
  260. public:
  261. wxPropertyInfo(wxPropertyInfo* &iter,
  262. wxClassInfo* itsClass,
  263. const wxString& name,
  264. const wxString& typeName,
  265. wxPropertyAccessor *accessor,
  266. wxAny dv,
  267. wxPropertyInfoFlags flags = 0,
  268. const wxString& helpString = wxEmptyString,
  269. const wxString& groupString = wxEmptyString) :
  270. m_itsClass(itsClass),
  271. m_name(name),
  272. m_typeInfo(NULL),
  273. m_typeName(typeName),
  274. m_collectionElementTypeInfo(NULL),
  275. m_accessor(accessor),
  276. m_defaultValue(dv),
  277. m_flags(flags),
  278. m_helpString(helpString),
  279. m_groupString(groupString)
  280. {
  281. Insert(iter);
  282. }
  283. wxPropertyInfo(wxPropertyInfo* &iter,
  284. wxClassInfo* itsClass,
  285. const wxString& name,
  286. wxEventSourceTypeInfo* type,
  287. wxPropertyAccessor *accessor,
  288. wxAny dv,
  289. wxPropertyInfoFlags flags = 0,
  290. const wxString& helpString = wxEmptyString,
  291. const wxString& groupString = wxEmptyString) :
  292. m_itsClass(itsClass),
  293. m_name(name),
  294. m_typeInfo(type),
  295. m_collectionElementTypeInfo(NULL),
  296. m_accessor(accessor),
  297. m_defaultValue(dv),
  298. m_flags(flags),
  299. m_helpString(helpString),
  300. m_groupString(groupString)
  301. {
  302. Insert(iter);
  303. }
  304. wxPropertyInfo(wxPropertyInfo* &iter,
  305. wxClassInfo* itsClass, const wxString& name,
  306. const wxString& collectionTypeName,
  307. const wxString& elementTypeName,
  308. wxPropertyAccessor *accessor,
  309. wxPropertyInfoFlags flags = 0,
  310. const wxString& helpString = wxEmptyString,
  311. const wxString& groupString = wxEmptyString) :
  312. m_itsClass(itsClass),
  313. m_name(name),
  314. m_typeInfo(NULL),
  315. m_typeName(collectionTypeName),
  316. m_collectionElementTypeInfo(NULL),
  317. m_collectionElementTypeName(elementTypeName),
  318. m_accessor(accessor),
  319. m_flags(flags),
  320. m_helpString(helpString),
  321. m_groupString(groupString)
  322. {
  323. Insert(iter);
  324. }
  325. ~wxPropertyInfo()
  326. { Remove(); }
  327. // return the class this property is declared in
  328. const wxClassInfo* GetDeclaringClass() const { return m_itsClass; }
  329. // return the name of this property
  330. const wxString& GetName() const { return m_name; }
  331. // returns the flags of this property
  332. wxPropertyInfoFlags GetFlags() const { return m_flags; }
  333. // returns the short help string of this property
  334. const wxString& GetHelpString() const { return m_helpString; }
  335. // returns the group string of this property
  336. const wxString& GetGroupString() const { return m_groupString; }
  337. // return the element type info of this property (for collections, otherwise NULL)
  338. const wxTypeInfo * GetCollectionElementTypeInfo() const
  339. {
  340. if ( m_collectionElementTypeInfo == NULL )
  341. m_collectionElementTypeInfo = wxTypeInfo::FindType(m_collectionElementTypeName);
  342. return m_collectionElementTypeInfo;
  343. }
  344. // return the type info of this property
  345. const wxTypeInfo * GetTypeInfo() const
  346. {
  347. if ( m_typeInfo == NULL )
  348. m_typeInfo = wxTypeInfo::FindType(m_typeName);
  349. return m_typeInfo;
  350. }
  351. // return the accessor for this property
  352. wxPropertyAccessor* GetAccessor() const { return m_accessor; }
  353. // returns NULL if this is the last property of this class
  354. wxPropertyInfo* GetNext() const { return m_next; }
  355. // returns the default value of this property, its kind may be wxT_VOID if it is not valid
  356. wxAny GetDefaultValue() const { return m_defaultValue; }
  357. private:
  358. // inserts this property at the end of the linked chain which begins
  359. // with "iter" property.
  360. void Insert(wxPropertyInfo* &iter);
  361. // removes this property from the linked chain of the m_itsClass properties.
  362. void Remove();
  363. wxClassInfo* m_itsClass;
  364. wxString m_name;
  365. mutable wxTypeInfo* m_typeInfo;
  366. wxString m_typeName;
  367. mutable wxTypeInfo* m_collectionElementTypeInfo;
  368. wxString m_collectionElementTypeName;
  369. wxPropertyAccessor* m_accessor;
  370. wxAny m_defaultValue;
  371. wxPropertyInfoFlags m_flags;
  372. wxString m_helpString;
  373. wxString m_groupString;
  374. wxPropertyInfo* m_next;
  375. // FIXME: what's this comment about??
  376. // string representation of the default value
  377. // to be assigned by the designer to the property
  378. // when the component is dropped on the container.
  379. };
  380. // stl is giving problems when forwarding declarations, therefore we define it as a subclass
  381. WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMapBase,
  382. class WXDLLIMPEXP_BASE );
  383. class WXDLLIMPEXP_BASE wxPropertyInfoMap : public wxPropertyInfoMapBase {
  384. };
  385. WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxAny, wxStringToAnyHashMapBase,
  386. class WXDLLIMPEXP_BASE );
  387. class WXDLLIMPEXP_FWD_BASE wxStringToAnyHashMap : public wxStringToAnyHashMapBase {
  388. };
  389. #define wxBEGIN_PROPERTIES_TABLE(theClass) \
  390. wxPropertyInfo *theClass::GetPropertiesStatic() \
  391. { \
  392. typedef theClass class_t; \
  393. static wxPropertyInfo* first = NULL;
  394. #define wxEND_PROPERTIES_TABLE() \
  395. return first; }
  396. #define wxHIDE_PROPERTY( pname ) \
  397. static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \
  398. wxT(#pname), typeid(void).name(), NULL, wxAny(), wxPROP_DONT_STREAM, \
  399. wxEmptyString, wxEmptyString );
  400. #define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group) \
  401. wxPROPERTY_SETTER( pname, class_t, type, setter ) \
  402. static wxPropertySetter##pname _setter##pname; \
  403. wxPROPERTY_GETTER( pname, class_t, type, getter ) \
  404. static wxPropertyGetter##pname _getter##pname; \
  405. static wxPropertyAccessor _accessor##pname( &_setter##pname, \
  406. &_getter##pname, NULL, NULL ); \
  407. static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \
  408. wxT(#pname), typeid(type).name(), &_accessor##pname, \
  409. wxAny(defaultValue), flags, group, help );
  410. #define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue, \
  411. pflags, help, group) \
  412. wxPROPERTY_SETTER( pname, class_t, type, setter ) \
  413. static wxPropertySetter##pname _setter##pname; \
  414. wxPROPERTY_GETTER( pname, class_t, type, getter ) \
  415. static wxPropertyGetter##pname _getter##pname; \
  416. static wxPropertyAccessor _accessor##pname( &_setter##pname, \
  417. &_getter##pname, NULL, NULL ); \
  418. static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \
  419. wxT(#pname), typeid(flags).name(), &_accessor##pname, \
  420. wxAny(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group );
  421. #define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group) \
  422. wxPROPERTY_GETTER( pname, class_t, type, getter ) \
  423. static wxPropertyGetter##pname _getter##pname; \
  424. static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \
  425. static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \
  426. wxT(#pname), typeid(type).name(),&_accessor##pname, \
  427. wxAny(defaultValue), flags, help, group );
  428. #define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue, \
  429. pflags, help, group) \
  430. wxPROPERTY_GETTER( pname, class_t, type, getter ) \
  431. static wxPropertyGetter##pname _getter##pname; \
  432. static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \
  433. static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \
  434. wxT(#pname), typeid(flags).name(),&_accessor##pname, \
  435. wxAny(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group );
  436. #define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter, \
  437. flags, help, group ) \
  438. wxPROPERTY_COLLECTION_ADDER( pname, class_t, addelemtype, adder ) \
  439. static wxPropertyCollectionAdder##pname _adder##pname; \
  440. wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \
  441. static wxPropertyCollectionGetter##pname _collectionGetter##pname; \
  442. static wxPropertyAccessor _accessor##pname( NULL, NULL,&_adder##pname, \
  443. &_collectionGetter##pname ); \
  444. static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \
  445. wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \
  446. &_accessor##pname, flags, help, group );
  447. #define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter, \
  448. flags, help, group) \
  449. wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \
  450. static wxPropertyCollectionGetter##pname _collectionGetter##pname; \
  451. static wxPropertyAccessor _accessor##pname( NULL, NULL, NULL, \
  452. &_collectionGetter##pname ); \
  453. static wxPropertyInfo _propertyInfo##pname( first,class_t::GetClassInfoStatic(), \
  454. wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \
  455. &_accessor##pname, flags, help, group );
  456. #define wxEVENT_PROPERTY( name, eventType, eventClass ) \
  457. static wxEventSourceTypeInfo _typeInfo##name( eventType, wxCLASSINFO( eventClass ) ); \
  458. static wxPropertyInfo _propertyInfo##name( first,class_t::GetClassInfoStatic(), \
  459. wxT(#name), &_typeInfo##name, NULL, wxAny() );
  460. #define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) \
  461. static wxEventSourceTypeInfo _typeInfo##name( eventType, lastEventType, \
  462. wxCLASSINFO( eventClass ) ); \
  463. static wxPropertyInfo _propertyInfo##name( first, class_t::GetClassInfoStatic(), \
  464. wxT(#name), &_typeInfo##name, NULL, wxAny() );
  465. // ----------------------------------------------------------------------------
  466. // Implementation Helper for Simple Properties
  467. // ----------------------------------------------------------------------------
  468. #define wxIMPLEMENT_PROPERTY(name, type) \
  469. private: \
  470. type m_##name; \
  471. public: \
  472. void Set##name( type const & p) { m_##name = p; } \
  473. type const & Get##name() const { return m_##name; }
  474. #endif // wxUSE_EXTENDED_RTTI
  475. #endif // _XTIPROP_H_