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()
 

Macro to generate unique identifier for a type

More...
 
#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)
 
#define NO_SETTER(owner, type)   ((void (owner::*)(type))nullptr)
 

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

More...
 

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:519

Definition at line 575 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:575

Definition at line 608 of file property.h.

◆ IMPLEMENT_ENUM_TO_WXANY

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

Definition at line 605 of file property.h.

◆ NO_SETTER

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

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

Definition at line 613 of file property.h.

◆ TYPE_HASH

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

Macro to generate unique identifier for a type

Definition at line 55 of file property.h.

◆ TYPE_NAME

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

Definition at line 56 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 46 of file property.h.

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