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>
68#include <tools/group_tool.h>
71#include <widgets/lib_tree.h>
77
78#include <wx/filedlg.h>
79#include <wx/hyperlink.h>
80
81BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
82 EVT_MENU( wxID_CLOSE, FOOTPRINT_EDIT_FRAME::CloseFootprintEditor )
83 EVT_MENU( wxID_EXIT, FOOTPRINT_EDIT_FRAME::OnExitKiCad )
84
86
89
91
94
95 // Horizontal toolbar
97
98 // UI update events.
100 FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard )
102 FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard )
104
105 // Drop files event
106 EVT_DROP_FILES( FOOTPRINT_EDIT_FRAME::OnDropFiles )
107
108END_EVENT_TABLE()
109
110
111FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
112 PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_FOOTPRINT_EDITOR, wxEmptyString,
113 wxDefaultPosition, wxDefaultSize,
114 KICAD_DEFAULT_DRAWFRAME_STYLE, GetFootprintEditorFrameName() ),
115 m_show_layer_manager_tools( true )
116{
117 m_showBorderAndTitleBlock = false; // true to show the frame references
118 m_aboutTitle = _HKI( "KiCad Footprint Editor" );
119 m_selLayerBox = nullptr;
120 m_editorSettings = nullptr;
121
122 // Give an icon
123 wxIcon icon;
124 wxIconBundle icon_bundle;
125
126 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit, 48 ) );
127 icon_bundle.AddIcon( icon );
128 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit, 128 ) );
129 icon_bundle.AddIcon( icon );
130 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit, 256 ) );
131 icon_bundle.AddIcon( icon );
132 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit_32 ) );
133 icon_bundle.AddIcon( icon );
134 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit_16 ) );
135 icon_bundle.AddIcon( icon );
136
137 SetIcons( icon_bundle );
138
139 // Create GAL canvas
140 m_canvasType = loadCanvasTypeSetting( GetSettings() );
141
142 PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize,
143 GetGalDisplayOptions(), m_canvasType );
144 SetCanvas( drawPanel );
145
146 CreateInfoBar();
147
148 SetBoard( new BOARD() );
149
150 // This board will only be used to hold a footprint for editing
152
153 // In Footprint Editor, the default net clearance is not known (it depends on the actual
154 // board). So we do not show the default clearance, by setting it to 0. The footprint or
155 // pad specific clearance will be shown.
156 GetBoard()->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetClearance( 0 );
157
158 // Don't show the default board solder mask expansion in the footprint editor. Only the
159 // footprint or pad mask expansions settings should be shown.
161
162 // Ensure all layers and items are visible:
163 // In footprint editor, some layers have no meaning or cannot be used, but we show all of
164 // them, at least to be able to edit a bad layer
166
167 GetGalDisplayOptions().m_axesEnabled = true;
168
169 // In Footprint Editor, set the default paper size to A4 for plot/print
170 SetPageSettings( PAGE_INFO( PAGE_INFO::A4 ) );
171 SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU( pcbIUScale.IU_PER_MILS ) ) );
172
173 // Create the manager and dispatcher & route draw panel events to the dispatcher
174 setupTools();
175 setupUIConditions();
176
177 initLibraryTree();
178 m_treePane = new FOOTPRINT_TREE_PANE( this );
179
180 // restore the last footprint from the project, if any, after the library has been init'ed
181 restoreLastFootprint();
182
183 ReCreateMenuBar();
184 ReCreateHToolbar();
185 ReCreateVToolbar();
186 ReCreateOptToolbar();
187
188 m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
189 m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas(), true );
190 m_propertiesPanel = new PCB_PROPERTIES_PANEL( this, this );
191
192 // LoadSettings() *after* creating m_LayersManager, because LoadSettings() initialize
193 // parameters in m_LayersManager
194 // NOTE: KifaceSettings() will return PCBNEW_SETTINGS if we started from pcbnew
195 LoadSettings( GetSettings() );
196
197 float proportion = GetFootprintEditorSettings()->m_AuiPanels.properties_splitter;
198 m_propertiesPanel->SetSplitterProportion( proportion );
199
200 // Must be set after calling LoadSettings() to be sure these parameters are not dependent
201 // on what is read in stored settings. Enable one internal layer, because footprints
202 // support keepout areas that can be on internal layers only (therefore on the first internal
203 // layer). This is needed to handle these keepout in internal layers only.
205 GetBoard()->SetEnabledLayers( GetBoard()->GetEnabledLayers().set( In1_Cu ) );
206 GetBoard()->SetVisibleLayers( GetBoard()->GetEnabledLayers() );
207 GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) );
208
209 SetActiveLayer( F_SilkS );
210
211 m_auimgr.SetManagedWindow( this );
212
213 unsigned int auiFlags = wxAUI_MGR_DEFAULT;
214#if !defined( _WIN32 )
215 // Windows cannot redraw the UI fast enough during a live resize and may lead to all kinds
216 // of graphical glitches
217 auiFlags |= wxAUI_MGR_LIVE_RESIZE;
218#endif
219 m_auimgr.SetFlags( auiFlags );
220
221 // Rows; layers 4 - 6
222 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
223 .Top().Layer( 6 ) );
224
225 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
226 .Bottom().Layer( 6 ) );
227
228 // Columns; layers 1 - 3
229 m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" )
230 .Left().Layer( 4 )
231 .Caption( _( "Libraries" ) )
232 .MinSize( FromDIP( 250 ), -1 ).BestSize( FromDIP( 250 ), -1 ) );
233 m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( PropertiesPaneName() )
234 .Left().Layer( 3 )
235 .Caption( _( "Properties" ) ).PaneBorder( false )
236 .MinSize( FromDIP( wxSize( 240, 60 ) ) ).BestSize( FromDIP( wxSize( 300, 200 ) ) ) );
237 m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
238 .Left().Layer( 2 ) );
239
240 m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
241 .Right().Layer(2) );
242 m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" )
243 .Right().Layer( 3 )
244 .Caption( _( "Appearance" ) ).PaneBorder( false )
245 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
246 m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Palette().Name( "SelectionFilter" )
247 .Right().Layer( 3 ).Position( 2 )
248 .Caption( _( "Selection Filter" ) ).PaneBorder( false )
249 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
250
251 // Center
252 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
253 .Center() );
254
255 m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
256 m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
257 m_auimgr.GetPane( PropertiesPaneName() ).Show( GetSettings()->m_AuiPanels.show_properties );
258
259 // The selection filter doesn't need to grow in the vertical direction when docked
260 m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0;
261
264 DragAcceptFiles( true );
265
266 ActivateGalCanvas();
267
268 FinishAUIInitialization();
269
270 // Apply saved visibility stuff at the end
271 if( FOOTPRINT_EDITOR_SETTINGS* cfg = dynamic_cast<FOOTPRINT_EDITOR_SETTINGS*>( GetSettings() ) )
272 {
273 wxAuiPaneInfo& treePane = m_auimgr.GetPane( "Footprints" );
274 wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
275
276 if( cfg->m_LibWidth > 0 )
277 SetAuiPaneSize( m_auimgr, treePane, cfg->m_LibWidth, -1 );
278
279 if( cfg->m_AuiPanels.right_panel_width > 0 )
280 SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
281
282 m_appearancePanel->SetUserLayerPresets( cfg->m_LayerPresets );
283 m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset );
284 m_appearancePanel->SetTabIndex( cfg->m_AuiPanels.appearance_panel_tab );
285 }
286
287 GetToolManager()->PostAction( ACTIONS::zoomFitScreen );
288 UpdateTitle();
289 setupUnits( GetSettings() );
290
291 resolveCanvasType();
292
293 // Default shutdown reason until a file is loaded
294 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Footprint changes are unsaved" ) );
295
296 // Catch unhandled accelerator command characters that were no handled by the library tree
297 // panel.
298 Bind( wxEVT_CHAR, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
299 Bind( wxEVT_CHAR_HOOK, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
300
301 // Ensure the window is on top
302 Raise();
303 Show( true );
304
305 // Register a call to update the toolbar sizes. It can't be done immediately because
306 // it seems to require some sizes calculated that aren't yet (at least on GTK).
307 CallAfter(
308 [this]()
309 {
310 // Ensure the controls on the toolbars all are correctly sized
311 UpdateToolbarControlSizes();
312 m_treePane->FocusSearchFieldIfExists();
313 } );
314}
315
316
318{
319 // Shutdown all running tools
320 if( m_toolManager )
322
323 // save the footprint in the PROJECT
325
326 // Clear the watched file
327 setFPWatcher( nullptr );
328
330 delete m_appearancePanel;
331 delete m_treePane;
332}
333
334
336{
338
339 FOOTPRINT* fp = static_cast<FOOTPRINT*>( GetModel() );
340
341 if( fp )
342 {
343 std::vector<MSG_PANEL_ITEM> msgItems;
344 fp->GetMsgPanelInfo( this, msgItems );
345 SetMsgPanel( msgItems );
346 }
347}
348
349
351{
352 return GetScreen() && GetScreen()->IsContentModified()
354}
355
356
358{
359 return m_toolManager->GetTool<PCB_SELECTION_TOOL>()->GetSelection();
360}
361
362
364{
365 // switches currently used canvas (Cairo / OpenGL).
366 PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
367
368 GetCanvas()->GetGAL()->SetAxesEnabled( true );
369
370 // The base class method *does not reinit* the layers manager. We must update the layer
371 // widget to match board visibility states, both layers and render columns, and and some
372 // settings dependent on the canvas.
374}
375
376
378{
379 SyncLibraryTree( true );
381}
382
383
385{
386 wxAuiPaneInfo& treePane = m_auimgr.GetPane( m_treePane );
387 treePane.Show( !IsLibraryTreeShown() );
388
389 if( IsLibraryTreeShown() )
390 {
391 // SetAuiPaneSize also updates m_auimgr
393 }
394 else
395 {
396 m_editorSettings->m_LibWidth = m_treePane->GetSize().x;
397 m_auimgr.Update();
398 }
399}
400
401
403{
405}
406
407
409{
411 wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
412 wxAuiPaneInfo& selectionFilter = m_auimgr.GetPane( "SelectionFilter" );
413
414 // show auxiliary Vertical layers and visibility manager toolbar
416 layersManager.Show( m_show_layer_manager_tools );
417 selectionFilter.Show( m_show_layer_manager_tools );
418
420 {
421 SetAuiPaneSize( m_auimgr, layersManager, settings->m_AuiPanels.right_panel_width, -1 );
422 }
423 else
424 {
425 settings->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
426 m_auimgr.Update();
427 }
428}
429
430
432{
433 return const_cast<wxAuiManager&>( m_auimgr ).GetPane( m_treePane ).IsShown();
434}
435
436
438{
439 return GetBoard()->GetFirstFootprint();
440}
441
442
444{
445 LIB_ID id;
446
447 if( IsLibraryTreeShown() )
449
450 if( id.GetLibNickname().empty() )
451 id = GetLoadedFPID();
452
453 return id;
454}
455
456
458{
459 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
460
461 if( footprint )
462 return LIB_ID( footprint->GetFPID().GetLibNickname(), m_footprintNameWhenLoaded );
463 else
464 return LIB_ID();
465}
466
467
469{
470 if( GetBoard()->GetFirstFootprint() )
471 {
474 }
475
476 GetScreen()->SetContentModified( false );
477}
478
479
481{
482 // If we've already vetted closing this window, then we have no FP anymore
483 if( m_isClosing || !GetBoard() )
484 return false;
485
486 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
487
488 return ( footprint && footprint->GetLink() != niluuid );
489}
490
491
493{
494 LIB_ID id = GetLoadedFPID();
495
496 if( id.IsValid() )
497 {
499 Prj().SetRString( PROJECT::PCB_FOOTPRINT_EDITOR_FP_NAME, id.GetLibItemName() );
500 }
501}
502
503
505{
506 const wxString& footprintName = Prj().GetRString( PROJECT::PCB_FOOTPRINT_EDITOR_FP_NAME );
507 const wxString& libNickname = Prj().GetRString( PROJECT::PCB_FOOTPRINT_EDITOR_LIB_NICKNAME );
508
509 if( libNickname.Length() && footprintName.Length() )
510 {
511 LIB_ID id;
512 id.SetLibNickname( libNickname );
513 id.SetLibItemName( footprintName );
514
515 FOOTPRINT* footprint = loadFootprint( id );
516
517 if( footprint )
518 AddFootprintToBoard( footprint );
519 }
520}
521
522
524{
526
527 m_originalFootprintCopy.reset( static_cast<FOOTPRINT*>( aFootprint->Clone() ) );
528 m_originalFootprintCopy->SetParent( nullptr );
529
531
533 // Ensure item UUIDs are valid
534 // ("old" footprints can have null uuids that create issues in fp editor)
535 aFootprint->FixUuids();
536
537 const wxString libName = aFootprint->GetFPID().GetLibNickname();
538
540 {
541 wxString msg;
542 msg.Printf( _( "Editing %s from board. Saving will update the board only." ),
543 aFootprint->GetReference() );
544
545 if( WX_INFOBAR* infobar = GetInfoBar() )
546 {
547 infobar->RemoveAllButtons();
548 infobar->AddCloseButton();
549 infobar->ShowMessage( msg, wxICON_INFORMATION );
550 }
551 }
552 // An empty libname is OK - you get that when creating a new footprint from the main menu
553 // In that case. treat is as editable, and the user will be prompted for save-as when saving.
554 else if( !libName.empty()
555 && !PROJECT_PCB::PcbFootprintLibs( &Prj() )->IsFootprintLibWritable( libName ) )
556 {
557 wxString msg = wxString::Format( _( "Editing footprint from read-only library '%s'." ),
558 UnescapeString( libName ) );
559
560 if( WX_INFOBAR* infobar = GetInfoBar() )
561 {
562 wxString link = _( "Save as editable copy" );
563
564 const auto saveAsEditableCopy = [this, aFootprint]( wxHyperlinkEvent& aEvent )
565 {
566 SaveFootprintAs( aFootprint );
567 };
568
569 wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, link, wxEmptyString );
570 button->Bind( wxEVT_COMMAND_HYPERLINK, saveAsEditableCopy );
571
572 infobar->RemoveAllButtons();
573 infobar->AddButton( button );
574 infobar->AddCloseButton();
575 infobar->ShowMessage( msg, wxICON_INFORMATION );
576 }
577 }
578 else
579 {
580 if( WX_INFOBAR* infobar = GetInfoBar() )
581 infobar->Dismiss();
582 }
583
585}
586
587
589{
590 ReloadFootprint( aFootprint );
591
593 setFPWatcher( nullptr );
594 else
595 setFPWatcher( aFootprint );
596}
597
598
600{
602}
603
604
606{
607 return GetBoard()->GetDesignSettings();
608}
609
610
612{
613 wxFAIL_MSG( wxT( "Plotting not supported in Footprint Editor" ) );
614
616}
617
618
620{
621 wxFAIL_MSG( wxT( "Plotting not supported in Footprint Editor" ) );
622}
623
624
626{
627 if( !m_editorSettings )
629
630 return m_editorSettings;
631}
632
633
635{
638}
639
640
642{
643 // Get our own settings; aCfg will be the PCBNEW_SETTINGS because we're part of the pcbnew
644 // compile unit
646
647 if( cfg )
648 {
650
652
655
658
660 }
661}
662
663
665{
666 // Load canvas type from the FOOTPRINT_EDITOR_SETTINGS:
668
669 // If we had an OpenGL failure this session, use the fallback GAL but don't update the
670 // user preference silently:
671
674}
675
676
678{
680
681 // Get our own settings; aCfg will be the PCBNEW_SETTINGS because we're part of the pcbnew
682 // compile unit
684
685 if( cfg )
686 {
688
691 cfg->m_LibWidth = m_treePane->GetSize().x;
693
695
697 {
698 cfg->m_AuiPanels.show_properties = m_propertiesPanel->IsShownOnScreen();
701 }
702
704
706 {
711 }
712 }
713}
714
715
716
718{
719 FOOTPRINT_EDITOR_SETTINGS* cfg = const_cast<FOOTPRINT_EDIT_FRAME*>( this )->GetSettings();
720
721 return cfg ? cfg->m_RotationAngle : ANGLE_90;
722}
723
724
725
727{
728 wxString currentTheme = GetFootprintEditorSettings()->m_ColorTheme;
729 return Pgm().GetSettingsManager().GetColorSettings( currentTheme );
730}
731
732
734{
735 // Get the actual frame settings for magnetic items
737 wxCHECK( cfg, nullptr );
738 return &cfg->m_MagneticItems;
739}
740
741
742const BOX2I FOOTPRINT_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
743{
744 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
745
746 if( footprint )
747 {
748 bool hasGraphicalItem = footprint->Pads().size() || footprint->Zones().size();
749
750 if( !hasGraphicalItem )
751 {
752 for( const BOARD_ITEM* item : footprint->GraphicalItems() )
753 {
754 if( item->Type() == PCB_TEXT_T || item->Type() == PCB_TEXTBOX_T )
755 continue;
756
757 hasGraphicalItem = true;
758 break;
759 }
760 }
761
762 if( hasGraphicalItem )
763 {
764 return footprint->GetBoundingBox( false );
765 }
766 else
767 {
768 BOX2I newFootprintBB( { 0, 0 }, { 0, 0 } );
769 newFootprintBB.Inflate( pcbIUScale.mmToIU( 12 ) );
770 return newFootprintBB;
771 }
772 }
773
774 return GetBoardBoundingBox( false );
775}
776
777
779{
780 if( IsContentModified() )
781 {
782 wxString footprintName = GetBoard()->GetFirstFootprint()->GetReference();
783 wxString msg = _( "Save changes to '%s' before closing?" );
784
785 if( !HandleUnsavedChanges( this, wxString::Format( msg, footprintName ),
786 [&]() -> bool
787 {
788 return SaveFootprint( GetBoard()->GetFirstFootprint() );
789 } ) )
790 {
791 return false;
792 }
793 }
794
795 if( doClose )
796 {
797 GetInfoBar()->ShowMessageFor( wxEmptyString, 1 );
798 Clear_Pcb( false );
799 UpdateTitle();
800 }
801
802 return true;
803}
804
805
806bool FOOTPRINT_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
807{
808 if( IsContentModified() )
809 {
810 // Shutdown blocks must be determined and vetoed as early as possible
812 aEvent.GetId() == wxEVT_QUERY_END_SESSION )
813 {
814 aEvent.Veto();
815 return false;
816 }
817
818 wxString footprintName = GetBoard()->GetFirstFootprint()->GetFPID().GetLibItemName();
819
821 footprintName = GetBoard()->GetFirstFootprint()->GetReference();
822
823 wxString msg = _( "Save changes to '%s' before closing?" );
824
825 if( !HandleUnsavedChanges( this, wxString::Format( msg, footprintName ),
826 [&]() -> bool
827 {
828 return SaveFootprint( GetBoard()->GetFirstFootprint() );
829 } ) )
830 {
831 aEvent.Veto();
832 return false;
833 }
834 }
835
836 PAD_TOOL* padTool = m_toolManager->GetTool<PAD_TOOL>();
837
838 if( padTool->InPadEditMode() )
839 padTool->ExitPadEditMode();
840
841 // Save footprint tree column widths
842 m_adapter->SaveSettings();
843
845}
846
847
849{
850 // No more vetos
851 GetCanvas()->SetEventDispatcher( nullptr );
853
854 // Do not show the layer manager during closing to avoid flicker
855 // on some platforms (Windows) that generate useless redraw of items in
856 // the Layer Manager
857 m_auimgr.GetPane( wxT( "LayersManager" ) ).Show( false );
858 m_auimgr.GetPane( wxT( "SelectionFilter" ) ).Show( false );
859
860 Clear_Pcb( false );
861
863
864 if( mgr->IsProjectOpen() && wxFileName::IsDirWritable( Prj().GetProjectPath() ) )
865 {
866 GFootprintList.WriteCacheToFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) );
867 }
868}
869
870
871void FOOTPRINT_EDIT_FRAME::OnExitKiCad( wxCommandEvent& event )
872{
873 Kiway().OnKiCadExit();
874}
875
876
878{
879 Close();
880}
881
882
884{
886
887 aEvent.Enable( frame != nullptr );
888}
889
890
892{
894
895 FOOTPRINT* editorFootprint = GetBoard()->GetFirstFootprint();
896 bool canInsert = frame && editorFootprint && editorFootprint->GetLink() == niluuid;
897
898 // If the source was deleted, the footprint can inserted but not updated in the board.
899 if( frame && editorFootprint && editorFootprint->GetLink() != niluuid )
900 {
901 BOARD* mainpcb = frame->GetBoard();
902 canInsert = true;
903
904 // search if the source footprint was not deleted:
905 for( FOOTPRINT* candidate : mainpcb->Footprints() )
906 {
907 if( editorFootprint->GetLink() == candidate->m_Uuid )
908 {
909 canInsert = false;
910 break;
911 }
912 }
913 }
914
915 aEvent.Enable( canInsert );
916}
917
918
920{
921 // call my base class
923
924 // We have 2 panes to update.
925 // For some obscure reason, the AUI manager hides the first modified pane.
926 // So force show panes
927 wxAuiPaneInfo& tree_pane_info = m_auimgr.GetPane( m_treePane );
928 bool tree_shown = tree_pane_info.IsShown();
929 tree_pane_info.Caption( _( "Libraries" ) );
930
931 wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_appearancePanel );
932 bool lm_shown = lm_pane_info.IsShown();
933 lm_pane_info.Caption( _( "Appearance" ) );
934 wxAuiPaneInfo& sf_pane_info = m_auimgr.GetPane( m_selectionFilterPanel );
935 sf_pane_info.Caption( _( "Selection Filter" ) );
936
937 // update the layer manager
939
940 // Now restore the visibility:
941 lm_pane_info.Show( lm_shown );
942 tree_pane_info.Show( tree_shown );
943 m_auimgr.Update();
944
946
947 UpdateTitle();
948}
949
950
952{
954 Update3DView( true, true );
956
957 if( !GetTitle().StartsWith( wxT( "*" ) ) )
958 UpdateTitle();
959}
960
961
963{
964 wxString title;
965 LIB_ID fpid = GetLoadedFPID();
966 FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
967 bool writable = true;
968
970 {
971 if( IsContentModified() )
972 title = wxT( "*" );
973
974 title += footprint->GetReference();
975 title += wxS( " " ) + wxString::Format( _( "[from %s]" ), Prj().GetProjectName()
976 + wxT( "." )
977 + FILEEXT::PcbFileExtension );
978 }
979 else if( fpid.IsValid() )
980 {
981 try
982 {
984 }
985 catch( const IO_ERROR& )
986 {
987 // best efforts...
988 }
989
990 // Note: don't used GetLoadedFPID(); footprint name may have been edited
991 if( IsContentModified() )
992 title = wxT( "*" );
993
994 title += From_UTF8( footprint->GetFPID().Format().c_str() );
995
996 if( !writable )
997 title += wxS( " " ) + _( "[Read Only]" );
998 }
999 else if( !fpid.GetLibItemName().empty() )
1000 {
1001 // Note: don't used GetLoadedFPID(); footprint name may have been edited
1002 if( IsContentModified() )
1003 title = wxT( "*" );
1004
1005 title += From_UTF8( footprint->GetFPID().GetLibItemName().c_str() );
1006 title += wxS( " " ) + _( "[Unsaved]" );
1007 }
1008 else
1009 {
1010 title = _( "[no footprint loaded]" );
1011 }
1012
1013 title += wxT( " \u2014 " ) + _( "Footprint Editor" );
1014
1015 SetTitle( title );
1016}
1017
1018
1020{
1022}
1023
1024
1026{
1030 UpdateTitle();
1031}
1032
1033
1035{
1037
1038 WX_PROGRESS_REPORTER progressReporter( this, _( "Loading Footprint Libraries" ), 2 );
1039
1040 if( GFootprintList.GetCount() == 0 )
1041 GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) );
1042
1043 GFootprintList.ReadFootprintFiles( fpTable, nullptr, &progressReporter );
1044 progressReporter.Show( false );
1045
1048
1050 auto adapter = static_cast<FP_TREE_SYNCHRONIZING_ADAPTER*>( m_adapter.get() );
1051
1052 adapter->AddLibraries( this );
1053}
1054
1055
1057{
1059 auto adapter = static_cast<FP_TREE_SYNCHRONIZING_ADAPTER*>( m_adapter.get() );
1060 LIB_ID target = GetTargetFPID();
1061 bool targetSelected = ( target == GetLibTree()->GetSelectedLibId() );
1062
1063 // Sync FOOTPRINT_INFO list to the libraries on disk
1064 if( aProgress )
1065 {
1066 WX_PROGRESS_REPORTER progressReporter( this, _( "Updating Footprint Libraries" ), 2 );
1067 GFootprintList.ReadFootprintFiles( fpTable, nullptr, &progressReporter );
1068 progressReporter.Show( false );
1069 }
1070 else
1071 {
1072 GFootprintList.ReadFootprintFiles( fpTable, nullptr, nullptr );
1073 }
1074
1075 // Unselect before syncing to avoid null reference in the adapter
1076 // if a selected item is removed during the sync
1077 GetLibTree()->Unselect();
1078
1079 // Sync the LIB_TREE to the FOOTPRINT_INFO list
1080 adapter->Sync( fpTable );
1081
1082 GetLibTree()->Regenerate( true );
1083
1084 if( target.IsValid() )
1085 {
1086 if( adapter->FindItem( target ) )
1087 {
1088 if( targetSelected )
1089 GetLibTree()->SelectLibId( target );
1090 else
1091 GetLibTree()->CenterLibId( target );
1092 }
1093 else
1094 {
1095 // Try to focus on parent
1096 target.SetLibItemName( wxEmptyString );
1097 GetLibTree()->CenterLibId( target );
1098 }
1099 }
1100}
1101
1102
1104{
1106}
1107
1108
1110{
1111 GetLibTree()->SelectLibId( aLibID );
1112}
1113
1114
1116{
1118}
1119
1120
1122{
1123 // Create the manager and dispatcher & route draw panel events to the dispatcher
1126 GetCanvas()->GetViewControls(), config(), this );
1127 m_actions = new PCB_ACTIONS();
1129
1131
1141 m_toolManager->RegisterTool( new PCB_CONTROL ); // copy/paste
1153
1154 for( TOOL_BASE* tool : m_toolManager->Tools() )
1155 {
1156 if( PCB_TOOL_BASE* pcbTool = dynamic_cast<PCB_TOOL_BASE*>( tool ) )
1157 pcbTool->SetIsFootprintEditor( true );
1158 }
1159
1160 m_toolManager->GetTool<PCB_VIEWER_TOOLS>()->SetFootprintFrame( true );
1162
1163 m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
1164
1165 // Load or reload wizard plugins in case they changed since the last time the frame opened
1166 // Because the board editor has also a plugin python menu,
1167 // call the PCB_EDIT_FRAME RunAction() if the board editor is running
1168 // Otherwise run the current RunAction().
1169 PCB_EDIT_FRAME* pcbframe = static_cast<PCB_EDIT_FRAME*>( Kiway().Player( FRAME_PCB_EDITOR, false ) );
1170
1171 if( pcbframe )
1173 else
1175}
1176
1177
1179{
1181
1183 PCB_EDITOR_CONDITIONS cond( this );
1184
1185 wxASSERT( mgr );
1186
1187#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
1188#define CHECK( x ) ACTION_CONDITIONS().Check( x )
1189
1190 auto haveFootprintCond =
1191 [this]( const SELECTION& )
1192 {
1193 return GetBoard() && GetBoard()->GetFirstFootprint() != nullptr;
1194 };
1195
1196 auto footprintTargettedCond =
1197 [this]( const SELECTION& )
1198 {
1199 return !GetTargetFPID().GetLibItemName().empty();
1200 };
1201
1202 mgr->SetConditions( ACTIONS::saveAs, ENABLE( footprintTargettedCond ) );
1205
1208
1212 mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
1213 mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
1214 mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
1215
1216 mgr->SetConditions( ACTIONS::cut, ENABLE( cond.HasItems() ) );
1217 mgr->SetConditions( ACTIONS::copy, ENABLE( cond.HasItems() ) );
1224
1231
1235
1238
1239 auto constrainedDrawingModeCond =
1240 [this]( const SELECTION& )
1241 {
1242 return GetSettings()->m_Use45Limit;
1243 };
1244
1245 auto highContrastCond =
1246 [this]( const SELECTION& )
1247 {
1248 return GetDisplayOptions().m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL;
1249 };
1250
1251 auto boardFlippedCond =
1252 [this]( const SELECTION& )
1253 {
1254 return GetCanvas() && GetCanvas()->GetView()->IsMirroredX();
1255 };
1256
1257 auto libraryTreeCond =
1258 [this](const SELECTION& )
1259 {
1260 return IsLibraryTreeShown();
1261 };
1262
1263 auto layerManagerCond =
1264 [this]( const SELECTION& )
1265 {
1266 return m_auimgr.GetPane( "LayersManager" ).IsShown();
1267 };
1268
1269 auto propertiesCond =
1270 [this] ( const SELECTION& )
1271 {
1272 return m_auimgr.GetPane( PropertiesPaneName() ).IsShown();
1273 };
1274
1275 mgr->SetConditions( PCB_ACTIONS::toggleHV45Mode, CHECK( constrainedDrawingModeCond ) );
1276 mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
1277 mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
1279
1280 mgr->SetConditions( ACTIONS::showLibraryTree, CHECK( libraryTreeCond ) );
1281 mgr->SetConditions( PCB_ACTIONS::showLayersManager, CHECK( layerManagerCond ) );
1282 mgr->SetConditions( PCB_ACTIONS::showProperties, CHECK( propertiesCond ) );
1283
1284 mgr->SetConditions( ACTIONS::print, ENABLE( haveFootprintCond ) );
1285 mgr->SetConditions( PCB_ACTIONS::exportFootprint, ENABLE( haveFootprintCond ) );
1286 mgr->SetConditions( PCB_ACTIONS::placeImportedGraphics, ENABLE( haveFootprintCond ) );
1287
1288 mgr->SetConditions( PCB_ACTIONS::footprintProperties, ENABLE( haveFootprintCond ) );
1289 mgr->SetConditions( PCB_ACTIONS::editTextAndGraphics, ENABLE( haveFootprintCond ) );
1290 mgr->SetConditions( PCB_ACTIONS::checkFootprint, ENABLE( haveFootprintCond ) );
1291 mgr->SetConditions( PCB_ACTIONS::repairFootprint, ENABLE( haveFootprintCond ) );
1292 mgr->SetConditions( PCB_ACTIONS::cleanupGraphics, ENABLE( haveFootprintCond ) );
1293 mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveFootprintCond ) );
1294
1295 auto isArcKeepCenterMode =
1296 [this]( const SELECTION& )
1297 {
1298 return GetSettings()->m_ArcEditMode == ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS;
1299 };
1300
1301 auto isArcKeepEndpointMode =
1302 [this]( const SELECTION& )
1303 {
1304 return GetSettings()->m_ArcEditMode == ARC_EDIT_MODE::KEEP_ENDPOINTS_OR_START_DIRECTION;
1305 };
1306
1307 mgr->SetConditions( PCB_ACTIONS::pointEditorArcKeepCenter, CHECK( isArcKeepCenterMode ) );
1308 mgr->SetConditions( PCB_ACTIONS::pointEditorArcKeepEndpoint, CHECK( isArcKeepEndpointMode ) );
1309
1310
1311// Only enable a tool if the part is edtable
1312#define CURRENT_EDIT_TOOL( action ) \
1313 mgr->SetConditions( action, ACTION_CONDITIONS().Enable( haveFootprintCond ) \
1314 .Check( cond.CurrentTool( action ) ) )
1315
1336
1337#undef CURRENT_EDIT_TOOL
1338#undef ENABLE
1339#undef CHECK
1340}
1341
1342
1344{
1346
1347 // Be sure the axis are enabled
1348 GetCanvas()->GetGAL()->SetAxesEnabled( true );
1349
1350 UpdateView();
1351
1352 // Ensure the m_Layers settings are using the canvas type:
1354}
1355
1356
1357void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
1358{
1359 PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
1360
1362 GetGalDisplayOptions().ReadWindowSettings( cfg->m_Window );
1363
1364 GetBoard()->GetDesignSettings() = cfg->m_DesignSettings;
1365
1369
1371
1372 if( aEnvVarsChanged )
1373 SyncLibraryTree( true );
1374
1375 Layout();
1376 SendSizeEvent();
1377}
1378
1379
1380std::unique_ptr<GRID_HELPER> FOOTPRINT_EDIT_FRAME::MakeGridHelper()
1381{
1382 return std::make_unique<PCB_GRID_HELPER>( m_toolManager, GetMagneticItemsSettings() );
1383}
1384
1385
1387{
1388 LIB_ID id = GetLoadedFPID();
1389
1390 if( id.empty() )
1391 {
1392 DisplayErrorMessage( this, _( "No footprint selected." ) );
1393 return;
1394 }
1395
1396 wxFileName fn( id.GetLibItemName() );
1397 fn.SetExt( wxT( "png" ) );
1398
1399 wxString projectPath = wxPathOnly( Prj().GetProjectFullName() );
1400
1401 wxFileDialog dlg( this, _( "Export View as PNG" ), projectPath, fn.GetFullName(),
1402 FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
1403
1404 if( dlg.ShowModal() == wxID_CANCEL || dlg.GetPath().IsEmpty() )
1405 return;
1406
1407 // calling wxYield is mandatory under Linux, after closing the file selector dialog
1408 // to refresh the screen before creating the PNG or JPEG image from screen
1409 wxYield();
1410 this->SaveCanvasImageToFile( dlg.GetPath(), BITMAP_TYPE::PNG );
1411}
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:178
static TOOL_ACTION paste
Definition: actions.h:73
static TOOL_ACTION millimetersUnits
Definition: actions.h:186
static TOOL_ACTION unselectAll
Definition: actions.h:76
static TOOL_ACTION revert
Definition: actions.h:55
static TOOL_ACTION showLibraryTree
Definition: actions.h:145
static TOOL_ACTION saveAs
Definition: actions.h:52
static TOOL_ACTION copy
Definition: actions.h:71
static TOOL_ACTION pluginsReload
Definition: actions.h:232
static TOOL_ACTION pasteSpecial
Definition: actions.h:74
static TOOL_ACTION showDatasheet
Definition: actions.h:208
static TOOL_ACTION milsUnits
Definition: actions.h:185
static TOOL_ACTION toggleBoundingBoxes
Definition: actions.h:138
static TOOL_ACTION undo
Definition: actions.h:68
static TOOL_ACTION duplicate
Definition: actions.h:77
static TOOL_ACTION inchesUnits
Definition: actions.h:184
static TOOL_ACTION highContrastMode
Definition: actions.h:136
static TOOL_ACTION embeddedFiles
Definition: actions.h:235
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:135
static TOOL_ACTION measureTool
Definition: actions.h:194
static TOOL_ACTION doDelete
Definition: actions.h:78
static TOOL_ACTION selectionTool
Definition: actions.h:193
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION zoomFitScreen
Definition: actions.h:127
static TOOL_ACTION redo
Definition: actions.h:69
static TOOL_ACTION deleteTool
Definition: actions.h:79
static TOOL_ACTION zoomTool
Definition: actions.h:130
static TOOL_ACTION print
Definition: actions.h:57
static TOOL_ACTION showProperties
Definition: actions.h:207
static TOOL_ACTION cut
Definition: actions.h:70
static TOOL_ACTION gridSetOrigin
Definition: actions.h:175
static TOOL_ACTION ddAddLibrary
Definition: actions.h:60
static TOOL_ACTION toggleGridOverrides
Definition: actions.h:179
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
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:175
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:80
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:793
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
Definition: board.cpp:593
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:822
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:805
void SetCopperLayerCount(int aCount)
Definition: board.cpp:742
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition: board.cpp:1393
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:890
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:646
ZONES & Zones()
Definition: footprint.h:211
EDA_ITEM * Clone() const override
Invoke a function on all children.
Definition: footprint.cpp:2025
std::deque< PAD * > & Pads()
Definition: footprint.h:205
const LIB_ID & GetFPID() const
Definition: footprint.h:247
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:1523
KIID GetLink() const
Definition: footprint.h:851
const wxString & GetReference() const
Definition: footprint.h:601
DRAWINGS & GraphicalItems()
Definition: footprint.h:208
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:1245
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:804
bool IsMirroredX() const
Return true if view is flipped across the X axis.
Definition: view.h:251
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:625
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:284
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:809
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:521
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:299
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:337
static TOOL_ACTION placeReferenceImage
Definition: pcb_actions.h:207
static TOOL_ACTION showLayersManager
Definition: pcb_actions.h:451
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:473
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:481
static TOOL_ACTION group
Definition: pcb_actions.h:529
static TOOL_ACTION drawRadialDimension
Definition: pcb_actions.h:218
static TOOL_ACTION editTextAndGraphics
Definition: pcb_actions.h:420
static TOOL_ACTION drawLeader
Definition: pcb_actions.h:220
static TOOL_ACTION ddImportFootprint
Definition: pcb_actions.h:587
static TOOL_ACTION ungroup
Definition: pcb_actions.h:530
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:493
static TOOL_ACTION pointEditorArcKeepEndpoint
Definition: pcb_actions.h:300
static TOOL_ACTION drawCenterDimension
Definition: pcb_actions.h:217
static TOOL_ACTION footprintProperties
Definition: pcb_actions.h:475
static TOOL_ACTION flipBoard
Definition: pcb_actions.h:391
static TOOL_ACTION textOutlines
Display texts as lines.
Definition: pcb_actions.h:496
static TOOL_ACTION checkFootprint
Definition: pcb_actions.h:478
static TOOL_ACTION mirrorV
Definition: pcb_actions.h:140
static TOOL_ACTION repairFootprint
Definition: pcb_actions.h:547
static TOOL_ACTION drawLine
Definition: pcb_actions.h:201
static TOOL_ACTION cleanupGraphics
Definition: pcb_actions.h:424
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).
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
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:595
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:49
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.