KiCad PCB EDA Suite
property.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2020 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef PROPERTY_H
23 #define PROPERTY_H
24 
25 #include <wx/any.h>
26 #include <wx/string.h>
27 #include <wx/bitmap.h>
28 #include <wx/font.h> // required for propgrid
29 #include <wx/validate.h> // required for propgrid
30 #include <wx/propgrid/property.h>
31 
32 #include <functional>
33 #include <map>
34 #include <memory>
35 #include <typeindex>
36 #include <type_traits>
37 
38 class wxPGProperty;
39 class INSPECTABLE;
40 class PROPERTY_BASE;
41 
42 template<typename T>
43 class ENUM_MAP;
44 
47 {
52 };
53 
55 #define TYPE_HASH( x ) typeid( x ).hash_code()
56 #define TYPE_NAME( x ) typeid( x ).name()
57 //#define TYPE_HASH( x ) typeid( std::decay<x>::type ).hash_code()
58 
59 template<typename Owner, typename T>
61 {
62 public:
63  virtual ~GETTER_BASE() {}
64 
65  virtual T operator()( Owner* aOwner ) const = 0;
66 };
67 
68 template<typename Owner, typename T, typename FuncType>
69 class GETTER : public GETTER_BASE<Owner, T>
70 {
71 public:
72  GETTER( FuncType aFunc )
73  : m_func( aFunc )
74  {
75  }
76 
77  T operator()( Owner* aOwner ) const override
78  {
79  return ( aOwner->*m_func )();
80  }
81 
82 private:
83  FuncType m_func;
84 };
85 
86 template<typename Owner, typename T>
88 {
89 public:
90  virtual ~SETTER_BASE() {}
91 
92  virtual void operator()( Owner* aOwner, T aValue ) = 0;
93 };
94 
95 template<typename Owner, typename T, typename FuncType>
96 class SETTER : public SETTER_BASE<Owner, T>
97 {
98 public:
99  SETTER( FuncType aFunc )
100  : m_func( aFunc )
101  {
102  }
103 
104  void operator()( Owner* aOwner, T aValue ) override
105  {
106  wxCHECK( m_func, /*void*/ );
107  ( aOwner->*m_func )( aValue );
108  }
109 
110 private:
111  FuncType m_func;
112 };
113 
114 
115 template<typename Owner, typename T, typename Base = Owner>
116 class METHOD
117 {
118 public:
119  constexpr static GETTER_BASE<Owner, T>* Wrap( T (Base::*aFunc)() )
120  {
121  return new GETTER<Owner, T, T (Base::*)()>( aFunc );
122  }
123 
124  constexpr static GETTER_BASE<Owner, T>* Wrap( const T (Base::*aFunc)() )
125  {
126  return new GETTER<Owner, T, T (Base::*)()>( aFunc );
127  }
128 
129  constexpr static GETTER_BASE<Owner, T>* Wrap( const T& (Base::*aFunc)() )
130  {
131  return new GETTER<Owner, T, const T& (Base::*)()>( aFunc );
132  }
133 
134  constexpr static GETTER_BASE<Owner, T>* Wrap( T (Base::*aFunc)() const )
135  {
136  return new GETTER<Owner, T, T (Base::*)() const>( aFunc );
137  }
138 
139  constexpr static GETTER_BASE<Owner, T>* Wrap( const T (Base::*aFunc)() const )
140  {
142  }
143 
144  constexpr static GETTER_BASE<Owner, T>* Wrap( const T& (Base::*aFunc)() const )
145  {
147  }
148 
149  constexpr static SETTER_BASE<Owner, T>* Wrap( void (Base::*aFunc)( T ) )
150  {
151  return aFunc ? new SETTER<Owner, T, void (Base::*)( T )>( aFunc ) : nullptr;
152  }
153 
154  constexpr static SETTER_BASE<Owner, T>* Wrap( void (Base::*aFunc)( T& ) )
155  {
156  return aFunc ? new SETTER<Owner, T, void (Base::*)( T& )>( aFunc ) : nullptr;
157  }
158 
159  constexpr static SETTER_BASE<Owner, T>* Wrap( void (Base::*aFunc)( const T& ) )
160  {
161  return aFunc ? new SETTER<Owner, T, void (Base::*)( const T& )>( aFunc ) : nullptr;
162  }
163 
164  METHOD() = delete;
165 };
166 
167 
169 {
170 private:
172  size_t nextId = 0;
173 
174 public:
175  PROPERTY_BASE( const wxString& aName, PROPERTY_DISPLAY aDisplay = DEFAULT ) :
176  m_id( nextId ),
177  m_name( aName ),
178  m_display( aDisplay ),
179  m_availFunc( [](INSPECTABLE*)->bool { return true; } )
180  {
181  ++nextId;
182  }
183 
184  virtual ~PROPERTY_BASE()
185  {
186  }
187 
188  const wxString& Name() const
189  {
190  return m_name;
191  }
192 
197  virtual const wxPGChoices& Choices() const
198  {
199  static wxPGChoices empty;
200  return empty;
201  }
202 
206  virtual void SetChoices( const wxPGChoices& aChoices )
207  {
208  wxFAIL; // only possible for PROPERTY_ENUM
209  }
210 
215  virtual bool HasChoices() const
216  {
217  return false;
218  }
219 
223  bool Available( INSPECTABLE* aObject ) const
224  {
225  return m_availFunc( aObject );
226  }
227 
231  void SetAvailableFunc( std::function<bool(INSPECTABLE*)> aFunc )
232  {
233  m_availFunc = aFunc;
234  }
235 
239  virtual size_t OwnerHash() const = 0;
240 
244  virtual size_t BaseHash() const = 0;
245 
249  virtual size_t TypeHash() const = 0;
250 
254  size_t Id() const
255  {
256  return m_id;
257  }
258 
259  virtual bool IsReadOnly() const = 0;
260 
262  {
263  return m_display;
264  }
265 
266 protected:
267  template<typename T>
268  void set( void* aObject, T aValue )
269  {
270  wxAny a = aValue;
271  setter( aObject, a );
272  }
273 
274  template<typename T>
275  T get( void* aObject )
276  {
277  wxAny a = getter( aObject );
278 
279  if ( !( std::is_enum<T>::value && a.CheckType<int>() ) && !a.CheckType<T>() )
280  throw std::invalid_argument("Invalid requested type");
281 
282  return wxANY_AS(a, T);
283  }
284 
285  virtual void setter( void* aObject, wxAny& aValue ) = 0;
286  virtual wxAny getter( void* aObject ) const = 0;
287 
288 private:
289  const size_t m_id;
290  const wxString m_name;
292 
294  std::function<bool(INSPECTABLE*)> m_availFunc;
295 
296  friend class INSPECTABLE;
297 };
298 
299 
300 template<typename Owner, typename T, typename Base = Owner>
301 class PROPERTY : public PROPERTY_BASE
302 {
303 public:
304  typedef typename std::decay<T>::type BASE_TYPE;
305  typedef void (Base::*SETTER)( T );
306 
307  template<typename SetType, typename GetType>
308  PROPERTY( const wxString& aName,
309  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )(),
310  PROPERTY_DISPLAY aDisplay = DEFAULT )
311  : PROPERTY( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
312  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
313  {
314  }
315 
316  template<typename SetType, typename GetType>
317  PROPERTY( const wxString& aName,
318  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )() const,
319  PROPERTY_DISPLAY aDisplay = DEFAULT )
320  : PROPERTY( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
321  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
322  {
323  }
324 
325  size_t OwnerHash() const override
326  {
327  return m_ownerHash;
328  }
329 
330  size_t BaseHash() const override
331  {
332  return m_baseHash;
333  }
334 
335  size_t TypeHash() const override
336  {
337  return m_typeHash;
338  }
339 
340  bool IsReadOnly() const override
341  {
342  return !m_setter;
343  }
344 
345 protected:
346  PROPERTY( const wxString& aName, SETTER_BASE<Owner, T>* s, GETTER_BASE<Owner, T>* g,
347  PROPERTY_DISPLAY aDisplay )
348  : PROPERTY_BASE( aName, aDisplay ), m_setter( s ), m_getter( g ),
349  m_ownerHash( TYPE_HASH( Owner ) ), m_baseHash( TYPE_HASH( Base ) ),
351  {
352  }
353 
354  virtual ~PROPERTY() {}
355 
356  virtual void setter( void* obj, wxAny& v ) override
357  {
358  wxCHECK( !IsReadOnly(), /*void*/ );
359 
360  if( !v.CheckType<T>() )
361  throw std::invalid_argument( "Invalid type requested" );
362 
363  Owner* o = reinterpret_cast<Owner*>( obj );
364  BASE_TYPE value = wxANY_AS(v, BASE_TYPE);
365  (*m_setter)( o, value );
366  }
367 
368  virtual wxAny getter( void* obj ) const override
369  {
370  Owner* o = reinterpret_cast<Owner*>( obj );
371  wxAny res = (*m_getter)( o );
372  return res;
373  }
374 
376  std::unique_ptr<SETTER_BASE<Owner, T>> m_setter;
377 
379  std::unique_ptr<GETTER_BASE<Owner, T>> m_getter;
380 
382  const size_t m_ownerHash;
383 
385  const size_t m_baseHash;
386 
388  const size_t m_typeHash;
389 };
390 
391 
392 template<typename Owner, typename T, typename Base = Owner>
393 class PROPERTY_ENUM : public PROPERTY<Owner, T, Base>
394 {
395 public:
396  template<typename SetType, typename GetType>
397  PROPERTY_ENUM( const wxString& aName,
398  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )(),
400  : PROPERTY<Owner, T, Base>( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
401  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
402  {
403  if ( std::is_enum<T>::value )
404  {
405  m_choices = ENUM_MAP<T>::Instance().Choices();
406  wxASSERT_MSG( m_choices.GetCount() > 0, "No enum choices defined" );
407  }
408  }
409 
410  template<typename SetType, typename GetType>
411  PROPERTY_ENUM( const wxString& aName,
412  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )() const,
414  : PROPERTY<Owner, T, Base>( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
415  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
416  {
417  if ( std::is_enum<T>::value )
418  {
419  m_choices = ENUM_MAP<T>::Instance().Choices();
420  wxASSERT_MSG( m_choices.GetCount() > 0, "No enum choices defined" );
421  }
422  }
423 
424  virtual void setter( void* obj, wxAny& v ) override
425  {
426  wxCHECK( !( PROPERTY<Owner, T, Base>::IsReadOnly() ), /*void*/ );
427  Owner* o = reinterpret_cast<Owner*>( obj );
428 
429  if( v.CheckType<T>() )
430  {
431  T value = wxANY_AS(v, T);
432  (*PROPERTY<Owner, T, Base>::m_setter)( o, value );
433  }
434  else if (v.CheckType<int>() )
435  {
436  int value = wxANY_AS(v, int);
437  (*PROPERTY<Owner, T, Base>::m_setter)( o, static_cast<T>( value ) );
438  }
439  else
440  {
441  throw std::invalid_argument( "Invalid type requested" );
442  }
443  }
444 
445  virtual wxAny getter( void* obj ) const override
446  {
447  Owner* o = reinterpret_cast<Owner*>( obj );
448  wxAny res = static_cast<T>( (*PROPERTY<Owner, T, Base>::m_getter)( o ) );
449  return res;
450  }
451 
452  const wxPGChoices& Choices() const override
453  {
454  return m_choices;
455  }
456 
457  void SetChoices( const wxPGChoices& aChoices ) override
458  {
459  m_choices = aChoices;
460  }
461 
462  bool HasChoices() const override
463  {
464  return m_choices.GetCount() > 0;
465  }
466 
467 protected:
468  wxPGChoices m_choices;
469 };
470 
471 
473 {
474 public:
475  virtual ~TYPE_CAST_BASE() {}
476  virtual void* operator()( void* aPointer ) const = 0;
477  virtual const void* operator()( const void* aPointer ) const = 0;
478  virtual size_t BaseHash() const = 0;
479  virtual size_t DerivedHash() const = 0;
480 };
481 
482 
483 template<typename Base, typename Derived>
484 class TYPE_CAST : public TYPE_CAST_BASE
485 {
486 public:
488  {
489  }
490 
491  void* operator()( void* aPointer ) const override
492  {
493  Base* base = reinterpret_cast<Base*>( aPointer );
494  return static_cast<Derived*>( base );
495  }
496 
497  const void* operator()( const void* aPointer ) const override
498  {
499  const Base* base = reinterpret_cast<const Base*>( aPointer );
500  return static_cast<const Derived*>( base );
501  }
502 
503  size_t BaseHash() const override
504  {
505  return TYPE_HASH( Base );
506  }
507 
508  size_t DerivedHash() const override
509  {
510  return TYPE_HASH( Derived );
511  }
512 };
513 
514 
515 template<typename T>
516 class ENUM_MAP
517 {
518 public:
520  {
521  static ENUM_MAP<T> inst;
522  return inst;
523  }
524 
525  ENUM_MAP& Map( T aValue, const wxString& aName )
526  {
527  m_choices.Add( aName, static_cast<int>( aValue ) );
528  m_reverseMap[ aName ] = aValue;
529  return *this;
530  }
531 
532  ENUM_MAP& Undefined( T aValue )
533  {
534  m_undefined = aValue;
535  return *this;
536  }
537 
538  const wxString& ToString( T value ) const
539  {
540  static const wxString s_undef = "UNDEFINED";
541 
542  int idx = m_choices.Index( static_cast<int>( value ) );
543 
544  if( idx >= 0 && idx < (int) m_choices.GetCount() )
545  return m_choices.GetLabel( static_cast<int>( idx ) );
546  else
547  return s_undef;
548  }
549 
550  const T ToEnum( const wxString value )
551  {
552  if( m_reverseMap.count( value ) )
553  return m_reverseMap[ value ];
554  else
555  return m_undefined;
556  }
557 
558  wxPGChoices& Choices()
559  {
560  return m_choices;
561  }
562 
563 private:
564  wxPGChoices m_choices;
565  std::unordered_map<wxString, T> m_reverseMap;
566  T m_undefined; // Returned if the string is not recognized
567 
569  {
570  }
571 };
572 
573 
574 // Helper macros to handle enum types
575 #define DECLARE_ENUM_TO_WXANY(type)\
576  template<>\
577  class wxAnyValueTypeImpl<type> : public wxAnyValueTypeImplBase<type>\
578  {\
579  WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl<type>)\
580  public:\
581  wxAnyValueTypeImpl() : wxAnyValueTypeImplBase<type>() {}\
582  virtual ~wxAnyValueTypeImpl() {}\
583  virtual bool ConvertValue( const wxAnyValueBuffer& src,\
584  wxAnyValueType* dstType, wxAnyValueBuffer& dst ) const override\
585  {\
586  type value = GetValue(src);\
587  ENUM_MAP<type>& conv = ENUM_MAP<type>::Instance();\
588  if( dstType->CheckType<wxString>() )\
589  {\
590  wxAnyValueTypeImpl<wxString>::SetValue( conv.ToString( value ), dst );\
591  return true;\
592  }\
593  if( dstType->CheckType<int>() )\
594  {\
595  wxAnyValueTypeImpl<int>::SetValue( static_cast<int>(value), dst );\
596  return true;\
597  }\
598  else\
599  {\
600  return false;\
601  }\
602  }\
603  };
604 
605 #define IMPLEMENT_ENUM_TO_WXANY(type)\
606  WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<type>)
607 
608 #define ENUM_TO_WXANY(type)\
609  DECLARE_ENUM_TO_WXANY(type)\
610  IMPLEMENT_ENUM_TO_WXANY(type)
611 
613 #define NO_SETTER(owner, type) ((void (owner::*)(type))nullptr)
614 
615 /*
616 #define DECLARE_PROPERTY(owner,type,name,getter,setter) \
617 namespace anonymous {\
618 static PROPERTY<owner,type> prop##_owner##_name_( "##name#", setter, getter );\
619 };
620 */
621 #endif /* PROPERTY_H */
size_t BaseHash() const override
Definition: property.h:503
Display value expressed in degrees.
Definition: property.h:50
virtual void * operator()(void *aPointer) const =0
virtual ~SETTER_BASE()
Definition: property.h:90
static constexpr GETTER_BASE< Owner, T > * Wrap(const T &(Base::*aFunc)() const)
Definition: property.h:144
virtual bool HasChoices() const
Returns true if this PROPERTY has a limited set of possible values.
Definition: property.h:215
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
virtual size_t BaseHash() const =0
PROPERTY_BASE(const wxString &aName, PROPERTY_DISPLAY aDisplay=DEFAULT)
Definition: property.h:175
void * operator()(void *aPointer) const override
Definition: property.h:491
METHOD()=delete
static constexpr GETTER_BASE< Owner, T > * Wrap(const T &(Base::*aFunc)())
Definition: property.h:129
virtual void setter(void *obj, wxAny &v) override
Definition: property.h:356
ENUM_MAP & Undefined(T aValue)
Definition: property.h:532
PROPERTY(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)(), PROPERTY_DISPLAY aDisplay=DEFAULT)
Definition: property.h:308
const size_t m_typeHash
Property value type-id
Definition: property.h:388
std::unique_ptr< GETTER_BASE< Owner, T > > m_getter
Get method
Definition: property.h:379
virtual T operator()(Owner *aOwner) const =0
const wxPGChoices & Choices() const override
Returns a limited set of possible values (e.g.
Definition: property.h:452
virtual void operator()(Owner *aOwner, T aValue)=0
virtual size_t TypeHash() const =0
Returns type-id of the property type.
std::unique_ptr< SETTER_BASE< Owner, T > > m_setter
Set method
Definition: property.h:376
static ENUM_MAP< T > & Instance()
Definition: property.h:519
PROPERTY_DISPLAY GetDisplay() const
Definition: property.h:261
static constexpr GETTER_BASE< Owner, T > * Wrap(const T(Base::*aFunc)())
Definition: property.h:124
virtual size_t DerivedHash() const =0
static constexpr GETTER_BASE< Owner, T > * Wrap(const T(Base::*aFunc)() const)
Definition: property.h:139
wxPGChoices & Choices()
Definition: property.h:558
std::decay< T >::type BASE_TYPE
Definition: property.h:304
virtual wxAny getter(void *obj) const override
Definition: property.h:368
virtual wxAny getter(void *aObject) const =0
PROPERTY_ENUM(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)() const, PROPERTY_DISPLAY aDisplay=PROPERTY_DISPLAY::DEFAULT)
Definition: property.h:411
const PROPERTY_DISPLAY m_display
Definition: property.h:291
virtual void setter(void *obj, wxAny &v) override
Definition: property.h:424
SETTER(FuncType aFunc)
Definition: property.h:99
static constexpr GETTER_BASE< Owner, T > * Wrap(T(Base::*aFunc)() const)
Definition: property.h:134
void operator()(Owner *aOwner, T aValue) override
Definition: property.h:104
bool IsReadOnly() const override
Definition: property.h:340
FuncType m_func
Definition: property.h:83
Display value expressed in distance units (mm/inch)
Definition: property.h:49
const void * operator()(const void *aPointer) const override
Definition: property.h:497
PROPERTY_ENUM(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)(), PROPERTY_DISPLAY aDisplay=PROPERTY_DISPLAY::DEFAULT)
Definition: property.h:397
const T ToEnum(const wxString value)
Definition: property.h:550
virtual ~TYPE_CAST_BASE()
Definition: property.h:475
void SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Sets a callback function to determine whether an object provides this property.
Definition: property.h:231
PROPERTY(const wxString &aName, SETTER_BASE< Owner, T > *s, GETTER_BASE< Owner, T > *g, PROPERTY_DISPLAY aDisplay)
Definition: property.h:346
Convert decidegrees to degrees for display.
Definition: property.h:51
virtual wxAny getter(void *obj) const override
Definition: property.h:445
const wxString m_name
Definition: property.h:290
const wxString & Name() const
Definition: property.h:188
bool HasChoices() const override
Returns true if this PROPERTY has a limited set of possible values.
Definition: property.h:462
static constexpr SETTER_BASE< Owner, T > * Wrap(void(Base::*aFunc)(T &))
Definition: property.h:154
virtual ~GETTER_BASE()
Definition: property.h:63
static constexpr SETTER_BASE< Owner, T > * Wrap(void(Base::*aFunc)(T))
Definition: property.h:149
PROPERTY_DISPLAY
Common property types
Definition: property.h:46
Class that other classes need to inherit from, in order to be inspectable.
Definition: inspectable.h:33
virtual ~PROPERTY()
Definition: property.h:354
T operator()(Owner *aOwner) const override
Definition: property.h:77
virtual const wxPGChoices & Choices() const
Returns a limited set of possible values (e.g.
Definition: property.h:197
virtual void setter(void *aObject, wxAny &aValue)=0
T m_undefined
Definition: property.h:566
size_t Id() const
Returns unique ID of the property.
Definition: property.h:254
size_t DerivedHash() const override
Definition: property.h:508
std::function< bool(INSPECTABLE *)> m_availFunc
Condition that determines whether the property is available
Definition: property.h:294
virtual bool IsReadOnly() const =0
void SetChoices(const wxPGChoices &aChoices) override
Sets the possible values for for the property.
Definition: property.h:457
static constexpr GETTER_BASE< Owner, T > * Wrap(T(Base::*aFunc)())
Definition: property.h:119
virtual void SetChoices(const wxPGChoices &aChoices)
Sets the possible values for for the property.
Definition: property.h:206
size_t nextId
Used to generate unique IDs
Definition: property.h:172
bool Available(INSPECTABLE *aObject) const
Returns true if aObject offers this PROPERTY.
Definition: property.h:223
TYPE_CAST()
Definition: property.h:487
static bool empty(const wxTextEntryBase *aCtrl)
std::unordered_map< wxString, T > m_reverseMap
Definition: property.h:565
const size_t m_id
Definition: property.h:289
static constexpr SETTER_BASE< Owner, T > * Wrap(void(Base::*aFunc)(const T &))
Definition: property.h:159
size_t BaseHash() const override
Returns type-id of the Base class.
Definition: property.h:330
wxPGChoices m_choices
Definition: property.h:564
const size_t m_ownerHash
Owner class type-id
Definition: property.h:382
virtual size_t BaseHash() const =0
Returns type-id of the Base class.
size_t OwnerHash() const override
Returns type-id of the Owner class.
Definition: property.h:325
T get(void *aObject)
Definition: property.h:275
void set(void *aObject, T aValue)
Definition: property.h:268
Default property for a given type.
Definition: property.h:48
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:525
FuncType m_func
Definition: property.h:111
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.
size_t TypeHash() const override
Returns type-id of the property type.
Definition: property.h:335
const size_t m_baseHash
Base class type-id
Definition: property.h:385
virtual ~PROPERTY_BASE()
Definition: property.h:184
wxPGChoices m_choices
Definition: property.h:468
const wxString & ToString(T value) const
Definition: property.h:538
PROPERTY(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)() const, PROPERTY_DISPLAY aDisplay=DEFAULT)
Definition: property.h:317
GETTER(FuncType aFunc)
Definition: property.h:72