KiCad PCB EDA Suite
pcb_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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 2013-2018 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 
28 #include <fctsys.h>
29 #include <kiface_i.h>
30 #include <pgm_base.h>
31 #include <class_drawpanel.h>
32 #include <confirm.h>
33 #include <pcb_edit_frame.h>
34 #include <collectors.h>
35 #include <build_version.h>
37 #include <fp_lib_table.h>
38 #include <bitmaps.h>
39 #include <trace_helpers.h>
40 #include <pcbnew.h>
41 #include <pcbnew_id.h>
42 #include <drc.h>
43 #include <layer_widget.h>
44 #include <pcb_layer_widget.h>
45 #include <hotkeys.h>
46 #include <config_params.h>
47 #include <footprint_edit_frame.h>
48 #include <dialog_helpers.h>
49 #include <dialog_plot.h>
52 #include <dialog_board_setup.h>
53 #include <dialog_configure_paths.h>
54 #include <convert_to_biu.h>
55 #include <view/view.h>
56 #include <view/view_controls.h>
57 #include <pcb_painter.h>
58 #include <invoke_pcb_dialog.h>
59 #include <class_track.h>
60 #include <class_board.h>
61 #include <class_module.h>
62 #include <worksheet_viewitem.h>
64 #include <ratsnest_viewitem.h>
66 #include <kicad_string.h>
67 #include <pcb_draw_panel_gal.h>
69 #include <functional>
70 #include <tool/tool_manager.h>
71 #include <tool/tool_dispatcher.h>
72 #include <tools/pcb_actions.h>
73 #include <gestfich.h>
74 #include <executable_names.h>
75 #include <eda_dockart.h>
76 
77 #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
78 #include <python_scripting.h>
79 #endif
80 
81 
82 using namespace std::placeholders;
83 
86 
87 static const wxString PlotLineWidthEntry = "PlotLineWidth_mm";
88 static const wxString ShowMicrowaveEntry = "ShowMicrowaveTools";
89 static const wxString ShowLayerManagerEntry = "ShowLayerManagerTools";
90 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
91 
93 
94 
95 BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
96  EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, PCB_EDIT_FRAME::OnSockRequestServer )
97  EVT_SOCKET( ID_EDA_SOCKET_EVENT, PCB_EDIT_FRAME::OnSockRequest )
98 
99  EVT_COMBOBOX( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom )
100  EVT_COMBOBOX( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid )
101 
102  EVT_CLOSE( PCB_EDIT_FRAME::OnCloseWindow )
103  EVT_SIZE( PCB_EDIT_FRAME::OnSize )
104 
105  EVT_TOOL( ID_LOAD_FILE, PCB_EDIT_FRAME::Files_io )
108  EVT_TOOL( ID_NEW_BOARD, PCB_EDIT_FRAME::Files_io )
110  EVT_TOOL( ID_OPEN_MODULE_EDITOR, PCB_EDIT_FRAME::Process_Special_Functions )
111  EVT_TOOL( ID_OPEN_MODULE_VIEWER, PCB_EDIT_FRAME::Process_Special_Functions )
112 
113  // Menu Files:
114  EVT_MENU( ID_MAIN_MENUBAR, PCB_EDIT_FRAME::Process_Special_Functions )
116 
122 
123  EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter )
124 
125  EVT_MENU( ID_GEN_EXPORT_SPECCTRA, PCB_EDIT_FRAME::ExportToSpecctra )
131 
132  EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,PCB_EDIT_FRAME::ImportSpecctraSession )
133  EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, PCB_EDIT_FRAME::ImportSpecctraDesign )
134  EVT_MENU( ID_GEN_IMPORT_GRAPHICS_FILE, PCB_EDIT_FRAME::Process_Special_Functions )
135 
136  EVT_MENU( ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
138 
139  EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit )
140 
141  // menu Config
142  EVT_MENU( ID_PCB_LIB_TABLE_EDIT, PCB_EDIT_FRAME::Process_Config )
146  EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config )
148 
149  // menu Postprocess
150  EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, PCB_EDIT_FRAME::GenFootprintsPositionFile )
151  EVT_MENU( ID_PCB_GEN_DRILL_FILE, PCB_EDIT_FRAME::InstallDrillFrame )
153  EVT_MENU( ID_PCB_GEN_CMP_FILE, PCB_EDIT_FRAME::RecreateCmpFileFromBoard )
154  EVT_MENU( ID_PCB_GEN_BOM_FILE_FROM_BOARD, PCB_EDIT_FRAME::RecreateBOMFileFromBoard )
155 
156  // menu Miscellaneous
157  EVT_MENU( ID_MENU_LIST_NETS, PCB_EDIT_FRAME::ListNetsAndSelect )
158  EVT_MENU( ID_PCB_EDIT_TRACKS_AND_VIAS, PCB_EDIT_FRAME::OnEditTracksAndVias )
159  EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions )
160  EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions )
161  EVT_MENU( ID_MENU_PCB_UPDATE_FOOTPRINTS, PCB_EDIT_FRAME::Process_Special_Functions )
162  EVT_MENU( ID_MENU_PCB_EXCHANGE_FOOTPRINTS, PCB_EDIT_FRAME::Process_Special_Functions )
163  EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions )
165 
166  // Menu Help
167  EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
168  EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
169  EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
170  EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
171 
172  // Menu 3D Frame
174 
175  // Switching canvases
176  EVT_MENU( ID_MENU_CANVAS_LEGACY, PCB_EDIT_FRAME::OnSwitchCanvas )
177  EVT_MENU( ID_MENU_CANVAS_CAIRO, PCB_EDIT_FRAME::OnSwitchCanvas )
178  EVT_MENU( ID_MENU_CANVAS_OPENGL, PCB_EDIT_FRAME::OnSwitchCanvas )
179 
180  // Menu Get Design Rules Editor
181  EVT_MENU( ID_BOARD_SETUP_DIALOG, PCB_EDIT_FRAME::ShowBoardSetupDialog )
182 
183  // Horizontal toolbar
184  EVT_TOOL( ID_RUN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
185  EVT_TOOL( ID_SHEET_SET, EDA_DRAW_FRAME::Process_PageSettings )
186  EVT_TOOL( wxID_CUT, PCB_EDIT_FRAME::Process_Special_Functions )
187  EVT_TOOL( wxID_COPY, PCB_EDIT_FRAME::Process_Special_Functions )
188  EVT_TOOL( wxID_PASTE, PCB_EDIT_FRAME::Process_Special_Functions )
189  EVT_TOOL( wxID_UNDO, PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList )
190  EVT_TOOL( wxID_REDO, PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList )
191  EVT_TOOL( wxID_PRINT, PCB_EDIT_FRAME::ToPrinter )
193  EVT_TOOL( ID_GEN_PLOT, PCB_EDIT_FRAME::Process_Special_Functions )
194  EVT_TOOL( ID_FIND_ITEMS, PCB_EDIT_FRAME::Process_Special_Functions )
195  EVT_TOOL( ID_GET_NETLIST, PCB_EDIT_FRAME::Process_Special_Functions )
196  EVT_TOOL( ID_DRC_CONTROL, PCB_EDIT_FRAME::Process_Special_Functions )
197  EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::Process_Special_Functions )
198  EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
199  EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions )
200  EVT_COMBOBOX( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
201  EVT_COMBOBOX( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
202 
203 
204 #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
205  EVT_TOOL( ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH, PCB_EDIT_FRAME::OnActionPluginRefresh )
206 #endif
207 
208 #if defined( KICAD_SCRIPTING_WXPYTHON )
209  // has meaning only with KICAD_SCRIPTING_WXPYTHON enabled
210  EVT_TOOL( ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, PCB_EDIT_FRAME::ScriptingConsoleEnableDisable )
212  PCB_EDIT_FRAME::OnUpdateScriptingConsoleState )
213 #endif
214 
215  // Option toolbar
219  PCB_EDIT_FRAME::OnSelectOptionToolbar )
221  PCB_EDIT_FRAME::OnSelectOptionToolbar )
223  PCB_EDIT_FRAME::OnSelectOptionToolbar )
225  PCB_EDIT_FRAME::OnSelectOptionToolbar )
227  PCB_EDIT_FRAME::OnSelectOptionToolbar )
228 
229  EVT_TOOL( ID_UPDATE_PCB_FROM_SCH, PCB_EDIT_FRAME::OnUpdatePCBFromSch )
230  EVT_TOOL( ID_RUN_EESCHEMA, PCB_EDIT_FRAME::OnRunEeschema )
231 
233  PCB_EDIT_FRAME::OnSelectOptionToolbar )
234 
236  PCB_EDIT_FRAME::OnSelectOptionToolbar )
237 
238  // Vertical main toolbar:
240  EVT_TOOL( ID_ZOOM_SELECTION, PCB_EDIT_FRAME::OnSelectTool )
242  PCB_EDIT_FRAME::OnSelectTool )
243 
245  PCB_EDIT_FRAME::ProcessMuWaveFunctions )
246 
248  PCB_EDIT_FRAME::Process_Special_Functions )
249 
250  // Tracks and vias sizes general options
253  PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
254 
255  // popup menus
256  EVT_MENU( ID_POPUP_PCB_DELETE_TRACKSEG, PCB_EDIT_FRAME::Process_Special_Functions )
258  PCB_EDIT_FRAME::Process_Special_Functions )
259 
260  // User interface update event handlers.
261  EVT_UPDATE_UI( ID_SAVE_BOARD, PCB_EDIT_FRAME::OnUpdateSave )
262  EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::OnUpdateLayerPair )
263  EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::OnUpdateLayerSelectBox )
264  EVT_UPDATE_UI( ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnUpdateDrcEnable )
265  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_RATSNEST, PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest )
266  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, PCB_EDIT_FRAME::OnUpdateViaDrawMode )
267  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, PCB_EDIT_FRAME::OnUpdateTraceDrawMode )
268  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
269  PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode )
270  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
271  PCB_EDIT_FRAME::OnUpdateShowLayerManager )
272  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
273  PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar )
274  EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
275  EVT_UPDATE_UI( ID_ZOOM_SELECTION, PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
276  EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
277  EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::OnUpdateSelectViaSize )
279  PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
281  PCB_EDIT_FRAME::OnUpdateSelectViaSize )
282  EVT_UPDATE_UI_RANGE( ID_PCB_HIGHLIGHT_BUTT, ID_PCB_MEASUREMENT_TOOL,
283  PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
284  EVT_UPDATE_UI_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
285  PCB_EDIT_FRAME::OnUpdateMuWaveToolbar )
286 
287  EVT_COMMAND( wxID_ANY, LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE, PCB_EDIT_FRAME::OnLayerColorChange )
288 END_EVENT_TABLE()
289 
290 
291 PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
292  PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB, wxT( "Pcbnew" ), wxDefaultPosition,
294 {
295  m_showBorderAndTitleBlock = true; // true to display sheet references
296  m_showAxis = false; // true to display X and Y axis
297  m_showOriginAxis = true;
298  m_showGridAxis = true;
299  m_SelTrackWidthBox = NULL;
300  m_SelViaSizeBox = NULL;
301  m_SelLayerBox = NULL;
302  m_show_microwave_tools = false;
303  m_show_layer_manager_tools = true;
304  m_hotkeysDescrList = g_Board_Editor_Hotkeys_Descr;
305  m_hasAutoSave = true;
306  m_microWaveToolBar = NULL;
307  m_Layers = nullptr;
308  m_FrameSize = ConvertDialogToPixels( wxSize( 500, 350 ) ); // default in case of no prefs
309 
310  // We don't know what state board was in when it was lasat saved, so we have to
311  // assume dirty
312  m_ZoneFillsDirty = true;
313 
314  m_rotationAngle = 900;
315 
316  // Create GAL canvas
317  EDA_DRAW_PANEL_GAL* galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),
318  m_FrameSize,
319  GetGalDisplayOptions(),
321 
322  SetGalCanvas( galCanvas );
323 
324  SetBoard( new BOARD() );
325 
326  // Create the PCB_LAYER_WIDGET *after* SetBoard():
327  m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas() );
328 
329  m_drc = new DRC( this ); // these 2 objects point to each other
330 
331  wxIcon icon;
332  icon.CopyFromBitmap( KiBitmap( icon_pcbnew_xpm ) );
333  SetIcon( icon );
334 
335  // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
336  // initialize parameters in m_LayersManager
337  LoadSettings( config() );
338 
339  SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU() ) );
340  GetScreen()->SetMaxUndoItems( m_UndoRedoCountMax );
341 
342  // PCB drawings start in the upper left corner.
343  GetScreen()->m_Center = false;
344 
345  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
346 
347  GetScreen()->AddGrid( m_UserGridSize, EDA_UNITS_T::UNSCALED_UNITS, ID_POPUP_GRID_USER );
348  GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
349 
350  if( m_canvas )
351  m_canvas->SetEnableBlockCommands( true );
352 
353  ReCreateMenuBar();
354  ReCreateHToolbar();
355  ReCreateAuxiliaryToolbar();
356  ReCreateVToolbar();
357  ReCreateOptToolbar();
358  ReCreateMicrowaveVToolbar();
359 
360  m_auimgr.SetManagedWindow( this );
361  m_auimgr.SetArtProvider( new EDA_DOCKART( this ) );
362 
363  // Horizontal items; layers 4 - 6
364  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
365  m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( "AuxToolbar" ).Top().Layer(4) );
366  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
367 
368  // Vertical items; layers 1 - 3
369  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
370 
371  m_auimgr.AddPane( m_microWaveToolBar, EDA_PANE().VToolbar().Name( "MicrowaveToolbar" ).Right().Layer(1) );
372  m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
373  m_auimgr.AddPane( m_Layers, EDA_PANE().Palette().Name( "LayersManager" ).Right().Layer(3)
374  .Caption( _( "Layers Manager" ) ).PaneBorder( false )
375  .MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ) );
376 
377  m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
378  m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrameGal" ).Center().Hide() );
379 
380  m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
381  m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools );
382 
383  ReFillLayerWidget(); // this is near end because contents establish size
384  m_Layers->ReFillRender(); // Update colors in Render after the config is read
385  syncLayerWidgetLayer();
386 
387  m_auimgr.Update();
388 
389  setupTools();
390 
391  Zoom_Automatique( false );
392 
393  EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = LoadCanvasTypeSetting();
394 
395  // Nudge user to switch to OpenGL if they are on legacy or Cairo
396  if( m_firstRunDialogSetting < 1 )
397  {
398  if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL )
399  {
400  wxString msg = _( "KiCad can use your graphics card to give you a smoother "
401  "and faster experience. This option is turned off by "
402  "default since it is not compatible with all computers.\n\n"
403  "Would you like to try enabling graphics acceleration?\n\n"
404  "If you'd like to choose later, select Modern Toolset "
405  "(Accelerated) in the Preferences menu." );
406 
407  wxMessageDialog dlg( this, msg, _( "Enable Graphics Acceleration" ),
408  wxYES_NO );
409 
410  dlg.SetYesNoLabels( _( "&Enable Acceleration" ), _( "&No Thanks" ) );
411 
412  if( dlg.ShowModal() == wxID_YES )
413  {
414  // Save Cairo as default in case OpenGL crashes
415  saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
416 
417  // Switch to OpenGL, which will save the new setting if successful
418  wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
419  GetEventHandler()->ProcessEvent( evt );
420 
421  // Switch back to Cairo if OpenGL is not supported
422  if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
423  {
424  wxCommandEvent cairoEvt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
425  GetEventHandler()->ProcessEvent( cairoEvt );
426  }
427  }
428  else
429  {
430  // If they were on legacy, or they've been coerced into GAL
431  // due to unavailable legacy (GTK3), switch to Cairo
432  wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
433  GetEventHandler()->ProcessEvent( evt );
434  }
435  }
436 
437  m_firstRunDialogSetting = 1;
438  SaveSettings( config() );
439  }
440  else
441  {
442  if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
443  {
444  if( GetGalCanvas()->SwitchBackend( canvasType ) )
445  UseGalCanvas( true );
446  }
447  }
448 
449  enableGALSpecificMenus();
450 
451  // disable Export STEP item if kicad2step does not exist
452  wxString strK2S = Pgm().GetExecutablePath();
453 
454 #ifdef __WXMAC__
455  if (strK2S.find( "pcbnew.app" ) != wxNOT_FOUND )
456  {
457  // On macOS, we have standalone applications inside the main bundle, so we handle that here:
458  strK2S += "../../";
459  }
460 
461  strK2S += "Contents/MacOS/";
462 #endif
463 
464  wxFileName appK2S( strK2S, "kicad2step" );
465 
466  #ifdef _WIN32
467  appK2S.SetExt( "exe" );
468  #endif
469 
470  if( !appK2S.FileExists() )
471  GetMenuBar()->FindItem( ID_GEN_EXPORT_FILE_STEP )->Enable( false );
472 }
473 
474 
476 {
477  delete m_drc;
478 }
479 
480 
482 {
484 
485  if( IsGalCanvasActive() )
486  {
487  aBoard->GetConnectivity()->Build( aBoard );
488 
489  // reload the worksheet
490  SetPageSettings( aBoard->GetPageSettings() );
491  }
492 }
493 
494 
496 {
497  return m_Pcb;
498 }
499 
500 
501 void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
502 {
503  PCB_BASE_FRAME::SetPageSettings( aPageSettings );
504 
505  if( IsGalCanvasActive() )
506  {
507  PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
508 
509  // Prepare worksheet template
510  KIGFX::WORKSHEET_VIEWITEM* worksheet;
511  worksheet = new KIGFX::WORKSHEET_VIEWITEM( IU_PER_MILS ,&m_Pcb->GetPageSettings(),
512  &m_Pcb->GetTitleBlock() );
513  worksheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
514 
515  BASE_SCREEN* screen = GetScreen();
516 
517  if( screen != NULL )
518  {
519  worksheet->SetSheetNumber( screen->m_ScreenNumber );
520  worksheet->SetSheetCount( screen->m_NumberOfScreens );
521  }
522 
523  // PCB_DRAW_PANEL_GAL takes ownership of the worksheet
524  drawPanel->SetWorksheet( worksheet );
525  }
526 }
527 
528 
530 {
531  if( GetScreen() )
532  return GetScreen()->IsSave();
533 
534  return false;
535 }
536 
537 
539 {
540  // Create the manager and dispatcher & route draw panel events to the dispatcher
541  m_toolManager = new TOOL_MANAGER;
542  m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
543  GetGalCanvas()->GetViewControls(), this );
544  m_actions = new PCB_ACTIONS();
545  m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
546 
547  // Register tools
548  m_actions->RegisterAllTools( m_toolManager );
549  m_toolManager->InitTools();
550 
551  // Run the selection tool, it is supposed to be always active
552  m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
553 }
554 
555 
557 {
558  m_Layers->ReFill();
559 
560  wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );
561 
562  wxSize bestz = m_Layers->GetBestSize();
563 
564  lyrs.MinSize( bestz );
565  lyrs.BestSize( bestz );
566  lyrs.FloatingSize( bestz );
567 
568  if( lyrs.IsDocked() )
569  m_auimgr.Update();
570  else
571  m_Layers->SetSize( bestz );
572 }
573 
574 
575 void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event )
576 {
577  Close( false );
578 }
579 
580 
581 void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
582 {
583  m_canvas->SetAbortRequest( true );
584 
585  if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
586  {
587  wxString msg = _( "Save changes to\n\"%s\"\nbefore closing?" );
588 
589  if( !HandleUnsavedChanges( this, wxString::Format( msg, GetBoard()->GetFileName() ),
590  [&]()->bool { return Files_io_from_id( ID_SAVE_BOARD ); } ) )
591  {
592  Event.Veto();
593  return;
594  }
595  }
596 
597  if( IsGalCanvasActive() )
598  {
599  // On Windows 7 / 32 bits, on OpenGL mode only, Pcbnew crashes
600  // when closing this frame if a footprint was selected, and the footprint editor called
601  // to edit this footprint, and when closing pcbnew if this footprint is still selected
602  // See https://bugs.launchpad.net/kicad/+bug/1655858
603  // I think this is certainly a OpenGL event fired after frame deletion, so this workaround
604  // avoid the crash (JPC)
605  GetGalCanvas()->SetEvtHandlerEnabled( false );
606  }
607 
608  GetGalCanvas()->StopDrawing();
609 
610  // Delete the auto save file if it exists.
611  wxFileName fn = GetBoard()->GetFileName();
612 
613  // Auto save file name is the normal file name prefixed with '_autosave'.
614  fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
615 
616  // When the auto save feature does not have write access to the board file path, it falls
617  // back to a platform specific user temporary file path.
618  if( !fn.IsOk() || !fn.IsDirWritable() )
619  fn.SetPath( wxFileName::GetTempDir() );
620 
621  wxLogTrace( traceAutoSave, "Deleting auto save file <" + fn.GetFullPath() + ">" );
622 
623  // Remove the auto save file on a normal close of Pcbnew.
624  if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
625  {
626  wxString msg = wxString::Format( _( "The auto save file \"%s\" could not be removed!" ),
627  fn.GetFullPath() );
628  wxMessageBox( msg, Pgm().App().GetAppName(), wxOK | wxICON_ERROR, this );
629  }
630 
631  // Do not show the layer manager during closing to avoid flicker
632  // on some platforms (Windows) that generate useless redraw of items in
633  // the Layer Manger
634  if( m_show_layer_manager_tools )
635  m_auimgr.GetPane( "LayersManager" ).Show( false );
636 
637  // Delete board structs and undo/redo lists, to avoid crash on exit
638  // when deleting some structs (mainly in undo/redo lists) too late
639  Clear_Pcb( false );
640 
641  // do not show the window because ScreenPcb will be deleted and we do not
642  // want any paint event
643  Show( false );
644 
645  Destroy();
646 }
647 
648 
649 void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
650 {
651  bool forceRecreateIfNotOwner = true;
652  CreateAndShow3D_Frame( forceRecreateIfNotOwner );
653 }
654 
655 
656 void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
657 {
658  if( !aEnable )
659  Compile_Ratsnest( NULL, true );
660 
662  COLORS_DESIGN_SETTINGS& cds = Settings().Colors();
663 
664  if( aEnable )
665  {
666  cds.SetLegacyMode( false );
667  GetGalCanvas()->GetGAL()->SetGridColor( cds.GetLayerColor( LAYER_GRID ) );
668  auto view = GetGalCanvas()->GetView();
669  view->GetPainter()->GetSettings()->ImportLegacyColors( &cds );
670  GetGalCanvas()->Refresh();
671  }
672 
673  enableGALSpecificMenus();
674 
675  // Force colors to be legacy-compatible in case they were changed in GAL
676  if( !aEnable )
677  {
678  cds.SetLegacyMode( true );
679  Refresh();
680  }
681 
682  // Re-create the layer manager to allow arbitrary colors when GAL is enabled
684 }
685 
686 
688 {
689  // some menus are active only in GAL mode and do nothing in legacy mode.
690  // So enable or disable them, depending on the display mode
691 
692  ReCreateMenuBar();
693 
694  if( GetMenuBar() )
695  {
696  // Enable / disable some menus which are usable only on GAL
697  pcbnew_ids id_list[] =
698  {
705  ID_MENU_PCB_FLIP_VIEW
706  };
707 
708  bool enbl = IsGalCanvasActive();
709 
710  for( unsigned ii = 0; ii < arrayDim( id_list ); ii++ )
711  {
712  if( GetMenuBar()->FindItem( id_list[ii] ) )
713  GetMenuBar()->FindItem( id_list[ii] )->Enable( enbl );
714  }
715 
716  // Update settings for GAL menus
717  auto view = GetGalCanvas()->GetView();
718  GetMenuBar()->FindItem( ID_MENU_PCB_FLIP_VIEW )->Check( view->IsMirroredX() );
719  }
720 }
721 
722 
723 void PCB_EDIT_FRAME::ShowBoardSetupDialog( wxCommandEvent& event )
724 {
725  DoShowBoardSetupDialog();
726 }
727 
728 
729 void PCB_EDIT_FRAME::DoShowBoardSetupDialog( const wxString& aInitialPage,
730  const wxString& aInitialParentPage )
731 {
732  DIALOG_BOARD_SETUP dlg( this );
733 
734  if( !aInitialPage.IsEmpty() )
735  dlg.SetInitialPage( aInitialPage, aInitialParentPage );
736 
737  if( dlg.ShowModal() == wxID_OK )
738  {
739  Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_PCB, GetProjectFileParameters() );
740 
742  ReCreateAuxiliaryToolbar();
743 
744  if( IsGalCanvasActive() )
745  {
746  for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
747  GetGalCanvas()->GetView()->Update( module );
748 
749  GetGalCanvas()->Refresh();
750  }
751 
752  //this event causes the routing tool to reload its design rules information
754  m_toolManager->ProcessEvent( toolEvent );
755 
756  OnModify();
757  }
758 }
759 
760 
761 void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
762 {
764 
765  wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
766 
767  m_configSettings.Load( aCfg );
768 
769  double dtmp;
770  aCfg->Read( PlotLineWidthEntry, &dtmp, 0.1 ); // stored in mm
771  dtmp = std::max( 0.01, std::min( dtmp, 5.0 ) );
772 
773  g_DrawDefaultLineThickness = Millimeter2iu( dtmp );
774 
775  aCfg->Read( ShowMicrowaveEntry, &m_show_microwave_tools );
776  aCfg->Read( ShowLayerManagerEntry, &m_show_layer_manager_tools );
777 
778  aCfg->Read( ShowPageLimitsEntry, &m_showPageLimits );
779 }
780 
781 
782 void PCB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
783 {
784  m_configSettings.Save( aCfg );
785 
787 
788  wxConfigSaveSetups( aCfg, GetConfigurationSettings() );
789 
790  // This value is stored in mm )
791  aCfg->Write( PlotLineWidthEntry, MM_PER_IU * g_DrawDefaultLineThickness );
792  aCfg->Write( ShowMicrowaveEntry, (long) m_show_microwave_tools );
793  aCfg->Write( ShowLayerManagerEntry, (long)m_show_layer_manager_tools );
794  aCfg->Write( ShowPageLimitsEntry, m_showPageLimits );
795 }
796 
797 
799 {
800  return IsElementVisible( LAYER_GRID );
801 }
802 
803 
805 {
806  SetElementVisibility( LAYER_GRID, aVisible );
807 }
808 
809 
811 {
812  return Settings().Colors().GetItemColor( LAYER_GRID );
813 }
814 
815 
817 {
818 
819  Settings().Colors().SetItemColor( LAYER_GRID, aColor );
820 
821  if( IsGalCanvasActive() )
822  {
823  GetGalCanvas()->GetGAL()->SetGridColor( aColor );
824  }
825 }
826 
827 
829 {
830  int copperlayercnt = GetBoard()->GetCopperLayerCount( );
831  PCB_LAYER_ID currLayer = GetActiveLayer();
832 
833  if( !GetDesignSettings().m_MicroViasAllowed )
834  return false; // Obvious..
835 
836  if( copperlayercnt < 4 )
837  return false; // Only on multilayer boards..
838 
839  if( ( currLayer == B_Cu )
840  || ( currLayer == F_Cu )
841  || ( currLayer == copperlayercnt - 2 )
842  || ( currLayer == In1_Cu ) )
843  return true;
844 
845  return false;
846 }
847 
848 
850 {
852 
853  syncLayerWidgetLayer();
854 
855  if( IsGalCanvasActive() )
856  {
857  m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
858  GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
859 
860  GetGalCanvas()->SetHighContrastLayer( aLayer );
861  GetGalCanvas()->Refresh();
862  }
863 }
864 
865 
867 {
868  UpdateTitle();
869 
870  // Re-create layers manager based on layer info in board
871  ReFillLayerWidget();
872  ReCreateLayerBox();
873 
874  // Sync layer and item visibility
875  syncLayerVisibilities();
876  syncLayerWidgetLayer();
877  syncRenderStates();
878 
879  // Update the tracks / vias available sizes list:
880  ReCreateAuxiliaryToolbar();
881 
882  // Update the RATSNEST items, which were not loaded at the time
883  // BOARD::SetVisibleElements() was called from within any PLUGIN.
884  // See case LAYER_RATSNEST: in BOARD::SetElementVisibility()
885  GetBoard()->SetVisibleElements( GetBoard()->GetVisibleElements() );
886 
887  // Display the loaded board:
888  Zoom_Automatique( false );
889 
890  Refresh();
891 
892  SetMsgPanel( GetBoard() );
893  SetStatusText( wxEmptyString );
894 }
895 
896 
898 {
899  m_Layers->SelectLayer( GetActiveLayer() );
900  m_Layers->OnLayerSelected();
901 }
902 
903 
905 {
906  m_Layers->ReFillRender();
907 }
908 
909 
911 {
912  m_Layers->SyncLayerVisibilities();
913  static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
914 }
915 
916 
917 void PCB_EDIT_FRAME::OnUpdateLayerAlpha( wxUpdateUIEvent & )
918 {
919  m_Layers->SyncLayerAlphaIndicators();
920 }
921 
922 
924 {
925  return GetBoard()->IsElementVisible( aElement );
926 }
927 
928 
929 void PCB_EDIT_FRAME::SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState )
930 {
931  GetGalCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
932  GetBoard()->SetElementVisibility( aElement, aNewState );
933  m_Layers->SetRenderState( aElement, aNewState );
934 }
935 
936 
938 {
940 
942  m_Layers->SetRenderState( ii, true );
943 }
944 
945 
947 {
948  // call my base class
950 
951  // update the layer manager
952  m_Layers->Freeze();
953 
954  wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_Layers );
955  pane_info.Caption( _( "Visibles" ) );
956  m_auimgr.Update();
957 
958  m_Layers->SetLayersManagerTabsText();
959  ReFillLayerWidget();
960  // m_Layers->ReFillRender(); // syncRenderStates() does this
961 
962  // upate the layer widget to match board visibility states, both layers and render columns.
963  syncLayerVisibilities();
964  syncLayerWidgetLayer();
965  syncRenderStates();
966 
967  m_Layers->Thaw();
968 
969  // pcbnew-specific toolbars
970  ReCreateMicrowaveVToolbar();
971 }
972 
973 
975 {
976  wxFileName absoluteFileName = m_lastNetListRead;
977  wxFileName pcbFileName = GetBoard()->GetFileName();
978 
979  if( !absoluteFileName.MakeAbsolute( pcbFileName.GetPath() ) || !absoluteFileName.FileExists() )
980  {
981  absoluteFileName.Clear();
982  m_lastNetListRead = wxEmptyString;
983  }
984 
985  return absoluteFileName.GetFullPath();
986 }
987 
988 
989 void PCB_EDIT_FRAME::SetLastNetListRead( const wxString& aLastNetListRead )
990 {
991  wxFileName relativeFileName = aLastNetListRead;
992  wxFileName pcbFileName = GetBoard()->GetFileName();
993 
994  if( relativeFileName.MakeRelativeTo( pcbFileName.GetPath() )
995  && relativeFileName.GetFullPath() != aLastNetListRead )
996  {
997  m_lastNetListRead = relativeFileName.GetFullPath();
998  }
999 }
1000 
1001 
1003 {
1005 
1006  Update3DView();
1007 
1008  m_ZoneFillsDirty = true;
1009 }
1010 
1011 
1012 void PCB_EDIT_FRAME::ExportSVG( wxCommandEvent& event )
1013 {
1014  InvokeExportSVG( this, GetBoard() );
1015 }
1016 
1017 
1019 {
1020  wxFileName fileName = GetBoard()->GetFileName();
1021  wxString fileinfo;
1022 
1023  if( fileName.IsOk() && fileName.FileExists() )
1024  fileinfo = fileName.IsFileWritable() ? wxString( wxEmptyString ) : _( " [Read Only]" );
1025  else
1026  fileinfo = _( " [Unsaved]" );
1027 
1028  SetTitle( wxString::Format( _( "Pcbnew" ) + wxT( " \u2014 %s%s" ),
1029  fileName.GetFullPath(),
1030  fileinfo ) );
1031 }
1032 
1033 
1035 {
1036  // Update the layer manager and other widgets from the board setup
1037  // (layer and items visibility, colors ...)
1038 
1039  // Rebuild list of nets (full ratsnest rebuild)
1040  Compile_Ratsnest( NULL, true );
1042 
1043  // Update info shown by the horizontal toolbars
1044  ReCreateLayerBox();
1045 
1046  // Update the layer manager
1047  m_Layers->Freeze();
1048  ReFillLayerWidget();
1049  // m_Layers->ReFillRender(); // syncRenderStates() does this
1050 
1051  // upate the layer widget to match board visibility states, both layers and render columns.
1052  syncLayerVisibilities();
1053  syncLayerWidgetLayer();
1054  syncRenderStates();
1055 
1056  m_Layers->Thaw();
1057 }
1058 
1059 
1060 #if defined( KICAD_SCRIPTING_WXPYTHON )
1061 
1062 void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent )
1063 {
1064 
1065  wxWindow * pythonPanelFrame = findPythonConsole();
1066  bool pythonPanelShown = true;
1067 
1068  if( pythonPanelFrame == NULL )
1069  pythonPanelFrame = CreatePythonShellWindow( this, pythonConsoleNameId() );
1070  else
1071  pythonPanelShown = ! pythonPanelFrame->IsShown();
1072 
1073  if( pythonPanelFrame )
1074  pythonPanelFrame->Show( pythonPanelShown );
1075  else
1076  wxMessageBox( wxT( "Error: unable to create the Python Console" ) );
1077 }
1078 #endif
1079 
1080 
1081 void PCB_EDIT_FRAME::OnLayerColorChange( wxCommandEvent& aEvent )
1082 {
1083  ReCreateLayerBox();
1084 }
1085 
1086 
1087 void PCB_EDIT_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent )
1088 {
1089  // switches currently used canvas (default / Cairo / OpenGL).
1091 
1092  // The base class method *does not reinit* the layers manager.
1093  // We must upate the layer widget to match board visibility states,
1094  // both layers and render columns.
1095  syncLayerVisibilities();
1096  syncLayerWidgetLayer();
1097  syncRenderStates();
1098 }
1099 
1100 void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
1101 {
1102  // Force rebuild the dialog if currently open because the old dialog can be not up to date
1103  // if the board (or units) has changed
1104  wxWindow* dlg = wxWindow::FindWindowByName( DLG_WINDOW_NAME );
1105 
1106  if( dlg )
1107  dlg->Destroy();
1108 
1109  dlg = new DIALOG_PLOT( this );
1110  dlg->Show( true );
1111 }
1112 
1113 
1114 bool PCB_EDIT_FRAME::SetCurrentNetClass( const wxString& aNetClassName )
1115 {
1116  bool change = GetDesignSettings().SetCurrentNetClass( aNetClassName );
1117 
1118  if( change )
1119  {
1120  ReCreateAuxiliaryToolbar();
1121  }
1122 
1123  return change;
1124 }
1125 
1126 
1127 void PCB_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
1128 {
1129  DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() );
1130  dlg.ShowModal();
1131 }
1132 
1133 
1134 void PCB_EDIT_FRAME::OnUpdatePCBFromSch( wxCommandEvent& event )
1135 {
1136  if( Kiface().IsSingle() )
1137  {
1138  DisplayError( this, _( "Cannot update the PCB, because Pcbnew is "
1139  "opened in stand-alone mode. In order to create or update "
1140  "PCBs from schematics, you need to launch the KiCad project manager "
1141  "and create a PCB project." ) );
1142  return;
1143  }
1144  else
1145  {
1146  // Update PCB requires a netlist. Therefore the schematic editor must be running
1147  // If this is not the case, open the schematic editor
1148  KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, true );
1149 
1150  if( !frame->IsShown() )
1151  {
1152  wxFileName schfn( Prj().GetProjectPath(), Prj().GetProjectName(), SchematicFileExtension );
1153 
1154  frame->OpenProjectFiles( std::vector<wxString>( 1, schfn.GetFullPath() ) );
1155  // Because the schematic editor frame is not on screen, iconize it:
1156  // However, another valid option is to do not iconize the schematic editor frame
1157  // and show it
1158  frame->Iconize( true );
1159  // we show the schematic editor frame, because do not show is seen as
1160  // a not yet opened schematic by Kicad manager, which is not the case
1161  frame->Show( true );
1162  }
1163 
1165  }
1166 }
1167 
1168 
1169 void PCB_EDIT_FRAME::OnRunEeschema( wxCommandEvent& event )
1170 {
1171  wxString msg;
1172  wxFileName schfn( Prj().GetProjectPath(), Prj().GetProjectName(), SchematicFileExtension );
1173 
1174  if( !schfn.FileExists() )
1175  {
1176  msg.Printf( _( "Schematic file \"%s\" not found." ), schfn.GetFullPath() );
1177  wxMessageBox( msg, _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
1178  return;
1179  }
1180 
1181  if( Kiface().IsSingle() )
1182  {
1183  wxString filename = wxT( "\"" ) + schfn.GetFullPath( wxPATH_NATIVE ) + wxT( "\"" );
1184  ExecuteFile( this, EESCHEMA_EXE, filename );
1185  }
1186  else
1187  {
1188  KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, false );
1189 
1190  // Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls
1191  // Kiway.Player( FRAME_SCH, true )
1192  // therefore, the schematic editor is sometimes running, but the schematic project
1193  // is not loaded, if the library editor was called, and the dialog field editor was used.
1194  // On linux, it happens the first time the schematic editor is launched, if
1195  // library editor was running, and the dialog field editor was open
1196  // On Windows, it happens always after the library editor was called,
1197  // and the dialog field editor was used
1198  if( !frame )
1199  {
1200  try
1201  {
1202  frame = Kiway().Player( FRAME_SCH, true );
1203  }
1204  catch( const IO_ERROR& err )
1205  {
1206  wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(),
1207  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
1208  return;
1209  }
1210  }
1211 
1212  if( !frame->IsShown() ) // the frame exists, (created by the dialog field editor)
1213  // but no project loaded.
1214  {
1215  frame->OpenProjectFiles( std::vector<wxString>( 1, schfn.GetFullPath() ) );
1216  frame->Show( true );
1217  }
1218 
1219  // On Windows, Raise() does not bring the window on screen, when iconized or not shown
1220  // On linux, Raise() brings the window on screen, but this code works fine
1221  if( frame->IsIconized() )
1222  {
1223  frame->Iconize( false );
1224  // If an iconized frame was created by Pcbnew, Iconize( false ) is not enough
1225  // to show the frame at its normal size: Maximize should be called.
1226  frame->Maximize( false );
1227  }
1228 
1229  frame->Raise();
1230  }
1231 }
1232 
1233 
1234 void PCB_EDIT_FRAME::OnFlipPcbView( wxCommandEvent& evt )
1235 {
1236  auto view = GetGalCanvas()->GetView();
1237  view->SetMirror( evt.IsChecked(), false );
1238  view->RecacheAllItems();
1239  Refresh();
1240 }
1241 
1242 
1244 {
1245  // Reload Python plugins if they are newer than
1246  // the already loaded, and load new plugins
1247 #if defined(KICAD_SCRIPTING)
1248  //Reload plugin list: reload Python plugins if they are newer than
1249  // the already loaded, and load new plugins
1251 
1252  #if defined(KICAD_SCRIPTING_ACTION_MENU)
1253  // Action plugins can be modified, therefore the plugins menu
1254  // must be updated:
1255  RebuildActionPluginMenus();
1256  // Recreate top toolbar to add action plugin buttons
1257  ReCreateHToolbar();
1258  #endif
1259 #endif
1260 }
1261 
1262 
1264 {
1265  if( Module == NULL )
1266  return;
1267 
1268 #ifdef __WXMAC__
1269  // avoid Avoid "writes" in the dialog, creates errors with WxOverlay and NSView & Modal
1270  // Raising an Exception - Fixes #764678
1271  DC = NULL;
1272 #endif
1273 
1274  DIALOG_FOOTPRINT_BOARD_EDITOR* dlg = new DIALOG_FOOTPRINT_BOARD_EDITOR( this, Module, DC );
1275 
1276  int retvalue = dlg->ShowModal();
1277  /* retvalue =
1278  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_WANT_UPDATE_FP if update footprint
1279  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_WANT_EXCHANGE_FP if change footprint
1280  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_WANT_MODEDIT for a goto editor command
1281  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_EDIT_OK for normal edit
1282  */
1283 
1284  dlg->Close();
1285  dlg->Destroy();
1286 
1288  {
1289 #ifdef __WXMAC__
1290  // If something edited, push a refresh request
1291  m_canvas->Refresh();
1292 #endif
1293  }
1295  {
1297 
1298  editor->Load_Module_From_BOARD( Module );
1299  SetCurItem( NULL );
1300 
1301  editor->Show( true );
1302  editor->Raise(); // Iconize( false );
1303  }
1304 
1306  {
1308 
1309  editor->LoadModuleFromLibrary( Module->GetFPID() );
1310  SetCurItem( NULL );
1311 
1312  editor->Show( true );
1313  editor->Raise(); // Iconize( false );
1314  }
1315 
1317  {
1318  InstallExchangeModuleFrame( Module, true, true );
1319  }
1320 
1322  {
1323  InstallExchangeModuleFrame( Module, false, true );
1324  }
1325 }
1326 
1327 
1329  bool selectedMode )
1330 {
1331  DIALOG_EXCHANGE_FOOTPRINTS dialog( this, aModule, updateMode, selectedMode );
1332 
1333  return dialog.ShowQuasiModal();
1334 }
1335 
1336 
1338 {
1340 
1341  ReCreateMicrowaveVToolbar();
1342 
1343  Layout();
1344  SendSizeEvent();
1345 }
1346 
1347 
1348 void PCB_EDIT_FRAME::LockModule( MODULE* aModule, bool aLocked )
1349 {
1350  const wxString ModulesMaskSelection = wxT( "*" );
1351  if( aModule )
1352  {
1353  aModule->SetLocked( aLocked );
1354  SetMsgPanel( aModule );
1355  OnModify();
1356  }
1357  else
1358  {
1359  aModule = GetBoard()->m_Modules;
1360 
1361  for( ; aModule != NULL; aModule = aModule->Next() )
1362  {
1363  if( WildCompareString( ModulesMaskSelection, aModule->GetReference() ) )
1364  {
1365  aModule->SetLocked( aLocked );
1366  OnModify();
1367  }
1368  }
1369  }
1370 }
void SetWorksheet(KIGFX::WORKSHEET_VIEWITEM *aWorksheet)
Function SetWorksheet Sets (or updates) worksheet used by the draw panel.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility, colors ...) (note: it is automatically called by action plugins, after running the plugin, so call this function is usually not needed inside action plugins.
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
void syncRenderStates()
Function syncRenderStates updates the "Render" checkboxes in the layer widget according to current to...
void UpdateTitle()
Function UpdateTitle sets the main window title bar text.
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Function HandleUnsavedChanges displays a dialog with Save, Cancel and Discard Changes buttons...
Definition: confirm.cpp:213
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative...
Definition: project.cpp:318
void SetPageSettings(const PAGE_INFO &aPageSettings) override
>
KiCad executable names.
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:120
SCH_EDIT_FRAME::OnSelectTool SCH_EDIT_FRAME::OnEditItem ID_POPUP_GENERAL_END_RANGE
virtual void ShowChangedLanguage() override
Function ShowChangedLanguage redraws the menus and what not in current language.
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
Class that draws missing connections on a PCB.
int m_ScreenNumber
Definition: base_screen.h:216
void syncLayerWidgetLayer()
Function syncLayerWidgetLayer updates the currently layer "selection" within the PCB_LAYER_WIDGET.
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
void OnConfigurePaths(wxCommandEvent &aEvent)
PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::ProcessMuWaveFunctions PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_WIDTH1, ID_POPUP_PCB_SELECT_WIDTH8, PCB_EDIT_FRAME::OnUpdateSelectTrackWidth) EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_VIASIZE1
This file is part of the common library TODO brief description.
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
void LockModule(MODULE *aModule, bool aLocked)
void UseGalCanvas(bool aEnable) override
>
void SetVisibleElements(int aMask)
Function SetVisibleElements is a proxy function that calls the correspondent function in m_BoardSetti...
void ShowBoardSetupDialog(wxCommandEvent &event)
Function ShowBoardSetupDialog.
void ToPlotter(wxCommandEvent &event)
Function ToPlotter Open a dialog frame to create plot and drill files relative to the current board...
This file is part of the common library.
VTBL_ENTRY const wxString & GetExecutablePath() const
Definition: pgm_base.h:217
void SetLastNetListRead(const wxString &aNetListFile)
Set the last net list successfully read by the net list dialog box.
Class PCB_LAYER_WIDGET is here to implement the abstract functions of LAYER_WIDGET so they may be tie...
static const wxString ShowPageLimitsEntry
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
VIEW_CONTROLS class definition.
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
PROJECT & Prj()
Definition: kicad.cpp:292
Class BOARD to handle a board.
void CommonSettingsChanged() override
Called after the preferences dialog is run.
PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::ProcessMuWaveFunctions PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar ID_POPUP_PCB_SELECT_VIASIZE8
MODULE * Next() const
Definition: class_module.h:122
int GetCopperLayerCount() const
Function GetCopperLayerCount.
PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::ProcessMuWaveFunctions PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR, PCB_EDIT_FRAME::OnUpdateShowLayerManager) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE
void OnLayerColorChange(wxCommandEvent &aEvent)
void LoadModuleFromLibrary(LIB_ID aFPID)
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
The common library.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
void SetVisibleAlls()
Function SetVisibleAlls changes the bit-mask of visible element categories and layers.
virtual void SetGridColor(COLOR4D aColor) override
Function SetGridColor() , virtual.
This is the end of the layers used for visibility bitmasks in Pcbnew There can be at most 32 layers a...
void syncLayerVisibilities()
Function syncLayerVisibilities updates each "Layer" checkbox in the layer widget according to each la...
void OnCloseWindow(wxCloseEvent &Event) override
The base class for create windows for drawing purpose.
Definition: draw_frame.h:78
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
FOOTPRINT_EDIT_FRAME::OnVerticalToolbar FOOTPRINT_EDIT_FRAME::ProcessPreferences ID_POPUP_PCB_END_RANGE
Definition of class FOOTPRINT_EDIT_FRAME.
void SetVisibleAlls()
Function SetVisibleAlls Set the status of all visible element categories and layers to VISIBLE...
virtual void OnSwitchCanvas(wxCommandEvent &aEvent)
virtual bool IsGridVisible() const override
Function IsGridVisible() , virtual.
int InstallExchangeModuleFrame(MODULE *aModule, bool updateMode, bool selectedMode)
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
Functions relatives to tracks, vias and segments used to fill zones.
VTBL_ENTRY bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList...
Definition: kiway_player.h:179
Pcbnew hotkeys.
static const wxString PlotLineWidthEntry
void UseGalCanvas(bool aEnable) override
>
void InstallFootprintPropertiesDialog(MODULE *Module, wxDC *DC)
virtual bool isAutoSaveRequired() const override
Function isautoSaveRequired returns true if the board has been modified.
#define PCB_EDIT_FRAME_NAME
Definition: draw_frame.h:56
EVT_TOOL(ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnSelectOptionToolbar) EVT_TOOL(ID_TB_OPTIONS_SHOW_RATSNEST
VTBL_ENTRY void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string aPayload, wxWindow *aSource=NULL)
Function ExpressMail send aPayload to aDestination from aSource.
Definition: kiway.cpp:386
BOARD_ITEM * Next() const
Class that handles properties and drawing of worksheet layout.
const LIB_ID & GetFPID() const
Definition: class_module.h:192
PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::ProcessMuWaveFunctions EVT_MENU_RANGE(ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE, PCB_EDIT_FRAME::Process_Special_Functions) EVT_MENU_RANGE(ID_POPUP_PCB_SELECT_WIDTH_START_RANGE
Class TOOL_MANAGER.
Definition: tool_manager.h:49
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
bool IsElementVisible(GAL_LAYER_ID aElement) const
Function IsElementVisible tests whether a given element category is visible.
static const wxString ShowLayerManagerEntry
PCB_LAYER_ID
A quick note on layer IDs:
Action belongs to a particular tool (i.e. a part of a pop-up menu)
Definition: tool_event.h:143
void CommonSettingsChanged() override
Function CommonSettingsChanged Notification event that some of the common (suite-wide) settings have ...
const wxString EESCHEMA_EXE
wxString ModulesMaskSelection
void SetSheetName(const std::string &aSheetName)
Function SetSheetName() Sets the sheet name displayed in the title block.
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:300
BOARD_ITEM_CONTAINER * GetModel() const override
>
void OnSelectOptionToolbar(wxCommandEvent &event)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, wxWindow *aFrame)
Sets the work environment (model, view, view controls and the parent window).
const wxString & GetFileName() const
Definition: class_board.h:238
void onBoardLoaded()
Updates the state of the GUI after a new board is loaded or created.
int ShowQuasiModal()
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Function WildCompareString compares a string against wild card (* and ?) pattern using the usual rule...
Definition: string.cpp:377
const std::string SchematicFileExtension
Class TOOL_EVENT.
Definition: tool_event.h:168
int g_DrawDefaultLineThickness
Default line thickness in internal units used to draw or plot items using a default thickness line va...
void ExportSVG(wxCommandEvent &event)
Function SVG_Print Shows the Export to SVG file dialog.
virtual ~PCB_EDIT_FRAME()
Definition of file extensions used in Kicad.
Helper dialog and control classes.
void ShowChangedLanguage() override
Function ShowChangedLanguage redraws the menus and what not in current language.
virtual COLOR4D GetGridColor() override
Function GetGridColor() , virtual.
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:258
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hotkeys_Descr[]
bool Load_Module_From_BOARD(MODULE *Module)
Load in Modedit a footprint from the main board.
void SetSheetNumber(int aSheetNumber)
Function SetSheetNumber() Changes the sheet number displayed in the title block.
wxLogTrace helper definitions.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
void BuildConnectivity()
Builds or rebuilds the board connectivity database for the board, especially the list of connected it...
void OnQuit(wxCommandEvent &event)
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility, colors ...)
PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar EVT_TOOL_RANGE(ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY, PCB_EDIT_FRAME::OnSelectOptionToolbar) EVT_TOOL(ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
Function SetActiveLayer will change the currently active layer to aLayer.
static const wxString ShowMicrowaveEntry
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
void Show3D_Frame(wxCommandEvent &event) override
Function Show3D_Frame displays the 3D view of current printed circuit board.
string & err
Definition: json11.cpp:598
Specialization of the wxAuiPaneInfo class for KiCad panels.
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:554
Class TOOL_DISPATCHER.
Class DIALOG_PLOT is the dialog to set the plot options, and create plot files in various formats...
Definition: dialog_plot.h:40
FOOTPRINT_EDIT_FRAME::OnVerticalToolbar EVT_MENU(ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, FOOTPRINT_EDIT_FRAME::ProcessPreferences) EVT_MENU(ID_PCB_LIB_TABLE_EDIT
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
of elements in an array. This implements type-safe compile time checking
Definition: macros.h:99
BOARD * GetBoard()
void enableGALSpecificMenus()
an helper function to enable some menus only active when the display is switched to GAL mode and whic...
void PythonPluginsReloadBase()
Helper function PythonPluginsReloadBase Reload Python plugins if they are newer than the already load...
Definition: pcbnew.cpp:311
virtual void OnSwitchCanvas(wxCommandEvent &aEvent) override
switches currently used canvas (default / Cairo / OpenGL).
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
Class LAYER_WIDGET is abstract and is used to manage a list of layers, with the notion of a "current"...
Definition: layer_widget.h:79
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
wxString GetLastNetListRead()
Get the last net list read with the net list dialog box.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
static TOOL_ACTION layerChanged
Definition: pcb_actions.h:291
Class PCB_ACTIONS.
Definition: pcb_actions.h:42
void OnUpdatePCBFromSch(wxCommandEvent &event)
void wxConfigSaveSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigSaveSetups writes aList of PARAM_CFG_ARRAY elements to save configuration values to ...
see class PGM_BASE
void OnUpdateLayerAlpha(wxUpdateUIEvent &aEvent) override
Update the UI to reflect changes to the current layer&#39;s transparency.
void SetBoard(BOARD *aBoard) override
>
Declaration of the eda_3d_viewer class.
void OnRunEeschema(wxCommandEvent &event)
void SetLocked(bool isLocked) override
Function SetLocked sets the MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: class_module.h:277
void DoShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString, const wxString &aInitialParentPage=wxEmptyString)
Common, abstract interface for edit frames.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar ID_PCB_MUWAVE_END_CMD
bool InvokeExportSVG(PCB_BASE_FRAME *aCaller, BOARD *aBoard)
Function InvokeExportSVG shows the Export SVG dialog.
virtual void SetGridVisibility(bool aVisible) override
Function SetGridVisibility() , virtual It may be overloaded by derived classes if you want to store/r...
#define max(a, b)
Definition: auxiliary.h:86
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:171
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:462
pcbnew_ids
Definition: pcbnew_id.h:16
DLIST< MODULE > m_Modules
Definition: class_board.h:249
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
Design Rule Checker object that performs all the DRC tests.
Definition: drc.h:174
virtual void SetBoard(BOARD *aBoard) override
>
void SetSheetCount(int aSheetCount)
Function SetSheetCount() Changes the sheets count number displayed in the title block.
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
#define IU_PER_MILS
Definition: plotter.cpp:134
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
virtual void SetPageSettings(const PAGE_INFO &aPageSettings) override
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
Definition: id.h:97
bool IsMicroViaAcceptable()
Function IsMicroViaAcceptable return true if a microvia can be placed on the board.
int m_NumberOfScreens
Definition: base_screen.h:217
void SetLegacyMode(bool aMode)
Enables or disables legacy color mode.
#define DLG_WINDOW_NAME
Definition: dialog_plot.h:34
Module description (excepted pads)
Abstract interface for BOARD_ITEMs capable of storing other items inside.
void ReFillLayerWidget()
Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading a ne...
#define GROUP_PCB
Names of sub sections where to store project info in *.pro project config files.
Definition: config_params.h:43
int ExecuteFile(wxWindow *frame, const wxString &ExecFile, const wxString &param, wxProcess *callback)
Function ExecuteFile calls the executable file ExecFile with the command line parameters param...
Definition: gestfich.cpp:208
void PythonPluginsReload()
Reload the Python plugins if they are newer than the already loaded, and load new plugins if any Do n...
void wxConfigLoadSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigLoadSetups uses aList of PARAM_CFG_ARRAY elements to load configuration values from ...
void OnFlipPcbView(wxCommandEvent &event)
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
virtual void SetActiveLayer(PCB_LAYER_ID aLayer) override
Function SetActiveLayer will change the currently active layer to aLayer and also update the PCB_LAYE...
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:297
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
#define min(a, b)
Definition: auxiliary.h:85
KIWAY Kiway
PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::ProcessMuWaveFunctions ID_POPUP_PCB_SELECT_WIDTH_END_RANGE
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39