132 const TRANSFORM& aTransform,
bool aDimmed )
140 wxString
text = aData ? *
static_cast<wxString*
>( aData ) :
GetText();
142 if( blackAndWhiteMode || bg == COLOR4D::UNSPECIFIED )
145 if( !blackAndWhiteMode &&
GetTextColor() != COLOR4D::UNSPECIFIED )
178 wxString extended_text = tmp_text.
GetText();
179 extended_text.Append(
'?');
182 extended_text.Append(
'A');
184 tmp_text.
SetText( extended_text );
194 return tmp_text.
TextHitTest( aPosition, aAccuracy );
235 if( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::EQUALITY )
328 const TRANSFORM& aTransform,
bool aDimmed )
const
330 if(
GetText().IsEmpty() || aBackground )
365 if( bg == COLOR4D::UNSPECIFIED )
478 if(
m_name.IsEmpty() && aUseDefaultName )
505 wxFAIL_MSG( wxS(
"trying to set a MANDATORY_FIELD's name\n" ) );
541 aList.emplace_back(
_(
"Field" ),
GetName() );
546 aList.emplace_back(
_(
"Visible" ),
IsVisible() ?
_(
"Yes" ) :
_(
"No" ) );
561 aList.emplace_back(
_(
"H Justification" ), msg );
570 aList.emplace_back(
_(
"V Justification" ), msg );
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.
void SetAttributes(const EDA_TEXT &aSrc)
Set the text attributes from another instance.
virtual bool IsVisible() const
void SetTextPos(const VECTOR2I &aPoint)
KIFONT::FONT * GetFont() const
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 void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
virtual wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const
Return the string actually shown after processing of the base text.
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.
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
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.
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.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
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
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()
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, void *aData=nullptr)
bool GetColorMode() const
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
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)
Print a graphic text through wxDC.
SCH_LAYER_ID
Eeschema drawing layers.
@ LAYER_SELECTION_SHADOWS
Message panel definition file.
wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
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.
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ MANDATORY_FIELDS
The first 4 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)