wxWidgets 3.3 compatibility: properties API
This commit is contained in:
parent
773d241863
commit
e7b6573717
|
@ -76,7 +76,11 @@ wxPGWindowList PG_UNIT_EDITOR::CreateControls( wxPropertyGrid* aPropGrid, wxPGPr
|
||||||
{
|
{
|
||||||
wxASSERT( m_unitBinder );
|
wxASSERT( m_unitBinder );
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
wxString text = aProperty->GetValueAsString( wxPGPropValFormatFlags::EditableValue );
|
||||||
|
#else
|
||||||
wxString text = aProperty->GetValueAsString( wxPG_EDITABLE_VALUE );
|
wxString text = aProperty->GetValueAsString( wxPG_EDITABLE_VALUE );
|
||||||
|
#endif
|
||||||
wxWindow* win = aPropGrid->GenerateEditorTextCtrl( aPos, aSize, text, nullptr, 0,
|
wxWindow* win = aPropGrid->GenerateEditorTextCtrl( aPos, aSize, text, nullptr, 0,
|
||||||
aProperty->GetMaxLength() );
|
aProperty->GetMaxLength() );
|
||||||
wxPGWindowList ret( win, nullptr );
|
wxPGWindowList ret( win, nullptr );
|
||||||
|
|
|
@ -303,15 +303,25 @@ PGPROPERTY_DISTANCE::~PGPROPERTY_DISTANCE()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
bool PGPROPERTY_DISTANCE::StringToDistance( wxVariant& aVariant, const wxString& aText,
|
bool PGPROPERTY_DISTANCE::StringToDistance( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags ) const
|
wxPGPropValFormatFlags aFlags ) const
|
||||||
|
#else
|
||||||
|
bool PGPROPERTY_DISTANCE::StringToDistance( wxVariant& aVariant, const wxString& aText,
|
||||||
|
int aFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// TODO(JE): Are there actual use cases for this?
|
// TODO(JE): Are there actual use cases for this?
|
||||||
wxCHECK_MSG( false, false, wxS( "PGPROPERTY_DISTANCE::StringToDistance should not be used." ) );
|
wxCHECK_MSG( false, false, wxS( "PGPROPERTY_DISTANCE::StringToDistance should not be used." ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString PGPROPERTY_DISTANCE::DistanceToString( wxVariant& aVariant, int aArgFlags ) const
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
wxString PGPROPERTY_DISTANCE::DistanceToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags ) const
|
||||||
|
#else
|
||||||
|
wxString PGPROPERTY_DISTANCE::DistanceToString( wxVariant& aVariant, int aFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
long distanceIU;
|
long distanceIU;
|
||||||
|
|
||||||
|
@ -349,15 +359,25 @@ PGPROPERTY_AREA::PGPROPERTY_AREA( EDA_DRAW_FRAME* aParentFrame ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool PGPROPERTY_AREA::StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
bool PGPROPERTY_AREA::StringToValue( wxVariant& aVariant, const wxString& aText,
|
bool PGPROPERTY_AREA::StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags ) const
|
int aArgFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// TODO(JE): Are there actual use cases for this?
|
// TODO(JE): Are there actual use cases for this?
|
||||||
wxCHECK_MSG( false, false, wxS( "PGPROPERTY_AREA::StringToValue should not be used." ) );
|
wxCHECK_MSG( false, false, wxS( "PGPROPERTY_AREA::StringToValue should not be used." ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
wxString PGPROPERTY_AREA::ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
wxString PGPROPERTY_AREA::ValueToString( wxVariant& aVariant, int aArgFlags ) const
|
wxString PGPROPERTY_AREA::ValueToString( wxVariant& aVariant, int aArgFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
wxCHECK( aVariant.GetType() == wxPG_VARIANT_TYPE_LONGLONG, wxEmptyString );
|
wxCHECK( aVariant.GetType() == wxPG_VARIANT_TYPE_LONGLONG, wxEmptyString );
|
||||||
|
|
||||||
|
@ -432,15 +452,25 @@ const wxPGEditor* PGPROPERTY_RATIO::DoGetEditorClass() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool PGPROPERTY_RATIO::StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
bool PGPROPERTY_RATIO::StringToValue( wxVariant& aVariant, const wxString& aText,
|
bool PGPROPERTY_RATIO::StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags ) const
|
int aArgFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// TODO(JE): Are there actual use cases for this?
|
// TODO(JE): Are there actual use cases for this?
|
||||||
wxCHECK_MSG( false, false, wxS( "PGPROPERTY_RATIO::StringToValue should not be used." ) );
|
wxCHECK_MSG( false, false, wxS( "PGPROPERTY_RATIO::StringToValue should not be used." ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
wxString PGPROPERTY_RATIO::ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
wxString PGPROPERTY_RATIO::ValueToString( wxVariant& aVariant, int aArgFlags ) const
|
wxString PGPROPERTY_RATIO::ValueToString( wxVariant& aVariant, int aArgFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
double value;
|
double value;
|
||||||
|
|
||||||
|
@ -490,7 +520,13 @@ wxValidator* PGPROPERTY_RATIO::DoGetValidator() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PGPROPERTY_ANGLE::StringToValue( wxVariant& aVariant, const wxString& aText, int aArgFlags ) const
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool PGPROPERTY_ANGLE::StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
|
bool PGPROPERTY_ANGLE::StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
int aArgFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
double value = 0.0;
|
double value = 0.0;
|
||||||
|
|
||||||
|
@ -512,7 +548,12 @@ bool PGPROPERTY_ANGLE::StringToValue( wxVariant& aVariant, const wxString& aText
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
wxString PGPROPERTY_ANGLE::ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
wxString PGPROPERTY_ANGLE::ValueToString( wxVariant& aVariant, int aArgFlags ) const
|
wxString PGPROPERTY_ANGLE::ValueToString( wxVariant& aVariant, int aArgFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if( aVariant.GetType() == wxPG_VARIANT_TYPE_DOUBLE )
|
if( aVariant.GetType() == wxPG_VARIANT_TYPE_DOUBLE )
|
||||||
{
|
{
|
||||||
|
@ -570,7 +611,12 @@ void PGPROPERTY_COLORENUM::OnCustomPaint( wxDC& aDC, const wxRect& aRect,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
wxString PGPROPERTY_STRING::ValueToString( wxVariant& aValue,
|
||||||
|
wxPGPropValFormatFlags aFlags ) const
|
||||||
|
#else
|
||||||
wxString PGPROPERTY_STRING::ValueToString( wxVariant& aValue, int aFlags ) const
|
wxString PGPROPERTY_STRING::ValueToString( wxVariant& aValue, int aFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if( aValue.GetType() != wxPG_VARIANT_TYPE_STRING )
|
if( aValue.GetType() != wxPG_VARIANT_TYPE_STRING )
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
|
@ -579,8 +625,13 @@ wxString PGPROPERTY_STRING::ValueToString( wxVariant& aValue, int aFlags ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool PGPROPERTY_STRING::StringToValue( wxVariant& aVariant, const wxString& aString,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
bool PGPROPERTY_STRING::StringToValue( wxVariant& aVariant, const wxString& aString,
|
bool PGPROPERTY_STRING::StringToValue( wxVariant& aVariant, const wxString& aString,
|
||||||
int aFlags ) const
|
int aFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
aVariant = EscapeString( aString, CTX_QUOTED_STR );
|
aVariant = EscapeString( aString, CTX_QUOTED_STR );
|
||||||
return true;
|
return true;
|
||||||
|
@ -608,19 +659,33 @@ PGPROPERTY_COLOR4D::PGPROPERTY_COLOR4D( const wxString& aLabel, const wxString&
|
||||||
m_backgroundColor( aBackgroundColor )
|
m_backgroundColor( aBackgroundColor )
|
||||||
{
|
{
|
||||||
SetEditor( PG_COLOR_EDITOR::EDITOR_NAME );
|
SetEditor( PG_COLOR_EDITOR::EDITOR_NAME );
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
SetFlag( wxPGPropertyFlags::NoEditor );
|
||||||
|
#else
|
||||||
SetFlag( wxPG_PROP_NOEDITOR );
|
SetFlag( wxPG_PROP_NOEDITOR );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool PGPROPERTY_COLOR4D::StringToValue( wxVariant& aVariant, const wxString& aString,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
bool PGPROPERTY_COLOR4D::StringToValue( wxVariant& aVariant, const wxString& aString,
|
bool PGPROPERTY_COLOR4D::StringToValue( wxVariant& aVariant, const wxString& aString,
|
||||||
int aFlags ) const
|
int aFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
aVariant.SetData( new COLOR4D_VARIANT_DATA( aString ) );
|
aVariant.SetData( new COLOR4D_VARIANT_DATA( aString ) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
wxString PGPROPERTY_COLOR4D::ValueToString( wxVariant& aValue,
|
||||||
|
wxPGPropValFormatFlags aFlags ) const
|
||||||
|
#else
|
||||||
wxString PGPROPERTY_COLOR4D::ValueToString( wxVariant& aValue, int aFlags ) const
|
wxString PGPROPERTY_COLOR4D::ValueToString( wxVariant& aValue, int aFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
wxString ret;
|
wxString ret;
|
||||||
|
|
||||||
|
|
|
@ -87,11 +87,11 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxCHECK_VERSION( 3, 3, 0 )
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
m_grid->AddActionTrigger( wxPGKeyboardActions::NextProperty, WXK_RETURN );
|
m_grid->AddActionTrigger( wxPGKeyboardAction::NextProperty, WXK_RETURN );
|
||||||
m_grid->AddActionTrigger( wxPGKeyboardActions::NextProperty, WXK_NUMPAD_ENTER );
|
m_grid->AddActionTrigger( wxPGKeyboardAction::NextProperty, WXK_NUMPAD_ENTER );
|
||||||
m_grid->AddActionTrigger( wxPGKeyboardActions::NextProperty, WXK_DOWN );
|
m_grid->AddActionTrigger( wxPGKeyboardAction::NextProperty, WXK_DOWN );
|
||||||
m_grid->AddActionTrigger( wxPGKeyboardActions::PrevProperty, WXK_UP );
|
m_grid->AddActionTrigger( wxPGKeyboardAction::PrevProperty, WXK_UP );
|
||||||
m_grid->AddActionTrigger( wxPGKeyboardActions::Edit, WXK_SPACE );
|
m_grid->AddActionTrigger( wxPGKeyboardAction::Edit, WXK_SPACE );
|
||||||
#else
|
#else
|
||||||
m_grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_RETURN );
|
m_grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_RETURN );
|
||||||
m_grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_NUMPAD_ENTER );
|
m_grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_NUMPAD_ENTER );
|
||||||
|
|
|
@ -236,7 +236,12 @@ SIM_ENUM_PROPERTY::SIM_ENUM_PROPERTY( const wxString& aLabel, const wxString& aN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool SIM_ENUM_PROPERTY::IntToValue( wxVariant& aVariant, int aNumber,
|
||||||
|
wxPGPropValFormatFlags aArgFlags ) const
|
||||||
|
#else
|
||||||
bool SIM_ENUM_PROPERTY::IntToValue( wxVariant& aVariant, int aNumber, int aArgFlags ) const
|
bool SIM_ENUM_PROPERTY::IntToValue( wxVariant& aVariant, int aNumber, int aArgFlags ) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if( m_disabled )
|
if( m_disabled )
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -115,7 +115,12 @@ public:
|
||||||
SIM_ENUM_PROPERTY( const wxString& aLabel, const wxString& aName, SIM_MODEL& aModel,
|
SIM_ENUM_PROPERTY( const wxString& aLabel, const wxString& aName, SIM_MODEL& aModel,
|
||||||
int aParamIndex, const wxArrayString& aValues );
|
int aParamIndex, const wxArrayString& aValues );
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool IntToValue( wxVariant& aVariant, int aNumber,
|
||||||
|
wxPGPropValFormatFlags aArgFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
#else
|
||||||
bool IntToValue( wxVariant& aVariant, int aNumber, int aArgFlags = 0 ) const override;
|
bool IntToValue( wxVariant& aVariant, int aNumber, int aArgFlags = 0 ) const override;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SIM_PROPERTY_H
|
#endif // SIM_PROPERTY_H
|
||||||
|
|
|
@ -48,8 +48,15 @@ public:
|
||||||
ORIGIN_TRANSFORMS::COORD_TYPES_T CoordType() const { return m_coordType; }
|
ORIGIN_TRANSFORMS::COORD_TYPES_T CoordType() const { return m_coordType; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToDistance( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const;
|
||||||
|
wxString DistanceToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const;
|
||||||
|
#else
|
||||||
bool StringToDistance( wxVariant& aVariant, const wxString& aText, int aArgFlags = 0 ) const;
|
bool StringToDistance( wxVariant& aVariant, const wxString& aText, int aArgFlags = 0 ) const;
|
||||||
wxString DistanceToString( wxVariant& aVariant, int aArgFlags = 0 ) const;
|
wxString DistanceToString( wxVariant& aVariant, int aArgFlags = 0 ) const;
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
EDA_DRAW_FRAME* m_parentFrame;
|
EDA_DRAW_FRAME* m_parentFrame;
|
||||||
|
@ -62,11 +69,21 @@ class PGPROPERTY_AREA : public wxIntProperty
|
||||||
public:
|
public:
|
||||||
PGPROPERTY_AREA( EDA_DRAW_FRAME* aParentFrame );
|
PGPROPERTY_AREA( EDA_DRAW_FRAME* aParentFrame );
|
||||||
|
|
||||||
|
virtual ~PGPROPERTY_AREA() = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
|
||||||
|
wxString ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
#else
|
||||||
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags = 0 ) const override;
|
int aArgFlags = 0 ) const override;
|
||||||
|
|
||||||
wxString ValueToString( wxVariant& aVariant, int aArgFlags = 0 ) const override;
|
wxString ValueToString( wxVariant& aVariant, int aArgFlags = 0 ) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
wxValidator* DoGetValidator() const override;
|
wxValidator* DoGetValidator() const override;
|
||||||
|
|
||||||
|
@ -80,6 +97,21 @@ class PGPROPERTY_SIZE : public wxUIntProperty, public PGPROPERTY_DISTANCE
|
||||||
public:
|
public:
|
||||||
PGPROPERTY_SIZE( EDA_DRAW_FRAME* aParentFrame );
|
PGPROPERTY_SIZE( EDA_DRAW_FRAME* aParentFrame );
|
||||||
|
|
||||||
|
virtual ~PGPROPERTY_SIZE() = default;
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override
|
||||||
|
{
|
||||||
|
return StringToDistance( aVariant, aText, aFlags );
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override
|
||||||
|
{
|
||||||
|
return DistanceToString( aVariant, aFlags );
|
||||||
|
}
|
||||||
|
#else
|
||||||
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags = 0 ) const override
|
int aArgFlags = 0 ) const override
|
||||||
{
|
{
|
||||||
|
@ -90,6 +122,7 @@ public:
|
||||||
{
|
{
|
||||||
return DistanceToString( aVariant, aArgFlags );
|
return DistanceToString( aVariant, aArgFlags );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool ValidateValue( wxVariant& aValue, wxPGValidationInfo& aValidationInfo ) const override;
|
bool ValidateValue( wxVariant& aValue, wxPGValidationInfo& aValidationInfo ) const override;
|
||||||
|
|
||||||
|
@ -102,6 +135,21 @@ class PGPROPERTY_COORD : public wxIntProperty, public PGPROPERTY_DISTANCE
|
||||||
public:
|
public:
|
||||||
PGPROPERTY_COORD( EDA_DRAW_FRAME* aParentFrame, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType );
|
PGPROPERTY_COORD( EDA_DRAW_FRAME* aParentFrame, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType );
|
||||||
|
|
||||||
|
virtual ~PGPROPERTY_COORD() = default;
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override
|
||||||
|
{
|
||||||
|
return StringToDistance( aVariant, aText, aFlags );
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override
|
||||||
|
{
|
||||||
|
return DistanceToString( aVariant, aFlags );
|
||||||
|
}
|
||||||
|
#else
|
||||||
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags = 0 ) const override
|
int aArgFlags = 0 ) const override
|
||||||
{
|
{
|
||||||
|
@ -112,6 +160,7 @@ public:
|
||||||
{
|
{
|
||||||
return DistanceToString( aVariant, aArgFlags );
|
return DistanceToString( aVariant, aArgFlags );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
wxValidator* DoGetValidator() const override;
|
wxValidator* DoGetValidator() const override;
|
||||||
};
|
};
|
||||||
|
@ -127,9 +176,19 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~PGPROPERTY_ANGLE() = default;
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
|
||||||
|
wxString ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
#else
|
||||||
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags = 0 ) const override;
|
int aArgFlags = 0 ) const override;
|
||||||
wxString ValueToString( wxVariant& aVariant, int aArgFlags = 0 ) const override;
|
wxString ValueToString( wxVariant& aVariant, int aArgFlags = 0 ) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
void SetScale( double aScale )
|
void SetScale( double aScale )
|
||||||
{
|
{
|
||||||
|
@ -155,9 +214,15 @@ public:
|
||||||
wxEnumProperty( wxPG_LABEL, wxPG_LABEL, *aChoices, 0 ),
|
wxEnumProperty( wxPG_LABEL, wxPG_LABEL, *aChoices, 0 ),
|
||||||
m_colorFunc( []( int aDummy ) { return wxNullColour; } )
|
m_colorFunc( []( int aDummy ) { return wxNullColour; } )
|
||||||
{
|
{
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
SetFlag( wxPGPropertyFlags::CustomImage );
|
||||||
|
#else
|
||||||
SetFlag( wxPG_PROP_CUSTOMIMAGE );
|
SetFlag( wxPG_PROP_CUSTOMIMAGE );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~PGPROPERTY_COLORENUM() = default;
|
||||||
|
|
||||||
wxSize OnMeasureImage( int aItem = -1 ) const override;
|
wxSize OnMeasureImage( int aItem = -1 ) const override;
|
||||||
|
|
||||||
void OnCustomPaint( wxDC& aDC, const wxRect& aRect, wxPGPaintData& aPaintData ) override;
|
void OnCustomPaint( wxDC& aDC, const wxRect& aRect, wxPGPaintData& aPaintData ) override;
|
||||||
|
@ -186,10 +251,18 @@ public:
|
||||||
|
|
||||||
virtual ~PGPROPERTY_RATIO() = default;
|
virtual ~PGPROPERTY_RATIO() = default;
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
|
||||||
|
wxString ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
#else
|
||||||
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
int aArgFlags = 0 ) const override;
|
int aArgFlags = 0 ) const override;
|
||||||
|
|
||||||
wxString ValueToString( wxVariant& aVariant, int aArgFlags = 0 ) const override;
|
wxString ValueToString( wxVariant& aVariant, int aArgFlags = 0 ) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool ValidateValue( wxVariant& aValue, wxPGValidationInfo& aValidationInfo ) const override;
|
bool ValidateValue( wxVariant& aValue, wxPGValidationInfo& aValidationInfo ) const override;
|
||||||
|
|
||||||
|
@ -206,10 +279,18 @@ public:
|
||||||
|
|
||||||
virtual ~PGPROPERTY_STRING() = default;
|
virtual ~PGPROPERTY_STRING() = default;
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
|
||||||
|
wxString ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
#else
|
||||||
wxString ValueToString( wxVariant& aValue, int aFlags = 0 ) const override;
|
wxString ValueToString( wxVariant& aValue, int aFlags = 0 ) const override;
|
||||||
|
|
||||||
bool StringToValue( wxVariant& aVariant, const wxString& aString,
|
bool StringToValue( wxVariant& aVariant, const wxString& aString,
|
||||||
int aFlags = 0 ) const override;
|
int aFlags = 0 ) const override;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -234,10 +315,18 @@ public:
|
||||||
|
|
||||||
virtual ~PGPROPERTY_COLOR4D() = default;
|
virtual ~PGPROPERTY_COLOR4D() = default;
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION( 3, 3, 0 )
|
||||||
|
bool StringToValue( wxVariant& aVariant, const wxString& aText,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
|
||||||
|
wxString ValueToString( wxVariant& aVariant,
|
||||||
|
wxPGPropValFormatFlags aFlags = wxPGPropValFormatFlags::Null ) const override;
|
||||||
|
#else
|
||||||
wxString ValueToString( wxVariant& aValue, int aFlags = 0 ) const override;
|
wxString ValueToString( wxVariant& aValue, int aFlags = 0 ) const override;
|
||||||
|
|
||||||
bool StringToValue( wxVariant &aVariant, const wxString &aText,
|
bool StringToValue( wxVariant &aVariant, const wxString &aText,
|
||||||
int aFlags = 0 ) const override;
|
int aFlags = 0 ) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
void SetBackgroundColor( const KIGFX::COLOR4D& aColor ) { m_backgroundColor = aColor; }
|
void SetBackgroundColor( const KIGFX::COLOR4D& aColor ) { m_backgroundColor = aColor; }
|
||||||
const KIGFX::COLOR4D& GetBackgroundColor() const { return m_backgroundColor; }
|
const KIGFX::COLOR4D& GetBackgroundColor() const { return m_backgroundColor; }
|
||||||
|
|
Loading…
Reference in New Issue