KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_edit_frame.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) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include <base_units.h>
26#include <bitmaps.h>
27#include <symbol_library.h>
28#include <confirm.h>
29#include <connection_graph.h>
30#include <dialogs/dialog_erc.h>
34#include <eeschema_id.h>
35#include <executable_names.h>
37#include <gestfich.h>
39#include <core/ignore.h>
40#include <invoke_sch_dialog.h>
41#include <string_utils.h>
42#include <kiface_base.h>
43#include <kiplatform/app.h>
44#include <kiway.h>
45#include <symbol_edit_frame.h>
46#include <symbol_viewer_frame.h>
47#include <pgm_base.h>
48#include <core/profile.h>
51#include <python_scripting.h>
52#include <sch_edit_frame.h>
54#include <sch_painter.h>
55#include <sch_sheet.h>
56#include <sch_marker.h>
57#include <sch_sheet_pin.h>
58#include <schematic.h>
59#include <sch_commit.h>
61#include <advanced_config.h>
62#include <sim/simulator_frame.h>
63#include <tool/action_manager.h>
64#include <tool/action_toolbar.h>
65#include <tool/common_control.h>
66#include <tool/common_tools.h>
67#include <tool/picker_tool.h>
69#include <tool/selection.h>
71#include <tool/tool_manager.h>
72#include <tool/zoom_tool.h>
73#include <tools/ee_actions.h>
78#include <tools/sch_edit_tool.h>
83#include <tools/sch_move_tool.h>
86#include <view/view_controls.h>
87#include <widgets/wx_infobar.h>
92#include <wx/cmdline.h>
93#include <wx/app.h>
94#include <wx/filedlg.h>
95#include <wx/socket.h>
99
100
101#define DIFF_SYMBOLS_DIALOG_NAME wxT( "DiffSymbolsDialog" )
102
103
104BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, SCH_BASE_FRAME )
107
108 EVT_SIZE( SCH_EDIT_FRAME::OnSize )
109
112
115
116 EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
117 EVT_MENU( wxID_CLOSE, SCH_EDIT_FRAME::OnExit )
118
119 // Drop files event
120 EVT_DROP_FILES( SCH_EDIT_FRAME::OnDropFiles )
121END_EVENT_TABLE()
122
123
124wxDEFINE_EVENT( EDA_EVT_SCHEMATIC_CHANGING, wxCommandEvent );
125wxDEFINE_EVENT( EDA_EVT_SCHEMATIC_CHANGED, wxCommandEvent );
126
127
128SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
129 SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH, wxT( "Eeschema" ), wxDefaultPosition,
131 m_ercDialog( nullptr ),
132 m_diffSymbolDialog( nullptr ),
133 m_symbolFieldsTableDialog( nullptr ),
134 m_netNavigator( nullptr ),
135 m_highlightedConnChanged( false )
136{
137 m_maximizeByDefault = true;
138 m_schematic = new SCHEMATIC( nullptr );
139
140 m_showBorderAndTitleBlock = true; // true to show sheet references
141 m_supportsAutoSave = true;
142 m_syncingPcbToSchSelection = false;
143 m_aboutTitle = _HKI( "KiCad Schematic Editor" );
144 m_show_search = false;
145
146 m_findReplaceDialog = nullptr;
147
148 m_findReplaceData = std::make_unique<SCH_SEARCH_DATA>();
149
150 // Give an icon
151 wxIcon icon;
152 wxIconBundle icon_bundle;
153
154 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_eeschema, 48 ) );
155 icon_bundle.AddIcon( icon );
156 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_eeschema, 128 ) );
157 icon_bundle.AddIcon( icon );
158 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_eeschema, 256 ) );
159 icon_bundle.AddIcon( icon );
160 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_eeschema_32 ) );
161 icon_bundle.AddIcon( icon );
162 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_eeschema_16 ) );
163 icon_bundle.AddIcon( icon );
164
165 SetIcons( icon_bundle );
166
167 LoadSettings( eeconfig() );
168
169 // NB: also links the schematic to the loaded project
170 CreateScreens();
171 SetCurrentSheet( Schematic().GetSheets()[0] );
172
173 setupTools();
174 setupUIConditions();
175 ReCreateMenuBar();
176 ReCreateHToolbar();
177 ReCreateVToolbar();
178 ReCreateOptToolbar();
179
180 m_hierarchy = new HIERARCHY_PANE( this );
181
182 // Initialize common print setup dialog settings.
183 m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER );
184 m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_MEDIUM );
185 m_pageSetupData.GetPrintData().SetBin( wxPRINTBIN_AUTO );
186 m_pageSetupData.GetPrintData().SetNoCopies( 1 );
187
188 m_searchPane = new SCH_SEARCH_PANE( this );
189 m_propertiesPanel = new SCH_PROPERTIES_PANEL( this, this );
190
191 m_propertiesPanel->SetSplitterProportion( eeconfig()->m_AuiPanels.properties_splitter );
192
193 m_selectionFilterPanel = new PANEL_SCH_SELECTION_FILTER( this );
194
195 m_auimgr.SetManagedWindow( this );
196
197 CreateInfoBar();
198
199 // Rows; layers 4 - 6
200 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
201 .Top().Layer( 6 ) );
202
203 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( wxS( "MsgPanel" ) )
204 .Bottom().Layer( 6 ) );
205
206 // Columns; layers 1 - 3
207 m_auimgr.AddPane( m_hierarchy, EDA_PANE().Palette().Name( SchematicHierarchyPaneName() )
208 .Caption( _( "Schematic Hierarchy" ) )
209 .Left().Layer( 3 ).Position( 1 )
210 .TopDockable( false )
211 .BottomDockable( false )
212 .CloseButton( false )
213 .MinSize( FromDIP( wxSize( 120, 60 ) ) )
214 .BestSize( FromDIP( wxSize( 200, 200 ) ) )
215 .FloatingSize( FromDIP( wxSize( 200, 200 ) ) )
216 .FloatingPosition( FromDIP( wxPoint( 50, 50 ) ) )
217 .Show( false ) );
218
219 m_auimgr.AddPane( m_propertiesPanel, defaultPropertiesPaneInfo( this ) );
220 m_auimgr.AddPane( m_selectionFilterPanel, defaultSchSelectionFilterPaneInfo( this ) );
221
222 m_auimgr.AddPane( createHighlightedNetNavigator(), defaultNetNavigatorPaneInfo() );
223
224 m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( wxS( "OptToolbar" ) )
225 .Left().Layer( 2 ) );
226
227 m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( wxS( "ToolsToolbar" ) )
228 .Right().Layer( 2 ) );
229
230 // Center
231 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
232 .Center() );
233
234 m_auimgr.AddPane( m_searchPane, EDA_PANE()
235 .Name( SearchPaneName() )
236 .Bottom()
237 .Caption( _( "Search" ) )
238 .PaneBorder( false )
239 .MinSize( FromDIP( wxSize( 180, 60 ) ) )
240 .BestSize( FromDIP( wxSize( 180, 100 ) ) )
241 .FloatingSize( FromDIP( wxSize( 480, 200 ) ) )
242 .CloseButton( false )
243 .DestroyOnClose( false )
244 .Show( m_show_search ) );
245
246 FinishAUIInitialization();
247
248 resolveCanvasType();
249 SwitchCanvas( m_canvasType );
250
251 GetCanvas()->GetGAL()->SetAxesEnabled( false );
252
253 KIGFX::SCH_VIEW* view = GetCanvas()->GetView();
254 static_cast<KIGFX::SCH_PAINTER*>( view->GetPainter() )->SetSchematic( m_schematic );
255
256 wxAuiPaneInfo& hierarchy_pane = m_auimgr.GetPane( SchematicHierarchyPaneName() );
257 wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
258 wxAuiPaneInfo& propertiesPane = m_auimgr.GetPane( PropertiesPaneName() );
259 wxAuiPaneInfo& selectionFilterPane = m_auimgr.GetPane( wxS( "SelectionFilter" ) );
260 EESCHEMA_SETTINGS* cfg = eeconfig();
261
262 hierarchy_pane.Show( cfg->m_AuiPanels.show_schematic_hierarchy );
263 netNavigatorPane.Show( cfg->m_AuiPanels.show_net_nav_panel );
264 propertiesPane.Show( cfg->m_AuiPanels.show_properties );
265 updateSelectionFilterVisbility();
266
267 // The selection filter doesn't need to grow in the vertical direction when docked
268 selectionFilterPane.dock_proportion = 0;
269
272 {
273 // Show at end, after positioning
274 hierarchy_pane.FloatingSize( cfg->m_AuiPanels.hierarchy_panel_float_width,
276 }
277
278 if( cfg->m_AuiPanels.net_nav_panel_float_size.GetWidth() > 0
279 && cfg->m_AuiPanels.net_nav_panel_float_size.GetHeight() > 0 )
280 {
281 netNavigatorPane.FloatingSize( cfg->m_AuiPanels.net_nav_panel_float_size );
282 netNavigatorPane.FloatingPosition( cfg->m_AuiPanels.net_nav_panel_float_pos );
283 }
284
286 SetAuiPaneSize( m_auimgr, propertiesPane, cfg->m_AuiPanels.properties_panel_width, -1 );
287
289 hierarchy_pane.Float();
290
292 && ( cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_TOP
293 || cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_BOTTOM ) )
294 {
295 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
296 searchPane.Direction( cfg->m_AuiPanels.search_panel_dock_direction );
297 SetAuiPaneSize( m_auimgr, searchPane, -1, cfg->m_AuiPanels.search_panel_height );
298 }
299
300 else if( cfg->m_AuiPanels.search_panel_width > 0
301 && ( cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_LEFT
302 || cfg->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_RIGHT ) )
303 {
304 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
305 searchPane.Direction( cfg->m_AuiPanels.search_panel_dock_direction );
306 SetAuiPaneSize( m_auimgr, searchPane, cfg->m_AuiPanels.search_panel_width, -1 );
307 }
308
310 netNavigatorPane.Float();
311
313 {
314 // If the net navigator is not show, let the hierarchy navigator take all of the vertical
315 // space.
317 {
318 SetAuiPaneSize( m_auimgr, hierarchy_pane,
320 }
321 else
322 {
323 SetAuiPaneSize( m_auimgr, hierarchy_pane,
326
327 SetAuiPaneSize( m_auimgr, netNavigatorPane,
329 cfg->m_AuiPanels.net_nav_panel_docked_size.GetHeight() );
330 }
331
332 // wxAUI hack: force width by setting MinSize() and then Fixed()
333 // thanks to ZenJu https://github.com/wxWidgets/wxWidgets/issues/13180
334 hierarchy_pane.MinSize( cfg->m_AuiPanels.hierarchy_panel_docked_width, 60 );
335 hierarchy_pane.Fixed();
336 netNavigatorPane.MinSize( cfg->m_AuiPanels.net_nav_panel_docked_size.GetWidth(), 60 );
337 netNavigatorPane.Fixed();
338 m_auimgr.Update();
339
340 // now make it resizable again
341 hierarchy_pane.Resizable();
342 netNavigatorPane.Resizable();
343 m_auimgr.Update();
344
345 // Note: DO NOT call m_auimgr.Update() anywhere after this; it will nuke the size
346 // back to minimum.
347 hierarchy_pane.MinSize( FromDIP( wxSize( 120, 60 ) ) );
348 netNavigatorPane.MinSize( FromDIP( wxSize( 120, 60 ) ) );
349 }
350 else
351 {
352 m_auimgr.Update();
353 }
354
355 LoadProjectSettings();
356
362
363 initScreenZoom();
364
365 m_hierarchy->Bind( wxEVT_SIZE, &SCH_EDIT_FRAME::OnResizeHierarchyNavigator, this );
366 m_netNavigator->Bind( wxEVT_TREE_SEL_CHANGING, &SCH_EDIT_FRAME::onNetNavigatorSelChanging,
367 this );
368 m_netNavigator->Bind( wxEVT_TREE_SEL_CHANGED, &SCH_EDIT_FRAME::onNetNavigatorSelection, this );
369 m_netNavigator->Bind( wxEVT_SIZE, &SCH_EDIT_FRAME::onResizeNetNavigator, this );
370
371 // This is used temporarily to fix a client size issue on GTK that causes zoom to fit
372 // to calculate the wrong zoom size. See SCH_EDIT_FRAME::onSize().
373 Bind( wxEVT_SIZE, &SCH_EDIT_FRAME::onSize, this );
374
375 setupUnits( eeconfig() );
376
377 // Net list generator
378 DefaultExecFlags();
379
380 updateTitle();
381 m_toolManager->GetTool<SCH_NAVIGATE_TOOL>()->ResetHistory();
382
383 // Default shutdown reason until a file is loaded
384 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "New schematic file is unsaved" ) );
385
386 // Init for dropping files
388 DragAcceptFiles( true );
389
390 // Ensure the window is on top
391 Raise();
392
393 // Now that all sizes are fixed, set the initial hierarchy_pane floating position to the
394 // top-left corner of the canvas
395 wxPoint canvas_pos = GetCanvas()->GetScreenPosition();
396 hierarchy_pane.FloatingPosition( canvas_pos.x + 10, canvas_pos.y + 10 );
397
398 Bind( EDA_EVT_CLOSE_DIALOG_BOOK_REPORTER, &SCH_EDIT_FRAME::onCloseSymbolDiffDialog, this );
399 Bind( EDA_EVT_CLOSE_ERC_DIALOG, &SCH_EDIT_FRAME::onCloseErcDialog, this );
400 Bind( EDA_EVT_CLOSE_DIALOG_SYMBOL_FIELDS_TABLE, &SCH_EDIT_FRAME::onCloseSymbolFieldsTableDialog,
401 this );
402}
403
404
406{
407 m_hierarchy->Unbind( wxEVT_SIZE, &SCH_EDIT_FRAME::OnResizeHierarchyNavigator, this );
408
409 // Ensure m_canvasType is up to date, to save it in config
411
412 SetScreen( nullptr );
413
414 if( m_schematic )
416
417 delete m_schematic;
418 m_schematic = nullptr;
419
420 // Close the project if we are standalone, so it gets cleaned up properly
421 if( Kiface().IsSingle() )
422 {
423 try
424 {
425 GetSettingsManager()->UnloadProject( &Prj(), false );
426 }
427 catch( const nlohmann::detail::type_error& exc )
428 {
429 // This may be overkill and could be an assertion but we are more likely to
430 // find any settings manager errors this way.
431 wxLogError( wxT( "Settings exception '%s' occurred." ), exc.what() );
432 }
433 }
434
435 delete m_hierarchy;
437}
438
439
441{
442 aEvent.Skip();
443
444 // Called when resizing the Hierarchy Navigator panel
445 // Store the current pane size
446 // It allows to retrieve the last defined pane size when switching between
447 // docked and floating pane state
448 // Note: *DO NOT* call m_auimgr.Update() here: it crashes KiCad at least on Windows
449
450 EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
451 wxAuiPaneInfo& hierarchy_pane = m_auimgr.GetPane( SchematicHierarchyPaneName() );
452
453 if( cfg && m_hierarchy->IsShownOnScreen() )
454 {
455 cfg->m_AuiPanels.hierarchy_panel_float_width = hierarchy_pane.floating_size.x;
456 cfg->m_AuiPanels.hierarchy_panel_float_height = hierarchy_pane.floating_size.y;
457
458 // initialize hierarchy_panel_docked_width and best size only if the hierarchy_pane
459 // width is > 0 (i.e. if its size is already set and has meaning)
460 // if it is floating, its size is not initialized (only floating_size is initialized)
461 // initializing hierarchy_pane.best_size is useful when switching to float pane and
462 // after switching to the docked pane, to retrieve the last docked pane width
463 if( hierarchy_pane.rect.width > 50 ) // 50 is a good margin
464 {
465 cfg->m_AuiPanels.hierarchy_panel_docked_width = hierarchy_pane.rect.width;
466 hierarchy_pane.best_size.x = hierarchy_pane.rect.width;
467 }
468 }
469}
470
471
473{
474 // Create the manager and dispatcher & route draw panel events to the dispatcher
477 GetCanvas()->GetViewControls(), config(), this );
478 m_actions = new EE_ACTIONS();
480
481 // Register tools
499
500 // Run the selection tool, it is supposed to be always active
502
504}
505
506
508{
510
512 SCH_EDITOR_CONDITIONS cond( this );
513
514 wxASSERT( mgr );
515
516 auto hasElements =
517 [ this ] ( const SELECTION& aSel )
518 {
519 return GetScreen() &&
520 ( !GetScreen()->Items().empty() || !SELECTION_CONDITIONS::Idle( aSel ) );
521 };
522
523 auto searchPaneCond =
524 [this] ( const SELECTION& )
525 {
526 return m_auimgr.GetPane( SearchPaneName() ).IsShown();
527 };
528
529 auto propertiesCond =
530 [this] ( const SELECTION& )
531 {
532 return m_auimgr.GetPane( PropertiesPaneName() ).IsShown();
533 };
534
535 auto hierarchyNavigatorCond =
536 [ this ] ( const SELECTION& aSel )
537 {
538 return m_auimgr.GetPane( SchematicHierarchyPaneName() ).IsShown();
539 };
540
541 auto netNavigatorCond =
542 [ this ] (const SELECTION& aSel )
543 {
544 return m_auimgr.GetPane( NetNavigatorPaneName() ).IsShown();
545 };
546
547 auto undoCond =
548 [ this ] (const SELECTION& aSel )
549 {
551 return true;
552
553 return GetUndoCommandCount() > 0;
554 };
555
556#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
557#define CHECK( x ) ACTION_CONDITIONS().Check( x )
558
560 mgr->SetConditions( ACTIONS::undo, ENABLE( undoCond ) );
562
563 mgr->SetConditions( EE_ACTIONS::showSearch, CHECK( searchPaneCond ) );
564 mgr->SetConditions( EE_ACTIONS::showHierarchy, CHECK( hierarchyNavigatorCond ) );
565 mgr->SetConditions( EE_ACTIONS::showNetNavigator, CHECK( netNavigatorCond ) );
566 mgr->SetConditions( ACTIONS::showProperties, CHECK( propertiesCond ) );
571 CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
572 mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
573 mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
574
576 CHECK( cond.LineMode( LINE_MODE::LINE_MODE_FREE ) ) );
578 CHECK( cond.LineMode( LINE_MODE::LINE_MODE_90 ) ) );
580 CHECK( cond.LineMode( LINE_MODE::LINE_MODE_45 ) ) );
581
582 mgr->SetConditions( ACTIONS::cut, ENABLE( hasElements ) );
583 mgr->SetConditions( ACTIONS::copy, ENABLE( hasElements ) );
586 mgr->SetConditions( ACTIONS::doDelete, ENABLE( hasElements ) );
587 mgr->SetConditions( ACTIONS::duplicate, ENABLE( hasElements ) );
588 mgr->SetConditions( ACTIONS::selectAll, ENABLE( hasElements ) );
589 mgr->SetConditions( ACTIONS::unselectAll, ENABLE( hasElements ) );
590
591 mgr->SetConditions( EE_ACTIONS::rotateCW, ENABLE( hasElements ) );
592 mgr->SetConditions( EE_ACTIONS::rotateCCW, ENABLE( hasElements ) );
593 mgr->SetConditions( EE_ACTIONS::mirrorH, ENABLE( hasElements ) );
594 mgr->SetConditions( EE_ACTIONS::mirrorV, ENABLE( hasElements ) );
595
600
601 if( SCRIPTING::IsWxAvailable() )
602 {
604 CHECK( cond.ScriptingConsoleVisible() ) );
605 }
606
607 auto showHiddenPinsCond =
608 [this]( const SELECTION& )
609 {
610 return GetShowAllPins();
611 };
612
613 auto showHiddenFieldsCond =
614 [this]( const SELECTION& )
615 {
617 return cfg && cfg->m_Appearance.show_hidden_fields;
618 };
619
620 auto showDirectiveLabelsCond =
621 [this]( const SELECTION& )
622 {
624 return cfg && cfg->m_Appearance.show_directive_labels;
625 };
626
627 auto showERCErrorsCond =
628 [this]( const SELECTION& )
629 {
631 return cfg && cfg->m_Appearance.show_erc_errors;
632 };
633
634 auto showERCWarningsCond =
635 [this]( const SELECTION& )
636 {
638 return cfg && cfg->m_Appearance.show_erc_warnings;
639 };
640
641 auto showERCExclusionsCond =
642 [this]( const SELECTION& )
643 {
645 return cfg && cfg->m_Appearance.show_erc_exclusions;
646 };
647
648 auto showOPVoltagesCond =
649 [this]( const SELECTION& )
650 {
652 return cfg && cfg->m_Appearance.show_op_voltages;
653 };
654
655 auto showOPCurrentsCond =
656 [this]( const SELECTION& )
657 {
659 return cfg && cfg->m_Appearance.show_op_currents;
660 };
661
662 auto showAnnotateAutomaticallyCond =
663 [this]( const SELECTION& )
664 {
666 return cfg && cfg->m_AnnotatePanel.automatic;
667 };
668
669 auto remapSymbolsCondition =
670 [&]( const SELECTION& aSel )
671 {
672 SCH_SCREENS schematic( Schematic().Root() );
673
674 // The remapping can only be performed on legacy projects.
675 return schematic.HasNoFullyDefinedLibIds();
676 };
677
678 auto belowRootSheetCondition =
679 [this]( const SELECTION& aSel )
680 {
682 return navigateTool && navigateTool->CanGoUp();
683 };
684
685 auto navSchematicHasPreviousSheet =
686 [this]( const SELECTION& aSel )
687 {
689 return navigateTool && navigateTool->CanGoPrevious();
690 };
691
692 auto navSchematicHasNextSheet =
693 [this]( const SELECTION& aSel )
694 {
696 return navigateTool && navigateTool->CanGoNext();
697 };
698
699 mgr->SetConditions( EE_ACTIONS::leaveSheet, ENABLE( belowRootSheetCondition ) );
700
701 /* Some of these are bound by default to arrow keys which will get a different action if we
702 * disable the buttons. So always leave them enabled so the action is consistent.
703 * https://gitlab.com/kicad/code/kicad/-/issues/14783
704 mgr->SetConditions( EE_ACTIONS::navigateUp, ENABLE( belowRootSheetCondition ) );
705 mgr->SetConditions( EE_ACTIONS::navigateForward, ENABLE( navHistoryHasForward ) );
706 mgr->SetConditions( EE_ACTIONS::navigateBack, ENABLE( navHistoryHsBackward ) );
707 */
708
709 mgr->SetConditions( EE_ACTIONS::navigatePrevious, ENABLE( navSchematicHasPreviousSheet ) );
710 mgr->SetConditions( EE_ACTIONS::navigateNext, ENABLE( navSchematicHasNextSheet ) );
711 mgr->SetConditions( EE_ACTIONS::remapSymbols, ENABLE( remapSymbolsCondition ) );
712 mgr->SetConditions( EE_ACTIONS::toggleHiddenPins, CHECK( showHiddenPinsCond ) );
713 mgr->SetConditions( EE_ACTIONS::toggleHiddenFields, CHECK( showHiddenFieldsCond ) );
714 mgr->SetConditions( EE_ACTIONS::toggleDirectiveLabels, CHECK( showDirectiveLabelsCond ) );
715 mgr->SetConditions( EE_ACTIONS::toggleERCErrors, CHECK( showERCErrorsCond ) );
716 mgr->SetConditions( EE_ACTIONS::toggleERCWarnings, CHECK( showERCWarningsCond ) );
717 mgr->SetConditions( EE_ACTIONS::toggleERCExclusions, CHECK( showERCExclusionsCond ) );
718 mgr->SetConditions( EE_ACTIONS::toggleOPVoltages, CHECK( showOPVoltagesCond ) );
719 mgr->SetConditions( EE_ACTIONS::toggleOPCurrents, CHECK( showOPCurrentsCond ) );
720 mgr->SetConditions( EE_ACTIONS::toggleAnnotateAuto, CHECK( showAnnotateAutomaticallyCond ) );
722
723#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )
724
749
750#undef CURRENT_TOOL
751#undef CHECK
752#undef ENABLE
753}
754
755
757{
758 // we cannot store a pointer to an item in the display list here since
759 // that item may be deleted, such as part of a line concatenation or other.
760 // So simply always keep a copy of the object which is to be repeated.
761
762 if( aItem )
763 {
764 m_items_to_repeat.clear();
765
766 AddCopyForRepeatItem( aItem );
767 }
768}
769
770
772{
773 // we cannot store a pointer to an item in the display list here since
774 // that item may be deleted, such as part of a line concatenation or other.
775 // So simply always keep a copy of the object which is to be repeated.
776
777 if( aItem )
778 {
779 std::unique_ptr<SCH_ITEM> repeatItem( static_cast<SCH_ITEM*>( aItem->Duplicate() ) );
780
781 // Clone() preserves the flags, we want 'em cleared.
782 repeatItem->ClearFlags();
783
784 m_items_to_repeat.emplace_back( std::move( repeatItem ) );
785 }
786}
787
788
790{
791 return Schematic().GetSheets().GetItem( aId );
792}
793
794
796{
798}
799
800
802{
803 return GetCurrentSheet().LastScreen();
804}
805
806
808{
809 return *m_schematic;
810}
811
812
814{
815 return GetCurrentSheet().Last()->GetName();
816}
817
818
820{
822}
823
824
826{
829
830 SCH_SHEET* rootSheet = new SCH_SHEET( m_schematic );
831 m_schematic->SetRoot( rootSheet );
832
833 SCH_SCREEN* rootScreen = new SCH_SCREEN( m_schematic );
834 const_cast<KIID&>( rootSheet->m_Uuid ) = rootScreen->GetUuid();
835 m_schematic->Root().SetScreen( rootScreen );
836 SetScreen( Schematic().RootScreen() );
837
838
839 m_schematic->RootScreen()->SetFileName( wxEmptyString );
840
841 // Don't leave root page number empty
842 SCH_SHEET_PATH rootSheetPath;
843
844 rootSheetPath.push_back( rootSheet );
845 m_schematic->RootScreen()->SetPageNumber( wxT( "1" ) );
846 rootSheetPath.SetPageNumber( wxT( "1" ) );
847
848 if( GetScreen() == nullptr )
849 {
850 SCH_SCREEN* screen = new SCH_SCREEN( m_schematic );
851 SetScreen( screen );
852 }
853}
854
855
857{
858 return m_schematic->CurrentSheet();
859}
860
861
863{
864 if( aSheet != GetCurrentSheet() )
865 {
866 FocusOnItem( nullptr );
867
868 Schematic().SetCurrentSheet( aSheet );
869 GetCanvas()->DisplaySheet( aSheet.LastScreen() );
870 }
871}
872
873
875{
877
878 for( SCH_ITEM* item : screen->Items() )
879 item->ClearCaches();
880
881 for( const std::pair<const wxString, LIB_SYMBOL*>& libSymbol : screen->GetLibSymbols() )
882 {
883 wxCHECK2( libSymbol.second, continue );
884 libSymbol.second->ClearCaches();
885 }
886
887 if( Schematic().Settings().m_IntersheetRefsShow )
889
890 FocusOnItem( nullptr );
891
892 GetCanvas()->DisplaySheet( GetCurrentSheet().LastScreen() );
893
895 selectionTool->Reset( TOOL_BASE::REDRAW );
896
898}
899
900
901bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
902{
903 // Exit interactive editing
904 // Note this this will commit *some* pending changes. For instance, the EE_POINT_EDITOR
905 // will cancel any drag currently in progress, but commit all changes from previous drags.
906 if( m_toolManager )
908
909 // Shutdown blocks must be determined and vetoed as early as possible
910 if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
911 && Schematic().GetSheets().IsModified() )
912 {
913 return false;
914 }
915
916 if( Kiface().IsSingle() )
917 {
918 auto* symbolEditor = (SYMBOL_EDIT_FRAME*) Kiway().Player( FRAME_SCH_SYMBOL_EDITOR, false );
919
920 if( symbolEditor && !symbolEditor->Close() ) // Can close symbol editor?
921 return false;
922
923 auto* symbolViewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false );
924
925 if( symbolViewer && !symbolViewer->Close() ) // Can close symbol viewer?
926 return false;
927
928 // SYMBOL_CHOOSER_FRAME is always modal so this shouldn't come up, but better safe than
929 // sorry.
930 auto* chooser = (SYMBOL_CHOOSER_FRAME*) Kiway().Player( FRAME_SYMBOL_CHOOSER, false );
931
932 if( chooser && !chooser->Close() ) // Can close symbol chooser?
933 return false;
934 }
935 else
936 {
937 auto* symbolEditor = (SYMBOL_EDIT_FRAME*) Kiway().Player( FRAME_SCH_SYMBOL_EDITOR, false );
938
939 if( symbolEditor && symbolEditor->IsSymbolFromSchematic() )
940 {
941 if( !symbolEditor->CanCloseSymbolFromSchematic( true ) )
942 return false;
943 }
944 }
945
946 if( !Kiway().PlayerClose( FRAME_SIMULATOR, false ) ) // Can close the simulator?
947 return false;
948
950 && !m_symbolFieldsTableDialog->Close( false ) ) // Can close the symbol fields table?
951 {
952 return false;
953 }
954
955 // We may have gotten multiple events; don't clean up twice
956 if( !Schematic().IsValid() )
957 return false;
958
959 SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
960
961 if( sheetlist.IsModified() )
962 {
963 wxFileName fileName = Schematic().RootScreen()->GetFileName();
964 wxString msg = _( "Save changes to '%s' before closing?" );
965
966 if( !HandleUnsavedChanges( this, wxString::Format( msg, fileName.GetFullName() ),
967 [&]() -> bool
968 {
969 return SaveProject();
970 } ) )
971 {
972 return false;
973 }
974 }
975
976 return true;
977}
978
979
981{
982 SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
983
984 // Shutdown all running tools
985 if( m_toolManager )
987
988 // Close modeless dialogs. They're trouble when they get destroyed after the frame.
989 Unbind( EDA_EVT_CLOSE_DIALOG_BOOK_REPORTER, &SCH_EDIT_FRAME::onCloseSymbolDiffDialog, this );
990 Unbind( EDA_EVT_CLOSE_ERC_DIALOG, &SCH_EDIT_FRAME::onCloseErcDialog, this );
991 Unbind( EDA_EVT_CLOSE_DIALOG_SYMBOL_FIELDS_TABLE,
993 m_netNavigator->Unbind( wxEVT_TREE_SEL_CHANGING, &SCH_EDIT_FRAME::onNetNavigatorSelChanging,
994 this );
995 m_netNavigator->Unbind( wxEVT_TREE_SEL_CHANGED, &SCH_EDIT_FRAME::onNetNavigatorSelection,
996 this );
997
998 // Close the find dialog and preserve its setting if it is displayed.
1000 {
1003
1004 m_findReplaceDialog->Destroy();
1005 m_findReplaceDialog = nullptr;
1006 }
1007
1008 if( m_diffSymbolDialog )
1009 {
1010 m_diffSymbolDialog->Destroy();
1011 m_diffSymbolDialog = nullptr;
1012 }
1013
1014 if( m_ercDialog )
1015 {
1016 m_ercDialog->Destroy();
1017 m_ercDialog = nullptr;
1018 }
1019
1021 {
1022 m_symbolFieldsTableDialog->Destroy();
1023 m_symbolFieldsTableDialog = nullptr;
1024 }
1025
1026 // Make sure local settings are persisted
1028
1029 // Shutdown all running tools
1030 if( m_toolManager )
1031 {
1033 // prevent the canvas from trying to dispatch events during close
1034 GetCanvas()->SetEventDispatcher( nullptr );
1035 delete m_toolManager;
1036 m_toolManager = nullptr;
1037 }
1038
1039 wxAuiPaneInfo& hierarchy_pane = m_auimgr.GetPane( SchematicHierarchyPaneName() );
1040
1041 if( hierarchy_pane.IsShown() && hierarchy_pane.IsFloating() )
1042 {
1043 hierarchy_pane.Show( false );
1044 m_auimgr.Update();
1045 }
1046
1047 SCH_SCREENS screens( Schematic().Root() );
1048 wxFileName fn;
1049
1050 for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
1051 {
1052 fn = Prj().AbsolutePath( screen->GetFileName() );
1053
1054 // Auto save file name is the normal file name prepended with GetAutoSaveFilePrefix().
1055 fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
1056
1057 if( fn.IsFileWritable() )
1058 wxRemoveFile( fn.GetFullPath() );
1059 }
1060
1061 wxFileName tmpFn = Prj().GetProjectFullName();
1062 wxFileName autoSaveFileName( tmpFn.GetPath(), getAutoSaveFileName() );
1063
1064 if( autoSaveFileName.IsFileWritable() )
1065 wxRemoveFile( autoSaveFileName.GetFullPath() );
1066
1067 sheetlist.ClearModifyStatus();
1068
1069 wxString fileName = Prj().AbsolutePath( Schematic().RootScreen()->GetFileName() );
1070
1071 if( !Schematic().GetFileName().IsEmpty() && !Schematic().RootScreen()->IsEmpty() )
1072 UpdateFileHistory( fileName );
1073
1074 Schematic().RootScreen()->Clear();
1075
1076 // all sub sheets are deleted, only the main sheet is usable
1078
1079 // Clear view before destroying schematic as repaints depend on schematic being valid
1080 SetScreen( nullptr );
1081
1082 Schematic().Reset();
1083
1084 // Prevents any rogue events from continuing (i.e. search panel tries to redraw)
1085 Show( false );
1086
1087 Destroy();
1088}
1089
1090
1092{
1093 return Schematic().ErcSettings().GetSeverity( aErrorCode );
1094}
1095
1096
1098{
1100
1101 wxCHECK( GetScreen(), /* void */ );
1102
1104 m_autoSaveRequired = true;
1105
1106 GetCanvas()->Refresh();
1107
1108 if( !GetTitle().StartsWith( wxS( "*" ) ) )
1109 updateTitle();
1110}
1111
1112
1113void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event )
1114{
1115 if( Kiface().IsSingle() )
1116 {
1117 DisplayError( this, _( "Cannot update the PCB, because the Schematic Editor is opened"
1118 " in stand-alone mode. In order to create/update PCBs from"
1119 " schematics, launch the KiCad shell and create a project." ) );
1120 return;
1121 }
1122
1123 KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_EDITOR, false );
1124
1125 if( !frame )
1126 {
1127 wxFileName fn = Prj().GetProjectFullName();
1128 fn.SetExt( FILEEXT::PcbFileExtension );
1129
1130 frame = Kiway().Player( FRAME_PCB_EDITOR, true );
1131
1132 // If Kiway() cannot create the Pcbnew frame, it shows a error message, and
1133 // frame is null
1134 if( !frame )
1135 return;
1136
1137 frame->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
1138 }
1139
1140 if( !frame->IsVisible() )
1141 frame->Show( true );
1142
1143 // On Windows, Raise() does not bring the window on screen, when iconized
1144 if( frame->IsIconized() )
1145 frame->Iconize( false );
1146
1147 frame->Raise();
1148
1149 std::string payload;
1151}
1152
1153
1155{
1156 m_toolManager->GetTool<SCH_NAVIGATE_TOOL>()->CleanHistory();
1158}
1159
1160
1162{
1163 // Update only the hierarchy navigation tree labels.
1164 // The tree list is expectyed to be up to date
1166}
1167
1168
1170{
1172}
1173
1174
1176{
1177 wxString findString;
1178
1179 EE_SELECTION& selection = m_toolManager->GetTool<EE_SELECTION_TOOL>()->GetSelection();
1180
1181 if( selection.Size() == 1 )
1182 {
1183 EDA_ITEM* front = selection.Front();
1184
1185 switch( front->Type() )
1186 {
1187 case SCH_SYMBOL_T:
1188 {
1189 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( front );
1190 findString = UnescapeString( symbol->GetField( VALUE_FIELD )->GetText() );
1191 break;
1192 }
1193
1194 case SCH_FIELD_T:
1195 findString = UnescapeString( static_cast<SCH_FIELD*>( front )->GetText() );
1196 break;
1197
1198 case SCH_LABEL_T:
1199 case SCH_GLOBAL_LABEL_T:
1200 case SCH_HIER_LABEL_T:
1201 case SCH_SHEET_PIN_T:
1202 findString = UnescapeString( static_cast<SCH_LABEL_BASE*>( front )->GetText() );
1203 break;
1204
1205 case SCH_TEXT_T:
1206 findString = UnescapeString( static_cast<SCH_TEXT*>( front )->GetText() );
1207
1208 if( findString.Contains( wxT( "\n" ) ) )
1209 findString = findString.Before( '\n' );
1210
1211 break;
1212
1213 default:
1214 break;
1215 }
1216 }
1217
1219 m_findReplaceDialog->Destroy();
1220
1222 static_cast<SCH_SEARCH_DATA*>( m_findReplaceData.get() ),
1223 wxDefaultPosition, wxDefaultSize,
1224 aReplace ? wxFR_REPLACEDIALOG : 0 );
1225
1228 m_findReplaceDialog->Show( true );
1229}
1230
1231
1232void SCH_EDIT_FRAME::ShowFindReplaceStatus( const wxString& aMsg, int aStatusTime )
1233{
1234 // Prepare the infobar, since we don't know its state
1237
1238 m_infoBar->ShowMessageFor( aMsg, aStatusTime, wxICON_INFORMATION );
1239}
1240
1241
1243{
1244 m_infoBar->Dismiss();
1245}
1246
1247
1249{
1252
1253 m_findReplaceDialog->Destroy();
1254 m_findReplaceDialog = nullptr;
1255
1257}
1258
1259
1260void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event )
1261{
1262 wxString fn = GetFileFromHistory( event.GetId(), _( "Schematic" ) );
1263
1264 if( fn.size() )
1265 OpenProjectFiles( std::vector<wxString>( 1, fn ) );
1266}
1267
1268
1269void SCH_EDIT_FRAME::OnClearFileHistory( wxCommandEvent& aEvent )
1270{
1272}
1273
1274
1276{
1277 // Only standalone mode can directly load a new document
1278 if( !Kiface().IsSingle() )
1279 return;
1280
1281 wxString pro_dir = m_mruPath;
1282
1283 wxFileDialog dlg( this, _( "New Schematic" ), pro_dir, wxEmptyString,
1285
1286 if( dlg.ShowModal() != wxID_CANCEL )
1287 {
1288 // Enforce the extension, wxFileDialog is inept.
1289 wxFileName create_me =
1291
1292 if( create_me.FileExists() )
1293 {
1294 wxString msg;
1295 msg.Printf( _( "Schematic file '%s' already exists." ), create_me.GetFullName() );
1296 DisplayError( this, msg );
1297 return ;
1298 }
1299
1300 // OpenProjectFiles() requires absolute
1301 wxASSERT_MSG( create_me.IsAbsolute(), wxS( "wxFileDialog returned non-absolute path" ) );
1302
1303 OpenProjectFiles( std::vector<wxString>( 1, create_me.GetFullPath() ), KICTL_CREATE );
1304 m_mruPath = create_me.GetPath();
1305 }
1306}
1307
1308
1310{
1311 // Only standalone mode can directly load a new document
1312 if( !Kiface().IsSingle() )
1313 return;
1314
1315 wxString pro_dir = m_mruPath;
1316 wxString wildcards = FILEEXT::AllSchematicFilesWildcard()
1318 + wxS( "|" ) + FILEEXT::LegacySchematicFileWildcard();
1319
1320 wxFileDialog dlg( this, _( "Open Schematic" ), pro_dir, wxEmptyString,
1321 wildcards, wxFD_OPEN | wxFD_FILE_MUST_EXIST );
1322
1323 if( dlg.ShowModal() != wxID_CANCEL )
1324 {
1325 OpenProjectFiles( std::vector<wxString>( 1, dlg.GetPath() ) );
1327 }
1328}
1329
1330
1331void SCH_EDIT_FRAME::OnOpenPcbnew( wxCommandEvent& event )
1332{
1333 wxFileName kicad_board = Prj().AbsolutePath( Schematic().GetFileName() );
1334
1335 if( kicad_board.IsOk() && !Schematic().GetFileName().IsEmpty() )
1336 {
1337 kicad_board.SetExt( FILEEXT::PcbFileExtension );
1338 wxFileName legacy_board( kicad_board );
1339 legacy_board.SetExt( FILEEXT::LegacyPcbFileExtension );
1340 wxFileName& boardfn = legacy_board;
1341
1342 if( !legacy_board.FileExists() || kicad_board.FileExists() )
1343 boardfn = kicad_board;
1344
1345 if( Kiface().IsSingle() )
1346 {
1347 ExecuteFile( PCBNEW_EXE, boardfn.GetFullPath() );
1348 }
1349 else
1350 {
1351 KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_EDITOR, false );
1352
1353 if( !frame )
1354 {
1355 frame = Kiway().Player( FRAME_PCB_EDITOR, true );
1356
1357 // frame can be null if Cvpcb cannot be run. No need to show a warning
1358 // Kiway() generates the error messages
1359 if( !frame )
1360 return;
1361
1362 frame->OpenProjectFiles( std::vector<wxString>( 1, boardfn.GetFullPath() ) );
1363 }
1364
1365 if( !frame->IsVisible() )
1366 frame->Show( true );
1367
1368 // On Windows, Raise() does not bring the window on screen, when iconized
1369 if( frame->IsIconized() )
1370 frame->Iconize( false );
1371
1372 frame->Raise();
1373 }
1374 }
1375 else
1376 {
1377 // If we are running inside a project, it should be impossible for this case to happen
1378 wxASSERT( Kiface().IsSingle() );
1380 }
1381}
1382
1383
1384void SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event )
1385{
1386 wxFileName fn = Prj().AbsolutePath( Schematic().GetFileName() );
1387 fn.SetExt( FILEEXT::NetlistFileExtension );
1388
1389 if( !ReadyToNetlist( _( "Assigning footprints requires a fully annotated schematic." ) ) )
1390 return;
1391
1392 try
1393 {
1394 KIWAY_PLAYER* player = Kiway().Player( FRAME_CVPCB, false ); // test open already.
1395
1396 if( !player )
1397 {
1398 player = Kiway().Player( FRAME_CVPCB, true );
1399
1400 // player can be null if Cvpcb cannot be run. No need to show a warning
1401 // Kiway() generates the error messages
1402 if( !player )
1403 return;
1404
1405 player->Show( true );
1406 }
1407
1408 // Ensure the netlist (mainly info about symbols) is up to date
1411
1412 player->Raise();
1413 }
1414 catch( const IO_ERROR& )
1415 {
1416 DisplayError( this, _( "Could not open CvPcb" ) );
1417 }
1418}
1419
1420
1421void SCH_EDIT_FRAME::OnExit( wxCommandEvent& event )
1422{
1423 if( event.GetId() == wxID_EXIT )
1424 Kiway().OnKiCadExit();
1425
1426 if( event.GetId() == wxID_CLOSE || Kiface().IsSingle() )
1427 Close( false );
1428}
1429
1430
1432{
1433 wxString fileName = Prj().AbsolutePath( GetScreen()->GetFileName() );
1434
1435 const wxBrush& brush =
1436 wxBrush( GetColorSettings()->GetColor( LAYER_SCHEMATIC_BACKGROUND ).ToColour() );
1437 aSettings->GetPrintDC()->SetBackground( brush );
1438 aSettings->GetPrintDC()->Clear();
1439
1440 aSettings->GetPrintDC()->SetLogicalFunction( wxCOPY );
1441 GetScreen()->Print( aSettings );
1442 PrintDrawingSheet( aSettings, GetScreen(), Schematic().GetProperties(), schIUScale.IU_PER_MILS,
1443 fileName );
1444}
1445
1446
1448{
1450 SIM_LIB_MGR simLibMgr( &Prj() );
1451 NULL_REPORTER devnull;
1452
1453 // Patch for bug early in V7.99 dev
1454 if( settings.m_OPO_VRange.EndsWith( 'A' ) )
1455 settings.m_OPO_VRange[ settings.m_OPO_VRange.Length() - 1 ] = 'V';
1456
1457 // Update items which may have ${OP} text variables
1458 //
1460 [&]( KIGFX::VIEW_ITEM* aItem ) -> int
1461 {
1462 int flags = 0;
1463
1464 if( SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aItem ) )
1465 {
1466 item->RunOnChildren(
1467 [&flags]( SCH_ITEM* aChild )
1468 {
1469 EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aChild );
1470
1471 if( text && text->HasTextVars() )
1472 {
1473 text->ClearRenderCache();
1474 text->ClearBoundingBoxCache();
1475 flags |= KIGFX::GEOMETRY | KIGFX::REPAINT;
1476 }
1477 } );
1478
1479 EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
1480
1481 if( text && text->HasTextVars() )
1482 {
1483 text->ClearRenderCache();
1484 text->ClearBoundingBoxCache();
1486 }
1487 }
1488
1489 return flags;
1490 } );
1491
1492 // Update OP overlay items
1493 //
1494 for( SCH_ITEM* item : GetScreen()->Items() )
1495 {
1496 if( item->Type() == SCH_LINE_T )
1497 {
1498 SCH_LINE* line = static_cast<SCH_LINE*>( item );
1499
1500 if( !line->GetOperatingPoint().IsEmpty() )
1501 GetCanvas()->GetView()->Update( line );
1502
1503 line->SetOperatingPoint( wxEmptyString );
1504 // update value from netlist, below
1505 }
1506 else if( item->Type() == SCH_SYMBOL_T )
1507 {
1508 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
1509 wxString ref = symbol->GetRef( &GetCurrentSheet() );
1510 std::vector<SCH_PIN*> pins = symbol->GetPins( &GetCurrentSheet() );
1511
1512 // Power symbols and other symbols which have the reference starting with "#" are
1513 // not included in simulation
1514 if( ref.StartsWith( '#' ) || symbol->GetExcludedFromSim() )
1515 continue;
1516
1517 for( SCH_PIN* pin : pins )
1518 {
1519 if( !pin->GetOperatingPoint().IsEmpty() )
1520 GetCanvas()->GetView()->Update( pin );
1521
1522 pin->SetOperatingPoint( wxEmptyString );
1523 }
1524
1525 if( pins.size() == 2 )
1526 {
1527 wxString op = m_schematic->GetOperatingPoint( ref, settings.m_OPO_IPrecision,
1528 settings.m_OPO_IRange );
1529
1530 if( !op.IsEmpty() && op != wxS( "--" ) && op != wxS( "?" ) )
1531 {
1532 pins[0]->SetOperatingPoint( op );
1533 GetCanvas()->GetView()->Update( symbol );
1534 }
1535 }
1536 else
1537 {
1538 SIM_MODEL& model = simLibMgr.CreateModel( &GetCurrentSheet(), *symbol,
1539 devnull ).model;
1540
1541 SPICE_ITEM spiceItem;
1542 spiceItem.refName = ref;
1543 ref = model.SpiceGenerator().ItemName( spiceItem );
1544
1545 for( const auto& modelPin : model.GetPins() )
1546 {
1547 SCH_PIN* symbolPin = symbol->GetPin( modelPin.get().symbolPinNumber );
1548 wxString signalName = ref + wxS( ":" ) + modelPin.get().name;
1549 wxString op = m_schematic->GetOperatingPoint( signalName,
1550 settings.m_OPO_IPrecision,
1551 settings.m_OPO_IRange );
1552
1553 if( symbolPin && !op.IsEmpty() && op != wxS( "--" ) && op != wxS( "?" ) )
1554 {
1555 symbolPin->SetOperatingPoint( op );
1556 GetCanvas()->GetView()->Update( symbol );
1557 }
1558 }
1559 }
1560 }
1561 }
1562
1563 for( const auto& [ key, subgraphList ] : m_schematic->m_connectionGraph->GetNetMap() )
1564 {
1565 wxString op = m_schematic->GetOperatingPoint( key.Name, settings.m_OPO_VPrecision,
1566 settings.m_OPO_VRange );
1567
1568 if( !op.IsEmpty() && op != wxS( "--" ) && op != wxS( "?" ) )
1569 {
1570 for( CONNECTION_SUBGRAPH* subgraph : subgraphList )
1571 {
1572 SCH_LINE* longestWire = nullptr;
1573 double length = 0.0;
1574
1575 for( SCH_ITEM* item : subgraph->GetItems() )
1576 {
1577 if( item->IsType( { SCH_ITEM_LOCATE_WIRE_T } ) )
1578 {
1579 SCH_LINE* wire = static_cast<SCH_LINE*>( item );
1580
1581 if( wire->GetLength() > length )
1582 {
1583 longestWire = wire;
1584 length = wire->GetLength();
1585 }
1586 }
1587 }
1588
1589 if( longestWire )
1590 {
1591 longestWire->SetOperatingPoint( op );
1592 GetCanvas()->GetView()->Update( longestWire );
1593 }
1594 }
1595 }
1596 }
1597}
1598
1599
1601{
1602 if( aItem->IsType( { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T } ) )
1603 {
1604 SCH_LABEL_BASE* label = static_cast<SCH_LABEL_BASE*>( aItem );
1605
1606 if( label->AutoRotateOnPlacement() )
1607 {
1608 SPIN_STYLE spin = aScreen->GetLabelOrientationForPoint( label->GetPosition(),
1609 label->GetSpinStyle(),
1610 &GetCurrentSheet() );
1611
1612 if( spin != label->GetSpinStyle() )
1613 {
1614 label->SetSpinStyle( spin );
1615
1616 for( SCH_ITEM* item : aScreen->Items().OfType( SCH_GLOBAL_LABEL_T ) )
1617 {
1618 SCH_LABEL_BASE* otherLabel = static_cast<SCH_LABEL_BASE*>( item );
1619
1620 if( otherLabel != label && otherLabel->GetText() == label->GetText() )
1621 otherLabel->AutoplaceFields( aScreen, false );
1622 }
1623 }
1624 }
1625 }
1626}
1627
1628
1630{
1631 SCH_SCREEN* screen = GetScreen();
1632
1633 wxCHECK( screen, /* void */ );
1634
1635 wxString title;
1636
1637 if( !screen->GetFileName().IsEmpty() )
1638 {
1639 wxFileName fn( Prj().AbsolutePath( screen->GetFileName() ) );
1640 bool readOnly = false;
1641 bool unsaved = false;
1642
1643 if( fn.IsOk() && screen->FileExists() )
1644 readOnly = screen->IsReadOnly();
1645 else
1646 unsaved = true;
1647
1648 if( IsContentModified() )
1649 title = wxT( "*" );
1650
1651 title += fn.GetName();
1652
1653 wxString sheetPath = GetCurrentSheet().PathHumanReadable( false, true );
1654
1655 if( sheetPath != title )
1656 title += wxString::Format( wxT( " [%s]" ), sheetPath );
1657
1658 if( readOnly )
1659 title += wxS( " " ) + _( "[Read Only]" );
1660
1661 if( unsaved )
1662 title += wxS( " " ) + _( "[Unsaved]" );
1663 }
1664 else
1665 {
1666 title = _( "[no schematic loaded]" );
1667 }
1668
1669 title += wxT( " \u2014 " ) + _( "Schematic Editor" );
1670
1671 SetTitle( title );
1672}
1673
1674
1676{
1678 GetScreen()->m_zoomInitialized = true;
1679}
1680
1681
1683{
1684 wxString highlightedConn = GetHighlightedConnection();
1685 SCHEMATIC_SETTINGS& settings = Schematic().Settings();
1687 SCH_COMMIT localCommit( m_toolManager );
1688
1689 if( !aCommit )
1690 aCommit = &localCommit;
1691
1692#ifdef PROFILE
1693 PROF_TIMER timer;
1694#endif
1695
1696 // Ensure schematic graph is accurate
1697 if( aCleanupFlags == LOCAL_CLEANUP )
1698 {
1699 SchematicCleanUp( aCommit, GetScreen() );
1700 }
1701 else if( aCleanupFlags == GLOBAL_CLEANUP )
1702 {
1703 for( const SCH_SHEET_PATH& sheet : list )
1704 SchematicCleanUp( aCommit, sheet.LastScreen() );
1705 }
1706
1707#ifdef PROFILE
1708 timer.Stop();
1709 wxLogTrace( "CONN_PROFILE", "SchematicCleanUp() %0.4f ms", timer.msecs() );
1710#endif
1711
1712 if( settings.m_IntersheetRefsShow )
1714
1715 std::function<void( SCH_ITEM* )> changeHandler =
1716 [&]( SCH_ITEM* aChangedItem ) -> void
1717 {
1718 GetCanvas()->GetView()->Update( aChangedItem, KIGFX::REPAINT );
1719
1720 SCH_CONNECTION* connection = aChangedItem->Connection();
1721
1722 if( connection && ( connection->Name() == highlightedConn ) )
1724 };
1725
1726 if( !ADVANCED_CFG::GetCfg().m_IncrementalConnectivity || aCleanupFlags == GLOBAL_CLEANUP
1727 || m_undoList.m_CommandsList.empty() )
1728 {
1729 Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler );
1730 }
1731 else
1732 {
1733 PICKED_ITEMS_LIST* changed_list = m_undoList.m_CommandsList.back();
1734 std::set<SCH_ITEM*> changed_items;
1735 std::vector<VECTOR2I> pts;
1736 std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> item_paths;
1737
1738 for( unsigned ii = 0; ii < changed_list->GetCount(); ++ii )
1739 {
1740 SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( changed_list->GetPickedItem( ii ) );
1741
1742 // Ignore objects that are not connectable.
1743 if( !item || !item->IsConnectable() )
1744 continue;
1745
1746 SCH_SCREEN* screen = static_cast<SCH_SCREEN*>( changed_list->GetScreenForItem( ii ) );
1747 SCH_SHEET_PATHS& paths = screen->GetClientSheetPaths();
1748
1749 std::vector<VECTOR2I> tmp_pts = item->GetConnectionPoints();
1750 pts.insert( pts.end(), tmp_pts.begin(), tmp_pts.end() );
1751 changed_items.insert( item );
1752
1753 for( SCH_SHEET_PATH& path : paths )
1754 item_paths.insert( std::make_pair( path, item ) );
1755 }
1756
1757 for( VECTOR2I& pt: pts )
1758 {
1759 for( SCH_ITEM* item : GetScreen()->Items().Overlapping( pt ) )
1760 {
1761 if( item->Type() == SCH_LINE_T )
1762 {
1763 if( item->HitTest( pt ) )
1764 changed_items.insert( item );
1765 }
1766 else if( item->Type() == SCH_SYMBOL_T )
1767 {
1768 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
1769 std::vector<SCH_PIN*> pins = symbol->GetPins();
1770
1771 changed_items.insert( pins.begin(), pins.end() );
1772 }
1773 else if( item->Type() == SCH_SHEET_T )
1774 {
1775 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1776
1777 wxCHECK2( sheet, continue );
1778
1779 std::vector<SCH_SHEET_PIN*> sheetPins = sheet->GetPins();
1780 changed_items.insert( sheetPins.begin(), sheetPins.end() );
1781 }
1782 else
1783 {
1784 // Non-connectable objects have already been pruned.
1785 if( item->IsConnected( pt ) )
1786 changed_items.insert( item );
1787 }
1788 }
1789 }
1790
1791 std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> all_items =
1792 Schematic().ConnectionGraph()->ExtractAffectedItems( changed_items );
1793
1794 all_items.insert( item_paths.begin(), item_paths.end() );
1795
1796 CONNECTION_GRAPH new_graph( &Schematic() );
1797
1798 new_graph.SetLastCodes( Schematic().ConnectionGraph() );
1799
1800 for( auto&[ path, item ] : all_items )
1801 {
1802 wxCHECK2( item, continue );
1803
1804 switch( item->Type() )
1805 {
1806 case SCH_FIELD_T:
1807 case SCH_PIN_T:
1808 {
1809 SCH_ITEM* parent = static_cast<SCH_ITEM*>( item->GetParent() );
1810 wxCHECK2( parent, continue );
1811 parent->SetConnectivityDirty();
1812 break;
1813 }
1814
1815 default:
1816 item->SetConnectivityDirty();
1817 }
1818 }
1819
1820 new_graph.Recalculate( list, false, &changeHandler );
1821 Schematic().ConnectionGraph()->Merge( new_graph );
1822 }
1823
1825 [&]( KIGFX::VIEW_ITEM* aItem ) -> int
1826 {
1827 int flags = 0;
1828 SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aItem );
1829 SCH_CONNECTION* connection = item ? item->Connection() : nullptr;
1830
1831 if( connection && connection->HasDriverChanged() )
1832 {
1833 connection->ClearDriverChanged();
1834 flags |= KIGFX::REPAINT;
1835 }
1836
1837 if( item )
1838 {
1839 item->RunOnChildren(
1840 [&flags]( SCH_ITEM* aChild )
1841 {
1842 EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aChild );
1843
1844 if( text && text->HasTextVars() )
1845 {
1846 text->ClearRenderCache();
1847 text->ClearBoundingBoxCache();
1849 }
1850 } );
1851
1852 EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
1853
1854 if( text && text->HasTextVars() )
1855 {
1856 text->ClearRenderCache();
1857 text->ClearBoundingBoxCache();
1859 }
1860
1861 if( flags & KIGFX::GEOMETRY )
1862 GetScreen()->Update( item, false ); // Refresh RTree
1863 }
1864
1865 return flags;
1866 } );
1867
1868 if( !highlightedConn.IsEmpty() )
1869 {
1871 || !Schematic().ConnectionGraph()->FindFirstSubgraphByName( highlightedConn ) )
1873
1875 }
1876
1877 if( !localCommit.Empty() )
1878 localCommit.Push( _( "Schematic Cleanup" ) );
1879}
1880
1881
1883{
1885 {
1886 for( SCH_FIELD& field : label->GetFields() )
1887 field.ClearBoundingBoxCache();
1888
1889 label->ClearBoundingBoxCache();
1890 GetCanvas()->GetView()->Update( label );
1891 } );
1892}
1893
1894
1896{
1898
1900}
1901
1902
1903void SCH_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
1904{
1905 SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
1906
1907 SCHEMATIC_SETTINGS& settings = Schematic().Settings();
1908
1910
1912
1913 EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
1916
1917 KIGFX::VIEW* view = GetCanvas()->GetView();
1923
1925
1926 settings.m_TemplateFieldNames.DeleteAllFieldNameTemplates( true /* global */ );
1927
1928 if( !cfg->m_Drawing.field_names.IsEmpty() )
1930
1932
1933 for( SCH_ITEM* item : screen->Items() )
1934 item->ClearCaches();
1935
1936 for( const auto& [ libItemName, libSymbol ] : screen->GetLibSymbols() )
1937 libSymbol->ClearCaches();
1938
1940
1942 Layout();
1943 SendSizeEvent();
1944}
1945
1946
1948{
1949 // Store the current zoom level into the current screen before calling
1950 // DisplayCurrentSheet() that set the zoom to GetScreen()->m_LastZoomLevel
1952
1953 // Rebuild the sheet view (draw area and any other items):
1955}
1956
1957
1959{
1960 // call my base class
1962
1963 // tooltips in toolbars
1965
1966 m_auimgr.GetPane( m_hierarchy ).Caption( _( "Schematic Hierarchy" ) );
1967 m_auimgr.GetPane( m_selectionFilterPanel ).Caption( _( "Selection Filter" ) );
1968 m_auimgr.GetPane( m_propertiesPanel ).Caption( _( "Properties" ) );
1969 m_auimgr.Update();
1971
1972 // status bar
1974
1975 updateTitle();
1976
1977 // This ugly hack is to fix an option(left) toolbar update bug that seems to only affect
1978 // windows. See https://bugs.launchpad.net/kicad/+bug/1816492. For some reason, calling
1979 // wxWindow::Refresh() does not resolve the issue. Only a resize event seems to force the
1980 // toolbar to update correctly.
1981#if defined( __WXMSW__ )
1982 PostSizeEvent();
1983#endif
1984}
1985
1986
1988{
1989 if( !GetHighlightedConnection().IsEmpty() )
1990 {
1991 SetStatusText( wxString::Format( _( "Highlighted net: %s" ),
1993 }
1994 else
1995 {
1996 SetStatusText( wxT( "" ) );
1997 }
1998}
1999
2000
2002{
2003 if( m_toolManager )
2005
2006 SCH_BASE_FRAME::SetScreen( aScreen );
2007 GetCanvas()->DisplaySheet( static_cast<SCH_SCREEN*>( aScreen ) );
2008
2009 if( m_toolManager )
2011}
2012
2013
2014const BOX2I SCH_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
2015{
2016 BOX2I bBoxDoc;
2017
2018 if( aIncludeAllVisible )
2019 {
2020 // Get the whole page size and return that
2023 bBoxDoc = BOX2I( VECTOR2I( 0, 0 ), VECTOR2I( sizeX, sizeY ) );
2024 }
2025 else
2026 {
2027 // Get current drawing-sheet in a form we can compare to an EDA_ITEM
2029 EDA_ITEM* dsAsItem = static_cast<EDA_ITEM*>( ds );
2030
2031 // Calc the bounding box of all items on screen except the page border
2032 for( EDA_ITEM* item : GetScreen()->Items() )
2033 {
2034 if( item != dsAsItem ) // Ignore the drawing-sheet itself
2035 bBoxDoc.Merge( item->GetBoundingBox() );
2036 }
2037 }
2038
2039 return bBoxDoc;
2040}
2041
2042
2044{
2045 return Schematic().GetSheets().IsModified();
2046}
2047
2048
2050{
2051 EESCHEMA_SETTINGS* cfg = eeconfig();
2052 return cfg && cfg->m_Appearance.show_hidden_pins;
2053}
2054
2055
2057{
2058 static KIID lastBrightenedItemID( niluuid );
2059
2060 SCH_SHEET_LIST sheetList = Schematic().GetSheets();
2062 SCH_ITEM* lastItem = sheetList.GetItem( lastBrightenedItemID, &dummy );
2063
2064 if( lastItem && lastItem != aItem )
2065 {
2066 lastItem->ClearBrightened();
2067
2068 UpdateItem( lastItem );
2069 lastBrightenedItemID = niluuid;
2070 }
2071
2072 if( aItem )
2073 {
2074 if( !aItem->IsBrightened() )
2075 {
2076 aItem->SetBrightened();
2077
2078 UpdateItem( aItem );
2079 lastBrightenedItemID = aItem->m_Uuid;
2080 }
2081
2083 }
2084}
2085
2086
2088{
2089 return Schematic().GetFileName();
2090}
2091
2092
2094{
2095 return m_toolManager->GetTool<EE_SELECTION_TOOL>()->GetSelection();
2096}
2097
2098
2099void SCH_EDIT_FRAME::onSize( wxSizeEvent& aEvent )
2100{
2101 if( IsShown() )
2102 {
2103 // We only need this until the frame is done resizing and the final client size is
2104 // established.
2105 Unbind( wxEVT_SIZE, &SCH_EDIT_FRAME::onSize, this );
2107 }
2108
2109 // Skip() is called in the base class.
2110 EDA_DRAW_FRAME::OnSize( aEvent );
2111}
2112
2113
2115 const KIID& aSchematicSymbolUUID )
2116{
2117 SCH_SHEET_PATH principalPath;
2118 SCH_ITEM* item = Schematic().GetSheets().GetItem( aSchematicSymbolUUID, &principalPath );
2119 SCH_SYMBOL* principalSymbol = dynamic_cast<SCH_SYMBOL*>( item );
2120 SCH_COMMIT commit( m_toolManager );
2121
2122 if( !principalSymbol )
2123 return;
2124
2125 wxString principalRef;
2126
2127 if( principalSymbol->IsAnnotated( &principalPath ) )
2128 principalRef = principalSymbol->GetRef( &principalPath, false );
2129
2130 std::vector< std::pair<SCH_SYMBOL*, SCH_SHEET_PATH> > allUnits;
2131
2132 for( const SCH_SHEET_PATH& path : Schematic().GetSheets() )
2133 {
2134 for( SCH_ITEM* candidate : path.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
2135 {
2136 SCH_SYMBOL* candidateSymbol = static_cast<SCH_SYMBOL*>( candidate );
2137
2138 if( candidateSymbol == principalSymbol
2139 || ( candidateSymbol->IsAnnotated( &path )
2140 && candidateSymbol->GetRef( &path, false ) == principalRef ) )
2141 {
2142 allUnits.emplace_back( candidateSymbol, path );
2143 }
2144 }
2145 }
2146
2147 for( auto& [ unit, path ] : allUnits )
2148 {
2149 // This needs to be done before the LIB_SYMBOL is changed to prevent stale
2150 // library symbols in the schematic file.
2151 path.LastScreen()->Remove( unit );
2152
2153 if( !unit->IsNew() )
2154 commit.Modify( unit, path.LastScreen() );
2155
2156 unit->SetLibSymbol( aSymbol.Flatten().release() );
2157 unit->UpdateFields( &GetCurrentSheet(),
2158 true, /* update style */
2159 true, /* update ref */
2160 true, /* update other fields */
2161 false, /* reset ref */
2162 false /* reset other fields */ );
2163
2164 path.LastScreen()->Append( unit );
2165 GetCanvas()->GetView()->Update( unit );
2166 }
2167
2168 if( !commit.Empty() )
2169 commit.Push( _( "Save Symbol to Schematic" ) );
2170}
2171
2172
2173void SCH_EDIT_FRAME::UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete, bool aUpdateRtree )
2174{
2175 SCH_BASE_FRAME::UpdateItem( aItem, isAddOrDelete, aUpdateRtree );
2176
2177 if( SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( aItem ) )
2178 sch_item->ClearCaches();
2179}
2180
2181
2183{
2184 wxCHECK( m_toolManager, /* void */ );
2185
2189
2190 wxCHECK( screen, /* void */ );
2191
2193
2194 SCH_BASE_FRAME::SetScreen( screen );
2195
2197
2198 // update the references, units, and intersheet-refs
2200
2201 // dangling state can also have changed if different units with different pin locations are
2202 // used
2206
2208
2209 wxCHECK( selectionTool, /* void */ );
2210
2211 auto visit =
2212 [&]( EDA_ITEM* item )
2213 {
2215 && !m_findReplaceData->findString.IsEmpty()
2216 && item->Matches( *m_findReplaceData, &GetCurrentSheet() ) )
2217 {
2218 item->SetForceVisible( true );
2219 selectionTool->BrightenItem( item );
2220 }
2221 else if( item->IsBrightened() )
2222 {
2223 item->SetForceVisible( false );
2224 selectionTool->UnbrightenItem( item );
2225 }
2226 };
2227
2228 for( SCH_ITEM* item : screen->Items() )
2229 {
2230 visit( item );
2231
2232 item->RunOnChildren(
2233 [&]( SCH_ITEM* aChild )
2234 {
2235 visit( aChild );
2236 } );
2237 }
2238
2239 if( !screen->m_zoomInitialized )
2240 {
2242 }
2243 else
2244 {
2245 // Set zoom to last used in this screen
2246 GetCanvas()->GetView()->SetScale( GetScreen()->m_LastZoomLevel );
2247 GetCanvas()->GetView()->SetCenter( GetScreen()->m_ScrollCenter );
2248 }
2249
2250 updateTitle();
2251
2252 HardRedraw(); // Ensure all items are redrawn (especially the drawing-sheet items)
2253
2254 // Allow tools to re-add their VIEW_ITEMs after the last call to Clear in HardRedraw
2256
2258
2259 wxCHECK( editTool, /* void */ );
2260
2262 editTool->UpdateNetHighlighting( dummy );
2263
2265
2267}
2268
2269
2271{
2272 if( !m_diffSymbolDialog )
2274 _( "Compare Symbol with Library" ) );
2275
2276 return m_diffSymbolDialog;
2277}
2278
2279
2280void SCH_EDIT_FRAME::onCloseSymbolDiffDialog( wxCommandEvent& aEvent )
2281{
2282 if( m_diffSymbolDialog && aEvent.GetString() == DIFF_SYMBOLS_DIALOG_NAME )
2283 {
2284 m_diffSymbolDialog->Destroy();
2285 m_diffSymbolDialog = nullptr;
2286 }
2287}
2288
2289
2291{
2292 if( !m_ercDialog )
2293 m_ercDialog = new DIALOG_ERC( this );
2294
2295 return m_ercDialog;
2296}
2297
2298
2299void SCH_EDIT_FRAME::onCloseErcDialog( wxCommandEvent& aEvent )
2300{
2301 if( m_ercDialog )
2302 {
2303 m_ercDialog->Destroy();
2304 m_ercDialog = nullptr;
2305 }
2306}
2307
2308
2310{
2313
2315}
2316
2317
2319{
2321 {
2322 m_symbolFieldsTableDialog->Destroy();
2323 m_symbolFieldsTableDialog = nullptr;
2324 }
2325}
2326
2327
2328void SCH_EDIT_FRAME::AddSchematicChangeListener( wxEvtHandler* aListener )
2329{
2330 auto it = std::find( m_schematicChangeListeners.begin(), m_schematicChangeListeners.end(),
2331 aListener );
2332
2333 // Don't add duplicate listeners.
2334 if( it == m_schematicChangeListeners.end() )
2335 m_schematicChangeListeners.push_back( aListener );
2336}
2337
2338
2340{
2341 auto it = std::find( m_schematicChangeListeners.begin(), m_schematicChangeListeners.end(),
2342 aListener );
2343
2344 // Don't add duplicate listeners.
2345 if( it != m_schematicChangeListeners.end() )
2346 m_schematicChangeListeners.erase( it );
2347}
2348
2349
2351{
2352 m_netNavigator = new wxTreeCtrl( this, wxID_ANY, wxPoint( 0, 0 ),
2353 FromDIP( wxSize( 160, 250 ) ),
2354 wxTR_DEFAULT_STYLE | wxNO_BORDER );
2355
2356 return m_netNavigator;
2357}
2358
2359
2360void SCH_EDIT_FRAME::SetHighlightedConnection( const wxString& aConnection,
2361 const NET_NAVIGATOR_ITEM_DATA* aSelection )
2362{
2363 bool refreshNetNavigator = aConnection != m_highlightedConn;
2364
2365 m_highlightedConn = aConnection;
2366
2367 if( refreshNetNavigator )
2368 RefreshNetNavigator( aSelection );
2369}
2370
2371
2373{
2374 if( m_netNavigator && !m_highlightedConn.IsEmpty() )
2375 {
2376 NET_NAVIGATOR_ITEM_DATA itemData;
2377 wxTreeItemId selection = m_netNavigator->GetSelection();
2378 bool refreshSelection = selection.IsOk() && ( selection != m_netNavigator->GetRootItem() );
2379
2380 if( refreshSelection )
2381 {
2383 dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( selection ) );
2384
2385 wxCHECK( tmp, /* void */ );
2386 itemData = *tmp;
2387 }
2388
2389 m_netNavigator->DeleteAllItems();
2390 RefreshNetNavigator( refreshSelection ? &itemData : nullptr );
2391 }
2392
2394}
2395
2396
2398{
2399 wxAuiPaneInfo& hierarchyPane = m_auimgr.GetPane( SchematicHierarchyPaneName() );
2400 wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
2401 wxAuiPaneInfo& propertiesPane = m_auimgr.GetPane( PropertiesPaneName() );
2402 wxAuiPaneInfo& selectionFilterPane = m_auimgr.GetPane( wxS( "SelectionFilter" ) );
2403
2404 // Don't give the selection filter its own visibility controls; instead show it if
2405 // anything else is visible
2406 bool showFilter = ( hierarchyPane.IsShown() && hierarchyPane.IsDocked() )
2407 || ( netNavigatorPane.IsShown() && netNavigatorPane.IsDocked() )
2408 || ( propertiesPane.IsShown() && propertiesPane.IsDocked() );
2409
2410 selectionFilterPane.Show( showFilter );
2411}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
@ icon_eeschema
@ icon_eeschema_16
@ icon_eeschema_32
BOX2< VECTOR2I > BOX2I
Definition: box2.h:853
static TOOL_ACTION toggleGrid
Definition: actions.h:172
static TOOL_ACTION paste
Definition: actions.h:70
static TOOL_ACTION cancelInteractive
Definition: actions.h:63
static TOOL_ACTION millimetersUnits
Definition: actions.h:180
static TOOL_ACTION unselectAll
Definition: actions.h:73
static TOOL_ACTION copy
Definition: actions.h:69
static TOOL_ACTION updateFind
Definition: actions.h:106
static TOOL_ACTION pasteSpecial
Definition: actions.h:71
static TOOL_ACTION milsUnits
Definition: actions.h:179
static TOOL_ACTION toggleBoundingBoxes
Definition: actions.h:135
static TOOL_ACTION showSearch
Definition: actions.h:98
static TOOL_ACTION undo
Definition: actions.h:66
static TOOL_ACTION duplicate
Definition: actions.h:74
static TOOL_ACTION inchesUnits
Definition: actions.h:178
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:132
static TOOL_ACTION doDelete
Definition: actions.h:75
static TOOL_ACTION selectionTool
Definition: actions.h:187
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION zoomFitScreen
Definition: actions.h:124
static TOOL_ACTION redo
Definition: actions.h:67
static TOOL_ACTION deleteTool
Definition: actions.h:76
static TOOL_ACTION zoomTool
Definition: actions.h:127
static TOOL_ACTION showProperties
Definition: actions.h:201
static TOOL_ACTION cut
Definition: actions.h:68
static TOOL_ACTION toggleGridOverrides
Definition: actions.h:173
static TOOL_ACTION selectAll
Definition: actions.h:72
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
WINDOW_SETTINGS m_Window
Definition: app_settings.h:170
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:41
void SetPageNumber(const wxString &aPageNumber)
Definition: base_screen.h:79
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:589
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
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
Definition: common_tools.h:38
Calculate the connectivity of a schematic and generates netlists.
const NET_MAP & GetNetMap() const
CONNECTION_SUBGRAPH * FindFirstSubgraphByName(const wxString &aNetName)
Retrieve a subgraph for the given net name, if one exists.
std::set< std::pair< SCH_SHEET_PATH, SCH_ITEM * > > ExtractAffectedItems(const std::set< SCH_ITEM * > &aItems)
For a set of items, this will remove the connected items and their associated data including subgraph...
void SetLastCodes(const CONNECTION_GRAPH *aOther)
void Merge(CONNECTION_GRAPH &aGraph)
Combine the input graph contents into the current graph.
void Recalculate(const SCH_SHEET_LIST &aSheetList, bool aUnconditional=false, std::function< void(SCH_ITEM *)> *aChangedItemHandler=nullptr)
Update the connection graph for the given list of sheets.
A subgraph is a set of items that are electrically connected on a single sheet.
wxArrayString GetFindEntries() const
wxArrayString GetReplaceEntries() const
void SetReplaceEntries(const wxArrayString &aEntries)
void SetFindEntries(const wxArrayString &aEntries, const wxString &aFindString)
bool Show(bool show) override
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
UNDO_REDO_CONTAINER m_undoList
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
SETTINGS_MANAGER * GetSettingsManager() const
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
WX_INFOBAR * m_infoBar
void UpdateFileHistory(const wxString &FullFileName, FILE_HISTORY *aFileHistory=nullptr)
Update the list of recently opened files.
wxAuiManager m_auimgr
void ClearFileHistory(FILE_HISTORY *aFileHistory=nullptr)
Removes all files from the file history.
virtual void OnSize(wxSizeEvent &aEvent)
virtual void OnDropFiles(wxDropFilesEvent &aEvent)
Handles event fired when a file is dropped to the window.
wxString GetFileFromHistory(int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=nullptr)
Fetches the file name from the file history list.
static wxString GetAutoSaveFilePrefix()
virtual int GetUndoCommandCount() const
wxString m_mruPath
wxArrayString m_replaceStringHistoryList
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
virtual void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
static const wxString PropertiesPaneName()
void FocusOnLocation(const VECTOR2I &aPos)
Useful to focus on a particular location, in find functions.
virtual void SetScreen(BASE_SCREEN *aScreen)
void RecreateToolbars()
Rebuild all toolbars, and update the checked state of check tools.
virtual void UpdateMsgPanel()
Redraw the message panel.
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, const std::map< wxString, wxString > *aProperties, double aMils2Iu, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Prints the drawing-sheet (frame and title block).
wxArrayString m_findStringHistoryList
std::unique_ptr< EDA_SEARCH_DATA > m_findReplaceData
PROPERTIES_PANEL * m_propertiesPanel
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual const VECTOR2I GetFocusPosition() const
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
Definition: eda_item.h:246
const KIID m_Uuid
Definition: eda_item.h:482
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
void ClearBrightened()
Definition: eda_item.h:119
void SetBrightened()
Definition: eda_item.h:116
bool IsBrightened() const
Definition: eda_item.h:108
Specialization of the wxAuiPaneInfo class for KiCad panels.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:80
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:95
virtual void ClearBoundingBoxCache()
Definition: eda_text.cpp:505
SELECTION_CONDITION BoundingBoxes()
SELECTION_CONDITION RedoAvailable()
Create a functor that tests if there are any items in the redo queue.
SELECTION_CONDITION CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
SELECTION_CONDITION ScriptingConsoleVisible()
Create a functor testing if the python scripting console window is visible.
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
SELECTION_CONDITION GridOverrides()
Create a functor testing if the grid overrides wires is enabled in a frame.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
PANEL_ANNOTATE m_AnnotatePanel
Gather all the actions that are shared by tools.
Definition: ee_actions.h:39
static TOOL_ACTION mirrorV
Definition: ee_actions.h:123
static TOOL_ACTION remapSymbols
Definition: ee_actions.h:167
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Definition: ee_actions.h:46
static TOOL_ACTION toggleAnnotateAuto
Definition: ee_actions.h:265
static TOOL_ACTION lineMode90
Definition: ee_actions.h:260
static TOOL_ACTION toggleHiddenPins
Definition: ee_actions.h:231
static TOOL_ACTION drawTable
Definition: ee_actions.h:99
static TOOL_ACTION placeSymbol
Definition: ee_actions.h:79
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
static TOOL_ACTION showPythonConsole
Definition: ee_actions.h:255
static TOOL_ACTION toggleERCWarnings
Definition: ee_actions.h:236
static TOOL_ACTION toggleERCExclusions
Definition: ee_actions.h:238
static TOOL_ACTION placeClassLabel
Definition: ee_actions.h:88
static TOOL_ACTION drawWire
Definition: ee_actions.h:81
static TOOL_ACTION drawCircle
Definition: ee_actions.h:101
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:122
static TOOL_ACTION lineModeFree
Definition: ee_actions.h:259
static TOOL_ACTION drawBus
Definition: ee_actions.h:82
static TOOL_ACTION toggleERCErrors
Definition: ee_actions.h:237
static TOOL_ACTION placePower
Definition: ee_actions.h:80
static TOOL_ACTION placeSheetPin
Definition: ee_actions.h:92
static TOOL_ACTION drawLines
Definition: ee_actions.h:103
static TOOL_ACTION toggleOPCurrents
Definition: ee_actions.h:240
static TOOL_ACTION mirrorH
Definition: ee_actions.h:124
static TOOL_ACTION highlightNetTool
Definition: ee_actions.h:290
static TOOL_ACTION syncSheetPins
Definition: ee_actions.h:94
static TOOL_ACTION rotateCW
Definition: ee_actions.h:121
static TOOL_ACTION leaveSheet
Definition: ee_actions.h:217
static TOOL_ACTION toggleHiddenFields
Definition: ee_actions.h:232
static TOOL_ACTION placeGlobalLabel
Definition: ee_actions.h:89
static TOOL_ACTION ddAppendFile
Definition: ee_actions.h:294
static TOOL_ACTION placeHierLabel
Definition: ee_actions.h:90
static TOOL_ACTION drawTextBox
Definition: ee_actions.h:98
static TOOL_ACTION showNetNavigator
Definition: ee_actions.h:291
static TOOL_ACTION drawRectangle
Definition: ee_actions.h:100
static TOOL_ACTION placeImage
Definition: ee_actions.h:104
static TOOL_ACTION toggleDirectiveLabels
Definition: ee_actions.h:235
static TOOL_ACTION showHierarchy
Definition: ee_actions.h:223
static TOOL_ACTION placeSchematicText
Definition: ee_actions.h:97
static TOOL_ACTION toggleOPVoltages
Definition: ee_actions.h:239
static TOOL_ACTION drawArc
Definition: ee_actions.h:102
static TOOL_ACTION lineMode45
Definition: ee_actions.h:261
static TOOL_ACTION drawSheet
Definition: ee_actions.h:91
static TOOL_ACTION navigateNext
Definition: ee_actions.h:222
static TOOL_ACTION placeLabel
Definition: ee_actions.h:87
static TOOL_ACTION placeBusWireEntry
Definition: ee_actions.h:86
static TOOL_ACTION placeJunction
Definition: ee_actions.h:85
static TOOL_ACTION navigatePrevious
Definition: ee_actions.h:221
static TOOL_ACTION placeNoConnect
Definition: ee_actions.h:84
Tool that displays edit points allowing to modify items by dragging the points.
bool empty() const
Definition: sch_rtree.h:176
EE_TYPE Overlapping(const BOX2I &aRect) const
Definition: sch_rtree.h:243
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:238
SEVERITY GetSeverity(int aErrorCode) const
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
void UpdateLabelsHierarchyTree()
Update the labels of the hierarchical tree of the schematic.
void UpdateHierarchySelection()
Updates the tree's selection to match current page.
void UpdateHierarchyTree()
Update the hierarchical tree of the schematic.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:77
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetDefaultFont(const wxString &aFont)
wxDC * GetPrintDC() const
Contains methods for drawing schematic-specific items.
Definition: sch_painter.h:137
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
Definition: sch_view.h:103
void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 }) override
Set the scaling factor, zooming around a given anchor point.
Definition: sch_view.cpp:75
An abstract base class for deriving all objects that can be added to a VIEW.
Definition: view_item.h:84
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
double GetScale() const
Definition: view.h:271
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1636
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:395
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:215
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:578
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
Definition: view.cpp:1528
Definition: kiid.h:49
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:67
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
Definition: kiway_player.h:115
void OnSockRequestServer(wxSocketEvent &evt)
Definition: eda_dde.cpp:99
void OnSockRequest(wxSocketEvent &evt)
Definition: eda_dde.cpp:69
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:279
void OnKiCadExit()
Definition: kiway.cpp:743
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:432
virtual bool PlayerClose(FRAME_T aFrameType, bool doForce)
Call the KIWAY_PLAYER::Close( bool force ) function on the window and if not vetoed,...
Definition: kiway.cpp:496
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
Definition: kiway.cpp:553
Define a library symbol object.
Definition: lib_symbol.h:99
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:605
Tree view item data for the net navigator.
A singleton reporter that reports to nowhere.
Definition: reporter.h:223
int GetHeightIU(double aIUScale) const
Gets the page height in IU.
Definition: page_info.h:162
int GetWidthIU(double aIUScale) const
Gets the page width in IU.
Definition: page_info.h:153
A holder to handle information on schematic or board items.
unsigned GetCount() const
BASE_SCREEN * GetScreenForItem(unsigned int aIdx) const
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
A small class to help profiling.
Definition: profile.h:48
void Stop()
Save the time when this function was called, and set the counter stane to stop.
Definition: profile.h:87
double msecs(bool aSinceLast=false)
Definition: profile.h:148
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
Definition: project.cpp:129
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:135
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:320
Action handler for the Properties panel.
These settings were stored in SCH_BASE_FRAME previously.
Holds all the data relating to one schematic.
Definition: schematic.h:75
void Reset()
Initialize this schematic to a blank one, unloading anything existing.
Definition: schematic.cpp:128
CONNECTION_GRAPH * m_connectionGraph
Holds and calculates connectivity information of this schematic.
Definition: schematic.h:329
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:136
void OnSchSheetChanged()
Notify the schematic and its listeners that the current sheet has been changed.
Definition: schematic.cpp:784
wxString GetOperatingPoint(const wxString &aNetName, int aPrecision, const wxString &aRange)
Definition: schematic.cpp:718
wxString GetFileName() const override
Helper to retrieve the filename from the root sheet screen.
Definition: schematic.cpp:281
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:287
CONNECTION_GRAPH * ConnectionGraph() const override
Definition: schematic.h:146
void SetCurrentSheet(const SCH_SHEET_PATH &aPath) override
Definition: schematic.h:141
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
Definition: schematic.h:100
void SetRoot(SCH_SHEET *aRootSheet)
Initialize the schematic with a new root sheet.
Definition: schematic.cpp:184
void SetProject(PROJECT *aPrj)
Definition: schematic.cpp:154
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
Definition: schematic.cpp:197
void RecomputeIntersheetRefs(const std::function< void(SCH_GLOBALLABEL *)> &aItemCallback)
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
Definition: schematic.cpp:656
bool IsValid() const
A simple test if the schematic is loaded, not a complete one.
Definition: schematic.h:121
void RemoveAllListeners()
Remove all listeners.
Definition: schematic.cpp:809
SCH_SHEET & Root() const
Definition: schematic.h:105
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
Definition: schematic.cpp:627
ERC_SETTINGS & ErcSettings() const
Definition: schematic.cpp:294
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
EESCHEMA_SETTINGS * eeconfig() const
PANEL_SCH_SELECTION_FILTER * m_selectionFilterPanel
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
virtual void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false)
Mark an item for refresh.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
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).
bool HasDriverChanged() const
wxString Name(bool aIgnoreSheet=false) const
Tool responsible for drawing/placing items (symbols, wires, buses, labels, etc.).
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplaySheet(SCH_SCREEN *aScreen)
Group generic conditions for PCB editor states.
SELECTION_CONDITION LineMode(LINE_MODE aMode)
Create a functor that tests if the frame is in the specified line drawing mode.
Handle actions specific to the schematic editor.
int UpdateNetHighlighting(const TOOL_EVENT &aEvent)
Launch a tool to highlight nets.
Schematic editor (Eeschema) main window.
bool IsContentModified() const override
Get if the current schematic has been modified but not saved.
void RefreshOperatingPointDisplay()
Refresh the display of any operaintg points.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
EDA_ITEM * GetItem(const KIID &aId) const override
Fetch an item by KIID.
const wxString & getAutoSaveFileName() const
wxTreeCtrl * m_netNavigator
std::vector< std::unique_ptr< SCH_ITEM > > m_items_to_repeat
For the repeat-last-item cmd.
void onResizeNetNavigator(wxSizeEvent &aEvent)
void updateSelectionFilterVisbility() override
Selection filter panel doesn't have a dedicated visibility control, so show it if any other AUI panel...
bool m_highlightedConnChanged
void onNetNavigatorSelChanging(wxTreeEvent &aEvent)
void OnOpenCvpcb(wxCommandEvent &event)
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
void ShowAllIntersheetRefs(bool aShow)
void SaveProjectLocalSettings() override
Save changes to the project settings to the project (.pro) file.
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Open a project or set of files given by aFileList.
void doCloseWindow() override
DIALOG_BOOK_REPORTER * m_diffSymbolDialog
void SetHighlightedConnection(const wxString &aConnection, const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool ReadyToNetlist(const wxString &aAnnotateMessage)
Check if we are ready to write a netlist file for the current schematic.
void onCloseErcDialog(wxCommandEvent &aEvent)
void ShowFindReplaceDialog(bool aReplace)
Run the Find or Find & Replace dialog.
void UpdateHierarchySelection()
Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy pane).
void SetScreen(BASE_SCREEN *aScreen) override
void OnFindDialogClose()
Notification that the Find dialog has closed.
void SaveSymbolToSchematic(const LIB_SYMBOL &aSymbol, const KIID &aSchematicSymbolUUID)
Update a schematic symbol from a LIB_SYMBOL.
void SchematicCleanUp(SCH_COMMIT *aCommit, SCH_SCREEN *aScreen=nullptr)
Perform routine schematic cleaning including breaking wire and buses and deleting identical objects s...
void onSize(wxSizeEvent &aEvent)
void ShowChangedLanguage() override
std::vector< wxEvtHandler * > m_schematicChangeListeners
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
void OnClearFileHistory(wxCommandEvent &aEvent)
bool GetShowAllPins() const override
Allow edit frame to show/hide hidden pins.
void OnAppendProject(wxCommandEvent &event)
SCHEMATIC * m_schematic
The currently loaded schematic.
void onCloseSymbolFieldsTableDialog(wxCommandEvent &aEvent)
void ClearFindReplaceStatus()
SCH_SHEET_PATH & GetCurrentSheet() const
void OnLoadFile(wxCommandEvent &event)
SCHEMATIC & Schematic() const
void updateTitle()
Set the main window title bar text.
void RefreshNetNavigator(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
wxString GetFullScreenDesc() const override
static const wxString SearchPaneName()
DIALOG_BOOK_REPORTER * GetSymbolDiffDialog()
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
void OnUpdatePCB(wxCommandEvent &event)
void RecomputeIntersheetRefs()
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
DIALOG_ERC * GetErcDialog()
void sendNetlistToCvpcb()
Send the KiCad netlist over to CVPCB.
void OnOpenPcbnew(wxCommandEvent &event)
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void OnPageSettingsChange() override
Called when modifying the page settings.
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
void RecalculateConnections(SCH_COMMIT *aCommit, SCH_CLEANUP_FLAGS aCleanupFlags)
Generate the connection data for the entire schematic hierarchy.
void initScreenZoom()
Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
void UpdateLabelsHierarchyNavigator()
Update the hierarchy navigation tree labels.
void OnImportProject(wxCommandEvent &event)
static const wxString SchematicHierarchyPaneName()
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void RemoveSchematicChangeListener(wxEvtHandler *aListener)
Remove aListener to from the schematic changed listener list.
void ShowFindReplaceStatus(const wxString &aMsg, int aStatusTime)
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
virtual void PrintPage(const RENDER_SETTINGS *aSettings) override
Plot or print the current sheet to the clipboard.
int GetSchematicJunctionSize()
void DisplayCurrentSheet()
Draw the current sheet on the display.
~SCH_EDIT_FRAME() override
const wxString & GetHighlightedConnection() const
DIALOG_ERC * m_ercDialog
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
void UpdateNetHighlightStatus()
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
DIALOG_SCH_FIND * m_findReplaceDialog
void UpdateHierarchyNavigator()
Update the hierarchy navigation tree and history.
void AddCopyForRepeatItem(const SCH_ITEM *aItem)
DIALOG_SYMBOL_FIELDS_TABLE * GetSymbolFieldsTableDialog()
void OnResizeHierarchyNavigator(wxSizeEvent &aEvent)
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
wxString m_highlightedConn
The highlighted net or bus or empty string.
static const wxString NetNavigatorPaneName()
void onCloseSymbolDiffDialog(wxCommandEvent &aEvent)
wxTreeCtrl * createHighlightedNetNavigator()
void OnExit(wxCommandEvent &event)
void AutoRotateItem(SCH_SCREEN *aScreen, SCH_ITEM *aItem)
Automatically set the rotation of an item (if the item supports it)
void AddSchematicChangeListener(wxEvtHandler *aListener)
Add aListener to post #EDA_EVT_SCHEMATIC_CHANGED command events to.
HIERARCHY_PANE * m_hierarchy
DIALOG_SYMBOL_FIELDS_TABLE * m_symbolFieldsTableDialog
SEVERITY GetSeverity(int aErrorCode) const override
void onNetNavigatorSelection(wxTreeEvent &aEvent)
void FocusOnItem(SCH_ITEM *aItem)
void SaveCopyForRepeatItem(const SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:52
Handle actions specific to the schematic editor.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:165
virtual bool IsConnectable() const
Definition: sch_item.h:389
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
Definition: sch_item.h:511
void SetConnectivityDirty(bool aDirty=true)
Definition: sch_item.h:455
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 std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Definition: sch_item.h:404
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
Definition: sch_item.cpp:94
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
bool AutoRotateOnPlacement() const
autoRotateOnPlacement
Definition: sch_label.cpp:1448
SPIN_STYLE GetSpinStyle() const
Definition: sch_label.cpp:372
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_label.cpp:638
std::vector< SCH_FIELD > & GetFields()
Definition: sch_label.h:194
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
Definition: sch_label.cpp:337
Tool responsible for drawing/placing items (symbols, wires, buses, labels, etc.)
static bool IsDrawingLineWireOrBus(const SELECTION &aSelection)
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:40
void SetOperatingPoint(const wxString &aText)
Definition: sch_line.h:307
double GetLength() const
Definition: sch_line.cpp:238
const wxString & GetOperatingPoint() const
Definition: sch_line.h:306
Handle actions specific to the schematic editor.
void SetOperatingPoint(const wxString &aText)
Definition: sch_pin.h:168
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:704
SCH_SCREEN * GetNext()
SCH_SCREEN * GetFirst()
bool HasNoFullyDefinedLibIds()
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:131
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
Definition: sch_screen.cpp:275
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
Definition: sch_screen.h:178
void TestDanglingEnds(const SCH_SHEET_PATH *aPath=nullptr, std::function< void(SCH_ITEM *)> *aChangedHandler=nullptr) const
Test all of the connectable objects in the schematic for unused connection points.
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols() const
Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this...
Definition: sch_screen.h:481
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
Definition: sch_screen.h:628
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:109
void Print(const RENDER_SETTINGS *aSettings)
Print all the items in the screen to aDC.
const wxString & GetFileName() const
Definition: sch_screen.h:144
const KIID & GetUuid() const
Definition: sch_screen.h:525
bool IsReadOnly() const
Definition: sch_screen.h:147
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
Definition: sch_screen.cpp:115
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Update aItem's bounding box in the tree.
Definition: sch_screen.cpp:313
bool m_zoomInitialized
Definition: sch_screen.h:653
bool FileExists() const
Definition: sch_screen.h:150
SPIN_STYLE GetLabelOrientationForPoint(const VECTOR2I &aPosition, SPIN_STYLE aDefaultOrientation, const SCH_SHEET_PATH *aSheet) const
Definition: sch_screen.cpp:505
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
Fetch a SCH_ITEM by ID.
bool IsModified() const
Check the entire hierarchy for any modifications.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const
Return the sheet path in a human readable form made from the sheet names.
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
SCH_SCREEN * LastScreen()
void SetPageNumber(const wxString &aPageNumber)
Set the sheet instance user definable page number.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
void clear()
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
wxString GetName() const
Definition: sch_sheet.h:107
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:162
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:181
Schematic symbol object.
Definition: sch_symbol.h:109
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
Definition: sch_symbol.cpp:751
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:953
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
bool GetExcludedFromSim() const override
Definition: sch_symbol.h:858
bool IsAnnotated(const SCH_SHEET_PATH *aSheet)
Check if the symbol has a valid annotation (reference) for the given sheet path.
Definition: sch_symbol.cpp:829
SCH_PIN * GetPin(const wxString &number) const
Find a symbol pin by number.
VECTOR2I GetPosition() const override
Definition: sch_text.h:134
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
void BrightenItem(EDA_ITEM *aItem)
void UnbrightenItem(EDA_ITEM *aItem)
EDA_ITEM * Front() const
Definition: selection.h:208
int Size() const
Returns the number of selected parts.
Definition: selection.h:115
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Saves, unloads and unregisters the given PROJECT.
SIM_MODEL & CreateModel(SIM_MODEL::TYPE aType, const std::vector< LIB_PIN * > &aPins, REPORTER &aReporter)
std::vector< std::reference_wrapper< const PIN > > GetPins() const
Definition: sim_model.cpp:756
const SPICE_GENERATOR & SpiceGenerator() const
Definition: sim_model.h:440
virtual std::string ItemName(const SPICE_ITEM &aItem) const
Symbol library viewer main window.
The symbol library editor main window.
Symbol library viewer main window.
void AddTemplateFieldNames(const wxString &aSerializedFieldNames)
Add a serialized list of template field names.
void DeleteAllFieldNameTemplates(bool aGlobal)
Delete the entire contents.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:167
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:169
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
ACTIONS * m_actions
Definition: tools_holder.h:168
@ REDRAW
Full drawing refresh.
Definition: tool_base.h:83
@ MODEL_RELOAD
Model changes (the sheet for a schematic)
Definition: tool_base.h:80
Generic, UI-independent tool event.
Definition: tool_event.h:167
Master controller class:
Definition: tool_manager.h:57
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:145
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:289
bool PostAction(const std::string &aActionName, T aParam)
Run the specified action after the current action (coroutine) ends.
Definition: tool_manager.h:230
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
void RegisterTool(TOOL_BASE *aTool)
Add a tool to the manager set and sets it up.
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Set the work environment (model, view, view controls and the parent window).
void InitTools()
Initializes all registered tools.
void ShutdownAllTools()
Shutdown all tools with a currently registered event loop in this tool manager by waking them up with...
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
Definition: wx_infobar.cpp:301
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
Definition: wx_infobar.cpp:140
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Definition: wx_infobar.cpp:187
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
Definition: wx_infobar.cpp:291
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
Definition: common.cpp:415
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:280
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:240
This file is part of the common library.
#define CHECK(x)
#define ENABLE(x)
#define _HKI(x)
#define _(s)
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define SCH_EDIT_FRAME_NAME
@ ID_IMPORT_NON_KICAD_SCH
Definition: eeschema_id.h:57
const wxAuiPaneInfo & defaultSchSelectionFilterPaneInfo(wxWindow *aWindow)
const wxAuiPaneInfo & defaultPropertiesPaneInfo(wxWindow *aWindow)
const wxAuiPaneInfo & defaultNetNavigatorPaneInfo()
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
KiCad executable names.
const wxString PCBNEW_EXE
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ FRAME_SCH_SYMBOL_EDITOR
Definition: frame_type.h:35
@ FRAME_SCH_VIEWER
Definition: frame_type.h:36
@ FRAME_SCH
Definition: frame_type.h:34
@ FRAME_SIMULATOR
Definition: frame_type.h:38
@ FRAME_CVPCB
Definition: frame_type.h:52
@ FRAME_SYMBOL_CHOOSER
Definition: frame_type.h:37
int ExecuteFile(const wxString &aEditorName, const wxString &aFileName, wxProcess *aCallback, bool aFileForKicad)
Call the executable file aEditorName with the parameter aFileName.
Definition: gestfich.cpp:139
static const std::string NetlistFileExtension
static const std::string LegacyPcbFileExtension
static const std::string KiCadSchematicFileExtension
static wxString LegacySchematicFileWildcard()
static wxString AllSchematicFilesWildcard()
static wxString KiCadSchematicFileWildcard()
@ ID_FILE_LIST_CLEAR
Definition: id.h:87
@ ID_EDA_SOCKET_EVENT
Definition: id.h:163
@ ID_EDA_SOCKET_EVENT_SERV
Definition: id.h:162
@ ID_FILEMAX
Definition: id.h:85
@ ID_FILE1
Definition: id.h:84
@ ID_APPEND_PROJECT
Definition: id.h:74
PROJECT & Prj()
Definition: kicad.cpp:591
KIID niluuid(0)
KIWAY Kiway
#define KICTL_CREATE
caller thinks requested project files may not exist.
Definition: kiway_player.h:78
@ LAYER_ERC_WARN
Definition: layer_ids.h:381
@ LAYER_ERC_EXCLUSION
Definition: layer_ids.h:383
@ LAYER_ERC_ERR
Definition: layer_ids.h:382
@ LAYER_OP_CURRENTS
Definition: layer_ids.h:400
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:388
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:366
@ LAYER_OP_VOLTAGES
Definition: layer_ids.h:399
@ MAIL_PCB_UPDATE
Definition: mail_type.h:46
@ REPAINT
Item needs to be redrawn.
Definition: view_item.h:57
@ GEOMETRY
Position or shape has changed.
Definition: view_item.h:54
void SetShutdownBlockReason(wxWindow *aWindow, const wxString &aReason)
Sets the block reason why the window/application is preventing OS shutdown.
Definition: gtk/app.cpp:90
bool SupportsShutdownBlockReason()
Whether or not the window supports setting a shutdown block reason.
Definition: gtk/app.cpp:79
see class PGM_BASE
SEVERITY
#define DIFF_SYMBOLS_DIALOG_NAME
wxDEFINE_EVENT(EDA_EVT_SCHEMATIC_CHANGING, wxCommandEvent)
#define CURRENT_TOOL(action)
SCH_CLEANUP_FLAGS
@ LOCAL_CLEANUP
@ GLOBAL_CLEANUP
std::vector< SCH_SHEET_PATH > SCH_SHEET_PATHS
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:119
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
const double IU_PER_MILS
Definition: base_units.h:78
std::string refName
Definition for symbol library class.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ SCH_LINE_T
Definition: typeinfo.h:148
@ SCH_SYMBOL_T
Definition: typeinfo.h:160
@ SCH_FIELD_T
Definition: typeinfo.h:159
@ SCH_LABEL_T
Definition: typeinfo.h:155
@ SCH_SHEET_T
Definition: typeinfo.h:162
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:157
@ SCH_SHEET_PIN_T
Definition: typeinfo.h:161
@ SCH_TEXT_T
Definition: typeinfo.h:152
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:156
@ SCH_PIN_T
Definition: typeinfo.h:163
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588
Definition of file extensions used in Kicad.
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.