23#ifndef PG_PROPERTIES_H
24#define PG_PROPERTIES_H
26#include <wx/propgrid/propgrid.h>
27#include <wx/propgrid/property.h>
28#include <wx/propgrid/props.h>
29#include <wx/propgrid/advprops.h>
51 bool StringToDistance( wxVariant& aVariant,
const wxString& aText,
int aArgFlags = 0 )
const;
67 int aArgFlags = 0 )
const override
72 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override
87 int aArgFlags = 0 )
const override
92 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override
106 wxFloatProperty( wxPG_LABEL, wxPG_LABEL, 0 ),
111 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
112 int aArgFlags = 0 )
const override;
113 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override;
123 bool ValidateValue( wxVariant&, wxPGValidationInfo& )
const override {
return true; }
136 wxEnumProperty( wxPG_LABEL, wxPG_LABEL, *aChoices, 0 ),
137 m_colorFunc( []( int aDummy ) {
return wxNullColour; } )
139 SetFlag( wxPG_PROP_CUSTOMIMAGE );
144 void OnCustomPaint( wxDC& aDC,
const wxRect& aRect, wxPGPaintData& aPaintData )
override;
165 wxStringProperty( wxPG_LABEL, wxPG_LABEL, wxEmptyString )
170 wxString
ValueToString( wxVariant& aValue,
int aFlags = 0 )
const override;
172 bool StringToValue( wxVariant& aVariant,
const wxString& aString,
173 int aFlags = 0 )
const override;
180 PGPROPERTY_BOOL(
const wxString& aLabel = wxPG_LABEL,
const wxString& aName = wxPG_LABEL,
181 bool aValue =
false );
192 PGPROPERTY_COLOR4D(
const wxString& aLabel = wxPG_LABEL,
const wxString& aName = wxPG_LABEL,
198 wxString
ValueToString( wxVariant& aValue,
int aFlags = 0 )
const override;
200 bool StringToValue( wxVariant &aVariant,
const wxString &aText,
201 int aFlags = 0 )
const override;
The base class for create windows for drawing purpose.
A color representation with 4 components: red, green, blue, alpha.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
A wxEnumProperty that displays a color next to the enum value.
void SetScale(double aScale)
wxString ValueToString(wxVariant &aVariant, int aArgFlags=0) const override
double m_scale
< Scale factor to convert between raw and displayed value
wxValidator * DoGetValidator() const override
Do not perform PG validation; the UX is not what we want.
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const override
bool ValidateValue(wxVariant &, wxPGValidationInfo &) const override
const wxPGEditor * DoGetEditorClass() const override
virtual ~PGPROPERTY_BOOL()=default
virtual ~PGPROPERTY_COLOR4D()=default
KIGFX::COLOR4D m_backgroundColor
Used for rendering colors with opacity.
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aFlags=0) const override
wxString ValueToString(wxVariant &aValue, int aFlags=0) const override
const KIGFX::COLOR4D & GetBackgroundColor() const
void SetBackgroundColor(const KIGFX::COLOR4D &aColor)
void SetColorFunc(std::function< wxColour(int aValue)> aFunc)
wxColour GetColor(int aValue)
wxSize OnMeasureImage(int aItem=-1) const override
void OnCustomPaint(wxDC &aDC, const wxRect &aRect, wxPGPaintData &aPaintData) override
std::function< wxColour(int aValue)> m_colorFunc
PGPROPERTY_COLORENUM(wxPGChoices *aChoices)
Customized wxPGProperty class to handle angles.
wxString ValueToString(wxVariant &aVariant, int aArgFlags=0) const override
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const override
wxValidator * DoGetValidator() const override
EDA_DRAW_FRAME * m_parentFrame
ORIGIN_TRANSFORMS::COORD_TYPES_T CoordType() const
wxString DistanceToString(wxVariant &aVariant, int aArgFlags=0) const
bool StringToDistance(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const
virtual ~PGPROPERTY_DISTANCE()=0
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
std::unique_ptr< REGEX_VALIDATOR > m_regExValidator
wxValidator * DoGetValidator() const override
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const override
wxString ValueToString(wxVariant &aVariant, int aArgFlags=0) const override
wxString ValueToString(wxVariant &aValue, int aFlags=0) const override
bool StringToValue(wxVariant &aVariant, const wxString &aString, int aFlags=0) const override
virtual ~PGPROPERTY_STRING()=default
Custom validator that checks verifies that a string exactly matches a regular expression.
wxPGProperty * PGPropertyFactory(const PROPERTY_BASE *aProperty, EDA_DRAW_FRAME *aFrame)
Customized abstract wxPGProperty class to handle coordinate/size units.