KiCad PCB EDA Suite
eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp
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) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <connection_graph.h>
26#include <string_utils.h>
27#include <sch_symbol.h>
28#include <sch_connection.h>
29#include <sch_edit_frame.h>
30#include <sch_shape.h>
31#include <sch_line.h>
32#include <sch_junction.h>
33#include <sch_sheet.h>
34#include <sch_sheet_pin.h>
35#include <schematic.h>
36#include <advanced_config.h>
37#include <tool/tool_manager.h>
39#include <tools/sch_edit_tool.h>
40#include <widgets/unit_binder.h>
41#include <widgets/font_choice.h>
42
44static bool g_modifyValues;
46static bool g_modifyWires;
47static bool g_modifyBuses;
56
58static wxString g_fieldnameFilter;
60static wxString g_referenceFilter;
61static bool g_filterBySymbol;
62static wxString g_symbolFilter;
63static bool g_filterByType;
65static bool g_filterByNet;
66static wxString g_netFilter;
67static bool g_filterSelected;
68
69
70#define DEFAULT_STYLE _( "Default" )
71
73{
76
80
82
83public:
86
87protected:
88 void OnReferenceFilterText( wxCommandEvent& event ) override
89 {
90 m_referenceFilterOpt->SetValue( true );
91 }
92 void OnSymbolFilterText( wxCommandEvent& event ) override
93 {
94 m_symbolFilterOpt->SetValue( true );
95 }
96 void OnFieldNameFilterText( wxCommandEvent& event ) override
97 {
98 m_fieldnameFilterOpt->SetValue( true );
99 }
100 void OnNetFilterText( wxCommandEvent& event ) override
101 {
102 m_netFilterOpt->SetValue( true );
103 }
104
105 bool TransferDataToWindow() override;
106 bool TransferDataFromWindow() override;
107
108 void visitItem( const SCH_SHEET_PATH& aSheetPath, SCH_ITEM* aItem );
109 void processItem( const SCH_SHEET_PATH& aSheetPath, SCH_ITEM* aItem );
110};
111
112
115 m_textSize( parent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
116 m_lineWidth( parent, m_lineWidthLabel, m_LineWidthCtrl, m_lineWidthUnits, true ),
117 m_junctionSize( parent, m_dotSizeLabel, m_dotSizeCtrl, m_dotSizeUnits, true )
118{
119 m_parent = parent;
120 m_appendUndo = false;
121
122 m_lineStyle->Append( DEFAULT_STYLE );
124
125 m_textColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
126 m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
127 m_colorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
128 m_colorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
129 m_fillColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
130 m_fillColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
131 m_dotColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
132 m_dotColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
133
135
137}
138
139
141{
142 g_modifyReferences = m_references->GetValue();
143 g_modifyValues = m_values->GetValue();
145 g_modifyWires = m_wires->GetValue();
146 g_modifyBuses = m_buses->GetValue();
148 g_modifyHierLabels = m_hierLabels->GetValue();
152 g_modifySheetPins = m_sheetPins->GetValue();
155
161 g_symbolFilter = m_symbolFilter->GetValue();
162 g_filterByType = m_typeFilterOpt->GetValue();
163 g_typeFilterIsPower = m_typeFilter->GetSelection() == 1;
164 g_filterByNet = m_netFilterOpt->GetValue();
165 g_netFilter = m_netFilter->GetValue();
167}
168
169
171{
173 m_selection = selectionTool->GetSelection();
174
175 m_references->SetValue( g_modifyReferences );
176 m_values->SetValue( g_modifyValues );
178 m_wires->SetValue( g_modifyWires );
179 m_buses->SetValue( g_modifyBuses );
181 m_hierLabels->SetValue( g_modifyHierLabels );
185 m_sheetPins->SetValue( g_modifySheetPins );
188
189 // SetValue() generates events, ChangeValue() does not
190 m_fieldnameFilter->ChangeValue( g_fieldnameFilter );
192 m_referenceFilter->ChangeValue( g_referenceFilter );
194 m_symbolFilter->ChangeValue( g_symbolFilter );
196 m_typeFilter->SetSelection( g_typeFilterIsPower ? 1 : 0 );
197 m_typeFilterOpt->SetValue( g_filterByType );
199
200 if( g_filterByNet && !g_netFilter.IsEmpty() )
201 {
202 m_netFilter->SetValue( g_netFilter );
203 m_netFilterOpt->SetValue( true );
204 }
206 {
208 }
209 else if( m_selection.GetSize() )
210 {
211 SCH_ITEM* sch_item = (SCH_ITEM*) m_selection.Front();
212 SCH_CONNECTION* connection = sch_item->Connection();
213
214 if( connection )
215 m_netFilter->SetValue( connection->Name() );
216 }
217
218 m_netFilterOpt->SetValue( g_filterByNet );
219
221 m_fontCtrl->SetStringSelection( INDETERMINATE_ACTION );
222
224 m_orientation->SetStringSelection( INDETERMINATE_ACTION );
225 m_hAlign->SetStringSelection( INDETERMINATE_ACTION );
226 m_vAlign->SetStringSelection( INDETERMINATE_ACTION );
227 m_italic->Set3StateValue( wxCHK_UNDETERMINED );
228 m_bold->Set3StateValue( wxCHK_UNDETERMINED );
229 m_visible->Set3StateValue( wxCHK_UNDETERMINED );
230 m_showFieldNames->Set3StateValue( wxCHK_UNDETERMINED );
232 m_lineStyle->SetStringSelection( INDETERMINATE_ACTION );
234 m_setColor->SetValue( false );
235 m_setFillColor->SetValue( false );
236 m_setDotColor->SetValue( false );
237
238 return true;
239}
240
241
243 SCH_ITEM* aItem )
244{
245 if( m_selectedFilterOpt->GetValue() )
246 {
247 if( !aItem->IsSelected() && ( !aItem->GetParent() || !aItem->GetParent()->IsSelected() ) )
248 return;
249 }
250
252 false );
253 m_appendUndo = true;
254
255 if( EDA_TEXT* eda_text = dynamic_cast<EDA_TEXT*>( aItem ) )
256 {
258 eda_text->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
259
260 if( m_setTextColor->GetValue() )
261 eda_text->SetTextColor( m_textColorSwatch->GetSwatchColor() );
262
263 if( m_hAlign->GetStringSelection() != INDETERMINATE_ACTION )
264 {
265 GR_TEXT_H_ALIGN_T hAlign = EDA_TEXT::MapHorizJustify( m_hAlign->GetSelection() - 1 );
266 SCH_SYMBOL* parentSymbol = dynamic_cast<SCH_SYMBOL*>( aItem->GetParent() );
267
268 if( parentSymbol && parentSymbol->GetTransform().x1 < 0 )
269 {
270 if( hAlign == GR_TEXT_H_ALIGN_LEFT )
271 hAlign = GR_TEXT_H_ALIGN_RIGHT;
272 else if( hAlign == GR_TEXT_H_ALIGN_RIGHT )
273 hAlign = GR_TEXT_H_ALIGN_LEFT;
274 }
275
276 eda_text->SetHorizJustify( hAlign );
277 }
278
279 if( m_vAlign->GetStringSelection() != INDETERMINATE_ACTION )
280 {
281 GR_TEXT_V_ALIGN_T vAlign = EDA_TEXT::MapVertJustify( m_vAlign->GetSelection() - 1 );
282 SCH_SYMBOL* parentSymbol = dynamic_cast<SCH_SYMBOL*>( aItem->GetParent() );
283
284 if( parentSymbol && parentSymbol->GetTransform().y1 < 0 )
285 {
286 if( vAlign == GR_TEXT_V_ALIGN_TOP )
287 vAlign = GR_TEXT_V_ALIGN_BOTTOM;
288 else if( vAlign == GR_TEXT_V_ALIGN_BOTTOM )
289 vAlign = GR_TEXT_V_ALIGN_TOP;
290 }
291
292 eda_text->SetVertJustify( vAlign );
293 }
294
295 if( m_visible->Get3StateValue() != wxCHK_UNDETERMINED )
296 eda_text->SetVisible( m_visible->GetValue() );
297
298 if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED )
299 eda_text->SetItalic( m_italic->GetValue() );
300
301 if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
302 eda_text->SetBold( m_bold->GetValue() );
303
304 // Must come after bold & italic
305 if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
306 {
307 eda_text->SetFont( m_fontCtrl->GetFontSelection( eda_text->IsBold(),
308 eda_text->IsItalic() ) );
309 }
310 else if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED
311 || m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
312 {
313 if( !eda_text->GetFontName().IsEmpty() )
314 {
315 eda_text->SetFont( KIFONT::FONT::GetFont( eda_text->GetFontName(),
316 eda_text->IsBold(),
317 eda_text->IsItalic() ) );
318 }
319 }
320 }
321
322 if( SCH_TEXT* sch_text = dynamic_cast<SCH_TEXT*>( aItem ) )
323 {
324 if( m_orientation->GetStringSelection() != INDETERMINATE_ACTION )
325 sch_text->SetTextSpinStyle( (TEXT_SPIN_STYLE::SPIN) m_orientation->GetSelection() );
326 }
327
328 if( SCH_FIELD* sch_field = dynamic_cast<SCH_FIELD*>( aItem ) )
329 {
330 if( m_showFieldNames->Get3StateValue() != wxCHK_UNDETERMINED )
331 sch_field->SetNameShown( m_showFieldNames->GetValue() );
332 }
333
334 if( aItem->HasLineStroke() )
335 {
336 STROKE_PARAMS stroke = aItem->GetStroke();
337
339 stroke.SetWidth( m_lineWidth.GetValue() );
340
341 if( m_lineStyle->GetStringSelection() != INDETERMINATE_ACTION )
342 {
343 if( m_lineStyle->GetStringSelection() == DEFAULT_STYLE )
345 else
346 stroke.SetPlotStyle( (PLOT_DASH_TYPE) m_lineStyle->GetSelection() );
347 }
348
349 if( m_setColor->GetValue() )
351
352 aItem->SetStroke( stroke );
353 }
354
355 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
356 {
357 if( m_setFillColor->GetValue() )
358 {
359 shape->SetFillColor( m_fillColorSwatch->GetSwatchColor() );
360
361 if( m_fillColorSwatch->GetSwatchColor() == COLOR4D::UNSPECIFIED )
362 shape->SetFillMode( FILL_T::NO_FILL );
363 else
364 shape->SetFillMode( FILL_T::FILLED_WITH_COLOR );
365 }
366 }
367
368 if( SCH_JUNCTION* junction = dynamic_cast<SCH_JUNCTION*>( aItem ) )
369 {
371 junction->SetDiameter( m_junctionSize.GetValue() );
372
373 if( m_setDotColor->GetValue() )
374 junction->SetColor( m_dotColorSwatch->GetSwatchColor() );
375 }
376}
377
379 SCH_ITEM* aItem )
380{
381 if( m_netFilterOpt->GetValue() && !m_netFilter->GetValue().IsEmpty() )
382 {
383 SCH_CONNECTION* connection = aItem->Connection( &aSheetPath );
384
385 if( !connection )
386 return;
387
388 if( !WildCompareString( m_netFilter->GetValue(), connection->Name(), false ) )
389 return;
390 }
391
392 if( m_referenceFilterOpt->GetValue() && !m_referenceFilter->GetValue().IsEmpty() )
393 {
394 if( aItem->Type() == SCH_SYMBOL_T )
395 {
396 wxString ref = static_cast<SCH_SYMBOL*>( aItem )->GetRef( &aSheetPath );
397
398 if( !WildCompareString( m_referenceFilter->GetValue(), ref, false ) )
399 return;
400 }
401 }
402
403 if( m_symbolFilterOpt->GetValue() && !m_symbolFilter->GetValue().IsEmpty() )
404 {
405 if( aItem->Type() == SCH_SYMBOL_T )
406 {
407 wxString id = UnescapeString( static_cast<SCH_SYMBOL*>( aItem )->GetLibId().Format() );
408
409 if( !WildCompareString( m_symbolFilter->GetValue(), id, false ) )
410 return;
411 }
412 }
413
414 if( m_typeFilterOpt->GetValue() )
415 {
416 if( aItem->Type() == SCH_SYMBOL_T )
417 {
418 bool isPower = static_cast<SCH_SYMBOL*>( aItem )->GetLibSymbolRef()->IsPower();
419
420 if( isPower != ( m_typeFilter->GetSelection() == 1 ) )
421 return;
422 }
423 }
424
425 if( aItem->Type() == SCH_SYMBOL_T )
426 {
427 SCH_SYMBOL* symbol = (SCH_SYMBOL*) aItem;
428
429 if( m_references->GetValue() )
430 processItem( aSheetPath, symbol->GetField( REFERENCE_FIELD ) );
431
432 if( m_values->GetValue() )
433 processItem( aSheetPath, symbol->GetField( VALUE_FIELD ) );
434
435 if( m_otherFields->GetValue() )
436 {
437 for( int i = 2; i < symbol->GetFieldCount(); ++i )
438 {
439 SCH_FIELD& field = symbol->GetFields()[i];
440 const wxString& fieldName = field.GetName();
441
442 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
443 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
444 {
445 processItem( aSheetPath, &field );
446 }
447 }
448 }
449 }
450 else if( aItem->Type() == SCH_SHEET_T )
451 {
452 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( aItem );
453
454 if( m_sheetTitles->GetValue() )
455 processItem( aSheetPath, &sheet->GetFields()[SHEETNAME] );
456
457 if( m_sheetFields->GetValue() )
458 {
459 for( SCH_FIELD& field : sheet->GetFields() )
460 {
461 if( field.GetId() == SHEETNAME )
462 continue;
463
464 const wxString& fieldName = field.GetName();
465
466 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
467 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
468 {
469 processItem( aSheetPath, &field );
470 }
471 }
472 }
473
474 if( m_sheetBorders->GetValue() )
475 {
478
479 if( m_setColor->GetValue() )
481
482 if( m_setFillColor->GetValue() )
484 }
485
486 if( m_sheetPins->GetValue() )
487 {
488 for( SCH_SHEET_PIN* pin : sheet->GetPins() )
489 processItem( aSheetPath, pin );
490 }
491 }
492 else if( aItem->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
493 {
494 if( m_globalLabels->GetValue() && aItem->Type() == SCH_GLOBAL_LABEL_T )
495 processItem( aSheetPath, aItem );
496
497 if( m_hierLabels->GetValue() && aItem->Type() == SCH_HIER_LABEL_T )
498 processItem( aSheetPath, aItem );
499
500 if( m_labelFields->GetValue() )
501 {
502 for( SCH_FIELD& field : static_cast<SCH_LABEL_BASE*>( aItem )->GetFields() )
503 {
504 const wxString& fieldName = field.GetName();
505
506 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
507 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
508 {
509 processItem( aSheetPath, &field );
510 }
511 }
512 }
513 }
514 else if( aItem->Type() == SCH_JUNCTION_T )
515 {
516 SCH_JUNCTION* junction = static_cast<SCH_JUNCTION*>( aItem );
517
518 for( SCH_ITEM* item : junction->ConnectedItems( aSheetPath ) )
519 {
520 if( item->GetLayer() == LAYER_BUS && m_buses->GetValue() )
521 {
522 processItem( aSheetPath, aItem );
523 break;
524 }
525 else if( item->GetLayer() == LAYER_WIRE && m_wires->GetValue() )
526 {
527 processItem( aSheetPath, aItem );
528 break;
529 }
530 }
531 }
532 else if( m_wires->GetValue() && aItem->IsType( { SCH_ITEM_LOCATE_WIRE_T,
533 SCH_LABEL_LOCATE_WIRE_T } ) )
534 {
535 processItem( aSheetPath, aItem );
536 }
537 else if( m_buses->GetValue() && aItem->IsType( { SCH_ITEM_LOCATE_BUS_T,
538 SCH_LABEL_LOCATE_BUS_T } ) )
539 {
540 processItem( aSheetPath, aItem );
541 }
542 else if( m_schTextAndGraphics->GetValue() && aItem->IsType( { SCH_TEXT_T, SCH_TEXTBOX_T,
543 SCH_ITEM_LOCATE_GRAPHIC_LINE_T,
544 SCH_SHAPE_T } ) )
545 {
546 processItem( aSheetPath, aItem );
547 }
548}
549
550
552{
553 if( !m_textSize.Validate( 1.0, 10000.0, EDA_UNITS::MILS ) ) // 1 mil .. 10 inches
554 return false;
555
556 SCH_SHEET_PATH currentSheet = m_parent->GetCurrentSheet();
557 m_appendUndo = false;
558
559 // Go through sheets
560 for( const SCH_SHEET_PATH& sheetPath : m_parent->Schematic().GetSheets() )
561 {
562 SCH_SCREEN* screen = sheetPath.LastScreen();
563
564 if( screen )
565 {
566 m_parent->SetCurrentSheet( sheetPath );
567
568 for( SCH_ITEM* item : screen->Items() )
569 visitItem( sheetPath, item );
570 }
571 }
572
573 if( m_appendUndo )
574 {
577 }
578
579 // Reset the view to where we left the user
580 m_parent->SetCurrentSheet( currentSheet );
581
582 return true;
583}
584
585
587{
589 dlg.ShowModal();
590 return 0;
591}
592
593
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
void visitItem(const SCH_SHEET_PATH &aSheetPath, SCH_ITEM *aItem)
void processItem(const SCH_SHEET_PATH &aSheetPath, SCH_ITEM *aItem)
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
bool IsSelected() const
Definition: eda_item.h:106
EDA_ITEM * GetParent() const
Definition: eda_item.h:99
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
static GR_TEXT_H_ALIGN_T MapHorizJustify(int aHorizJustify)
Definition: eda_text.cpp:62
static GR_TEXT_V_ALIGN_T MapVertJustify(int aVertJustify)
Definition: eda_text.cpp:76
EE_SELECTION & GetSelection()
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic) const
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false)
Definition: font.cpp:65
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
Definition: schematic.h:86
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
wxString Name(bool aIgnoreSheet=false) const
Schematic editor (Eeschema) main window.
const SCH_CONNECTION * GetHighlightedConnection() const
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, bool aDirtyConnectivity=true)
Create a copy of the current schematic item, and put it in the undo list.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
int GlobalEdit(const TOOL_EVENT &aEvent)
Delete the selected items, or the item under the cursor.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Definition: sch_field.cpp:813
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
SCH_ITEM_SET & ConnectedItems(const SCH_SHEET_PATH &aPath)
Retrieve the set of items connected to this item on the given sheet.
Definition: sch_item.cpp:187
virtual void SetStroke(const STROKE_PARAMS &aStroke)
Definition: sch_item.h:459
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:146
virtual STROKE_PARAMS GetStroke() const
Definition: sch_item.h:457
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
Definition: sch_item.h:455
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_item.h:162
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:109
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SCREEN * LastScreen()
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:115
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:93
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:118
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:112
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:175
Schematic symbol object.
Definition: sch_symbol.h:81
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: sch_symbol.h:486
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:843
TRANSFORM & GetTransform()
Definition: sch_symbol.h:283
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
Definition: sch_symbol.cpp:879
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:99
EDA_ITEM * Front() const
Definition: selection.h:208
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88
void SetWidth(int aWidth)
Definition: stroke_params.h:99
void SetColor(const KIGFX::COLOR4D &aColor)
void SetPlotStyle(PLOT_DASH_TYPE aPlotStyle)
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
Generic, UI-independent tool event.
Definition: tool_event.h:156
int y1
Definition: transform.h:50
int x1
Definition: transform.h:49
virtual long long int GetValue()
Return the current value in Internal Units.
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
@ FILLED_WITH_COLOR
@ LAYER_WIRE
Definition: layer_ids.h:344
@ LAYER_BUS
Definition: layer_ids.h:345
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
@ SHEETNAME
Definition: sch_sheet.h:45
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Compare a string against wild card (* and ?) pattern using the usual rules.
wxString UnescapeString(const wxString &aSource)
PLOT_DASH_TYPE
Dashed line types.
Definition: stroke_params.h:48
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
GR_TEXT_H_ALIGN_T
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
GR_TEXT_V_ALIGN_T
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_TOP
@ SCH_SYMBOL_T
Definition: typeinfo.h:156
@ SCH_SHEET_T
Definition: typeinfo.h:158
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:153
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:152
@ SCH_JUNCTION_T
Definition: typeinfo.h:142
#define INDETERMINATE_ACTION
Definition: ui_common.h:43