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-2024 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 // Must come after SetTextSize()
297 if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
298 eda_text->SetBold( m_bold->GetValue() );
299
300 // Must come after SetBold() & SetItalic()
301 if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
302 {
303 eda_text->SetFont( m_fontCtrl->GetFontSelection( eda_text->IsBold(),
304 eda_text->IsItalic() ) );
305 }
306 else if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED
307 || m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
308 {
309 if( !eda_text->GetFontName().IsEmpty() )
310 {
311 eda_text->SetFont( KIFONT::FONT::GetFont( eda_text->GetFontName(),
312 eda_text->IsBold(),
313 eda_text->IsItalic() ) );
314 }
315 }
316 }
317
318 if( SCH_LABEL_BASE* sch_label = dynamic_cast<SCH_LABEL_BASE*>( aItem ) )
319 {
320 if( m_orientation->GetStringSelection() != INDETERMINATE_ACTION )
321 sch_label->SetSpinStyle( (SPIN_STYLE::SPIN) m_orientation->GetSelection() );
322 }
323
324 if( SCH_FIELD* sch_field = dynamic_cast<SCH_FIELD*>( aItem ) )
325 {
326 if( m_showFieldNames->Get3StateValue() != wxCHK_UNDETERMINED )
327 sch_field->SetNameShown( m_showFieldNames->GetValue() );
328 }
329
330 if( aItem->HasLineStroke() )
331 {
332 STROKE_PARAMS stroke = aItem->GetStroke();
333
335 stroke.SetWidth( m_lineWidth.GetValue() );
336
337 if( m_lineStyle->GetStringSelection() != INDETERMINATE_ACTION )
338 {
339 if( m_lineStyle->GetStringSelection() == DEFAULT_STYLE )
340 stroke.SetLineStyle( LINE_STYLE::DEFAULT );
341 else
342 stroke.SetLineStyle( (LINE_STYLE) m_lineStyle->GetSelection() );
343 }
344
345 if( m_setColor->GetValue() )
347
348 aItem->SetStroke( stroke );
349 }
350
351 if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
352 {
353 if( m_setFillColor->GetValue() )
354 {
355 shape->SetFillColor( m_fillColorSwatch->GetSwatchColor() );
356
357 if( m_fillColorSwatch->GetSwatchColor() == COLOR4D::UNSPECIFIED )
358 shape->SetFillMode( FILL_T::NO_FILL );
359 else
360 shape->SetFillMode( FILL_T::FILLED_WITH_COLOR );
361 }
362 }
363
364 if( SCH_JUNCTION* junction = dynamic_cast<SCH_JUNCTION*>( aItem ) )
365 {
367 junction->SetDiameter( m_junctionSize.GetValue() );
368
369 if( m_setDotColor->GetValue() )
370 junction->SetColor( m_dotColorSwatch->GetSwatchColor() );
371 }
372}
373
375 const SCH_SHEET_PATH& aSheetPath,
376 SCH_ITEM* aItem )
377{
378 if( m_netFilterOpt->GetValue() && !m_netFilter->GetValue().IsEmpty() )
379 {
380 SCH_CONNECTION* connection = aItem->Connection( &aSheetPath );
381
382 if( !connection )
383 return;
384
385 if( !WildCompareString( m_netFilter->GetValue(), connection->Name(), false ) )
386 return;
387 }
388
389 if( m_referenceFilterOpt->GetValue() && !m_referenceFilter->GetValue().IsEmpty() )
390 {
391 if( aItem->Type() == SCH_SYMBOL_T )
392 {
393 wxString ref = static_cast<SCH_SYMBOL*>( aItem )->GetRef( &aSheetPath );
394
395 if( !WildCompareString( m_referenceFilter->GetValue(), ref, false ) )
396 return;
397 }
398 }
399
400 if( m_symbolFilterOpt->GetValue() && !m_symbolFilter->GetValue().IsEmpty() )
401 {
402 if( aItem->Type() == SCH_SYMBOL_T )
403 {
404 wxString id = UnescapeString( static_cast<SCH_SYMBOL*>( aItem )->GetLibId().Format() );
405
406 if( !WildCompareString( m_symbolFilter->GetValue(), id, false ) )
407 return;
408 }
409 }
410
411 if( m_typeFilterOpt->GetValue() )
412 {
413 if( aItem->Type() == SCH_SYMBOL_T )
414 {
415 bool isPower = static_cast<SCH_SYMBOL*>( aItem )->GetLibSymbolRef()->IsPower();
416
417 if( isPower != ( m_typeFilter->GetSelection() == 1 ) )
418 return;
419 }
420 }
421
422 switch( aItem->Type() )
423 {
424 case SCH_SYMBOL_T:
425 {
426 SCH_SYMBOL* symbol = (SCH_SYMBOL*) aItem;
427
428 if( m_references->GetValue() )
429 processItem( aCommit, aSheetPath, symbol->GetField( REFERENCE_FIELD ) );
430
431 if( m_values->GetValue() )
432 processItem( aCommit, aSheetPath, symbol->GetField( VALUE_FIELD ) );
433
434 if( m_otherFields->GetValue() )
435 {
436 for( int i = 2; i < symbol->GetFieldCount(); ++i )
437 {
438 SCH_FIELD& field = symbol->GetFields()[i];
439 const wxString& fieldName = field.GetName();
440
441 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
442 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
443 {
444 processItem( aCommit, aSheetPath, &field );
445 }
446 }
447 }
448
449 break;
450 }
451
452 case SCH_SHEET_T:
453 {
454 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( aItem );
455
456 if( m_sheetTitles->GetValue() )
457 processItem( aCommit, aSheetPath, &sheet->GetFields()[SHEETNAME] );
458
459 if( m_sheetFields->GetValue() )
460 {
461 for( SCH_FIELD& field : sheet->GetFields() )
462 {
463 if( field.GetId() == SHEETNAME )
464 continue;
465
466 const wxString& fieldName = field.GetName();
467
468 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
469 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
470 {
471 processItem( aCommit, aSheetPath, &field );
472 }
473 }
474 }
475
476 if( m_sheetBorders->GetValue() )
477 {
480
481 if( m_setColor->GetValue() )
483
484 if( m_setFillColor->GetValue() )
486 }
487
488 if( m_sheetPins->GetValue() )
489 {
490 for( SCH_SHEET_PIN* pin : sheet->GetPins() )
491 processItem( aCommit, aSheetPath, pin );
492 }
493
494 break;
495 }
496
497 case SCH_LINE_T:
498 if( m_schTextAndGraphics->GetValue() && aItem->GetLayer() == LAYER_NOTES )
499 processItem( aCommit, aSheetPath, aItem );
500 else if( m_wires->GetValue() && aItem->GetLayer() == LAYER_WIRE )
501 processItem( aCommit, aSheetPath, aItem );
502 else if( m_buses->GetValue() && aItem->GetLayer() == LAYER_BUS )
503 processItem( aCommit, aSheetPath, aItem );
504
505 break;
506
507 case SCH_LABEL_T:
509 case SCH_HIER_LABEL_T:
511 if( m_wires->GetValue() && aItem->IsType( { SCH_LABEL_LOCATE_WIRE_T } ) )
512 processItem( aCommit, aSheetPath, aItem );
513
514 if( m_buses->GetValue() && aItem->IsType( { SCH_LABEL_LOCATE_BUS_T } ) )
515 processItem( aCommit, aSheetPath, aItem );
516
517 if( m_globalLabels->GetValue() && aItem->Type() == SCH_GLOBAL_LABEL_T )
518 processItem( aCommit, aSheetPath, aItem );
519
520 if( m_hierLabels->GetValue() && aItem->Type() == SCH_HIER_LABEL_T )
521 processItem( aCommit, aSheetPath, aItem );
522
523 if( m_labelFields->GetValue() )
524 {
525 for( SCH_FIELD& field : static_cast<SCH_LABEL_BASE*>( aItem )->GetFields() )
526 {
527 const wxString& fieldName = field.GetName();
528
529 if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty()
530 || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) )
531 {
532 processItem( aCommit, aSheetPath, &field );
533 }
534 }
535 }
536
537 break;
538
539 case SCH_JUNCTION_T:
540 {
541 SCH_JUNCTION* junction = static_cast<SCH_JUNCTION*>( aItem );
542
543 for( SCH_ITEM* item : junction->ConnectedItems( aSheetPath ) )
544 {
545 if( item->GetLayer() == LAYER_BUS && m_buses->GetValue() )
546 {
547 processItem( aCommit, aSheetPath, aItem );
548 break;
549 }
550 else if( item->GetLayer() == LAYER_WIRE && m_wires->GetValue() )
551 {
552 processItem( aCommit, aSheetPath, aItem );
553 break;
554 }
555 }
556
557 break;
558 }
559
560 case SCH_TEXT_T:
561 case SCH_TEXTBOX_T:
562 case SCH_SHAPE_T:
563 if( m_schTextAndGraphics->GetValue() )
564 processItem( aCommit, aSheetPath, aItem );
565
566 break;
567
568 default:
569 break;
570 }
571}
572
573
575{
576 if( !m_textSize.Validate( 1.0, 10000.0, EDA_UNITS::MILS ) ) // 1 mil .. 10 inches
577 return false;
578
579 SCH_SHEET_PATH currentSheet = m_parent->GetCurrentSheet();
580 SCH_COMMIT commit( m_parent );
581
582 // Go through sheets
583 for( const SCH_SHEET_PATH& sheetPath : m_parent->Schematic().GetSheets() )
584 {
585 SCH_SCREEN* screen = sheetPath.LastScreen();
586
587 if( screen )
588 {
589 m_parent->SetCurrentSheet( sheetPath );
590
591 for( SCH_ITEM* item : screen->Items() )
592 visitItem( &commit, sheetPath, item );
593 }
594 }
595
596 if( !commit.Empty() )
597 {
598 commit.Push( _( "Edit Text and Graphics" ) );
600 }
601
602 // Reset the view to where we left the user
603 m_parent->SetCurrentSheet( currentSheet );
604 m_parent->Refresh();
605
606 return true;
607}
608
609
611{
613 dlg.ShowModal();
614 return 0;
615}
616
617
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:105
bool Empty() const
Returns status of an item.
Definition: commit.h:144
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:393
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:1002
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:165
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:272
virtual void SetStroke(const STROKE_PARAMS &aStroke)
Definition: sch_item.h:526
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:524
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
Definition: sch_item.h:522
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_item.h:180
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:109
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: sch_symbol.h:588
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:953
TRANSFORM & GetTransform()
Definition: sch_symbol.h:314
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
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:355
@ LAYER_NOTES
Definition: layer_ids.h:369
@ LAYER_BUS
Definition: layer_ids.h:356
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)
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:148
@ SCH_SYMBOL_T
Definition: typeinfo.h:160
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:158
@ SCH_LABEL_T
Definition: typeinfo.h:155
@ SCH_SHEET_T
Definition: typeinfo.h:162
@ SCH_SHAPE_T
Definition: typeinfo.h:149
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:157
@ SCH_TEXT_T
Definition: typeinfo.h:152
@ SCH_TEXTBOX_T
Definition: typeinfo.h:151
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:156
@ SCH_JUNCTION_T
Definition: typeinfo.h:144
#define INDETERMINATE_ACTION
Definition: ui_common.h:45
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588