26#ifndef CLASS_SCH_FIELD_H
27#define CLASS_SCH_FIELD_H
54 const wxString& aName = wxEmptyString );
57 const wxString& aName = wxEmptyString );
73 return wxT(
"SCH_FIELD" );
76 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override
81 for(
KICAD_T scanType : aScanTypes )
115 wxString
GetName(
bool aUseDefaultName =
true )
const;
123 void SetName(
const wxString& aName );
125 void SetText(
const wxString& aText )
override;
135 void SetId(
int aId );
144 int aDepth = 0 )
const;
146 wxString
GetShownText(
bool aAllowExtraText,
int aDepth = 0 )
const override;
168 return name.Trim().empty() && value.Trim().empty();
184 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
235 std::vector<std::unique_ptr<KIFONT::GLYPH>>*
272 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
273 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
276 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
override;
279 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
override;
309 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
329 int compare(
const SCH_ITEM& aOther,
int aCompareFlags = 0 )
const override;
BITMAPS
A list of all bitmap identifiers.
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.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
const VECTOR2I & GetTextPos() const
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
virtual const wxString & GetText() const
Return the string associated with the text object.
void Offset(const VECTOR2I &aOffset)
FONT is an abstract base class for both outline and stroke fonts.
A color representation with 4 components: red, green, blue, alpha.
Base plotter engine class.
Schematic editor (Eeschema) main window.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
void ClearRenderCache() override
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
wxString GetClass() const override
Return the class name.
COLOR4D m_lastResolvedColor
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
wxString GetFullText(int unit=1) const
Return the text of a field.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
std::vector< std::unique_ptr< KIFONT::GLYPH > > m_renderCache
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
VECTOR2I GetPosition() const override
void SetEffectiveHorizJustify(GR_TEXT_H_ALIGN_T)
int GetSchTextSize() const
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData=nullptr) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
void SetLastResolvedState(const SCH_ITEM *aItem) override
bool m_showName
Render the field name in addition to its value.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
static bool ClassOf(const EDA_ITEM *aItem)
bool IsHypertext() const override
Allow items to support hypertext actions when hovered/clicked.
bool m_autoAdded
Was this field automatically added to a LIB_SYMBOL?
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
SCH_LAYER_ID GetDefaultLayer() const
bool IsHorizJustifyFlipped() const
Return whether the field will be rendered with the horizontal justification inverted due to rotation ...
bool IsVertJustifyFlipped() const
EDA_ANGLE GetDrawRotation() const override
Adjusters to allow EDA_TEXT to draw/print/etc.
void SetEffectiveVertJustify(GR_TEXT_V_ALIGN_T)
void CalcEdit(const VECTOR2I &aPosition) override
Calculate the attributes of an item at aPosition when it is being edited.
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void SetCanAutoplace(bool aCanPlace)
bool m_isNamedVariable
If the field name is a variable name, e.g.
void DoHypertextAction(EDA_DRAW_FRAME *aFrame) const override
int GetPenWidth() const override
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
COLOR4D GetFieldColor() const
bool IsNamedVariable() const
Named variables are fields whose names are variables like ${VAR}.
wxString GetFriendlyName() const override
bool operator==(const SCH_ITEM &aItem) const override
SCH_FIELD & operator=(const SCH_FIELD &aField)
void ImportValues(const SCH_FIELD &aSource)
Copy parameters from a SCH_FIELD source.
void SetAutoAdded(bool aAutoAdded)
bool operator<(const SCH_ITEM &aItem) const override
wxString GetShownName() const
Gets the fields name as displayed on the schematic or in the symbol fields table.
VECTOR2I GetLibPosition() const
bool IsEmpty()
Return true if both the name and value of the field are empty.
void BeginEdit(const VECTOR2I &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
void SetShowInChooser(bool aShow=true)
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
void SetSchTextSize(int aSize)
GR_TEXT_H_ALIGN_T GetEffectiveHorizJustify() const
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
void SetPosition(const VECTOR2I &aPosition) override
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void SetName(const wxString &aName)
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
VECTOR2I m_renderCachePos
bool CanAutoplace() const
std::vector< std::unique_ptr< KIFONT::GLYPH > > * GetRenderCache(const wxString &forResolvedText, const VECTOR2I &forPosition, TEXT_ATTRIBUTES &aAttrs) const
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 ShowInChooser() const
void ClearCaches() override
void SetText(const wxString &aText) override
VECTOR2I GetParentPosition() const
const KIFONT::METRICS & getFontMetrics() const override
const wxString & GetInternalName()
Get the initial name of the field set at creation (or set by SetName()).
bool m_showInChooser
This field is available as a data column for the chooser.
void OnScintillaCharAdded(SCINTILLA_TRICKS *aScintillaTricks, wxStyledTextEvent &aEvent) const
void SetNameShown(bool aShown=true)
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void Copy(SCH_FIELD *aTarget) const
Copy parameters of this field to another field.
KIFONT::FONT * getDrawFont() const override
bool m_allowAutoPlace
This field can be autoplaced.
Base class for any item which can be embedded within the SCHEMATIC container class,...
const KIFONT::METRICS & GetFontMetrics() const
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
SCH_LAYER_ID
Eeschema drawing layers.
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ INVALID_FIELD
The field ID hasn't been set yet; field is invalid.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ SCH_FIELD_LOCATE_REFERENCE_T
@ SCH_FIELD_LOCATE_FOOTPRINT_T
@ SCH_FIELD_LOCATE_VALUE_T
@ SCH_FIELD_LOCATE_DATASHEET_T
VECTOR2< int32_t > VECTOR2I