KiCad PCB EDA Suite
property.h File Reference
#include <wx/any.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/font.h>
#include <wx/validate.h>
#include <wx/propgrid/property.h>
#include <functional>
#include <map>
#include <memory>
#include <typeindex>
#include <type_traits>

Go to the source code of this file.

Classes

class  ENUM_MAP< T >
 
class  GETTER_BASE< Owner, T >
 
class  GETTER< Owner, T, FuncType >
 
class  SETTER_BASE< Owner, T >
 
class  SETTER< Owner, T, FuncType >
 
class  METHOD< Owner, T, Base >
 
class  PROPERTY_BASE
 
class  PROPERTY< Owner, T, Base >
 
class  PROPERTY_ENUM< Owner, T, Base >
 
class  TYPE_CAST_BASE
 
class  TYPE_CAST< Base, Derived >
 
class  ENUM_MAP< T >
 

Macros

#define TYPE_HASH(x)   typeid( x ).hash_code()
 
#define TYPE_NAME(x)   typeid( x ).name()
 
#define DECLARE_ENUM_TO_WXANY(type)
 
#define IMPLEMENT_ENUM_TO_WXANY(type)   WX_IMPLEMENT_ANY_VALUE_TYPE( wxAnyValueTypeImpl<type> )
 
#define ENUM_TO_WXANY(type)
 Macro to define read-only fields (no setter method available) More...
 
#define NO_SETTER(owner, type)   ( ( void ( owner::* )( type ) ) nullptr )
 

Enumerations

enum  PROPERTY_DISPLAY { DEFAULT, DISTANCE, DEGREE, DECIDEGREE }
 Common property types. More...
 

Macro Definition Documentation

◆ DECLARE_ENUM_TO_WXANY

#define DECLARE_ENUM_TO_WXANY (   type)
Value:
template <> \
class wxAnyValueTypeImpl<type> : public wxAnyValueTypeImplBase<type> \
{ \
WX_DECLARE_ANY_VALUE_TYPE( wxAnyValueTypeImpl<type> ) \
public: \
wxAnyValueTypeImpl() : wxAnyValueTypeImplBase<type>() {} \
virtual ~wxAnyValueTypeImpl() {} \
virtual bool ConvertValue( const wxAnyValueBuffer& src, wxAnyValueType* dstType, \
wxAnyValueBuffer& dst ) const override \
{ \
type value = GetValue( src ); \
ENUM_MAP<type>& conv = ENUM_MAP<type>::Instance(); \
if( dstType->CheckType<wxString>() ) \
{ \
wxAnyValueTypeImpl<wxString>::SetValue( conv.ToString( value ), dst ); \
return true; \
} \
if( dstType->CheckType<int>() ) \
{ \
wxAnyValueTypeImpl<int>::SetValue( static_cast<int>( value ), dst ); \
return true; \
} \
else \
{ \
return false; \
} \
} \
};
static ENUM_MAP< T > & Instance()
Definition: property.h:508

Definition at line 564 of file property.h.

◆ ENUM_TO_WXANY

#define ENUM_TO_WXANY (   type)
Value:
IMPLEMENT_ENUM_TO_WXANY( type )
#define DECLARE_ENUM_TO_WXANY(type)
Definition: property.h:564

Macro to define read-only fields (no setter method available)

Definition at line 596 of file property.h.

◆ IMPLEMENT_ENUM_TO_WXANY

#define IMPLEMENT_ENUM_TO_WXANY (   type)    WX_IMPLEMENT_ANY_VALUE_TYPE( wxAnyValueTypeImpl<type> )

Definition at line 594 of file property.h.

◆ NO_SETTER

#define NO_SETTER (   owner,
  type 
)    ( ( void ( owner::* )( type ) ) nullptr )

Definition at line 605 of file property.h.

◆ TYPE_HASH

#define TYPE_HASH (   x)    typeid( x ).hash_code()

Definition at line 57 of file property.h.

◆ TYPE_NAME

#define TYPE_NAME (   x)    typeid( x ).name()

Definition at line 58 of file property.h.

Enumeration Type Documentation

◆ PROPERTY_DISPLAY

Common property types.

Enumerator
DEFAULT 

Default property for a given type.

DISTANCE 

Display value expressed in distance units (mm/inch)

DEGREE 

Display value expressed in degrees.

DECIDEGREE 

Convert decidegrees to degrees for display.

Definition at line 48 of file property.h.

49 {
50  DEFAULT,
51  DISTANCE,
52  DEGREE,
53  DECIDEGREE
54 };
Display value expressed in degrees.
Definition: property.h:52
Display value expressed in distance units (mm/inch)
Definition: property.h:51
Convert decidegrees to degrees for display.
Definition: property.h:53
Default property for a given type.
Definition: property.h:50