Properties: Add text orientation

This commit is contained in:
Jon Evans 2022-12-02 21:33:21 -05:00
parent 2091aaba2f
commit 70f9d8cab9
2 changed files with 11 additions and 0 deletions

View File

@ -1023,6 +1023,10 @@ static struct EDA_TEXT_DESC
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
REGISTER_TYPE( EDA_TEXT );
propMgr.AddProperty( new PROPERTY<EDA_TEXT, double>( _HKI( "Orientation" ),
&EDA_TEXT::SetTextAngleDegrees, &EDA_TEXT::GetTextAngleDegrees,
PROPERTY_DISPLAY::PT_DEGREE ) );
const wxString textProps = _( "Text Properties" );
propMgr.AddProperty( new PROPERTY<EDA_TEXT, wxString>( _HKI( "Text" ),

View File

@ -119,6 +119,13 @@ public:
virtual void SetTextAngle( const EDA_ANGLE& aAngle );
const EDA_ANGLE& GetTextAngle() const { return m_attributes.m_Angle; }
// For property system:
void SetTextAngleDegrees( double aOrientation )
{
SetTextAngle( EDA_ANGLE( aOrientation, DEGREES_T ) );
}
double GetTextAngleDegrees() const { return m_attributes.m_Angle.AsDegrees(); }
void SetItalic( bool aItalic );
bool IsItalic() const { return m_attributes.m_Italic; }