61 const wxString& aName ) :
66 m_allowAutoPlace( true ),
68 m_showInChooser( true ),
69 m_renderCacheValid( false ),
104 for(
const std::unique_ptr<KIFONT::GLYPH>& glyph : aField.
m_renderCache )
107 m_renderCache.emplace_back( std::make_unique<KIFONT::OUTLINE_GLYPH>( *outline ) );
109 m_renderCache.emplace_back( std::make_unique<KIFONT::STROKE_GLYPH>( *stroke ) );
132 for(
const std::unique_ptr<KIFONT::GLYPH>& glyph : aField.
m_renderCache )
135 m_renderCache.emplace_back( std::make_unique<KIFONT::OUTLINE_GLYPH>( *outline ) );
137 m_renderCache.emplace_back( std::make_unique<KIFONT::STROKE_GLYPH>( *stroke ) );
214 std::function<bool( wxString* )> libSymbolResolver =
215 [&]( wxString* token ) ->
bool
221 std::function<bool( wxString* )> symbolResolver =
222 [&]( wxString* token ) ->
bool
228 std::function<bool( wxString* )> schematicResolver =
229 [&]( wxString* token ) ->
bool
235 return schematic->ResolveTextVar( aPath, token, aDepth + 1 );
240 std::function<bool( wxString* )> sheetResolver =
241 [&]( wxString* token ) ->
bool
250 path.push_back( sheet );
260 std::function<bool( wxString* )> labelResolver =
261 [&]( wxString* token ) ->
bool
275 if(
text == wxS(
"~" ) )
283 for(
int ii = 0; ii < 10 &&
text.Contains( wxT(
"${" ) ); ++ii )
331 return GetShownText( &schematic->CurrentSheet(), aAllowExtraText, aDepth );
333 return GetShownText(
nullptr, aAllowExtraText, aDepth );
383std::vector<std::unique_ptr<KIFONT::GLYPH>>*
413 if( glyph->IsOutline() )
430 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
455 if( !blackAndWhiteMode &&
GetTextColor() != COLOR4D::UNSPECIFIED )
523 wxCHECK_RET( aItem && aItem->
Type() ==
SCH_FIELD_T, wxT(
"Cannot swap with invalid item." ) );
654 return render_center.
y > pos.
y;
656 return render_center.
x < pos.
x;
659 return render_center.
y < pos.
y;
661 return render_center.
x > pos.
x;
681 actualJustify = aJustify;
711 return render_center.
x < pos.
x;
713 return render_center.
y < pos.
y;
716 return render_center.
x > pos.
x;
718 return render_center.
y > pos.
y;
738 actualJustify = aJustify;
761 bool searchHiddenFields =
false;
762 bool searchAndReplace =
false;
763 bool replaceReferences =
false;
772 catch(
const std::bad_cast& )
778 if( !
IsVisible() && !searchHiddenFields )
783 if( searchAndReplace && !replaceReferences )
787 wxASSERT( aAuxData );
809 wxStyledTextEvent &aEvent )
const
817 wxStyledTextCtrl* scintilla = aScintillaTricks->
Scintilla();
818 int key = aEvent.GetKey();
820 wxArrayString autocompleteTokens;
821 int pos = scintilla->GetCurrentPos();
822 int start = scintilla->WordStartPosition( pos,
true );
828 wxString
text = scintilla->GetText();
829 int currpos = scintilla->GetCurrentPos();
830 text.Replace( wxS(
"\n" ), wxS(
"" ) );
831 scintilla->SetText(
text );
832 scintilla->GotoPos( currpos-1 );
840 && scintilla->GetCharAt( pt - 2 ) ==
'$'
841 && scintilla->GetCharAt( pt - 1 ) ==
'{';
845 if( start > 1 && scintilla->GetCharAt( start - 1 ) ==
':' )
847 int refStart = scintilla->WordStartPosition( start - 1,
true );
849 if( textVarRef( refStart ) )
851 partial = scintilla->GetRange( start, pos );
853 wxString ref = scintilla->GetRange( refStart, start - 1 );
855 if( ref == wxS(
"OP" ) )
867 if(
pin.StartsWith(
'<' ) &&
pin.EndsWith(
'>' ) )
868 autocompleteTokens.push_back(
pin.Mid( 1,
pin.Length() - 2 ) );
870 autocompleteTokens.push_back(
pin );
881 for(
size_t jj = 0; jj < refs.
GetCount(); jj++ )
883 if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(),
true ) == ref )
885 refSymbol = refs[ jj ].GetSymbol();
895 else if( textVarRef( start ) )
897 partial = scintilla->GetTextRange( start, pos );
917 for( std::pair<wxString, wxString> entry : schematic->
Prj().
GetTextVars() )
918 autocompleteTokens.push_back( entry.first );
922 scintilla->SetFocus();
946 bool replaceReferences =
false;
953 catch(
const std::bad_cast& )
958 bool isReplaced =
false;
967 wxCHECK_MSG( aAuxData,
false, wxT(
"Need sheetpath to replace in refdes." ) );
969 if( !replaceReferences )
981 wxCHECK_MSG( aAuxData,
false, wxT(
"Need sheetpath to replace in value field." ) );
992 wxCHECK_MSG( aAuxData,
false, wxT(
"Need sheetpath to replace in footprint field." ) );
1069 wxString::Format( wxT(
"SCH_FIELD text angle is not horizontal or vertical: %d" ),
1117 return wxString::Format(
_(
"Field %s '%s'" ),
1132 aList.emplace_back(
_(
"Visible" ),
IsVisible() ?
_(
"Yes" ) :
_(
"No" ) );
1148 aList.emplace_back(
_(
"H Justification" ), msg );
1158 aList.emplace_back(
_(
"V Justification" ), msg );
1164 constexpr int START_ID = 1;
1173 std::vector<std::pair<wxString, wxString>> pages;
1177 for(
int i = 0; i < (int) pages.size(); ++i )
1179 menu.Append( i + START_ID, wxString::Format(
_(
"Go to Page %s (%s)" ),
1181 pages[i].second ) );
1184 menu.AppendSeparator();
1185 menu.Append( 999 + START_ID,
_(
"Back to Previous Selected Sheet" ) );
1187 int sel = aFrame->GetPopupMenuSelectionFromUser( menu ) - START_ID;
1189 if( sel >= 0 && sel < (
int) pages.size() )
1190 href = wxT(
"#" ) + pages[ sel ].first;
1191 else if( sel == 999 )
1194 if( !href.IsEmpty() )
1234 else if(
m_name.IsEmpty() && aUseDefaultName )
1241 else if(
m_name.IsEmpty() && aUseDefaultName )
1263 return wxT(
"Sheetname" );
1265 return wxT(
"Sheetfile" );
1270 if(
m_name ==
_(
"Net Class" ) ||
m_name == wxT(
"Net Class" ) )
1272 return wxT(
"Netclass" );
1274 else if(
m_name ==
_(
"Sheet References" )
1275 ||
m_name == wxT(
"Sheet References" )
1276 ||
m_name == wxT(
"Intersheet References" ) )
1278 return wxT(
"Intersheetrefs" );
1293 case VALUE_FIELD:
return BITMAPS::edit_comp_value;
1295 default:
return BITMAPS::text;
1299 return BITMAPS::text;
1356 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
1374 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
1375 bg = COLOR4D::WHITE;
1382 color.Desaturate( );
1386 penWidth = std::max( penWidth, renderSettings->
GetMinPenWidth() );
1448 std::vector<std::pair<wxString, wxString>> pages;
1449 std::vector<wxString> pageHrefs;
1456 for(
const auto& [ pageNumber, sheetName ] : pages )
1457 pageHrefs.push_back( wxT(
"#" ) + pageNumber );
1522 auto field =
static_cast<const SCH_FIELD*
>( &aItem );
1524 if(
GetId() != field->GetId() )
1525 return GetId() < field->GetId();
1527 if(
GetText() != field->GetText() )
1528 return GetText() < field->GetText();
1536 return GetName() < field->GetName();
1547 return *
this == field;
1589 double similarity = 0.99;
1624 int compareFlags = aCompareFlags;
1662 bool ignoreFieldText =
false;
1665 ignoreFieldText =
true;
1668 ignoreFieldText =
true;
1670 if( !ignoreFieldText )
1710 if( h_inst.Choices().GetCount() == 0)
1719 if( v_inst.Choices().GetCount() == 0)
1733 const wxString textProps =
_HKI(
"Text Properties" );
1760 _HKI(
"Text Properties" ) );
1764 auto isNotNamedVariable =
1768 return !field->IsNamedVariable();
1774 isNotNamedVariable );
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr const Vec GetEnd() const
constexpr void SetOrigin(const Vec &pos)
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr Vec Centre() const
constexpr bool Contains(const Vec &aPoint) const
constexpr void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
constexpr const Vec & GetOrigin() const
constexpr void SetEnd(coord_type x, coord_type y)
constexpr void Offset(coord_type dx, coord_type dy)
constexpr bool Intersects(const BOX2< Vec > &aRect) const
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.
virtual VECTOR2I GetPosition() const
KICAD_T Type() const
Returns the type of object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
EDA_ITEM * GetParent() const
EDA_ITEM * m_parent
Linked list: Link (parent struct)
bool IsForceVisible() const
static bool Replace(const EDA_SEARCH_DATA &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
int GetTextHeight() const
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.
BOX2I GetTextBox(int aLine=-1) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
EDA_TEXT & operator=(const EDA_TEXT &aItem)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
bool Replace(const EDA_SEARCH_DATA &aSearchData)
Helper function used in search and replace dialog.
virtual void SetVisible(bool aVisible)
virtual void ClearBoundingBoxCache()
double Similarity(const EDA_TEXT &aOther) const
virtual void ClearRenderCache()
const TEXT_ATTRIBUTES & GetAttributes() const
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
void SwapAttributes(EDA_TEXT &aTradingPartner)
Swap the text attributes of the two involved instances.
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)
void SwapText(EDA_TEXT &aTradingPartner)
bool operator==(const EDA_TEXT &aRhs) const
VECTOR2I GetTextSize() const
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
static ENUM_MAP< T > & Instance()
Class that other classes need to inherit from, in order to be inspectable.
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, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
virtual bool IsOutline() const
Class OUTLINE_FONT implements outline font drawing.
void GetLinesAsGlyphs(std::vector< std::unique_ptr< GLYPH > > *aGlyphs, const wxString &aText, const VECTOR2I &aPosition, const TEXT_ATTRIBUTES &aAttrs, const METRICS &aFontMetrics) const
A color representation with 4 components: red, green, blue, alpha.
int GetDefaultPenWidth() const
int GetMinPenWidth() const
const wxString & GetDefaultFont() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
Define a library symbol object.
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
static wxString LetterSubReference(int aUnit, int aFirstId)
A singleton reporter that reports to nowhere.
Base plotter engine class.
bool GetColorMode() const
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont=nullptr, const KIFONT::METRICS &aFontMetrics=KIFONT::METRICS::Default(), void *aData=nullptr)
virtual void HyperlinkMenu(const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
Create a clickable hyperlink menu with a rectangular click area.
virtual std::map< wxString, wxString > & GetTextVars() const
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.
PROPERTY_BASE & ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew, const wxString &aGroup=wxEmptyString)
Replace an existing property for a specific type.
void OverrideWriteability(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName, std::function< bool(INSPECTABLE *)> aFunc)
Sets an override writeability functor for a base class property of a given derived class.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
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.
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
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 ...
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.
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.
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}.
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.
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.
SCH_FIELD(const VECTOR2I &aPos, int aFieldId, SCH_ITEM *aParent, const wxString &aName=wxEmptyString)
void BeginEdit(const VECTOR2I &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
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
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
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.
void ClearCaches() override
void SetText(const wxString &aText) override
VECTOR2I GetParentPosition() const
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.
VECTOR2I GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
Base class for any item which can be embedded within the SCHEMATIC container class,...
const wxString & GetDefaultFont() const
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
const SYMBOL * GetParentSymbol() const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
void SetLayer(SCH_LAYER_ID aLayer)
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
virtual int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
bool IsConnectivityDirty() const
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
const KIFONT::METRICS & GetFontMetrics() const
double SimilarityBase(const SCH_ITEM &aItem) const
Calculate the boilerplate similarity for all LIB_ITEMs without preventing the use above of a pure vir...
void GetIntersheetRefs(const SCH_SHEET_PATH *aPath, std::vector< std::pair< wxString, wxString > > *pages)
Builds an array of { pageNumber, pageName } pairs.
virtual bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
static const wxString GetDefaultFieldName(const wxString &aName, bool aUseDefaultName)
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
VECTOR2I GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated=true)
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
wxString SubReference(int aUnit, bool aAddSeparator=true) const
void SetValueFieldText(const wxString &aValue)
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
void SetFootprintFieldText(const wxString &aFootprint)
VECTOR2I GetPosition() const override
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
TRANSFORM & GetTransform()
int GetUnitSelection(const SCH_SHEET_PATH *aSheet) const
Return the instance-specific unit selection for the given sheet path.
int GetUnitCount() const override
Return the number of units per package of the symbol.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
wxStyledTextCtrl * Scintilla() const
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
SIM_MODEL & CreateModel(SIM_MODEL::TYPE aType, const std::vector< SCH_PIN * > &aPins, REPORTER &aReporter)
virtual std::vector< std::string > GetPinNames() 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) const
A lower-precision version of StringFromValue().
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
wxString GetTextVars(const wxString &aSource)
Returns any variables unexpanded, e.g.
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
static constexpr EDA_ANGLE ANGLE_270
#define STRUCT_DELETED
flag indication structures to be erased
#define SKIP_STRUCT
flag indicating that the structure should be ignored
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
KICOMMON_API wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
KICOMMON_API wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
static GR_TEXT_H_ALIGN_T horizJustify(const char *horizontal)
#define DECLARE_ENUM_TO_WXANY(type)
static const std::vector< KICAD_T > labelTypes
static struct SCH_FIELD_DESC _SCH_FIELD_DESC
@ SHEET_MANDATORY_FIELDS
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
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.
Definition for symbol library class.
wxString GetCanonicalFieldName(int idx)
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ 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".
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
wxLogTrace helper definitions.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
VECTOR2< int32_t > VECTOR2I