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#if wxCHECK_VERSION( 3, 3, 0 )
53 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const;
55 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const;
57 bool StringToDistance( wxVariant& aVariant,
const wxString& aText,
int aArgFlags = 0 )
const;
75#if wxCHECK_VERSION( 3, 3, 0 )
76 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
77 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
80 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
82 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
83 int aArgFlags = 0 )
const override;
85 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override;
102#if wxCHECK_VERSION( 3, 3, 0 )
103 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
104 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override
110 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override
116 int aArgFlags = 0 )
const override
121 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override
127 bool ValidateValue( wxVariant& aValue, wxPGValidationInfo& aValidationInfo )
const override;
140#if wxCHECK_VERSION( 3, 3, 0 )
141 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
142 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override
148 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override
154 int aArgFlags = 0 )
const override
159 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override
174 wxFloatProperty( wxPG_LABEL, wxPG_LABEL, 0 ),
181#if wxCHECK_VERSION( 3, 3, 0 )
182 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
183 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
186 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
188 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
189 int aArgFlags = 0 )
const override;
190 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override;
201 bool ValidateValue( wxVariant&, wxPGValidationInfo& )
const override {
return true; }
214 wxEnumProperty( wxPG_LABEL, wxPG_LABEL, *aChoices, 0 ),
215 m_colorFunc( []( int aDummy ) {
return wxNullColour; } )
217#if wxCHECK_VERSION( 3, 3, 0 )
218 SetFlag( wxPGPropertyFlags::CustomImage );
220 SetFlag( wxPG_PROP_CUSTOMIMAGE );
228 void OnCustomPaint( wxDC& aDC,
const wxRect& aRect, wxPGPaintData& aPaintData )
override;
254#if wxCHECK_VERSION( 3, 3, 0 )
255 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
256 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
259 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
261 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
262 int aArgFlags = 0 )
const override;
264 wxString
ValueToString( wxVariant& aVariant,
int aArgFlags = 0 )
const override;
267 bool ValidateValue( wxVariant& aValue, wxPGValidationInfo& aValidationInfo )
const override;
277 wxStringProperty( wxPG_LABEL, wxPG_LABEL, wxEmptyString )
282#if wxCHECK_VERSION( 3, 3, 0 )
283 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
284 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
287 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
289 wxString
ValueToString( wxVariant& aValue,
int aFlags = 0 )
const override;
291 bool StringToValue( wxVariant& aVariant,
const wxString& aString,
292 int aFlags = 0 )
const override;
300 PGPROPERTY_BOOL(
const wxString& aLabel = wxPG_LABEL,
const wxString& aName = wxPG_LABEL,
301 bool aValue =
false );
312 PGPROPERTY_COLOR4D(
const wxString& aLabel = wxPG_LABEL,
const wxString& aName = wxPG_LABEL,
318#if wxCHECK_VERSION( 3, 3, 0 )
319 bool StringToValue( wxVariant& aVariant,
const wxString& aText,
320 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
323 wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null )
const override;
325 wxString
ValueToString( wxVariant& aValue,
int aFlags = 0 )
const override;
327 bool StringToValue( wxVariant &aVariant,
const wxString &aText,
328 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.
virtual ~PGPROPERTY_ANGLE()=default
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const override
bool ValidateValue(wxVariant &, wxPGValidationInfo &) const override
wxString ValueToString(wxVariant &aVariant, int aArgFlags=0) const override
wxValidator * DoGetValidator() const override
virtual ~PGPROPERTY_AREA()=default
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const override
EDA_DRAW_FRAME * m_parentFrame
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
virtual ~PGPROPERTY_COLORENUM()=default
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
virtual ~PGPROPERTY_COORD()=default
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
wxValidator * DoGetValidator() const override
bool ValidateValue(wxVariant &aValue, wxPGValidationInfo &aValidationInfo) const override
bool StringToValue(wxVariant &aVariant, const wxString &aText, int aArgFlags=0) const override
wxString ValueToString(wxVariant &aVariant, int aArgFlags=0) const override
virtual ~PGPROPERTY_RATIO()=default
const wxPGEditor * DoGetEditorClass() const override
virtual ~PGPROPERTY_SIZE()=default
wxValidator * DoGetValidator() const override
bool ValidateValue(wxVariant &aValue, wxPGValidationInfo &aValidationInfo) 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.