KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The 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
25#include <string_utils.h>
26#include <sch_symbol.h>
27#include <sch_connection.h>
28#include <sch_edit_frame.h>
29#include <sch_shape.h>
30#include <sch_line.h>
31#include <sch_junction.h>
32#include <sch_sheet.h>
33#include <sch_sheet_pin.h>
34#include <schematic.h>
35#include <sch_commit.h>
36#include <tool/tool_manager.h>
38#include <tools/sch_edit_tool.h>
39#include <widgets/unit_binder.h>
40#include <widgets/font_choice.h>
41
43static bool g_modifyValues;
45static bool g_modifyWires;
46static bool g_modifyBuses;
55
57static wxString g_fieldnameFilter;
59static wxString g_referenceFilter;
60static bool g_filterBySymbol;
61static wxString g_symbolFilter;
62static bool g_filterByType;
64static bool g_filterByNet;
65static wxString g_netFilter;
66static bool g_filterSelected;
67
68
70{
73
77
78public:
81
82protected:
83 void OnReferenceFilterText( wxCommandEvent& event ) override
84 {
85 m_referenceFilterOpt->SetValue( true );
86 }
87 void OnSymbolFilterText( wxCommandEvent& event ) override
88 {
89 m_symbolFilterOpt->SetValue( true );
90 }
91 void OnFieldNameFilterText( wxCommandEvent& event ) override
92 {
93 m_fieldnameFilterOpt->SetValue( true );
94 }
95 void OnNetFilterText( wxCommandEvent& event ) override
96 {
97 m_netFilterOpt->SetValue( true );
98 }
99
100 bool TransferDataToWindow() override;
101 bool TransferDataFromWindow() override;
102
103 void visitItem( SCH_COMMIT* aCommit, const SCH_SHEET_PATH& aSheetPath, SCH_ITEM* aItem );
104 void processItem( SCH_COMMIT* aCommit, const SCH_SHEET_PATH& aSheetPath, SCH_ITEM* aItem );
105};
106
107
110 m_textSize( parent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
111 m_lineWidth( parent, m_lineWidthLabel, m_LineWidthCtrl, m_lineWidthUnits, true ),
112 m_junctionSize( parent, m_dotSizeLabel, m_dotSizeCtrl, m_dotSizeUnits, true )
113{
114 m_parent = parent;
115
117
118 m_textColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
119 m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
120 m_colorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
121 m_colorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
122 m_fillColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
123 m_fillColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
124 m_dotColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
125 m_dotColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
126
128
130}
131
132
134{
135 g_modifyReferences = m_references->GetValue();
136 g_modifyValues = m_values->GetValue();
138 g_modifyWires = m_wires->GetValue();
139 g_modifyBuses = m_buses->GetValue();
141 g_modifyHierLabels = m_hierLabels->GetValue();
145 g_modifySheetPins = m_sheetPins->GetValue();
148
154 g_symbolFilter = m_symbolFilter->GetValue();
155 g_filterByType = m_typeFilterOpt->GetValue();
156 g_typeFilterIsPower = m_typeFilter->GetSelection() == 1;
157 g_filterByNet = m_netFilterOpt->GetValue();
158 g_netFilter = m_netFilter->GetValue();
160}
161
162
164{
166 m_selection = selectionTool->GetSelection();
167
168 m_references->SetValue( g_modifyReferences );
169 m_values->SetValue( g_modifyValues );
171 m_wires->SetValue( g_modifyWires );
172 m_buses->SetValue( g_modifyBuses );
174 m_hierLabels->SetValue( g_modifyHierLabels );
178 m_sheetPins->SetValue( g_modifySheetPins );
181
182 // SetValue() generates events, ChangeValue() does not
183 m_fieldnameFilter->ChangeValue( g_fieldnameFilter );
185 m_referenceFilter->ChangeValue( g_referenceFilter );
187 m_symbolFilter->ChangeValue( g_symbolFilter );
189 m_typeFilter->SetSelection( g_typeFilterIsPower ? 1 : 0 );
190 m_typeFilterOpt->SetValue( g_filterByType );
192
193 if( g_filterByNet && !g_netFilter.IsEmpty() )
194 {
195 m_netFilter->SetValue( g_netFilter );
196 m_netFilterOpt->SetValue( true );
197 }
198 else if( !m_parent->GetHighlightedConnection().IsEmpty() )
199 {
201 }
202 else if( m_selection.GetSize() )
203 {
204 SCH_ITEM* sch_item = (SCH_ITEM*) m_selection.Front();
205 SCH_CONNECTION* connection = sch_item->Connection();
206
207 if( connection )
208 m_netFilter->SetValue( connection->Name() );
209 }
210
211 m_netFilterOpt->SetValue( g_filterByNet );
212
214 m_fontCtrl->SetStringSelection( INDETERMINATE_ACTION );
215
217 m_orientation->SetStringSelection( INDETERMINATE_ACTION );
218 m_hAlign->SetStringSelection( INDETERMINATE_ACTION );
219 m_vAlign->SetStringSelection( INDETERMINATE_ACTION );
220 m_italic->Set3StateValue( wxCHK_UNDETERMINED );
221 m_bold->Set3StateValue( wxCHK_UNDETERMINED );
222 m_visible->Set3StateValue( wxCHK_UNDETERMINED );
223 m_showFieldNames->Set3StateValue( wxCHK_UNDETERMINED );
225 m_lineStyle->SetStringSelection( INDETERMINATE_ACTION );
227 m_setColor->SetValue( false );
228 m_setFillColor->SetValue( false );
229 m_setDotColor->SetValue( false );
230
231 return true;
232}
233
234
236 const SCH_SHEET_PATH& aSheetPath,
237 SCH_ITEM* aItem )
238{
239 if( m_selectedFilterOpt->GetValue() )
240 {
241 if( !aItem->IsSelected() && ( !aItem->GetParent() || !aItem->GetParent()->IsSelected() ) )
242 return;
243 }
244
245 aCommit->Modify( aItem, aSheetPath.LastScreen() );
246
247 if( EDA_TEXT* eda_text = dynamic_cast<EDA_TEXT*>( aItem ) )
248 {
250 eda_text->SetTextSize( VECTOR2I( m_textSize.GetValue(), m_textSize.GetValue() ) );
251
252 if( m_setTextColor->GetValue() )
253 eda_text->SetTextColor( m_textColorSwatch->GetSwatchColor() );
254
255 if( m_hAlign->GetStringSelection() != INDETERMINATE_ACTION )
256 {
257 GR_TEXT_H_ALIGN_T hAlign = EDA_TEXT::MapHorizJustify( m_hAlign->GetSelection() - 1 );
258 SCH_SYMBOL* parentSymbol = dynamic_cast<SCH_SYMBOL*>( aItem->GetParent() );
259
260 if( parentSymbol && parentSymbol->GetTransform().x1 < 0 )
261 {
262 if( hAlign == GR_TEXT_H_ALIGN_LEFT )
263 hAlign = GR_TEXT_H_ALIGN_RIGHT;
264 else if( hAlign == GR_TEXT_H_ALIGN_RIGHT )
265 hAlign = GR_TEXT_H_ALIGN_LEFT;
266 }
267
268 eda_text->SetHorizJustify( hAlign );
269 }
270
271 if( m_vAlign->GetStringSelection() != INDETERMINATE_ACTION )
272 {
273 GR_TEXT_V_ALIGN_T vAlign = EDA_TEXT::MapVertJustify( m_vAlign->GetSelection() - 1 );
274 SCH_SYMBOL* parentSymbol = dynamic_cast<SCH_SYMBOL*>( aItem->GetParent() );
275
276 if( parentSymbol && parentSymbol->GetTransform().y1 < 0 )
277 {
278 if( vAlign == GR_TEXT_V_ALIGN_TOP )
279 vAlign = GR_TEXT_V_ALIGN_BOTTOM;
280 else if( vAlign == GR_TEXT_V_ALIGN_BOTTOM )
281 vAlign = GR_TEXT_V_ALIGN_TOP;
282 }
283
284 eda_text->SetVertJustify( vAlign );
285 }
286
287 if( m_visible->Get3StateValue() != wxCHK_UNDETERMINED )
288 eda_text->SetVisible( m_visible->GetValue() );
289
290 if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED )
291 eda_text->SetItalic( m_italic->GetValue() );
292
293 // Must come after SetTextSize()
294 if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
295 eda_text->SetBold( m_bold->GetValue() );
296
297 // Must come after SetBold() & SetItalic()
298 if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
299 {
300 eda_text->SetFont( m_fontCtrl->GetFontSelection( eda_text->IsBold(),
301 eda_text->IsItalic() ) );
302 }
303 else if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED
304 || m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
305 {
306 if( !eda_text->GetFontName().IsEmpty() )
307 {
308 eda_text->SetFont( KIFONT::FONT::GetFont( eda_text->GetFontName(),
309 eda_text->IsBold(),
310 eda_text->IsItalic() ) );
311 }
312 }
313 }
314
315 if( SCH_LABEL_BASE* sch_label = dynamic_cast<SCH_LABEL_BASE*>( aItem ) )
316 {
317 if( m_orientation->GetStringSelection() != INDETERMINATE_ACTION )
318 sch_label->SetSpinStyle( (SPIN_STYLE::SPIN) m_orientation->GetSelection() );
319 }
320
321 if( SCH_FIELD* sch_field = dynamic_cast<SCH_FIELD*>( aItem ) )
322 {
323 if( m_showFieldNames->Get3StateValue() != wxCHK_UNDETERMINED )
324 sch_field->SetNameShown( m_showFieldNames->GetValue() );
325 }
326
327 if( aItem->HasLineStroke() )
328 {
329 STROKE_PARAMS stroke = aItem->GetStroke();
330
332 stroke.SetWidth( m_lineWidth.GetValue() );
333
334 if( m_lineStyle->GetStringSelection() != INDETERMINATE_ACTION )
335 stroke.SetLineStyle( (LINE_STYLE) m_lineStyle->GetSelection() );
336
337 if( m_setColor->GetValue() )
339
340 aItem->SetStroke( stroke );
341 }
342
343 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
344 {
345 if( m_setFillColor->GetValue() )
346 {
347 shape->SetFillColor( m_fillColorSwatch->GetSwatchColor() );
348
349 if( m_fillColorSwatch->GetSwatchColor() == COLOR4D::UNSPECIFIED )
350 shape->SetFillMode( FILL_T::NO_FILL );
351 else
352 shape->SetFillMode( FILL_T::FILLED_WITH_COLOR );
353 }
354 }
355
356 if( SCH_JUNCTION* junction = dynamic_cast<SCH_JUNCTION*>( aItem ) )
357 {
359 junction->SetDiameter( m_junctionSize.GetValue() );
360
361 if( m_setDotColor->GetValue() )
362 junction->SetColor( m_dotColorSwatch->GetSwatchColor() );
363 }
364}
365
367 const SCH_SHEET_PATH& aSheetPath,
368 SCH_ITEM* aItem )
369{
370 if( m_netFilterOpt->GetValue() && !m_netFilter->GetValue().IsEmpty() )
371 {
372 SCH_CONNECTION* connection = aItem->Connection( &aSheetPath );
373
374 if( !connection )
375 return;
376
377 if( !WildCompareString( m_netFilter->GetValue(), connection->Name(), false ) )
378 return;
379 }
380
381 if( m_referenceFilterOpt->GetValue() && !m_referenceFilter->GetValue().IsEmpty() )
382 {
383 if( aItem->Type() == SCH_SYMBOL_T )
384 {
385 wxString ref = static_cast<SCH_SYMBOL*>( aItem )->GetRef( &aSheetPath );
386
387 if( !WildCompareString( m_referenceFilter->GetValue(), ref, false ) )
388 return;
389 }
390 }
391
392 if( m_symbolFilterOpt->GetValue() && !m_symbolFilter->GetValue().IsEmpty() )
393 {
394 if( aItem->Type() == SCH_SYMBOL_T )
395 {
396 wxString id = UnescapeString( static_cast<SCH_SYMBOL*>( aItem )->GetLibId().Format() );
397
398 if( !WildCompareString( m_symbolFilter->GetValue(), id, false ) )
399 return;
400 }
401 }
402
403 if( m_typeFilterOpt->GetValue() )
404 {
405 if( aItem->Type() == SCH_SYMBOL_T )
406 {
407 bool isPower = static_cast<SCH_SYMBOL*>( aItem )->GetLibSymbolRef()->IsPower();
408
409 if( isPower != ( m_typeFilter->GetSelection() == 1 ) )
410 return;
411 }
412 }
413
414 static const std::vector<KICAD_T> wireLabelTypes = { SCH_LABEL_LOCATE_WIRE_T };
415 static const std::vector<KICAD_T> busLabelTypes = { SCH_LABEL_LOCATE_BUS_T };
416
417 switch( aItem->Type() )
418 {
419 case SCH_SYMBOL_T:
420 {
421 SCH_SYMBOL* symbol = (SCH_SYMBOL*) aItem;
422
423 if( m_references->GetValue() )
424 processItem( aCommit, aSheetPath, symbol->GetField( REFERENCE_FIELD ) );
425
426 if( m_values->GetValue() )
427 processItem( aCommit, aSheetPath, symbol->GetField( VALUE_FIELD ) );
428
429 if( m_otherFields->GetValue() )
430 {
431 for( int i = 2; i < symbol->GetFieldCount(); ++i )
432 {
433 SCH_FIELD& field = symbol->GetFields()[i];
434 const wxString& fieldName = field.GetName();
435
436 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
437 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
438 {
439 processItem( aCommit, aSheetPath, &field );
440 }
441 }
442 }
443
444 break;
445 }
446
447 case SCH_SHEET_T:
448 {
449 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( aItem );
450
451 if( m_sheetTitles->GetValue() )
452 processItem( aCommit, aSheetPath, &sheet->GetFields()[SHEETNAME] );
453
454 if( m_sheetFields->GetValue() )
455 {
456 for( SCH_FIELD& field : sheet->GetFields() )
457 {
458 if( field.GetId() == SHEETNAME )
459 continue;
460
461 const wxString& fieldName = field.GetName();
462
463 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
464 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
465 {
466 processItem( aCommit, aSheetPath, &field );
467 }
468 }
469 }
470
471 if( m_sheetBorders->GetValue() )
472 {
475
476 if( m_setColor->GetValue() )
478
479 if( m_setFillColor->GetValue() )
481 }
482
483 if( m_sheetPins->GetValue() )
484 {
485 for( SCH_SHEET_PIN* pin : sheet->GetPins() )
486 processItem( aCommit, aSheetPath, pin );
487 }
488
489 break;
490 }
491
492 case SCH_LINE_T:
493 if( m_schTextAndGraphics->GetValue() && aItem->GetLayer() == LAYER_NOTES )
494 processItem( aCommit, aSheetPath, aItem );
495 else if( m_wires->GetValue() && aItem->GetLayer() == LAYER_WIRE )
496 processItem( aCommit, aSheetPath, aItem );
497 else if( m_buses->GetValue() && aItem->GetLayer() == LAYER_BUS )
498 processItem( aCommit, aSheetPath, aItem );
499
500 break;
501
502 case SCH_LABEL_T:
504 case SCH_HIER_LABEL_T:
506 if( m_wires->GetValue() && aItem->IsType( wireLabelTypes ) )
507 processItem( aCommit, aSheetPath, aItem );
508
509 if( m_buses->GetValue() && aItem->IsType( busLabelTypes ) )
510 processItem( aCommit, aSheetPath, aItem );
511
512 if( m_globalLabels->GetValue() && aItem->Type() == SCH_GLOBAL_LABEL_T )
513 processItem( aCommit, aSheetPath, aItem );
514
515 if( m_hierLabels->GetValue() && aItem->Type() == SCH_HIER_LABEL_T )
516 processItem( aCommit, aSheetPath, aItem );
517
518 if( m_labelFields->GetValue() )
519 {
520 for( SCH_FIELD& field : static_cast<SCH_LABEL_BASE*>( aItem )->GetFields() )
521 {
522 const wxString& fieldName = field.GetName();
523
524 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
525 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
526 {
527 processItem( aCommit, aSheetPath, &field );
528 }
529 }
530 }
531
532 break;
533
534 case SCH_JUNCTION_T:
535 {
536 SCH_JUNCTION* junction = static_cast<SCH_JUNCTION*>( aItem );
537
538 for( SCH_ITEM* item : junction->ConnectedItems( aSheetPath ) )
539 {
540 if( item->GetLayer() == LAYER_BUS && m_buses->GetValue() )
541 {
542 processItem( aCommit, aSheetPath, aItem );
543 break;
544 }
545 else if( item->GetLayer() == LAYER_WIRE && m_wires->GetValue() )
546 {
547 processItem( aCommit, aSheetPath, aItem );
548 break;
549 }
550 }
551
552 break;
553 }
554
555 case SCH_TEXT_T:
556 case SCH_TEXTBOX_T:
557 case SCH_SHAPE_T:
558 if( m_schTextAndGraphics->GetValue() )
559 processItem( aCommit, aSheetPath, aItem );
560
561 break;
562
563 default:
564 break;
565 }
566}
567
568
570{
571 if( !m_textSize.Validate( 1.0, 10000.0, EDA_UNITS::MILS ) ) // 1 mil .. 10 inches
572 return false;
573
574 SCH_SHEET_PATH currentSheet = m_parent->GetCurrentSheet();
575 SCH_COMMIT commit( m_parent );
576
577 // Go through sheets
578 for( const SCH_SHEET_PATH& sheetPath : m_parent->Schematic().Hierarchy() )
579 {
580 SCH_SCREEN* screen = sheetPath.LastScreen();
581
582 if( screen )
583 {
584 m_parent->SetCurrentSheet( sheetPath );
585
586 for( SCH_ITEM* item : screen->Items() )
587 visitItem( &commit, sheetPath, item );
588 }
589 }
590
591 if( !commit.Empty() )
592 {
593 commit.Push( _( "Edit Text and Graphics" ) );
595 }
596
597 // Reset the view to where we left the user
598 m_parent->SetCurrentSheet( currentSheet );
599 m_parent->Refresh();
600
601 return true;
602}
603
604
606{
608 dlg.ShowModal();
609 return 0;
610}
611
612
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.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Modify a given item in the model.
Definition: commit.h:108
bool Empty() const
Definition: commit.h:150
void processItem(SCH_COMMIT *aCommit, const SCH_SHEET_PATH &aSheetPath, SCH_ITEM *aItem)
void visitItem(SCH_COMMIT *aCommit, 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...
int ShowModal() override
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
bool IsSelected() const
Definition: eda_item.h:110
EDA_ITEM * GetParent() const
Definition: eda_item.h:103
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:80
static GR_TEXT_H_ALIGN_T MapHorizJustify(int aHorizJustify)
Definition: eda_text.cpp:67
static GR_TEXT_V_ALIGN_T MapVertJustify(int aVertJustify)
Definition: eda_text.cpp:81
EE_SELECTION & GetSelection()
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic, bool aForDrawingSheet=false) const
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
Definition: font.cpp:146
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
Definition: schematic.cpp:214
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
Definition: sch_commit.cpp:432
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.
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)
const wxString & GetHighlightedConnection() const
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:1229
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:167
const SCH_ITEM_VEC & ConnectedItems(const SCH_SHEET_PATH &aPath)
Retrieve the set of items connected to this item on the given sheet.
Definition: sch_item.cpp:277
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:282
virtual void SetStroke(const STROKE_PARAMS &aStroke)
Definition: sch_item.h:569
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:218
virtual STROKE_PARAMS GetStroke() const
Definition: sch_item.h:567
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
Definition: sch_item.h:565
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_item.h:182
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:108
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:118
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:92
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:121
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:115
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:180
Schematic symbol object.
Definition: sch_symbol.h:77
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: sch_symbol.h:574
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) override
Populate a std::vector with SCH_FIELDs.
Definition: sch_symbol.cpp:954
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:906
bool IsPower() const override
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:100
EDA_ITEM * Front() const
Definition: selection.h:172
Simple container to manage line stroke parameters.
Definition: stroke_params.h:93
void SetLineStyle(LINE_STYLE aLineStyle)
void SetWidth(int aWidth)
void SetColor(const KIGFX::COLOR4D &aColor)
const TRANSFORM & GetTransform() const
Definition: symbol.h:191
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
Generic, UI-independent tool event.
Definition: tool_event.h:168
int y1
Definition: transform.h:49
int x1
Definition: transform.h:48
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.
#define _(s)
@ LAYER_WIRE
Definition: layer_ids.h:404
@ LAYER_NOTES
Definition: layer_ids.h:419
@ LAYER_BUS
Definition: layer_ids.h:405
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:198
@ 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)
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:46
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_TOP
@ SCH_LINE_T
Definition: typeinfo.h:163
@ SCH_SYMBOL_T
Definition: typeinfo.h:172
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:171
@ SCH_LABEL_T
Definition: typeinfo.h:167
@ SCH_SHEET_T
Definition: typeinfo.h:174
@ SCH_SHAPE_T
Definition: typeinfo.h:149
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:169
@ SCH_LABEL_LOCATE_WIRE_T
Definition: typeinfo.h:191
@ SCH_TEXT_T
Definition: typeinfo.h:151
@ SCH_LABEL_LOCATE_BUS_T
Definition: typeinfo.h:192
@ SCH_TEXTBOX_T
Definition: typeinfo.h:152
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:168
@ SCH_JUNCTION_T
Definition: typeinfo.h:159
#define INDETERMINATE_ACTION
Definition: ui_common.h:47
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:695