26#ifndef CLASS_SCH_FIELD_H
27#define CLASS_SCH_FIELD_H
55 const wxString& aName = wxEmptyString );
57 SCH_FIELD(
SCH_ITEM* aParent,
int aFieldId,
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 )
110 wxString
GetName(
bool aUseDefaultName =
true )
const;
118 void SetName(
const wxString& aName );
120 void SetText(
const wxString& aText )
override;
130 void SetId(
int aId );
139 int aDepth = 0 )
const;
141 wxString
GetShownText(
bool aAllowExtraText,
int aDepth = 0 )
const override;
152 return name.Trim().empty() && value.Trim().empty();
165 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
214 std::vector<std::unique_ptr<KIFONT::GLYPH>>*
269 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
270 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
284 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
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
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.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Field object used in symbol libraries.
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
wxString GetClass() const override
Return the class name.
COLOR4D m_lastResolvedColor
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
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
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 Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
Print a schematic item.
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.
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
bool IsHorizJustifyFlipped() const
Return whether the field will be rendered with the horizontal justification inverted due to rotation ...
bool IsVertJustifyFlipped() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
EDA_ANGLE GetDrawRotation() const override
Adjusters to allow EDA_TEXT to draw/print/etc.
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
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_SETTINGS &aPlotSettings) const override
Plot the schematic item to aPlotter.
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}.
bool operator==(const SCH_ITEM &aItem) const override
SCH_FIELD & operator=(const SCH_FIELD &aField)
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.
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
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 ImportValues(const LIB_FIELD &aSource)
Copy parameters from a LIB_FIELD source.
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.
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()).
void OnScintillaCharAdded(SCINTILLA_TRICKS *aScintillaTricks, wxStyledTextEvent &aEvent) const
void SetNameShown(bool aShown=true)
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
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.
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ 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