KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright (C) 2015-2016 Wayne Stambaugh <[email protected]>
7 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#include "tool/embed_tool.h"
24#include "tools/convert_tool.h"
25#include "tools/drawing_tool.h"
26#include "tools/edit_tool.h"
29#include "tools/pad_tool.h"
30#include "tools/pcb_actions.h"
31#include "tools/pcb_control.h"
38#include <bitmaps.h>
39#include <board.h>
40#include <footprint.h>
41#include <confirm.h>
44#include <footprint_info_impl.h>
45#include <fp_lib_table.h>
47#include <kiface_base.h>
48#include <kiplatform/app.h>
49#include <kiway.h>
50#include <macros.h>
51#include <pcbnew_id.h>
52#include <pgm_base.h>
53#include <project.h>
54#include <project_pcb.h>
56#include <tool/action_toolbar.h>
57#include <tool/common_control.h>
58#include <tool/common_tools.h>
60#include <tool/selection.h>
63#include <tool/tool_manager.h>
64#include <tool/zoom_tool.h>
65#include <tools/array_tool.h>
69#include <tools/group_tool.h>
72#include <widgets/lib_tree.h>
78
79#include <wx/filedlg.h>
80#include <wx/hyperlink.h>
81
82BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
83 EVT_MENU( wxID_CLOSE, FOOTPRINT_EDIT_FRAME::CloseFootprintEditor )
84 EVT_MENU( wxID_EXIT, FOOTPRINT_EDIT_FRAME::OnExitKiCad )
85
87
90
92
95
96 // Horizontal toolbar
98
99 // UI update events.
101 FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard )
103 FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard )
105
106 // Drop files event
107 EVT_DROP_FILES( FOOTPRINT_EDIT_FRAME::OnDropFiles )
108
109END_EVENT_TABLE()
110
111
112FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
113 PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_FOOTPRINT_EDITOR, wxEmptyString,
114 wxDefaultPosition, wxDefaultSize,
115 KICAD_DEFAULT_DRAWFRAME_STYLE, GetFootprintEditorFrameName() ),
116 m_show_layer_manager_tools( true )
117{
118 m_showBorderAndTitleBlock = false; // true to show the frame references
119 m_aboutTitle = _HKI( "KiCad Footprint Editor" );
120 m_selLayerBox = nullptr;
121 m_editorSettings = nullptr;
122
123 // Give an icon
124 wxIcon icon;
125 wxIconBundle icon_bundle;
126
127 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit, 48 ) );
128 icon_bundle.AddIcon( icon );
129 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit, 128 ) );
130 icon_bundle.AddIcon( icon );
131 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit, 256 ) );
132 icon_bundle.AddIcon( icon );
133 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit_32 ) );
134 icon_bundle.AddIcon( icon );
135 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit_16 ) );
136 icon_bundle.AddIcon( icon );
137
138 SetIcons( icon_bundle );
139
140 // Create GAL canvas
141 m_canvasType = loadCanvasTypeSetting( GetSettings() );
142
143 PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize,
144 GetGalDisplayOptions(), m_canvasType );
145 SetCanvas( drawPanel );
146
147 CreateInfoBar();
148
149 SetBoard( new BOARD() );
150
151 // This board will only be used to hold a footprint for editing
153
154 // In Footprint Editor, the default net clearance is not known (it depends on the actual
155 // board). So we do not show the default clearance, by setting it to 0. The footprint or
156 // pad specific clearance will be shown.
157 GetBoard()->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetClearance( 0 );
158
159 // Don't show the default board solder mask expansion in the footprint editor. Only the
160 // footprint or pad mask expansions settings should be shown.
162
163 // Ensure all layers and items are visible:
164 // In footprint editor, some layers have no meaning or cannot be used, but we show all of
165 // them, at least to be able to edit a bad layer
167
168 GetGalDisplayOptions().m_axesEnabled = true;
169
170 // In Footprint Editor, set the default paper size to A4 for plot/print
171 SetPageSettings( PAGE_INFO( PAGE_INFO::A4 ) );
172 SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU( pcbIUScale.IU_PER_MILS ) ) );
173
174 // Create the manager and dispatcher & route draw panel events to the dispatcher
175 setupTools();
176 setupUIConditions();
177
178 initLibraryTree();
179 m_treePane = new FOOTPRINT_TREE_PANE( this );
180
181 ReCreateMenuBar();
182 ReCreateHToolbar();
183 ReCreateVToolbar();
184 ReCreateOptToolbar();
185
186 m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
187 m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas(), true );
188 m_propertiesPanel = new PCB_PROPERTIES_PANEL( this, this );
189
190 // LoadSettings() *after* creating m_LayersManager, because LoadSettings() initialize
191 // parameters in m_LayersManager
192 // NOTE: KifaceSettings() will return PCBNEW_SETTINGS if we started from pcbnew
193 LoadSettings( GetSettings() );
194
195 float proportion = GetFootprintEditorSettings()->m_AuiPanels.properties_splitter;
196 m_propertiesPanel->SetSplitterProportion( proportion );
197
198 // Must be set after calling LoadSettings() to be sure these parameters are not dependent
199 // on what is read in stored settings. Enable one internal layer, because footprints
200 // support keepout areas that can be on internal layers only (therefore on the first internal
201 // layer). This is needed to handle these keepout in internal layers only.
203 GetBoard()->SetEnabledLayers( GetBoard()->GetEnabledLayers().set( In1_Cu ) );
204 GetBoard()->SetVisibleLayers( GetBoard()->GetEnabledLayers() );
205 GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) );
206
207 SetActiveLayer( F_SilkS );
208
209 m_auimgr.SetManagedWindow( this );
210
211 unsigned int auiFlags = wxAUI_MGR_DEFAULT;
212#if !defined( _WIN32 )
213 // Windows cannot redraw the UI fast enough during a live resize and may lead to all kinds
214 // of graphical glitches
215 auiFlags |= wxAUI_MGR_LIVE_RESIZE;
216#endif
217 m_auimgr.SetFlags( auiFlags );
218
219 // Rows; layers 4 - 6
220 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
221 .Top().Layer( 6 ) );
222
223 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
224 .Bottom().Layer( 6 ) );
225
226 // Columns; layers 1 - 3
227 m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" )
228 .Left().Layer( 4 )
229 .Caption( _( "Libraries" ) )
230 .MinSize( FromDIP( 250 ), -1 ).BestSize( FromDIP( 250 ), -1 ) );
231 m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
232 .Left().Layer( 3 )
233 .Caption( _( "Properties" ) ).PaneBorder( false )
234 .MinSize( FromDIP( wxSize( 240, 60 ) ) ).BestSize( FromDIP( wxSize( 300, 200 ) ) ) );
235 m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
236 .Left().Layer( 2 ) );
237
238 m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
239 .Right().Layer(2) );
240 m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" )
241 .Right().Layer( 3 )
242 .Caption( _( "Appearance" ) ).PaneBorder( false )
243 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
244 m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Palette().Name( "SelectionFilter" )
245 .Right().Layer( 3 ).Position( 2 )
246 .Caption( _( "Selection Filter" ) ).PaneBorder( false )
247 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
248
249 // Center
250 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
251 .Center() );
252
253 m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
254 m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
255 m_auimgr.GetPane( PropertiesPaneName() ).Show( GetSettings()->m_AuiPanels.show_properties );
256
257 // The selection filter doesn't need to grow in the vertical direction when docked
258 m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0;
259
262 DragAcceptFiles( true );
263
264 FinishAUIInitialization();
265
266 // Apply saved visibility stuff at the end
267 if( FOOTPRINT_EDITOR_SETTINGS* cfg = dynamic_cast<FOOTPRINT_EDITOR_SETTINGS*>( GetSettings() ) )
268 {
269 wxAuiPaneInfo& treePane = m_auimgr.GetPane( "Footprints" );
270 wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
271
272 if( cfg->m_LibWidth > 0 )
273 SetAuiPaneSize( m_auimgr, treePane, cfg->m_LibWidth, -1 );
274
275 if( cfg->m_AuiPanels.right_panel_width > 0 )
276 SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
277
278 m_appearancePanel->SetUserLayerPresets( cfg->m_LayerPresets );
279 m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset );
280 m_appearancePanel->SetTabIndex( cfg->m_AuiPanels.appearance_panel_tab );
281 }
282
283 // restore the last footprint from the project, if any, after the library has been init'ed
284 // N.B. This needs to happen after the AUI manager has been initialized so that we can
285 // properly call the WX_INFOBAR without crashing on some systems.
286 restoreLastFootprint();
287
288 // This displays the last footprint loaded, if any, so it must be done after restoreLastFootprint()
289 ActivateGalCanvas();
290
291 GetToolManager()->PostAction( ACTIONS::zoomFitScreen );
292 UpdateTitle();
293 setupUnits( GetSettings() );
294
295 resolveCanvasType();
296
297 // Default shutdown reason until a file is loaded
298 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Footprint changes are unsaved" ) );
299
300 // Catch unhandled accelerator command characters that were no handled by the library tree
301 // panel.
302 Bind( wxEVT_CHAR, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
303 Bind( wxEVT_CHAR_HOOK, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
304
305 // Ensure the window is on top
306 Raise();
307 Show( true );
308
309 // Register a call to update the toolbar sizes. It can't be done immediately because
310 // it seems to require some sizes calculated that aren't yet (at least on GTK).
311 CallAfter(
312 [this]()
313 {
314 // Ensure the controls on the toolbars all are correctly sized
315 UpdateToolbarControlSizes();
316 m_treePane->FocusSearchFieldIfExists();
317 } );
318}
319
320
322{
323 // Shutdown all running tools
324 if( m_toolManager )
326
327 // save the footprint in the PROJECT
329
330 // Clear the watched file
331 setFPWatcher( nullptr );
332
334 delete m_appearancePanel;
335 delete m_treePane;
336}
337
338
340{
342
343 FOOTPRINT* fp = static_cast<FOOTPRINT*>( GetModel() );
344
345 if( fp )
346 {
347 std::vector<MSG_PANEL_ITEM> msgItems;
348 fp->GetMsgPanelInfo( this, msgItems );
349 SetMsgPanel( msgItems );
350 }
351}
352
353
355{
356 return GetScreen() && GetScreen()->IsContentModified()
358}
359
360
362{
363 return m_toolManager->GetTool<PCB_SELECTION_TOOL>()->GetSelection();
364}
365
366
368{
369 // switches currently used canvas (Cairo / OpenGL).
370 PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
371
372 GetCanvas()->GetGAL()->SetAxesEnabled( true );
373
374 // The base class method *does not reinit* the layers manager. We must update the layer
375 // widget to match board visibility states, both layers and render columns, and and some
376 // settings dependent on the canvas.
378}
379
380
382{
383 SyncLibraryTree( true );
385}
386
387
389{
390 wxAuiPaneInfo& treePane = m_auimgr.GetPane( m_treePane );
391 treePane.Show( !IsLibraryTreeShown() );
392
393 if( IsLibraryTreeShown() )
394 {
395 // SetAuiPaneSize also updates m_auimgr
397 }
398 else
399 {
400 m_editorSettings->m_LibWidth = m_treePane->GetSize().x;
401 m_auimgr.Update();
402 }
403}
404
405
407{
409}
410
411
413{
415 wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
416 wxAuiPaneInfo& selectionFilter = m_auimgr.GetPane( "SelectionFilter" );
417
418 // show auxiliary Vertical layers and visibility manager toolbar
420 layersManager.Show( m_show_layer_manager_tools );
421 selectionFilter.Show( m_show_layer_manager_tools );
422
424 {
425 SetAuiPaneSize( m_auimgr, layersManager, settings->m_AuiPanels.right_panel_width, -1 );
426 }
427 else
428 {
429 settings->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
430 m_auimgr.Update();
431 }
432}
433
434
436{
437 return const_cast<wxAuiManager&>( m_auimgr ).GetPane( m_treePane ).IsShown();
438}
439
440
442{
443 return GetBoard()->GetFirstFootprint();
444}
445
446
448{
449 LIB_ID id;
450
451 if( IsLibraryTreeShown() )
453
454 if( id.GetLibNickname().empty() )
455 id = GetLoadedFPID();
456
457 return id;
458}
459
460
462{
463 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
464
465 if( footprint )
466 return LIB_ID( footprint->GetFPID().GetLibNickname(), m_footprintNameWhenLoaded );
467 else
468 return LIB_ID();
469}
470
471
473{
474 if( GetBoard()->GetFirstFootprint() )
475 {
478 }
479
480 GetScreen()->SetContentModified( false );
481}
482
483
485{
486 // If we've already vetted closing this window, then we have no FP anymore
487 if( m_isClosing || !GetBoard() )
488 return false;
489
490 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
491
492 return ( footprint && footprint->GetLink() != niluuid );
493}
494
495
497{
498 LIB_ID id = GetLoadedFPID();
499
500 if( id.IsValid() )
501 {
503 Prj().SetRString( PROJECT::PCB_FOOTPRINT_EDITOR_FP_NAME, id.GetLibItemName() );
504 }
505}
506
507
509{
510 const wxString& footprintName = Prj().GetRString( PROJECT::PCB_FOOTPRINT_EDITOR_FP_NAME );
511 const wxString& libNickname = Prj().GetRString( PROJECT::PCB_FOOTPRINT_EDITOR_LIB_NICKNAME );
512
513 if( libNickname.Length() && footprintName.Length() )
514 {
515 LIB_ID id;
516 id.SetLibNickname( libNickname );
517 id.SetLibItemName( footprintName );
518
519 FOOTPRINT* footprint = loadFootprint( id );
520
521 if( footprint )
522 AddFootprintToBoard( footprint );
523 }
524}
525
526
528{
530
531 m_originalFootprintCopy.reset( static_cast<FOOTPRINT*>( aFootprint->Clone() ) );
532 m_originalFootprintCopy->SetParent( nullptr );
533
535
537 // Ensure item UUIDs are valid
538 // ("old" footprints can have null uuids that create issues in fp editor)
539 aFootprint->FixUuids();
540
541 const wxString libName = aFootprint->GetFPID().GetLibNickname();
542
544 {
545 const wxString msg =
546 wxString::Format( _( "Editing %s from board. Saving will update the board only." ),
547 aFootprint->GetReference() );
548 const wxString openLibLink =
549 wxString::Format( _( "Open in library %s" ), UnescapeString( libName ) );
550
551 const auto openLibraryCopy = [this]( wxHyperlinkEvent& aEvent )
552 {
554 };
555
556 if( WX_INFOBAR* infobar = GetInfoBar() )
557 {
558 wxHyperlinkCtrl* button =
559 new wxHyperlinkCtrl( infobar, wxID_ANY, openLibLink, wxEmptyString );
560 button->Bind( wxEVT_COMMAND_HYPERLINK, openLibraryCopy );
561
562 infobar->RemoveAllButtons();
563 infobar->AddButton( button );
564 infobar->AddCloseButton();
565 infobar->ShowMessage( msg, wxICON_INFORMATION );
566 }
567 }
568 // An empty libname is OK - you get that when creating a new footprint from the main menu
569 // In that case. treat is as editable, and the user will be prompted for save-as when saving.
570 else if( !libName.empty()
571 && !PROJECT_PCB::PcbFootprintLibs( &Prj() )->IsFootprintLibWritable( libName ) )
572 {
573 wxString msg = wxString::Format( _( "Editing footprint from read-only library %s." ),
574 UnescapeString( libName ) );
575
576 if( WX_INFOBAR* infobar = GetInfoBar() )
577 {
578 wxString link = _( "Save as editable copy" );
579
580 const auto saveAsEditableCopy = [this, aFootprint]( wxHyperlinkEvent& aEvent )
581 {
582 SaveFootprintAs( aFootprint );
583 };
584
585 wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, link, wxEmptyString );
586 button->Bind( wxEVT_COMMAND_HYPERLINK, saveAsEditableCopy );
587
588 infobar->RemoveAllButtons();
589 infobar->AddButton( button );
590 infobar->AddCloseButton();
591 infobar->ShowMessage( msg, wxICON_INFORMATION );
592 }
593 }
594 else
595 {
596 if( WX_INFOBAR* infobar = GetInfoBar() )
597 infobar->Dismiss();
598 }
599
601}
602
603
605{
606 ReloadFootprint( aFootprint );
607
609 setFPWatcher( nullptr );
610 else
611 setFPWatcher( aFootprint );
612}
613
614
616{
618}
619
620
622{
623 return GetBoard()->GetDesignSettings();
624}
625
626
628{
629 wxFAIL_MSG( wxT( "Plotting not supported in Footprint Editor" ) );
630
632}
633
634
636{
637 wxFAIL_MSG( wxT( "Plotting not supported in Footprint Editor" ) );
638}
639
640
642{
643 if( !m_editorSettings )
644 {
646
648 }
649
650 return m_editorSettings;
651}
652
653
655{
656 if( m_editorSettings )
657 return m_editorSettings;
658
660}
661
662
664{
665 // Get our own settings; aCfg will be the PCBNEW_SETTINGS because we're part of the pcbnew
666 // compile unit
668
669 if( cfg )
670 {
672
674
677
680
682 }
683}
684
685
687{
688 // Load canvas type from the FOOTPRINT_EDITOR_SETTINGS:
690
691 // If we had an OpenGL failure this session, use the fallback GAL but don't update the
692 // user preference silently:
693
696}
697
698
700{
702
703 // Get our own settings; aCfg will be the PCBNEW_SETTINGS because we're part of the pcbnew
704 // compile unit
706
707 if( cfg )
708 {
710
713 cfg->m_LibWidth = m_treePane->GetSize().x;
715
717
719 {
720 cfg->m_AuiPanels.show_properties = m_propertiesPanel->IsShownOnScreen();
723 }
724
726
728 {
733 }
734 }
735}
736
737
738
740{
741 FOOTPRINT_EDITOR_SETTINGS* cfg = const_cast<FOOTPRINT_EDIT_FRAME*>( this )->GetSettings();
742
743 return cfg ? cfg->m_RotationAngle : ANGLE_90;
744}
745
746
747
749{
750 wxString currentTheme = GetFootprintEditorSettings()->m_ColorTheme;
751 return Pgm().GetSettingsManager().GetColorSettings( currentTheme );
752}
753
754
756{
757 // Get the actual frame settings for magnetic items
759 wxCHECK( cfg, nullptr );
760 return &cfg->m_MagneticItems;
761}
762
763
764const BOX2I FOOTPRINT_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
765{
766 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
767
768 if( footprint )
769 {
770 bool hasGraphicalItem = footprint->Pads().size() || footprint->Zones().size();
771
772 if( !hasGraphicalItem )
773 {
774 for( const BOARD_ITEM* item : footprint->GraphicalItems() )
775 {
776 if( item->Type() == PCB_TEXT_T || item->Type() == PCB_TEXTBOX_T )
777 continue;
778
779 hasGraphicalItem = true;
780 break;
781 }
782 }
783
784 if( hasGraphicalItem )
785 {
786 return footprint->GetBoundingBox( false );
787 }
788 else
789 {
790 BOX2I newFootprintBB( { 0, 0 }, { 0, 0 } );
791 newFootprintBB.Inflate( pcbIUScale.mmToIU( 12 ) );
792 return newFootprintBB;
793 }
794 }
795
796 return GetBoardBoundingBox( false );
797}
798
799
801{
802 if( IsContentModified() )
803 {
804 wxString footprintName = GetBoard()->GetFirstFootprint()->GetReference();
805 wxString msg = _( "Save changes to '%s' before closing?" );
806
807 if( !HandleUnsavedChanges( this, wxString::Format( msg, footprintName ),
808 [&]() -> bool
809 {
810 return SaveFootprint( GetBoard()->GetFirstFootprint() );
811 } ) )
812 {
813 return false;
814 }
815 }
816
817 if( doClose )
818 {
819 GetInfoBar()->ShowMessageFor( wxEmptyString, 1 );
820 Clear_Pcb( false );
821 UpdateTitle();
822 }
823
824 return true;
825}
826
827
828bool FOOTPRINT_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
829{
830 if( IsContentModified() )
831 {
832 // Shutdown blocks must be determined and vetoed as early as possible
834 aEvent.GetId() == wxEVT_QUERY_END_SESSION )
835 {
836 aEvent.Veto();
837 return false;
838 }
839
840 wxString footprintName = GetBoard()->GetFirstFootprint()->GetFPID().GetLibItemName();
841
843 footprintName = GetBoard()->GetFirstFootprint()->GetReference();
844
845 wxString msg = _( "Save changes to '%s' before closing?" );
846
847 if( !HandleUnsavedChanges( this, wxString::Format( msg, footprintName ),
848 [&]() -> bool
849 {
850 return SaveFootprint( GetBoard()->GetFirstFootprint() );
851 } ) )
852 {
853 aEvent.Veto();
854 return false;
855 }
856 }
857
858 PAD_TOOL* padTool = m_toolManager->GetTool<PAD_TOOL>();
859
860 if( padTool->InPadEditMode() )
861 padTool->ExitPadEditMode();
862
863 // Save footprint tree column widths
864 m_adapter->SaveSettings();
865
867}
868
869
871{
872 // No more vetos
873 GetCanvas()->SetEventDispatcher( nullptr );
875
876 // Do not show the layer manager during closing to avoid flicker
877 // on some platforms (Windows) that generate useless redraw of items in
878 // the Layer Manager
879 m_auimgr.GetPane( wxT( "LayersManager" ) ).Show( false );
880 m_auimgr.GetPane( wxT( "SelectionFilter" ) ).Show( false );
881
882 Clear_Pcb( false );
883
885
886 if( mgr->IsProjectOpen() && wxFileName::IsDirWritable( Prj().GetProjectPath() ) )
887 {
888 GFootprintList.WriteCacheToFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) );
889 }
890}
891
892
893void FOOTPRINT_EDIT_FRAME::OnExitKiCad( wxCommandEvent& event )
894{
895 Kiway().OnKiCadExit();
896}
897
898
900{
901 Close();
902}
903
904
906{
908
909 aEvent.Enable( frame != nullptr );
910}
911
912
914{
916
917 FOOTPRINT* editorFootprint = GetBoard()->GetFirstFootprint();
918 bool canInsert = frame && editorFootprint && editorFootprint->GetLink() == niluuid;
919
920 // If the source was deleted, the footprint can inserted but not updated in the board.
921 if( frame && editorFootprint && editorFootprint->GetLink() != niluuid )
922 {
923 BOARD* mainpcb = frame->GetBoard();
924 canInsert = true;
925
926 // search if the source footprint was not deleted:
927 for( FOOTPRINT* candidate : mainpcb->Footprints() )
928 {
929 if( editorFootprint->GetLink() == candidate->m_Uuid )
930 {
931 canInsert = false;
932 break;
933 }
934 }
935 }
936
937 aEvent.Enable( canInsert );
938}
939
940
942{
943 // call my base class
945
946 // We have 2 panes to update.
947 // For some obscure reason, the AUI manager hides the first modified pane.
948 // So force show panes
949 wxAuiPaneInfo& tree_pane_info = m_auimgr.GetPane( m_treePane );
950 bool tree_shown = tree_pane_info.IsShown();
951 tree_pane_info.Caption( _( "Libraries" ) );
952
953 wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_appearancePanel );
954 bool lm_shown = lm_pane_info.IsShown();
955 lm_pane_info.Caption( _( "Appearance" ) );
956 wxAuiPaneInfo& sf_pane_info = m_auimgr.GetPane( m_selectionFilterPanel );
957 sf_pane_info.Caption( _( "Selection Filter" ) );
958
959 // update the layer manager
961
962 // Now restore the visibility:
963 lm_pane_info.Show( lm_shown );
964 tree_pane_info.Show( tree_shown );
965 m_auimgr.Update();
966
968
969 UpdateTitle();
970}
971
972
974{
976 Update3DView( true, true );
978
979 if( !GetTitle().StartsWith( wxT( "*" ) ) )
980 UpdateTitle();
981}
982
983
985{
986 wxString title;
987 LIB_ID fpid = GetLoadedFPID();
988 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
989 bool writable = true;
990
992 {
993 if( IsContentModified() )
994 title = wxT( "*" );
995
996 title += footprint->GetReference();
997 title += wxS( " " ) + wxString::Format( _( "[from %s]" ), Prj().GetProjectName()
998 + wxT( "." )
999 + FILEEXT::PcbFileExtension );
1000 }
1001 else if( fpid.IsValid() )
1002 {
1003 try
1004 {
1006 }
1007 catch( const IO_ERROR& )
1008 {
1009 // best efforts...
1010 }
1011
1012 // Note: don't used GetLoadedFPID(); footprint name may have been edited
1013 if( IsContentModified() )
1014 title = wxT( "*" );
1015
1016 title += From_UTF8( footprint->GetFPID().Format().c_str() );
1017
1018 if( !writable )
1019 title += wxS( " " ) + _( "[Read Only]" );
1020 }
1021 else if( !fpid.GetLibItemName().empty() )
1022 {
1023 // Note: don't used GetLoadedFPID(); footprint name may have been edited
1024 if( IsContentModified() )
1025 title = wxT( "*" );
1026
1027 title += From_UTF8( footprint->GetFPID().GetLibItemName().c_str() );
1028 title += wxS( " " ) + _( "[Unsaved]" );
1029 }
1030 else
1031 {
1032 title = _( "[no footprint loaded]" );
1033 }
1034
1035 title += wxT( " \u2014 " ) + _( "Footprint Editor" );
1036
1037 SetTitle( title );
1038}
1039
1040
1042{
1044}
1045
1046
1048{
1052 UpdateTitle();
1053}
1054
1055
1057{
1059
1060 WX_PROGRESS_REPORTER progressReporter( this, _( "Loading Footprint Libraries" ), 2 );
1061
1062 if( GFootprintList.GetCount() == 0 )
1063 GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) );
1064
1065 GFootprintList.ReadFootprintFiles( fpTable, nullptr, &progressReporter );
1066 progressReporter.Show( false );
1067
1070
1072 auto adapter = static_cast<FP_TREE_SYNCHRONIZING_ADAPTER*>( m_adapter.get() );
1073
1074 adapter->AddLibraries( this );
1075}
1076
1077
1079{
1081 auto adapter = static_cast<FP_TREE_SYNCHRONIZING_ADAPTER*>( m_adapter.get() );
1082 LIB_ID target = GetTargetFPID();
1083 bool targetSelected = ( target == GetLibTree()->GetSelectedLibId() );
1084
1085 // Sync FOOTPRINT_INFO list to the libraries on disk
1086 if( aProgress )
1087 {
1088 WX_PROGRESS_REPORTER progressReporter( this, _( "Updating Footprint Libraries" ), 2 );
1089 GFootprintList.ReadFootprintFiles( fpTable, nullptr, &progressReporter );
1090 progressReporter.Show( false );
1091 }
1092 else
1093 {
1094 GFootprintList.ReadFootprintFiles( fpTable, nullptr, nullptr );
1095 }
1096
1097 // Unselect before syncing to avoid null reference in the adapter
1098 // if a selected item is removed during the sync
1099 GetLibTree()->Unselect();
1100
1101 // Sync the LIB_TREE to the FOOTPRINT_INFO list
1102 adapter->Sync( fpTable );
1103
1104 GetLibTree()->Regenerate( true );
1105
1106 if( target.IsValid() )
1107 {
1108 if( adapter->FindItem( target ) )
1109 {
1110 if( targetSelected )
1111 GetLibTree()->SelectLibId( target );
1112 else
1113 GetLibTree()->CenterLibId( target );
1114 }
1115 else
1116 {
1117 // Try to focus on parent
1118 target.SetLibItemName( wxEmptyString );
1119 GetLibTree()->CenterLibId( target );
1120 }
1121 }
1122}
1123
1124
1126{
1128}
1129
1130
1132{
1133 GetLibTree()->SelectLibId( aLibID );
1134}
1135
1136
1138{
1140}
1141
1142
1144{
1145 // Create the manager and dispatcher & route draw panel events to the dispatcher
1148 GetCanvas()->GetViewControls(), config(), this );
1149 m_actions = new PCB_ACTIONS();
1151
1153
1163 m_toolManager->RegisterTool( new PCB_CONTROL ); // copy/paste
1176
1177 for( TOOL_BASE* tool : m_toolManager->Tools() )
1178 {
1179 if( PCB_TOOL_BASE* pcbTool = dynamic_cast<PCB_TOOL_BASE*>( tool ) )
1180 pcbTool->SetIsFootprintEditor( true );
1181 }
1182
1183 m_toolManager->GetTool<PCB_VIEWER_TOOLS>()->SetFootprintFrame( true );
1185
1186 m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
1187
1188 // Load or reload wizard plugins in case they changed since the last time the frame opened
1189 // Because the board editor has also a plugin python menu,
1190 // call the PCB_EDIT_FRAME RunAction() if the board editor is running
1191 // Otherwise run the current RunAction().
1192 PCB_EDIT_FRAME* pcbframe = static_cast<PCB_EDIT_FRAME*>( Kiway().Player( FRAME_PCB_EDITOR, false ) );
1193
1194 if( pcbframe )
1196 else
1198}
1199
1200
1202{
1204
1206 PCB_EDITOR_CONDITIONS cond( this );
1207
1208 wxASSERT( mgr );
1209
1210#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
1211#define CHECK( x ) ACTION_CONDITIONS().Check( x )
1212
1213 auto haveFootprintCond =
1214 [this]( const SELECTION& )
1215 {
1216 return GetBoard() && GetBoard()->GetFirstFootprint() != nullptr;
1217 };
1218
1219 auto footprintTargettedCond =
1220 [this]( const SELECTION& )
1221 {
1222 return !GetTargetFPID().GetLibItemName().empty();
1223 };
1224
1225 const auto footprintFromBoardCond =
1226 [this]( const SELECTION& )
1227 {
1228 return IsCurrentFPFromBoard();
1229 };
1230
1231 // clang-format off
1232 mgr->SetConditions( ACTIONS::saveAs, ENABLE( footprintTargettedCond ) );
1235 mgr->SetConditions( PCB_ACTIONS::editLibFpInFpEditor,ENABLE( footprintFromBoardCond ) );
1236
1239
1243 mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
1244 mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
1245 mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
1246
1247 mgr->SetConditions( ACTIONS::cut, ENABLE( cond.HasItems() ) );
1248 mgr->SetConditions( ACTIONS::copy, ENABLE( cond.HasItems() ) );
1255
1262
1266
1269 // clang-format on
1270
1271 auto constrainedDrawingModeCond =
1272 [this]( const SELECTION& )
1273 {
1274 return GetSettings()->m_Use45Limit;
1275 };
1276
1277 auto highContrastCond =
1278 [this]( const SELECTION& )
1279 {
1280 return GetDisplayOptions().m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL;
1281 };
1282
1283 auto boardFlippedCond =
1284 [this]( const SELECTION& )
1285 {
1286 return GetCanvas() && GetCanvas()->GetView()->IsMirroredX();
1287 };
1288
1289 auto libraryTreeCond =
1290 [this](const SELECTION& )
1291 {
1292 return IsLibraryTreeShown();
1293 };
1294
1295 auto layerManagerCond =
1296 [this]( const SELECTION& )
1297 {
1298 return m_auimgr.GetPane( "LayersManager" ).IsShown();
1299 };
1300
1301 auto propertiesCond =
1302 [this] ( const SELECTION& )
1303 {
1304 return m_auimgr.GetPane( PropertiesPaneName() ).IsShown();
1305 };
1306
1307 mgr->SetConditions( PCB_ACTIONS::toggleHV45Mode, CHECK( constrainedDrawingModeCond ) );
1308 mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
1309 mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
1311
1312 mgr->SetConditions( ACTIONS::showLibraryTree, CHECK( libraryTreeCond ) );
1313 mgr->SetConditions( PCB_ACTIONS::showLayersManager, CHECK( layerManagerCond ) );
1314 mgr->SetConditions( PCB_ACTIONS::showProperties, CHECK( propertiesCond ) );
1315
1316 mgr->SetConditions( ACTIONS::print, ENABLE( haveFootprintCond ) );
1317 mgr->SetConditions( PCB_ACTIONS::exportFootprint, ENABLE( haveFootprintCond ) );
1318 mgr->SetConditions( PCB_ACTIONS::placeImportedGraphics, ENABLE( haveFootprintCond ) );
1319
1320 mgr->SetConditions( PCB_ACTIONS::footprintProperties, ENABLE( haveFootprintCond ) );
1321 mgr->SetConditions( PCB_ACTIONS::editTextAndGraphics, ENABLE( haveFootprintCond ) );
1322 mgr->SetConditions( PCB_ACTIONS::checkFootprint, ENABLE( haveFootprintCond ) );
1323 mgr->SetConditions( PCB_ACTIONS::repairFootprint, ENABLE( haveFootprintCond ) );
1324 mgr->SetConditions( PCB_ACTIONS::cleanupGraphics, ENABLE( haveFootprintCond ) );
1325 mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveFootprintCond ) );
1326
1327 auto isArcKeepCenterMode =
1328 [this]( const SELECTION& )
1329 {
1330 return GetSettings()->m_ArcEditMode == ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS;
1331 };
1332
1333 auto isArcKeepEndpointMode =
1334 [this]( const SELECTION& )
1335 {
1336 return GetSettings()->m_ArcEditMode == ARC_EDIT_MODE::KEEP_ENDPOINTS_OR_START_DIRECTION;
1337 };
1338
1339 mgr->SetConditions( PCB_ACTIONS::pointEditorArcKeepCenter, CHECK( isArcKeepCenterMode ) );
1340 mgr->SetConditions( PCB_ACTIONS::pointEditorArcKeepEndpoint, CHECK( isArcKeepEndpointMode ) );
1341
1342
1343// Only enable a tool if the part is edtable
1344#define CURRENT_EDIT_TOOL( action ) \
1345 mgr->SetConditions( action, ACTION_CONDITIONS().Enable( haveFootprintCond ) \
1346 .Check( cond.CurrentTool( action ) ) )
1347
1368
1369#undef CURRENT_EDIT_TOOL
1370#undef ENABLE
1371#undef CHECK
1372}
1373
1374
1376{
1378
1379 // Be sure the axis are enabled
1380 GetCanvas()->GetGAL()->SetAxesEnabled( true );
1381
1382 UpdateView();
1383
1384 // Ensure the m_Layers settings are using the canvas type:
1386}
1387
1388
1389void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
1390{
1391 PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
1392
1395
1397
1399
1403
1405
1406 if( aEnvVarsChanged )
1407 SyncLibraryTree( true );
1408
1409 Layout();
1410 SendSizeEvent();
1411}
1412
1413
1414std::unique_ptr<GRID_HELPER> FOOTPRINT_EDIT_FRAME::MakeGridHelper()
1415{
1416 return std::make_unique<PCB_GRID_HELPER>( m_toolManager, GetMagneticItemsSettings() );
1417}
1418
1419
1421{
1422 LIB_ID id = GetLoadedFPID();
1423
1424 if( id.empty() )
1425 {
1426 DisplayErrorMessage( this, _( "No footprint selected." ) );
1427 return;
1428 }
1429
1430 wxFileName fn( id.GetLibItemName() );
1431 fn.SetExt( wxT( "png" ) );
1432
1433 wxString projectPath = wxPathOnly( Prj().GetProjectFullName() );
1434
1435 wxFileDialog dlg( this, _( "Export View as PNG" ), projectPath, fn.GetFullName(),
1436 FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
1437
1438 if( dlg.ShowModal() == wxID_CANCEL || dlg.GetPath().IsEmpty() )
1439 return;
1440
1441 // calling wxYield is mandatory under Linux, after closing the file selector dialog
1442 // to refresh the screen before creating the PNG or JPEG image from screen
1443 wxYield();
1444 this->SaveCanvasImageToFile( dlg.GetPath(), BITMAP_TYPE::PNG );
1445}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
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_modedit_32
@ icon_modedit
@ icon_modedit_16
static TOOL_ACTION toggleGrid
Definition: actions.h:187
static TOOL_ACTION paste
Definition: actions.h:73
static TOOL_ACTION millimetersUnits
Definition: actions.h:195
static TOOL_ACTION unselectAll
Definition: actions.h:76
static TOOL_ACTION revert
Definition: actions.h:55
static TOOL_ACTION showLibraryTree
Definition: actions.h:154
static TOOL_ACTION saveAs
Definition: actions.h:52
static TOOL_ACTION copy
Definition: actions.h:71
static TOOL_ACTION pluginsReload
Definition: actions.h:241
static TOOL_ACTION pasteSpecial
Definition: actions.h:74
static TOOL_ACTION showDatasheet
Definition: actions.h:217
static TOOL_ACTION milsUnits
Definition: actions.h:194
static TOOL_ACTION toggleBoundingBoxes
Definition: actions.h:147
static TOOL_ACTION undo
Definition: actions.h:68
static TOOL_ACTION duplicate
Definition: actions.h:77
static TOOL_ACTION inchesUnits
Definition: actions.h:193
static TOOL_ACTION highContrastMode
Definition: actions.h:145
static TOOL_ACTION embeddedFiles
Definition: actions.h:244
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:144
static TOOL_ACTION measureTool
Definition: actions.h:203
static TOOL_ACTION doDelete
Definition: actions.h:78
static TOOL_ACTION selectionTool
Definition: actions.h:202
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION zoomFitScreen
Definition: actions.h:134
static TOOL_ACTION redo
Definition: actions.h:69
static TOOL_ACTION deleteTool
Definition: actions.h:79
static TOOL_ACTION zoomTool
Definition: actions.h:138
static TOOL_ACTION print
Definition: actions.h:57
static TOOL_ACTION showProperties
Definition: actions.h:216
static TOOL_ACTION cut
Definition: actions.h:70
static TOOL_ACTION gridSetOrigin
Definition: actions.h:184
static TOOL_ACTION ddAddLibrary
Definition: actions.h:60
static TOOL_ACTION toggleGridOverrides
Definition: actions.h:188
static TOOL_ACTION selectAll
Definition: actions.h:75
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...
std::vector< LAYER_PRESET > GetUserLayerPresets() const
Update the current layer presets from those saved in the project file.
int GetTabIndex() const
Set the current notebook tab.
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
wxString GetActiveLayerPreset() const
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
WINDOW_SETTINGS m_Window
Definition: app_settings.h:194
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:197
The array tool.
Definition: array_tool.h:48
bool IsContentModified() const
Definition: base_screen.h:60
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
Container for design settings for a BOARD object.
std::shared_ptr< NET_SETTINGS > m_NetSettings
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:302
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
Definition: board.cpp:798
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition: board.cpp:592
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition: board.h:448
void SetVisibleAlls()
Change the bit-mask of visible element categories and layers.
Definition: board.cpp:827
const FOOTPRINTS & Footprints() const
Definition: board.h:331
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
Definition: board.cpp:810
void SetCopperLayerCount(int aCount)
Definition: board.cpp:747
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition: board.cpp:1399
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:895
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:558
Color settings are a bit different than most of the settings objects in that there can be more than o...
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
Definition: common_tools.h:38
Tool responsible for drawing graphical elements like lines, arcs, circles, etc.
Definition: drawing_tool.h:55
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.
wxAuiManager m_auimgr
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
virtual void OnSize(wxSizeEvent &aEvent)
virtual bool canCloseWindow(wxCloseEvent &aCloseEvent)
bool m_isClosing
Set by NonUserClose() to indicate that the user did not request the current close.
WX_INFOBAR * GetInfoBar()
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
bool SaveCanvasImageToFile(const wxString &aFileName, BITMAP_TYPE aBitmapType)
Save the current view as an image file.
virtual void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Changes the current rendering backend.
EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting(APP_SETTINGS_BASE *aCfg=nullptr)
Returns the canvas type stored in the application settings.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
static bool m_openGLFailureOccured
Has any failure occured when switching to OpenGL in any EDA_DRAW_FRAME?
static const wxString PropertiesPaneName()
virtual void UpdateMsgPanel()
Redraw the message panel.
PROPERTIES_PANEL * m_propertiesPanel
static constexpr GAL_TYPE GAL_FALLBACK
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
void ForceRefresh()
Force a redraw.
@ GAL_TYPE_OPENGL
OpenGL implementation.
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
Specialization of the wxAuiPaneInfo class for KiCad panels.
SELECTION_CONDITION NoActiveTool()
Create a functor testing if there are no tools active in the frame.
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.
virtual SELECTION_CONDITION UndoAvailable()
Create a functor that tests if there are any items in the undo queue.
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 ContentModified()
Create a functor that tests if the content of the frame is modified.
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.
The interactive edit tool.
Definition: edit_tool.h:56
Module editor specific tools.
BOARD_DESIGN_SETTINGS m_DesignSettings
Only some of these settings are actually used for footprint editing.
std::vector< LAYER_PRESET > m_LayerPresets
PCB_SELECTION_FILTER_OPTIONS m_SelectionFilter
void CloseFootprintEditor(wxCommandEvent &Event)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Returns the BOARD_DESIGN_SETTINGS for the open project.
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
void HardRedraw() override
Refresh the library tree and redraw the window.
static const wxChar * GetFootprintEditorFrameName()
void SyncLibraryTree(bool aProgress)
Synchronize the footprint library tree to the current state of the footprint library table.
void OnSaveFootprintAsPng(wxCommandEvent &event)
bool SaveFootprintAs(FOOTPRINT *aFootprint)
void FocusLibraryTreeInput() override
void ToggleLibraryTree() override
BOARD_ITEM_CONTAINER * GetModel() const override
LIB_TREE * GetLibTree() const override
bool canCloseWindow(wxCloseEvent &Event) override
void UpdateMsgPanel() override
Redraw the message panel.
LIB_ID GetTargetFPID() const
Return the LIB_ID of the part selected in the footprint tree, or the loaded part if there is no selec...
LIB_ID GetLoadedFPID() const
Return the LIB_ID of the part being edited.
APP_SETTINGS_BASE * config() const override
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void SelectLayer(wxCommandEvent &event)
void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings) override
bool SaveFootprint(FOOTPRINT *aFootprint)
Save in an existing library a given footprint.
void initLibraryTree()
Make sure the footprint info list is loaded (with a progress dialog) and then initialize the footprin...
void OnLoadFootprintFromBoard(wxCommandEvent &event)
Called from the main toolbar to load a footprint from board mainly to edit it.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void ShowChangedLanguage() override
Update visible items after a language change.
void resolveCanvasType() override
Determines the Canvas type to load (with prompt if required) and initializes m_canvasType.
void OnSaveFootprintToBoard(wxCommandEvent &event)
bool IsContentModified() const override
Get if any footprints or libraries have been modified but not saved.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > m_adapter
bool IsLibraryTreeShown() const override
FOOTPRINT_EDITOR_SETTINGS * m_editorSettings
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
bool Clear_Pcb(bool doAskAboutUnsavedChanges)
Delete all and reinitialize the current board.
Definition: initpcb.cpp:105
void OnUpdateLoadFootprintFromBoard(wxUpdateUIEvent &aEvent)
void OnUpdateSaveFootprintToBoard(wxUpdateUIEvent &aEvent)
Install the corresponding dialog editor for the given item.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
bool CanCloseFPFromBoard(bool doClose)
void AddFootprintToBoard(FOOTPRINT *aFootprint) override
Override from PCB_BASE_EDIT_FRAME which adds a footprint to the editor's dummy board,...
void OnModify() override
Must be called after a footprint change in order to set the "modify" flag of the current screen and p...
FOOTPRINT_TREE_PANE * m_treePane
std::unique_ptr< GRID_HELPER > MakeGridHelper() override
void OnDisplayOptionsChanged() override
void FocusOnLibID(const LIB_ID &aLibID)
const PCB_PLOT_PARAMS & GetPlotSettings() const override
Return the PCB_PLOT_PARAMS for the BOARD owned by this frame.
std::unique_ptr< FOOTPRINT > m_originalFootprintCopy
void ReloadFootprint(FOOTPRINT *aFootprint) override
Override from PCB_BASE_FRAME which reloads the footprint from the library without setting the footpri...
EDA_ANGLE GetRotationAngle() const override
Return the angle used for rotate operations.
void RefreshLibraryTree()
Redisplay the library tree.
void OnExitKiCad(wxCommandEvent &aEvent)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
MAGNETIC_SETTINGS * GetMagneticItemsSettings() override
FOOTPRINT_EDITOR_SETTINGS * GetSettings()
void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) override
Switch the currently used canvas (Cairo / OpenGL).
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
bool ReadFootprintFiles(FP_LIB_TABLE *aTable, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override
Read all the footprints provided by the combination of aTable and aNickname.
void WriteCacheToFile(const wxString &aFilePath) override
void ReadCacheFromFile(const wxString &aFilePath) override
void DisplayErrors(wxTopLevelWindow *aCaller=nullptr)
unsigned GetErrorCount() const
unsigned GetCount() const
Footprint Editor pane with footprint library tree.
void FocusSearchFieldIfExists()
Focus the search widget if it exists.
bool FixUuids()
Old footprints do not always have a valid UUID (some can be set to null uuid) However null UUIDs,...
Definition: footprint.cpp:692
ZONES & Zones()
Definition: footprint.h:212
EDA_ITEM * Clone() const override
Invoke a function on all children.
Definition: footprint.cpp:2075
std::deque< PAD * > & Pads()
Definition: footprint.h:206
const LIB_ID & GetFPID() const
Definition: footprint.h:248
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: footprint.cpp:1573
KIID GetLink() const
Definition: footprint.h:870
const wxString & GetReference() const
Definition: footprint.h:622
DRAWINGS & GraphicalItems()
Definition: footprint.h:209
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:1295
bool IsFootprintLibWritable(const wxString &aNickname)
Return true if the library given by aNickname is writable.
void AddLibraries(EDA_BASE_FRAME *aParent)
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(FOOTPRINT_EDIT_FRAME *aFrame, FP_LIB_TABLE *aLibs)
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:77
bool m_axesEnabled
Fullscreen crosshair or small cross.
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:765
bool IsMirroredX() const
Return true if view is flipped across the X axis.
Definition: view.h:247
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:636
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:285
void OnKiCadExit()
Definition: kiway.cpp:725
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:406
Module editor specific tools.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
Definition: lib_id.cpp:110
bool IsValid() const
Check if this LID_ID is valid.
Definition: lib_id.h:172
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
Definition: lib_id.cpp:99
UTF8 Format() const
Definition: lib_id.cpp:118
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
Definition: lib_id.h:112
const UTF8 & GetLibItemName() const
Definition: lib_id.h:102
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
void RefreshLibTree()
Refreshes the tree (mainly to update highlighting and asterisking)
Definition: lib_tree.cpp:440
void CenterLibId(const LIB_ID &aLibId)
Ensure that an item is visible (preferably centered).
Definition: lib_tree.cpp:349
void ShowChangedLanguage()
Definition: lib_tree.cpp:291
void SelectLibId(const LIB_ID &aLibId)
Select an item in the tree widget.
Definition: lib_tree.cpp:343
LIB_TREE_MODEL_ADAPTER::SORT_MODE GetSortMode() const
Definition: lib_tree.h:141
void Unselect()
Unselect currently selected item in wxDataViewCtrl.
Definition: lib_tree.cpp:355
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit symbols, if the user selects the symbol itself rather than picking an individual unit,...
Definition: lib_tree.cpp:301
void Regenerate(bool aKeepState)
Regenerate the tree.
Definition: lib_tree.cpp:422
void SetSortMode(LIB_TREE_MODEL_ADAPTER::SORT_MODE aMode)
Save/restore the sorting mode.
Definition: lib_tree.h:140
Tool relating to pads and pad settings.
Definition: pad_tool.h:37
void ExitPadEditMode()
Definition: pad_tool.cpp:846
bool InPadEditMode()
Definition: pad_tool.h:65
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
static const wxChar A4[]
Definition: page_info.h:68
void SetCheckboxesFromFilter(PCB_SELECTION_FILTER_OPTIONS &aOptions)
Gather all the actions that are shared by tools.
Definition: pcb_actions.h:50
static TOOL_ACTION toggleHV45Mode
Definition: pcb_actions.h:524
static TOOL_ACTION drawRuleArea
Definition: pcb_actions.h:223
static TOOL_ACTION placeText
Definition: pcb_actions.h:208
static TOOL_ACTION pointEditorArcKeepCenter
Definition: pcb_actions.h:302
static TOOL_ACTION drawOrthogonalDimension
Definition: pcb_actions.h:219
static TOOL_ACTION drawRectangle
Definition: pcb_actions.h:203
static TOOL_ACTION setAnchor
Definition: pcb_actions.h:230
static TOOL_ACTION padDisplayMode
Definition: pcb_actions.h:340
static TOOL_ACTION placeReferenceImage
Definition: pcb_actions.h:207
static TOOL_ACTION showLayersManager
Definition: pcb_actions.h:454
static TOOL_ACTION drawCircle
Definition: pcb_actions.h:204
static TOOL_ACTION mirrorH
Mirroring of selected items.
Definition: pcb_actions.h:139
static TOOL_ACTION exportFootprint
Definition: pcb_actions.h:476
static TOOL_ACTION drawTextBox
Definition: pcb_actions.h:209
static TOOL_ACTION drawPolygon
Definition: pcb_actions.h:202
static TOOL_ACTION placePad
Activation of the drawing tool (placing a PAD)
Definition: pcb_actions.h:484
static TOOL_ACTION group
Definition: pcb_actions.h:532
static TOOL_ACTION drawRadialDimension
Definition: pcb_actions.h:218
static TOOL_ACTION editTextAndGraphics
Definition: pcb_actions.h:423
static TOOL_ACTION drawLeader
Definition: pcb_actions.h:220
static TOOL_ACTION ddImportFootprint
Definition: pcb_actions.h:590
static TOOL_ACTION ungroup
Definition: pcb_actions.h:533
static TOOL_ACTION placeImportedGraphics
Definition: pcb_actions.h:229
static TOOL_ACTION drawArc
Definition: pcb_actions.h:205
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
Definition: pcb_actions.h:496
static TOOL_ACTION pointEditorArcKeepEndpoint
Definition: pcb_actions.h:303
static TOOL_ACTION drawCenterDimension
Definition: pcb_actions.h:217
static TOOL_ACTION footprintProperties
Definition: pcb_actions.h:478
static TOOL_ACTION flipBoard
Definition: pcb_actions.h:394
static TOOL_ACTION textOutlines
Display texts as lines.
Definition: pcb_actions.h:499
static TOOL_ACTION checkFootprint
Definition: pcb_actions.h:481
static TOOL_ACTION editLibFpInFpEditor
Definition: pcb_actions.h:452
static TOOL_ACTION mirrorV
Definition: pcb_actions.h:140
static TOOL_ACTION repairFootprint
Definition: pcb_actions.h:550
static TOOL_ACTION drawLine
Definition: pcb_actions.h:201
static TOOL_ACTION cleanupGraphics
Definition: pcb_actions.h:427
static TOOL_ACTION rotateCw
Rotation of selected objects.
Definition: pcb_actions.h:132
static TOOL_ACTION rotateCcw
Definition: pcb_actions.h:133
static TOOL_ACTION drawAlignedDimension
Definition: pcb_actions.h:216
Common, abstract interface for edit frames.
APPEARANCE_CONTROLS * m_appearancePanel
PANEL_SELECTION_FILTER * m_selectionFilterPanel
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual const PCB_PLOT_PARAMS & GetPlotSettings() const
Return the PCB_PLOT_PARAMS for the BOARD owned by this frame.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void setFPWatcher(FOOTPRINT *aFootprint)
Creates (or removes) a watcher on the specified footprint.
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
FOOTPRINT * loadFootprint(const LIB_ID &aFootprintId)
Attempts to load aFootprintId from the footprint library table.
BOX2I GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
BOARD * GetBoard() const
virtual void AddFootprintToBoard(FOOTPRINT *aFootprint)
Add the given footprint to the board.
PCB_DISPLAY_OPTIONS m_displayOptions
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
Handle actions that are shared between different frames in PcbNew.
Definition: pcb_control.h:47
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
Group generic conditions for PCB editor states.
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
SELECTION_CONDITION HasItems()
Create a functor that tests if there are items in the board.
SELECTION_CONDITION GraphicsFillDisplay()
Create a functor that tests if the frame fills graphics items.
SELECTION_CONDITION TextFillDisplay()
Create a functor that tests if the frame fills text items.
The main frame for Pcbnew.
Generic tool for picking an item.
Parameters and options when plotting/printing a board.
Tool that displays edit points allowing to modify items by dragging the points.
The selection tool: currently supports:
Tool useful for viewing footprints.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
The interactive edit tool.
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
Definition: project_pcb.cpp:37
@ PCB_FOOTPRINT_EDITOR_FP_NAME
Definition: project.h:226
@ PCB_FOOTPRINT_EDITOR_LIB_NICKNAME
Definition: project.h:227
virtual void SetRString(RSTRING_T aStringId, const wxString &aString)
Store a "retained string", which is any session and project specific string identified in enum RSTRIN...
Definition: project.cpp:307
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
Definition: project.cpp:318
float SplitterProportion() const
Action handler for the Properties panel.
Tool relating to pads and pad settings.
static SELECTION_CONDITION HasType(KICAD_T aType)
Create a functor that tests if among the selected items there is at least one of a given type.
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
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).
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
bool IsProjectOpen() const
Helper for checking if we have a project open TODO: This should be deprecated along with Prj() once w...
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
Base abstract interface for all kinds of tools.
Definition: tool_base.h:66
@ MODEL_RELOAD
Model changes (the sheet for a schematic)
Definition: tool_base.h:80
virtual void DispatchWxEvent(wxEvent &aEvent)
Process wxEvents (mostly UI events), translate them to TOOL_EVENTs, and make tools handle those.
Master controller class:
Definition: tool_manager.h:62
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:150
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:302
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
std::vector< TOOL_BASE * > Tools()
Definition: tool_manager.h:337
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...
bool empty() const
Definition: utf8.h:104
const char * c_str() const
Definition: utf8.h:103
A modified version of the wxInfoBar class that allows us to:
Definition: wx_infobar.h:76
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
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
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:130
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:195
This file is part of the common library.
#define CHECK(x)
#define ENABLE(x)
#define _HKI(x)
static bool empty(const wxTextEntryBase *aCtrl)
#define _(s)
Declaration of the eda_3d_viewer class.
static constexpr EDA_ANGLE ANGLE_90
Definition: eda_angle.h:403
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define FOOTPRINT_EDIT_FRAME_NAME
EVT_UPDATE_UI(ID_LOAD_FOOTPRINT_FROM_BOARD, FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard) EVT_UPDATE_UI(ID_ADD_FOOTPRINT_TO_BOARD
#define CURRENT_EDIT_TOOL(action)
FOOTPRINT_LIST_IMPL GFootprintList
The global footprint info table.
Definition: cvpcb.cpp:156
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:43
static const std::string KiCadFootprintLibPathExtension
static const std::string KiCadFootprintFileExtension
static wxString PngFileWildcard()
@ ID_ON_GRID_SELECT
Definition: id.h:145
@ ID_ON_ZOOM_SELECT
Definition: id.h:143
PROJECT & Prj()
Definition: kicad.cpp:597
KIID niluuid(0)
@ F_SilkS
Definition: layer_ids.h:100
@ In1_Cu
Definition: layer_ids.h:66
This file contains miscellaneous commonly used macros and functions.
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
Definition: definitions.h:38
void SetShutdownBlockReason(wxWindow *aWindow, const wxString &aReason)
Sets the block reason why the window/application is preventing OS shutdown.
Definition: unix/app.cpp:90
bool SupportsShutdownBlockReason()
Whether or not the window supports setting a shutdown block reason.
Definition: unix/app.cpp:79
@ ID_FPEDIT_SAVE_PNG
Definition: pcbnew_id.h:98
@ ID_ADD_FOOTPRINT_TO_BOARD
Definition: pcbnew_id.h:116
@ ID_LOAD_FOOTPRINT_FROM_BOARD
Definition: pcbnew_id.h:117
@ ID_TOOLBARH_PCB_SELECT_LAYER
Definition: pcbnew_id.h:96
SETTINGS_MANAGER * GetSettingsManager()
BOARD * GetBoard()
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1060
see class PGM_BASE
KIWAY Kiway(KFCTL_STANDALONE)
wxString UnescapeString(const wxString &aSource)
wxString From_UTF8(const char *cstring)
const double IU_PER_MILS
Definition: base_units.h:77
constexpr int mmToIU(double mm) const
Definition: base_units.h:88
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:110
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition: typeinfo.h:93
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:92
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.