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 (C) 2019-2023 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
69#define DEFAULT_STYLE _( "Default" )
70
72{
75
79
80public:
83
84protected:
85 void OnReferenceFilterText( wxCommandEvent& event ) override
86 {
87 m_referenceFilterOpt->SetValue( true );
88 }
89 void OnSymbolFilterText( wxCommandEvent& event ) override
90 {
91 m_symbolFilterOpt->SetValue( true );
92 }
93 void OnFieldNameFilterText( wxCommandEvent& event ) override
94 {
95 m_fieldnameFilterOpt->SetValue( true );
96 }
97 void OnNetFilterText( wxCommandEvent& event ) override
98 {
99 m_netFilterOpt->SetValue( true );
100 }
101
102 bool TransferDataToWindow() override;
103 bool TransferDataFromWindow() override;
104
105 void visitItem( SCH_COMMIT* aCommit, const SCH_SHEET_PATH& aSheetPath, SCH_ITEM* aItem );
106 void processItem( SCH_COMMIT* aCommit, const SCH_SHEET_PATH& aSheetPath, SCH_ITEM* aItem );
107};
108
109
112 m_textSize( parent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, true ),
113 m_lineWidth( parent, m_lineWidthLabel, m_LineWidthCtrl, m_lineWidthUnits, true ),
114 m_junctionSize( parent, m_dotSizeLabel, m_dotSizeCtrl, m_dotSizeUnits, true )
115{
116 m_parent = parent;
117
118 m_lineStyle->Append( DEFAULT_STYLE );
120
121 m_textColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
122 m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
123 m_colorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
124 m_colorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
125 m_fillColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
126 m_fillColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
127 m_dotColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
128 m_dotColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
129
131
133}
134
135
137{
138 g_modifyReferences = m_references->GetValue();
139 g_modifyValues = m_values->GetValue();
141 g_modifyWires = m_wires->GetValue();
142 g_modifyBuses = m_buses->GetValue();
144 g_modifyHierLabels = m_hierLabels->GetValue();
148 g_modifySheetPins = m_sheetPins->GetValue();
151
157 g_symbolFilter = m_symbolFilter->GetValue();
158 g_filterByType = m_typeFilterOpt->GetValue();
159 g_typeFilterIsPower = m_typeFilter->GetSelection() == 1;
160 g_filterByNet = m_netFilterOpt->GetValue();
161 g_netFilter = m_netFilter->GetValue();
163}
164
165
167{
169 m_selection = selectionTool->GetSelection();
170
171 m_references->SetValue( g_modifyReferences );
172 m_values->SetValue( g_modifyValues );
174 m_wires->SetValue( g_modifyWires );
175 m_buses->SetValue( g_modifyBuses );
177 m_hierLabels->SetValue( g_modifyHierLabels );
181 m_sheetPins->SetValue( g_modifySheetPins );
184
185 // SetValue() generates events, ChangeValue() does not
186 m_fieldnameFilter->ChangeValue( g_fieldnameFilter );
188 m_referenceFilter->ChangeValue( g_referenceFilter );
190 m_symbolFilter->ChangeValue( g_symbolFilter );
192 m_typeFilter->SetSelection( g_typeFilterIsPower ? 1 : 0 );
193 m_typeFilterOpt->SetValue( g_filterByType );
195
196 if( g_filterByNet && !g_netFilter.IsEmpty() )
197 {
198 m_netFilter->SetValue( g_netFilter );
199 m_netFilterOpt->SetValue( true );
200 }
201 else if( !m_parent->GetHighlightedConnection().IsEmpty() )
202 {
204 }
205 else if( m_selection.GetSize() )
206 {
207 SCH_ITEM* sch_item = (SCH_ITEM*) m_selection.Front();
208 SCH_CONNECTION* connection = sch_item->Connection();
209
210 if( connection )
211 m_netFilter->SetValue( connection->Name() );
212 }
213
214 m_netFilterOpt->SetValue( g_filterByNet );
215
217 m_fontCtrl->SetStringSelection( INDETERMINATE_ACTION );
218
220 m_orientation->SetStringSelection( INDETERMINATE_ACTION );
221 m_hAlign->SetStringSelection( INDETERMINATE_ACTION );
222 m_vAlign->SetStringSelection( INDETERMINATE_ACTION );
223 m_italic->Set3StateValue( wxCHK_UNDETERMINED );
224 m_bold->Set3StateValue( wxCHK_UNDETERMINED );
225 m_visible->Set3StateValue( wxCHK_UNDETERMINED );
226 m_showFieldNames->Set3StateValue( wxCHK_UNDETERMINED );
228 m_lineStyle->SetStringSelection( INDETERMINATE_ACTION );
230 m_setColor->SetValue( false );
231 m_setFillColor->SetValue( false );
232 m_setDotColor->SetValue( false );
233
234 return true;
235}
236
237
239 const SCH_SHEET_PATH& aSheetPath,
240 SCH_ITEM* aItem )
241{
242 if( m_selectedFilterOpt->GetValue() )
243 {
244 if( !aItem->IsSelected() && ( !aItem->GetParent() || !aItem->GetParent()->IsSelected() ) )
245 return;
246 }
247
248 aCommit->Modify( aItem, aSheetPath.LastScreen() );
249
250 if( EDA_TEXT* eda_text = dynamic_cast<EDA_TEXT*>( aItem ) )
251 {
253 eda_text->SetTextSize( VECTOR2I( m_textSize.GetValue(), m_textSize.GetValue() ) );
254
255 if( m_setTextColor->GetValue() )
256 eda_text->SetTextColor( m_textColorSwatch->GetSwatchColor() );
257
258 if( m_hAlign->GetStringSelection() != INDETERMINATE_ACTION )
259 {
260 GR_TEXT_H_ALIGN_T hAlign = EDA_TEXT::MapHorizJustify( m_hAlign->GetSelection() - 1 );
261 SCH_SYMBOL* parentSymbol = dynamic_cast<SCH_SYMBOL*>( aItem->GetParent() );
262
263 if( parentSymbol && parentSymbol->GetTransform().x1 < 0 )
264 {
265 if( hAlign == GR_TEXT_H_ALIGN_LEFT )
266 hAlign = GR_TEXT_H_ALIGN_RIGHT;
267 else if( hAlign == GR_TEXT_H_ALIGN_RIGHT )
268 hAlign = GR_TEXT_H_ALIGN_LEFT;
269 }
270
271 eda_text->SetHorizJustify( hAlign );
272 }
273
274 if( m_vAlign->GetStringSelection() != INDETERMINATE_ACTION )
275 {
276 GR_TEXT_V_ALIGN_T vAlign = EDA_TEXT::MapVertJustify( m_vAlign->GetSelection() - 1 );
277 SCH_SYMBOL* parentSymbol = dynamic_cast<SCH_SYMBOL*>( aItem->GetParent() );
278
279 if( parentSymbol && parentSymbol->GetTransform().y1 < 0 )
280 {
281 if( vAlign == GR_TEXT_V_ALIGN_TOP )
282 vAlign = GR_TEXT_V_ALIGN_BOTTOM;
283 else if( vAlign == GR_TEXT_V_ALIGN_BOTTOM )
284 vAlign = GR_TEXT_V_ALIGN_TOP;
285 }
286
287 eda_text->SetVertJustify( vAlign );
288 }
289
290 if( m_visible->Get3StateValue() != wxCHK_UNDETERMINED )
291 eda_text->SetVisible( m_visible->GetValue() );
292
293 if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED )
294 eda_text->SetItalic( m_italic->GetValue() );
295
296 if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
297 eda_text->SetBold( m_bold->GetValue() );
298
299 // Must come after bold & italic
300 if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
301 {
302 eda_text->SetFont( m_fontCtrl->GetFontSelection( eda_text->IsBold(),
303 eda_text->IsItalic() ) );
304 }
305 else if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED
306 || m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
307 {
308 if( !eda_text->GetFontName().IsEmpty() )
309 {
310 eda_text->SetFont( KIFONT::FONT::GetFont( eda_text->GetFontName(),
311 eda_text->IsBold(),
312 eda_text->IsItalic() ) );
313 }
314 }
315 }
316
317 if( SCH_LABEL_BASE* sch_label = dynamic_cast<SCH_LABEL_BASE*>( aItem ) )
318 {
319 if( m_orientation->GetStringSelection() != INDETERMINATE_ACTION )
320 sch_label->SetSpinStyle( (SPIN_STYLE::SPIN) m_orientation->GetSelection() );
321 }
322
323 if( SCH_FIELD* sch_field = dynamic_cast<SCH_FIELD*>( aItem ) )
324 {
325 if( m_showFieldNames->Get3StateValue() != wxCHK_UNDETERMINED )
326 sch_field->SetNameShown( m_showFieldNames->GetValue() );
327 }
328
329 if( aItem->HasLineStroke() )
330 {
331 STROKE_PARAMS stroke = aItem->GetStroke();
332
334 stroke.SetWidth( m_lineWidth.GetValue() );
335
336 if( m_lineStyle->GetStringSelection() != INDETERMINATE_ACTION )
337 {
338 if( m_lineStyle->GetStringSelection() == DEFAULT_STYLE )
339 stroke.SetLineStyle( LINE_STYLE::DEFAULT );
340 else
341 stroke.SetLineStyle( (LINE_STYLE) m_lineStyle->GetSelection() );
342 }
343
344 if( m_setColor->GetValue() )
346
347 aItem->SetStroke( stroke );
348 }
349
350 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
351 {
352 if( m_setFillColor->GetValue() )
353 {
354 shape->SetFillColor( m_fillColorSwatch->GetSwatchColor() );
355
356 if( m_fillColorSwatch->GetSwatchColor() == COLOR4D::UNSPECIFIED )
357 shape->SetFillMode( FILL_T::NO_FILL );
358 else
359 shape->SetFillMode( FILL_T::FILLED_WITH_COLOR );
360 }
361 }
362
363 if( SCH_JUNCTION* junction = dynamic_cast<SCH_JUNCTION*>( aItem ) )
364 {
366 junction->SetDiameter( m_junctionSize.GetValue() );
367
368 if( m_setDotColor->GetValue() )
369 junction->SetColor( m_dotColorSwatch->GetSwatchColor() );
370 }
371}
372
374 const SCH_SHEET_PATH& aSheetPath,
375 SCH_ITEM* aItem )
376{
377 if( m_netFilterOpt->GetValue() && !m_netFilter->GetValue().IsEmpty() )
378 {
379 SCH_CONNECTION* connection = aItem->Connection( &aSheetPath );
380
381 if( !connection )
382 return;
383
384 if( !WildCompareString( m_netFilter->GetValue(), connection->Name(), false ) )
385 return;
386 }
387
388 if( m_referenceFilterOpt->GetValue() && !m_referenceFilter->GetValue().IsEmpty() )
389 {
390 if( aItem->Type() == SCH_SYMBOL_T )
391 {
392 wxString ref = static_cast<SCH_SYMBOL*>( aItem )->GetRef( &aSheetPath );
393
394 if( !WildCompareString( m_referenceFilter->GetValue(), ref, false ) )
395 return;
396 }
397 }
398
399 if( m_symbolFilterOpt->GetValue() && !m_symbolFilter->GetValue().IsEmpty() )
400 {
401 if( aItem->Type() == SCH_SYMBOL_T )
402 {
403 wxString id = UnescapeString( static_cast<SCH_SYMBOL*>( aItem )->GetLibId().Format() );
404
405 if( !WildCompareString( m_symbolFilter->GetValue(), id, false ) )
406 return;
407 }
408 }
409
410 if( m_typeFilterOpt->GetValue() )
411 {
412 if( aItem->Type() == SCH_SYMBOL_T )
413 {
414 bool isPower = static_cast<SCH_SYMBOL*>( aItem )->GetLibSymbolRef()->IsPower();
415
416 if( isPower != ( m_typeFilter->GetSelection() == 1 ) )
417 return;
418 }
419 }
420
421 switch( aItem->Type() )
422 {
423 case SCH_SYMBOL_T:
424 {
425 SCH_SYMBOL* symbol = (SCH_SYMBOL*) aItem;
426
427 if( m_references->GetValue() )
428 processItem( aCommit, aSheetPath, symbol->GetField( REFERENCE_FIELD ) );
429
430 if( m_values->GetValue() )
431 processItem( aCommit, aSheetPath, symbol->GetField( VALUE_FIELD ) );
432
433 if( m_otherFields->GetValue() )
434 {
435 for( int i = 2; i < symbol->GetFieldCount(); ++i )
436 {
437 SCH_FIELD& field = symbol->GetFields()[i];
438 const wxString& fieldName = field.GetName();
439
440 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
441 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
442 {
443 processItem( aCommit, aSheetPath, &field );
444 }
445 }
446 }
447
448 break;
449 }
450
451 case SCH_SHEET_T:
452 {
453 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( aItem );
454
455 if( m_sheetTitles->GetValue() )
456 processItem( aCommit, aSheetPath, &sheet->GetFields()[SHEETNAME] );
457
458 if( m_sheetFields->GetValue() )
459 {
460 for( SCH_FIELD& field : sheet->GetFields() )
461 {
462 if( field.GetId() == SHEETNAME )
463 continue;
464
465 const wxString& fieldName = field.GetName();
466
467 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
468 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
469 {
470 processItem( aCommit, aSheetPath, &field );
471 }
472 }
473 }
474
475 if( m_sheetBorders->GetValue() )
476 {
479
480 if( m_setColor->GetValue() )
482
483 if( m_setFillColor->GetValue() )
485 }
486
487 if( m_sheetPins->GetValue() )
488 {
489 for( SCH_SHEET_PIN* pin : sheet->GetPins() )
490 processItem( aCommit, aSheetPath, pin );
491 }
492
493 break;
494 }
495
496 case SCH_LINE_T:
497 if( m_schTextAndGraphics->GetValue() && aItem->GetLayer() == LAYER_NOTES )
498 processItem( aCommit, aSheetPath, aItem );
499 else if( m_wires->GetValue() && aItem->GetLayer() == LAYER_WIRE )
500 processItem( aCommit, aSheetPath, aItem );
501 else if( m_buses->GetValue() && aItem->GetLayer() == LAYER_BUS )
502 processItem( aCommit, aSheetPath, aItem );
503
504 break;
505
506 case SCH_LABEL_T:
508 case SCH_HIER_LABEL_T:
510 if( m_wires->GetValue() && aItem->IsType( { SCH_LABEL_LOCATE_WIRE_T } ) )
511 processItem( aCommit, aSheetPath, aItem );
512
513 if( m_buses->GetValue() && aItem->IsType( { SCH_LABEL_LOCATE_BUS_T } ) )
514 processItem( aCommit, aSheetPath, aItem );
515
516 if( m_globalLabels->GetValue() && aItem->Type() == SCH_GLOBAL_LABEL_T )
517 processItem( aCommit, aSheetPath, aItem );
518
519 if( m_hierLabels->GetValue() && aItem->Type() == SCH_HIER_LABEL_T )
520 processItem( aCommit, aSheetPath, aItem );
521
522 if( m_labelFields->GetValue() )
523 {
524 for( SCH_FIELD& field : static_cast<SCH_LABEL_BASE*>( aItem )->GetFields() )
525 {
526 const wxString& fieldName = field.GetName();
527
528 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
529 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
530 {
531 processItem( aCommit, aSheetPath, &field );
532 }
533 }
534 }
535
536 break;
537
538 case SCH_JUNCTION_T:
539 {
540 SCH_JUNCTION* junction = static_cast<SCH_JUNCTION*>( aItem );
541
542 for( SCH_ITEM* item : junction->ConnectedItems( aSheetPath ) )
543 {
544 if( item->GetLayer() == LAYER_BUS && m_buses->GetValue() )
545 {
546 processItem( aCommit, aSheetPath, aItem );
547 break;
548 }
549 else if( item->GetLayer() == LAYER_WIRE && m_wires->GetValue() )
550 {
551 processItem( aCommit, aSheetPath, aItem );
552 break;
553 }
554 }
555
556 break;
557 }
558
559 case SCH_TEXT_T:
560 case SCH_TEXTBOX_T:
561 case SCH_SHAPE_T:
562 if( m_schTextAndGraphics->GetValue() )
563 processItem( aCommit, aSheetPath, aItem );
564
565 break;
566
567 default:
568 break;
569 }
570}
571
572
574{
575 if( !m_textSize.Validate( 1.0, 10000.0, EDA_UNITS::MILS ) ) // 1 mil .. 10 inches
576 return false;
577
578 SCH_SHEET_PATH currentSheet = m_parent->GetCurrentSheet();
579 SCH_COMMIT commit( m_parent );
580
581 // Go through sheets
582 for( const SCH_SHEET_PATH& sheetPath : m_parent->Schematic().GetSheets() )
583 {
584 SCH_SCREEN* screen = sheetPath.LastScreen();
585
586 if( screen )
587 {
588 m_parent->SetCurrentSheet( sheetPath );
589
590 for( SCH_ITEM* item : screen->Items() )
591 visitItem( &commit, sheetPath, item );
592 }
593 }
594
595 if( !commit.Empty() )
596 {
597 commit.Push( _( "Edit Text and Graphics" ), SKIP_CONNECTIVITY );
599 }
600
601 // Reset the view to where we left the user
602 m_parent->SetCurrentSheet( currentSheet );
603 m_parent->Refresh();
604
605 return true;
606}
607
608
610{
612 dlg.ShowModal();
613 return 0;
614}
615
616
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)
Create an undo entry for an item that has been already modified.
Definition: commit.h:103
bool Empty() const
Returns status of an item.
Definition: commit.h:142
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...
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:80
static GR_TEXT_H_ALIGN_T MapHorizJustify(int aHorizJustify)
Definition: eda_text.cpp:63
static GR_TEXT_V_ALIGN_T MapVertJustify(int aVertJustify)
Definition: eda_text.cpp:77
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:146
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
Definition: schematic.h:100
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
Definition: sch_commit.cpp:353
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:52
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Definition: sch_field.cpp:1000
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:151
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:197
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:258
virtual void SetStroke(const STROKE_PARAMS &aStroke)
Definition: sch_item.h:488
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:147
virtual STROKE_PARAMS GetStroke() const
Definition: sch_item.h:486
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
Definition: sch_item.h:484
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_item.h:166
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:119
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:93
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:122
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:116
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:181
Schematic symbol object.
Definition: sch_symbol.h:81
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: sch_symbol.h:476
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:940
TRANSFORM & GetTransform()
Definition: sch_symbol.h:285
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
Definition: sch_symbol.cpp:988
bool IsPower() const
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:81
void SetLineStyle(LINE_STYLE aLineStyle)
Definition: stroke_params.h:95
void SetWidth(int aWidth)
Definition: stroke_params.h:92
void SetColor(const KIGFX::COLOR4D &aColor)
Definition: stroke_params.h:98
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
Generic, UI-independent tool event.
Definition: tool_event.h:167
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:349
@ LAYER_NOTES
Definition: layer_ids.h:363
@ LAYER_BUS
Definition: layer_ids.h:350
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
#define SKIP_CONNECTIVITY
Definition: sch_commit.h:43
@ 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: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_LINE_T
Definition: typeinfo.h:146
@ SCH_SYMBOL_T
Definition: typeinfo.h:156
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:154
@ SCH_LABEL_T
Definition: typeinfo.h:151
@ SCH_SHEET_T
Definition: typeinfo.h:158
@ SCH_SHAPE_T
Definition: typeinfo.h:147
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:153
@ SCH_TEXT_T
Definition: typeinfo.h:150
@ SCH_TEXTBOX_T
Definition: typeinfo.h:149
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:152
@ SCH_JUNCTION_T
Definition: typeinfo.h:142
#define INDETERMINATE_ACTION
Definition: ui_common.h:45
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588