121 wxString
text = aData ? *static_cast<wxString*>( aData ) :
GetText();
142 wxString extended_text = tmp_text.
GetText();
143 extended_text.Append(
'?');
146 extended_text.Append(
'A');
148 tmp_text.
SetText( extended_text );
158 return tmp_text.
TextHitTest( aPosition, aAccuracy );
195 if( aCompareFlags & LIB_ITEM::COMPARE_FLAGS::EQUALITY )
277 int rot_angle = aRotateCCW ? -900 : 900;
352 wxPoint end = rect.
GetEnd();
395 if(
m_name.IsEmpty() && aUseDefaultName )
421 wxFAIL_MSG( wxT(
"trying to set a MANDATORY_FIELD's name\n" ) );
457 aList.emplace_back(
_(
"Field" ),
GetName() );
462 aList.emplace_back(
_(
"Visible" ),
IsVisible() ?
_(
"Yes" ) :
_(
"No" ) );
476 aList.emplace_back(
_(
"H Justification" ), msg );
485 aList.emplace_back(
_(
"V Justification" ), msg );
Field Reference of part, i.e. "IC21".
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.
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
void MirrorVertical(const wxPoint &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
void Offset(const wxPoint &aOffset)
EDA_ITEM * m_parent
Linked list: Link (parent struct)
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
void print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform) override
Print the field.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void CopyText(const EDA_TEXT &aSrc)
Implementation of conversion functions that require both schematic and board internal units.
void CalcEdit(const wxPoint &aPosition) override
Calculate the new circle at aPosition when editing.
void SetEffects(const EDA_TEXT &aSrc)
Set the text effects from another instance.
Field object used in symbol libraries.
EDA_RECT GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
void SetTextPos(const wxPoint &aPoint)
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
double GetTextAngle() const
void SetOrigin(const wxPoint &pos)
virtual int GetEffectivePenWidth(const RENDER_SETTINGS *aSettings) const
void GRText(wxDC *aDC, const wxPoint &aPos, const COLOR4D &aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Draw a graphic text (like footprint texts).
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
void MoveTo(const wxPoint &aPosition) override
Move a draw object to aPosition.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void RotatePoint(int *pX, int *pY, double angle)
The base class for create windows for drawing purpose.
void SetName(const wxString &aName)
Set a user definable field name to aName.
Define a library symbol object.
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
int GetPenWidth() const override
virtual void SetParent(EDA_ITEM *aParent)
wxString GetName(bool aUseDefaultName=true) const
Return the field name.
The base class for drawable items used by schematic library symbols.
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
void Offset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
int GetTextHeight() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
const wxPoint GetEnd() const
virtual void SetVisible(bool aVisible)
wxString GetTextStyleName() const
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
virtual int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Field Value of part, i.e. "3.3K".
virtual void SetText(const wxString &aText)
SCH_LAYER_ID
Eeschema drawing layers.
int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
virtual bool IsVisible() const
const wxPoint GetOrigin() const
void SetEnd(int x, int y)
const wxSize & GetTextSize() const
int GetUnitCount() const override
For items with units, return the number of units.
void Copy(LIB_FIELD *aTarget) const
Copy parameters of this field to another field.
void Rotate(const wxPoint &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
LIB_FIELD & operator=(const LIB_FIELD &field)
wxDC * GetPrintDC() const
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslate=true)
Return a default symbol field name for field aFieldNdx for all components.
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.
wxString UnescapeString(const wxString &aSource)
void BeginEdit(const wxPoint &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
void Plot(PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) const override
Plot the draw item using the plot object.
LIB_SYMBOL * GetParent() const
Base plotter engine class.
RENDER_SETTINGS * RenderSettings()
TRANSFORM DefaultTransform
BITMAPS
A list of all bitmap identifiers.
Handle the component boundary box.
wxString GetFullText(int unit=1) const
Return the text of a field.
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
A base class for most all the KiCad significant classes used in schematics and boards.
SCH_LAYER_ID GetDefaultLayer() const
const wxPoint & GetTextPos() const
virtual void Text(const wxPoint &aPos, const COLOR4D &aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=nullptr)
Draw text with the plotter.
virtual void SetTextAngle(double aAngle)
wxString m_name
Name (not the field text value itself, that is #EDA_TEXT::m_Text)
void Init(int aId)
Object constructor initialization helper.
Message panel definition file.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual wxString GetShownText(int aDepth=0) const
Return the string actually shown after processing of the base text.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
KICAD_T Type() const
Returns the type of object.
A color representation with 4 components: red, green, blue, alpha.
Field Name Module PCB, i.e. "16DIP300".
bool GetColorMode() const