131 const TRANSFORM& aTransform,
bool aDimmed )
139 wxString
text = aData ? *
static_cast<wxString*
>( aData ) :
GetText();
141 if( blackAndWhiteMode || bg == COLOR4D::UNSPECIFIED )
144 if( !blackAndWhiteMode &&
GetTextColor() != COLOR4D::UNSPECIFIED )
177 wxString extended_text = tmp_text.
GetText();
178 extended_text.Append(
'?');
181 extended_text.Append(
'A');
183 tmp_text.
SetText( extended_text );
193 return tmp_text.
TextHitTest( aPosition, aAccuracy );
257 bool ignoreFieldText =
false;
260 ignoreFieldText =
true;
263 ignoreFieldText =
true;
265 if( !ignoreFieldText )
341 const TRANSFORM& aTransform,
bool aDimmed )
const
343 if(
GetText().IsEmpty() || aBackground )
378 if( bg == COLOR4D::UNSPECIFIED )
383 color = COLOR4D::BLACK;
491 if(
m_name.IsEmpty() && aUseDefaultName )
512 wxFAIL_MSG( wxS(
"trying to set a MANDATORY_FIELD's name\n" ) );
522 return wxString::Format(
"%s '%s'",
552 aList.emplace_back(
_(
"Visible" ),
IsVisible() ?
_(
"Yes" ) :
_(
"No" ) );
567 aList.emplace_back(
_(
"H Justification" ), msg );
576 aList.emplace_back(
_(
"V Justification" ), msg );
582 return BITMAPS::move;
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
void SetOrigin(const Vec &pos)
const Vec & GetOrigin() const
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
void SetEnd(coord_type x, coord_type y)
bool IsHorizontal() const
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM * m_parent
Linked list: Link (parent struct)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
int GetTextHeight() const
BOX2I GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
const VECTOR2I & GetTextPos() const
COLOR4D GetTextColor() const
wxString GetTextStyleName() const
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
void SetTextPos(const VECTOR2I &aPoint)
KIFONT::FONT * GetFont() const
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
void Offset(const VECTOR2I &aOffset)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
virtual bool TextHitTest(const VECTOR2I &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
const TEXT_ATTRIBUTES & GetAttributes() const
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
void CopyText(const EDA_TEXT &aSrc)
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
VECTOR2I GetTextSize() const
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false)
A color representation with 4 components: red, green, blue, alpha.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const wxString & GetDefaultFont() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
wxDC * GetPrintDC() const
Field object used in symbol libraries.
bool m_allowAutoPlace
This field can be autoplaced when converted to a SCH_FIELD.
void SetAutoAdded(bool aAutoAdded)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void Offset(const VECTOR2I &aOffset) override
Set the drawing object by aOffset from the current position.
void Init(int aId)
Object constructor initialization helper.
bool m_autoAdded
Was this field automatically added to a LIB_SYMBOL?
KIFONT::FONT * getDrawFont() const override
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
wxString m_name
Name (not the field text value itself, that is #EDA_TEXT::m_Text)
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, void *aData, const TRANSFORM &aTransform, bool aDimmed) override
Print the field.
bool CanAutoplace() const
SCH_LAYER_ID GetDefaultLayer() const
void Plot(PLOTTER *aPlotter, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed) const override
Plot the draw item using the plot object.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
void SetName(const wxString &aName)
Set a user definable field name to aName.
void Copy(LIB_FIELD *aTarget) const
Copy parameters of this field to another field.
bool m_showInChooser
This field is available as a data column for the chooser.
wxString GetFullText(int unit=1) const
Return the text of a field.
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
void BeginEdit(const VECTOR2I &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
int GetPenWidth() const override
wxString GetShownText(bool aAllowExtraText, int aDepth=0) const override
Return the string actually shown after processing of the base text.
void MirrorHorizontal(const VECTOR2I &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the new circle at aPosition when editing.
void MirrorVertical(const VECTOR2I &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void MoveTo(const VECTOR2I &aPosition) override
Move a draw object to aPosition.
void SetNameShown(bool aShown=true)
LIB_FIELD & operator=(const LIB_FIELD &field)
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void SetCanAutoplace(bool aCanPlace)
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
bool m_showName
Render the field's name in addition to its value.
int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
The base class for drawable items used by schematic library symbols.
const wxString & GetDefaultFont() const
virtual int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
virtual int GetEffectivePenWidth(const RENDER_SETTINGS *aSettings) const
const KIFONT::METRICS & GetFontMetrics() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
LIB_SYMBOL * GetParent() const
Define a library symbol object.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
int GetUnitCount() const override
For items with units, return the number of units.
Base plotter engine class.
RENDER_SETTINGS * RenderSettings()
bool GetColorMode() const
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics, void *aData=nullptr)
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
GR_TEXT_H_ALIGN_T m_Halign
GR_TEXT_V_ALIGN_T m_Valign
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
static constexpr EDA_ANGLE & ANGLE_VERTICAL
static constexpr EDA_ANGLE & ANGLE_90
TRANSFORM DefaultTransform
bool GetGRForceBlackPenState(void)
void GRPrintText(wxDC *aDC, const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics)
Print a graphic text through wxDC.
SCH_LAYER_ID
Eeschema drawing layers.
@ LAYER_SELECTION_SHADOWS
static struct LIB_FIELD_DESC _LIB_FIELD_DESC
Message panel definition file.
wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
wxString UnescapeString(const wxString &aSource)
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslateForHI=false)
Return a default symbol field name for field aFieldNdx for all components.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ MANDATORY_FIELDS
The first 5 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)