KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_field.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2022 CERN
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#pragma once
27
28
29#include <eda_text.h>
30#include <sch_item.h>
31#include <template_fieldnames.h>
32#include <general.h>
33#include <string_utils.h>
34#include "scintilla_tricks.h"
35#include <algorithm>
36
37class SCH_EDIT_FRAME;
38class SCH_TEXT;
39
40
42{
44 std::vector<std::unique_ptr<KIFONT::GLYPH>> glyphs;
45};
46
47
48class SCH_FIELD : public SCH_ITEM, public EDA_TEXT
49{
50public:
51 SCH_FIELD(); // For std::map::operator[]
52
53 explicit SCH_FIELD( SCH_ITEM* aParent, FIELD_T aFieldId = FIELD_T::USER, const wxString& aName = wxEmptyString );
54
55 explicit SCH_FIELD( SCH_ITEM* aParent, SCH_TEXT* aText );
56
57 SCH_FIELD( const SCH_FIELD& aText );
58
59 void Serialize( google::protobuf::Any& aContainer ) const override;
60 bool Deserialize( const google::protobuf::Any& aContainer ) override;
61
62 ~SCH_FIELD() override
63 { }
64
65 SCH_FIELD& operator=( const SCH_FIELD& aField );
66
67 static bool ClassOf( const EDA_ITEM* aItem )
68 {
69 return aItem && SCH_FIELD_T == aItem->Type();
70 }
71
72 wxString GetClass() const override
73 {
74 return wxT( "SCH_FIELD" );
75 }
76
77 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
78 {
79 if( SCH_ITEM::IsType( aScanTypes ) )
80 return true;
81
82 for( KICAD_T scanType : aScanTypes )
83 {
85 return true;
86 else if ( scanType == SCH_FIELD_LOCATE_VALUE_T && m_id == FIELD_T::VALUE )
87 return true;
88 else if ( scanType == SCH_FIELD_LOCATE_FOOTPRINT_T && m_id == FIELD_T::FOOTPRINT )
89 return true;
90 else if ( scanType == SCH_FIELD_LOCATE_DATASHEET_T && m_id == FIELD_T::DATASHEET )
91 return true;
92 }
93
94 return false;
95 }
96
97 wxString GetFriendlyName() const override
98 {
99 return _( "Field" );
100 }
101
102 bool HasHypertext() const override;
103
104 void DoHypertextAction( EDA_DRAW_FRAME* aFrame, const VECTOR2I& aMousePos ) const override;
105
112 wxString GetName( bool aUseDefaultName = true ) const;
113
117 wxString GetCanonicalName() const;
118
124 static bool IsNetclassLabelFieldName( const wxString& aName );
125
126 void SetName( const wxString& aName );
127
128 void SetText( const wxString& aText ) override;
129
130 void SetText( const wxString& aText, const SCH_SHEET_PATH* aPath, const wxString& aVariantName = wxEmptyString );
131
132 virtual const wxString& GetText() const override { return EDA_TEXT::GetText(); }
133
134 wxString GetText( const SCH_SHEET_PATH* aPath, const wxString& aVariantName = wxEmptyString ) const;
135
136 FIELD_T GetId() const { return m_id; }
137
138 int GetOrdinal() const
139 {
140 return IsMandatory() ? (int) m_id : m_ordinal;
141 }
142 void SetOrdinal( int aOrdinal )
143 {
145 m_ordinal = aOrdinal;
146 }
147
153 wxString GetShownName() const;
154 wxString GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraText, int aDepth = 0,
155 const wxString& aVariantName = wxEmptyString ) const;
156
157 wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override;
158
168 wxString GetFullText( int unit = 1 ) const;
169
175 bool IsEmpty()
176 {
177 wxString name( m_name );
178 wxString value( GetText() );
179
180 return name.Trim().empty() && value.Trim().empty();
181 }
182
183 int GetSchTextSize() const { return GetTextWidth(); }
184 void SetSchTextSize( int aSize ) { SetTextSize( VECTOR2I( aSize, aSize ) ); }
185
186 COLOR4D GetFieldColor() const;
187
188 void SetLastResolvedState( const SCH_ITEM* aItem ) override
189 {
190 const SCH_FIELD* aField = dynamic_cast<const SCH_FIELD*>( aItem );
191
192 if( aField )
194 }
195
196 std::vector<int> ViewGetLayers() const override;
197
199
203 EDA_ANGLE GetDrawRotation() const override;
204
205 KIFONT::FONT* GetDrawFont( const RENDER_SETTINGS* aSettings ) const override;
206
207 const BOX2I GetBoundingBox() const override;
208
213 bool IsHorizJustifyFlipped() const;
214 bool IsVertJustifyFlipped() const;
215
218
221
222 bool IsNameShown() const { return m_showName; }
223 void SetNameShown( bool aShown = true ) { m_showName = aShown; }
224
231 bool IsGeneratedField() const { return m_isGeneratedField; }
232
233 bool CanAutoplace() const { return m_allowAutoPlace; }
234 void SetCanAutoplace( bool aCanPlace ) { m_allowAutoPlace = aCanPlace; }
235
236 void swapData( SCH_ITEM* aItem ) override;
237
238 int GetPenWidth() const override;
239
240 bool IsAutoAdded() const { return m_autoAdded; }
241 void SetAutoAdded( bool aAutoAdded ) { m_autoAdded = aAutoAdded; }
242
243 bool ShowInChooser() const { return m_showInChooser; }
244 void SetShowInChooser( bool aShow = true ) { m_showInChooser = aShow; }
245
246 void ClearCaches() override;
247 void ClearRenderCache() override;
248
249 std::vector<std::unique_ptr<KIFONT::GLYPH>>*
250 GetRenderCache( const wxString& forResolvedText, const VECTOR2I& forPosition, TEXT_ATTRIBUTES& aAttrs ) const;
251
252 void Move( const VECTOR2I& aMoveVector ) override
253 {
254 Offset( aMoveVector );
255 }
256
257 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) override;
258
259 void MirrorVertically( int aCenter ) override;
260 void MirrorHorizontally( int aCenter ) override;
261
262 void BeginEdit( const VECTOR2I& aStartPoint ) override;
263 void CalcEdit( const VECTOR2I& aPosition ) override;
264
265 void OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks, wxStyledTextEvent &aEvent ) const;
266
267 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
268
269 bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData = nullptr ) override;
270
271 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
272 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
273
274 BITMAPS GetMenuImage() const override;
275
276 bool IsReplaceable() const override;
277
278 bool IsLocked() const override;
279
281
282 VECTOR2I GetPosition() const override;
283 void SetPosition( const VECTOR2I& aPosition ) override;
284
286
287 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
288 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
289 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
290
291 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
292 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
293
294 EDA_ITEM* Clone() const override;
295
303 void ImportValues( const SCH_FIELD& aSource );
304
312 void Copy( SCH_FIELD* aTarget ) const;
313
314 bool IsMandatory() const;
315
316 bool operator <( const SCH_ITEM& aItem ) const override;
317
318 double Similarity( const SCH_ITEM& aItem ) const override;
319
320 bool operator==( const SCH_ITEM& aItem ) const override;
321 bool operator==( const SCH_FIELD& aItem ) const;
322
323#if defined(DEBUG)
324 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
325#endif
326
327protected:
329
330 const KIFONT::METRICS& getFontMetrics() const override { return GetFontMetrics(); }
331
344 int compare( const SCH_ITEM& aOther, int aCompareFlags = 0 ) const override;
345
346 void setId( FIELD_T aId );
347
348 wxString getUnescapedText( const SCH_SHEET_PATH* aPath = nullptr,
349 const wxString& aVariantName = wxEmptyString ) const;
350
351private:
354 wxString m_name;
355
360
363
364 mutable std::unique_ptr<SCH_FIELD_RENDER_CACHE_DATA> m_renderCache;
365
367};
368
369
370inline int NextFieldOrdinal( const std::vector<SCH_FIELD>& aFields )
371{
372 int ordinal = 42; // Arbitrarily larger than any mandatory FIELD_T id
373
374 for( const SCH_FIELD& field : aFields )
375 ordinal = std::max( ordinal, field.GetOrdinal() + 1 );
376
377 return ordinal;
378}
379
380
381inline const SCH_FIELD* FindField( const std::vector<SCH_FIELD>& aFields, FIELD_T aFieldId )
382{
383 for( const SCH_FIELD& field : aFields )
384 {
385 if( field.GetId() == aFieldId )
386 return &field;
387 }
388
389 return nullptr;
390}
391
392
393inline SCH_FIELD* FindField( std::vector<SCH_FIELD>& aFields, FIELD_T aFieldId )
394{
395 const std::vector<SCH_FIELD>& constFields = const_cast<const std::vector<SCH_FIELD>&>( aFields );
396 return const_cast<SCH_FIELD*>( FindField( constFields, aFieldId ) );
397}
398
399
400inline const SCH_FIELD* FindField( const std::vector<SCH_FIELD>& aFields, const wxString& aFieldName )
401{
402 for( const SCH_FIELD& field : aFields )
403 {
404 if( field.GetName() == aFieldName )
405 return &field;
406 }
407
408 return nullptr;
409}
410
411
412inline SCH_FIELD* FindField( std::vector<SCH_FIELD>& aFields, const wxString& aFieldName )
413{
414 const std::vector<SCH_FIELD>& constFields = const_cast<const std::vector<SCH_FIELD>&>( aFields );
415 return const_cast<SCH_FIELD*>( FindField( constFields, aFieldName ) );
416}
417
418
419inline wxString GetFieldValue( const std::vector<SCH_FIELD>* aFields, FIELD_T aFieldType )
420{
421 if( !aFields )
422 return wxEmptyString;
423
424 if( const SCH_FIELD* field = FindField( *aFields, aFieldType ) )
425 return field->GetText();
426
427 return wxEmptyString;
428}
429
430
431inline std::string GetFieldValue( const std::vector<SCH_FIELD>* aFields, const wxString& aFieldName,
432 bool aResolve, int aDepth )
433{
434 if( !aFields )
435 return "";
436
437 if( const SCH_FIELD* field = FindField( *aFields, aFieldName ) )
438 return ( aResolve ? field->GetShownText( false, aDepth ) : field->GetText() ).ToStdString();
439
440 return "";
441}
442
443
444inline void SetFieldValue( std::vector<SCH_FIELD>& aFields, const wxString& aFieldName,
445 const std::string& aValue, bool aIsVisible = true,
446 const SCH_SHEET_PATH* aSheetPath = nullptr, const wxString& aVariantName = wxEmptyString )
447{
448 if( !aSheetPath || aVariantName.empty() )
449 {
450 // Without a sheet path this is a local write (usually to the Symbol Properties dialog's copy of the
451 // fields). Variant handling will apply only when the local fields are written back to the symbol.
452
453 if( aValue == "" )
454 {
455 std::erase_if( aFields, [&]( const SCH_FIELD& field )
456 {
457 return field.GetName() == aFieldName;
458 } );
459 return;
460 }
461
462 if( SCH_FIELD* field = FindField( aFields, aFieldName ) )
463 {
464 field->SetText( aValue );
465 return;
466 }
467
468 SCH_ITEM* parent = static_cast<SCH_ITEM*>( aFields.at( 0 ).GetParent() );
469 aFields.emplace_back( parent, FIELD_T::USER, aFieldName );
470
471 aFields.back().SetText( aValue );
472 aFields.back().SetVisible( aIsVisible );
473 return;
474 }
475
476 if( SCH_FIELD* field = FindField( aFields, aFieldName ) )
477 {
478 field->SetText( aValue, aSheetPath, aVariantName );
479 return;
480 }
481
482 SCH_ITEM* parent = static_cast<SCH_ITEM*>( aFields.at( 0 ).GetParent() );
483 aFields.emplace_back( parent, FIELD_T::USER, aFieldName );
484
485 // Since the default variant doesn't have this field at all, we're going to set it to the same value
486 // and visibility as specified for the variant. We therefore don't really have a variant at all, so we
487 // can ignore variant processing here.
488 aFields.back().SetText( aValue );
489 aFields.back().SetVisible( aIsVisible );
490}
const char * name
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:100
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:112
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:41
const VECTOR2I & GetTextPos() const
Definition eda_text.h:298
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
Definition eda_text.cpp:536
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:114
int GetTextWidth() const
Definition eda_text.h:289
void Offset(const VECTOR2I &aOffset)
Definition eda_text.cpp:598
EDA_TEXT(const EDA_IU_SCALE &aIuScale, const wxString &aText=wxEmptyString)
Definition eda_text.cpp:102
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:98
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:105
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Base plotter engine class.
Definition plotter.h:137
Schematic editor (Eeschema) main window.
friend class SCH_IO_KICAD_SEXPR_PARSER
Definition sch_field.h:328
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.
Definition sch_field.h:72
void SetOrdinal(int aOrdinal)
Definition sch_field.h:142
COLOR4D m_lastResolvedColor
Definition sch_field.h:366
bool IsAutoAdded() const
Definition sch_field.h:240
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
bool IsMandatory() 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.
~SCH_FIELD() override
Definition sch_field.h:62
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool IsLocked() const override
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
VECTOR2I GetPosition() const override
void SetEffectiveHorizJustify(GR_TEXT_H_ALIGN_T)
int GetSchTextSize() const
Definition sch_field.h:183
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
Definition sch_field.h:188
bool m_showName
Render the field name in addition to its value.
Definition sch_field.h:356
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.
Definition sch_field.h:77
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)
Definition sch_field.h:67
bool IsNameShown() const
Definition sch_field.h:222
bool m_autoAdded
Was this field automatically added to a LIB_SYMBOL?
Definition sch_field.h:361
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
std::unique_ptr< SCH_FIELD_RENDER_CACHE_DATA > m_renderCache
Definition sch_field.h:364
bool IsGeneratedField() const
Generated fields are fields whose names are variables like ${VAR}.
Definition sch_field.h:231
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 HasHypertext() const override
Indicates that the item has at least one hypertext action.
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.
virtual const wxString & GetText() const override
Return the string associated with the text object.
Definition sch_field.h:132
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.
FIELD_T GetId() const
Definition sch_field.h:136
void SetCanAutoplace(bool aCanPlace)
Definition sch_field.h:234
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,...
bool m_isGeneratedField
If the field name is a variable name (e.g.
Definition sch_field.h:358
int m_ordinal
Sort order for non-mandatory fields.
Definition sch_field.h:353
COLOR4D GetFieldColor() const
wxString getUnescapedText(const SCH_SHEET_PATH *aPath=nullptr, const wxString &aVariantName=wxEmptyString) const
wxString GetFriendlyName() const override
Definition sch_field.h:97
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)
Definition sch_field.h:241
bool operator<(const SCH_ITEM &aItem) const override
FIELD_T m_id
Field id,.
Definition sch_field.h:352
void DoHypertextAction(EDA_DRAW_FRAME *aFrame, const VECTOR2I &aMousePos) const override
wxString GetShownName() const
Get the field's name as displayed on the schematic or in the symbol fields table.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
VECTOR2I GetLibPosition() const
Definition sch_field.h:280
void setId(FIELD_T aId)
int GetOrdinal() const
Definition sch_field.h:138
bool IsEmpty()
Return true if both the name and value of the field are empty.
Definition sch_field.h:175
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0, const wxString &aVariantName=wxEmptyString) const
KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const override
void BeginEdit(const VECTOR2I &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
void SetShowInChooser(bool aShow=true)
Definition sch_field.h:244
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
void SetSchTextSize(int aSize)
Definition sch_field.h:184
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 SetName(const wxString &aName)
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition sch_field.h:252
bool CanAutoplace() const
Definition sch_field.h:233
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
Definition sch_field.h:243
void ClearCaches() override
void SetText(const wxString &aText) override
VECTOR2I GetParentPosition() const
const KIFONT::METRICS & getFontMetrics() const override
Definition sch_field.h:330
bool m_showInChooser
This field is available as a data column for the chooser.
Definition sch_field.h:362
void OnScintillaCharAdded(SCINTILLA_TRICKS *aScintillaTricks, wxStyledTextEvent &aEvent) const
wxString m_name
Definition sch_field.h:354
void SetNameShown(bool aShown=true)
Definition sch_field.h:223
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
static bool IsNetclassLabelFieldName(const wxString &aName)
Test whether aName is one of the known translations of the directive-label net class field name (used...
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void Copy(SCH_FIELD *aTarget) const
Copy parameters of this field to another field.
bool m_allowAutoPlace
This field can be autoplaced.
Definition sch_field.h:357
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:166
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:56
const KIFONT::METRICS & GetFontMetrics() const
Definition sch_item.cpp:785
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition sch_item.h:181
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.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
#define _(s)
SCH_LAYER_ID
Eeschema drawing layers.
Definition layer_ids.h:451
void SetFieldValue(std::vector< SCH_FIELD > &aFields, const wxString &aFieldName, const std::string &aValue, bool aIsVisible=true, const SCH_SHEET_PATH *aSheetPath=nullptr, const wxString &aVariantName=wxEmptyString)
Definition sch_field.h:444
wxString GetFieldValue(const std::vector< SCH_FIELD > *aFields, FIELD_T aFieldType)
Definition sch_field.h:419
const SCH_FIELD * FindField(const std::vector< SCH_FIELD > &aFields, FIELD_T aFieldId)
Definition sch_field.h:381
int NextFieldOrdinal(const std::vector< SCH_FIELD > &aFields)
Definition sch_field.h:370
std::vector< std::unique_ptr< KIFONT::GLYPH > > glyphs
Definition sch_field.h:44
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ USER
The field ID hasn't been set yet; field is invalid.
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:75
@ SCH_FIELD_LOCATE_REFERENCE_T
Definition typeinfo.h:181
@ SCH_FIELD_LOCATE_FOOTPRINT_T
Definition typeinfo.h:183
@ SCH_FIELD_T
Definition typeinfo.h:151
@ SCH_FIELD_LOCATE_VALUE_T
Definition typeinfo.h:182
@ SCH_FIELD_LOCATE_DATASHEET_T
Definition typeinfo.h:184
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:687