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_CHOICE( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom )
100  EVT_CHOICE( 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_DXF_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 )
147  EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions )
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_CHOICE( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
201  EVT_CHOICE( 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 
309  // We don't know what state board was in when it was lasat saved, so we have to
310  // assume dirty
311  m_ZoneFillsDirty = true;
312 
313  m_rotationAngle = 900;
314 
315  // Create GAL canvas
316  EDA_DRAW_PANEL_GAL* galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),
317  m_FrameSize,
318  GetGalDisplayOptions(),
320 
321  SetGalCanvas( galCanvas );
322 
323  SetBoard( new BOARD() );
324 
325  // Create the PCB_LAYER_WIDGET *after* SetBoard():
326  m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas() );
327 
328  m_drc = new DRC( this ); // these 2 objects point to each other
329 
330  wxIcon icon;
331  icon.CopyFromBitmap( KiBitmap( icon_pcbnew_xpm ) );
332  SetIcon( icon );
333 
334  // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
335  // initialize parameters in m_LayersManager
336  LoadSettings( config() );
337 
338  SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU() ) );
339  GetScreen()->SetMaxUndoItems( m_UndoRedoCountMax );
340 
341  // PCB drawings start in the upper left corner.
342  GetScreen()->m_Center = false;
343 
344  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
345 
346  GetScreen()->AddGrid( m_UserGridSize, EDA_UNITS_T::UNSCALED_UNITS, ID_POPUP_GRID_USER );
347  GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
348 
349  if( m_canvas )
350  m_canvas->SetEnableBlockCommands( true );
351 
352  ReCreateMenuBar();
353  ReCreateHToolbar();
354  ReCreateAuxiliaryToolbar();
355  ReCreateVToolbar();
356  ReCreateOptToolbar();
357  ReCreateMicrowaveVToolbar();
358 
359  m_auimgr.SetManagedWindow( this );
360  m_auimgr.SetArtProvider( new EDA_DOCKART( this ) );
361 
362  // Horizontal items; layers 4 - 6
363  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
364  m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( "AuxToolbar" ).Top().Layer(4) );
365  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
366 
367  // Vertical items; layers 1 - 3
368  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
369 
370  m_auimgr.AddPane( m_microWaveToolBar, EDA_PANE().VToolbar().Name( "MicrowaveToolbar" ).Right().Layer(1) );
371  m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
372  m_auimgr.AddPane( m_Layers, EDA_PANE().Palette().Name( "LayersManager" ).Right().Layer(3)
373  .Caption( _( "Layers Manager" ) ).PaneBorder( false )
374  .MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ) );
375 
376  m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
377  m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrameGal" ).Center().Hide() );
378 
379  m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
380  m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools );
381 
382  ReFillLayerWidget(); // this is near end because contents establish size
383  m_Layers->ReFillRender(); // Update colors in Render after the config is read
384  syncLayerWidgetLayer();
385 
386  m_auimgr.Update();
387 
388  setupTools();
389 
390  Zoom_Automatique( false );
391 
392  EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = LoadCanvasTypeSetting();
393 
394  // Nudge user to switch to OpenGL if they are on legacy or Cairo
395  if( m_firstRunDialogSetting < 1 )
396  {
397  if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL )
398  {
399  wxString msg = _( "KiCad can use your graphics card to give you a smoother "
400  "and faster experience. This option is turned off by "
401  "default since it is not compatible with all computers.\n\n"
402  "Would you like to try enabling graphics acceleration?\n\n"
403  "If you'd like to choose later, select Modern Toolset "
404  "(Accelerated) in the Preferences menu." );
405 
406  wxMessageDialog dlg( this, msg, _( "Enable Graphics Acceleration" ),
407  wxYES_NO );
408 
409  dlg.SetYesNoLabels( _( "&Enable Acceleration" ), _( "&No Thanks" ) );
410 
411  if( dlg.ShowModal() == wxID_YES )
412  {
413  // Save Cairo as default in case OpenGL crashes
414  saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
415 
416  // Switch to OpenGL, which will save the new setting if successful
417  wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
418  GetEventHandler()->ProcessEvent( evt );
419 
420  // Switch back to Cairo if OpenGL is not supported
421  if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
422  {
423  wxCommandEvent cairoEvt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
424  GetEventHandler()->ProcessEvent( cairoEvt );
425  }
426  }
427  else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
428  {
429  // If they were on legacy, switch them to Cairo
430  wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
431  GetEventHandler()->ProcessEvent( evt );
432  }
433  }
434 
435  m_firstRunDialogSetting = 1;
436  SaveSettings( config() );
437  }
438  else
439  {
440  if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
441  {
442  if( GetGalCanvas()->SwitchBackend( canvasType ) )
443  UseGalCanvas( true );
444  }
445  }
446 
447  enableGALSpecificMenus();
448 
449  // disable Export STEP item if kicad2step does not exist
450  wxString strK2S = Pgm().GetExecutablePath();
451 
452 #ifdef __WXMAC__
453  if (strK2S.find( "pcbnew.app" ) != wxNOT_FOUND )
454  {
455  // On macOS, we have standalone applications inside the main bundle, so we handle that here:
456  strK2S += "../../";
457  }
458 
459  strK2S += "Contents/MacOS/";
460 #endif
461 
462  wxFileName appK2S( strK2S, "kicad2step" );
463 
464  #ifdef _WIN32
465  appK2S.SetExt( "exe" );
466  #endif
467 
468  if( !appK2S.FileExists() )
469  GetMenuBar()->FindItem( ID_GEN_EXPORT_FILE_STEP )->Enable( false );
470 }
471 
472 
474 {
475  delete m_drc;
476 }
477 
478 
480 {
482 
483  if( IsGalCanvasActive() )
484  {
485  aBoard->GetConnectivity()->Build( aBoard );
486 
487  // reload the worksheet
488  SetPageSettings( aBoard->GetPageSettings() );
489  }
490 }
491 
492 
494 {
495  return m_Pcb;
496 }
497 
498 
499 void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
500 {
501  PCB_BASE_FRAME::SetPageSettings( aPageSettings );
502 
503  if( IsGalCanvasActive() )
504  {
505  PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
506 
507  // Prepare worksheet template
508  KIGFX::WORKSHEET_VIEWITEM* worksheet;
509  worksheet = new KIGFX::WORKSHEET_VIEWITEM( IU_PER_MILS ,&m_Pcb->GetPageSettings(),
510  &m_Pcb->GetTitleBlock() );
511  worksheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
512 
513  BASE_SCREEN* screen = GetScreen();
514 
515  if( screen != NULL )
516  {
517  worksheet->SetSheetNumber( screen->m_ScreenNumber );
518  worksheet->SetSheetCount( screen->m_NumberOfScreens );
519  }
520 
521  // PCB_DRAW_PANEL_GAL takes ownership of the worksheet
522  drawPanel->SetWorksheet( worksheet );
523  }
524 }
525 
526 
528 {
529  if( GetScreen() )
530  return GetScreen()->IsSave();
531 
532  return false;
533 }
534 
535 
537 {
538  // Create the manager and dispatcher & route draw panel events to the dispatcher
539  m_toolManager = new TOOL_MANAGER;
540  m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
541  GetGalCanvas()->GetViewControls(), this );
542  m_actions = new PCB_ACTIONS();
543  m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
544 
545  // Register tools
546  m_actions->RegisterAllTools( m_toolManager );
547  m_toolManager->InitTools();
548 
549  // Run the selection tool, it is supposed to be always active
550  m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
551 }
552 
553 
555 {
556  m_Layers->ReFill();
557 
558  wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );
559 
560  wxSize bestz = m_Layers->GetBestSize();
561 
562  lyrs.MinSize( bestz );
563  lyrs.BestSize( bestz );
564  lyrs.FloatingSize( bestz );
565 
566  if( lyrs.IsDocked() )
567  m_auimgr.Update();
568  else
569  m_Layers->SetSize( bestz );
570 }
571 
572 
573 void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event )
574 {
575  Close( false );
576 }
577 
578 
579 void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
580 {
581  m_canvas->SetAbortRequest( true );
582 
583  if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
584  {
585  wxString msg = _( "Save changes to\n\"%s\"\nbefore closing?" );
586 
587  if( !HandleUnsavedChanges( this, wxString::Format( msg, GetBoard()->GetFileName() ),
588  [&]()->bool { return Files_io_from_id( ID_SAVE_BOARD ); } ) )
589  {
590  Event.Veto();
591  return;
592  }
593  }
594 
595  if( IsGalCanvasActive() )
596  {
597  // On Windows 7 / 32 bits, on OpenGL mode only, Pcbnew crashes
598  // when closing this frame if a footprint was selected, and the footprint editor called
599  // to edit this footprint, and when closing pcbnew if this footprint is still selected
600  // See https://bugs.launchpad.net/kicad/+bug/1655858
601  // I think this is certainly a OpenGL event fired after frame deletion, so this workaround
602  // avoid the crash (JPC)
603  GetGalCanvas()->SetEvtHandlerEnabled( false );
604  }
605 
606  GetGalCanvas()->StopDrawing();
607 
608  // Delete the auto save file if it exists.
609  wxFileName fn = GetBoard()->GetFileName();
610 
611  // Auto save file name is the normal file name prefixed with '_autosave'.
612  fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
613 
614  // When the auto save feature does not have write access to the board file path, it falls
615  // back to a platform specific user temporary file path.
616  if( !fn.IsOk() || !fn.IsDirWritable() )
617  fn.SetPath( wxFileName::GetTempDir() );
618 
619  wxLogTrace( traceAutoSave, "Deleting auto save file <" + fn.GetFullPath() + ">" );
620 
621  // Remove the auto save file on a normal close of Pcbnew.
622  if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
623  {
624  wxString msg = wxString::Format( _( "The auto save file \"%s\" could not be removed!" ),
625  fn.GetFullPath() );
626  wxMessageBox( msg, Pgm().App().GetAppName(), wxOK | wxICON_ERROR, this );
627  }
628 
629  // Do not show the layer manager during closing to avoid flicker
630  // on some platforms (Windows) that generate useless redraw of items in
631  // the Layer Manger
632  if( m_show_layer_manager_tools )
633  m_auimgr.GetPane( "LayersManager" ).Show( false );
634 
635  // Delete board structs and undo/redo lists, to avoid crash on exit
636  // when deleting some structs (mainly in undo/redo lists) too late
637  Clear_Pcb( false );
638 
639  // do not show the window because ScreenPcb will be deleted and we do not
640  // want any paint event
641  Show( false );
642 
643  Destroy();
644 }
645 
646 
647 void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
648 {
649  bool forceRecreateIfNotOwner = true;
650  CreateAndShow3D_Frame( forceRecreateIfNotOwner );
651 }
652 
653 
654 void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
655 {
656  if( !aEnable )
657  Compile_Ratsnest( NULL, true );
658 
660  COLORS_DESIGN_SETTINGS& cds = Settings().Colors();
661 
662  if( aEnable )
663  {
664  cds.SetLegacyMode( false );
665  GetGalCanvas()->GetGAL()->SetGridColor( cds.GetLayerColor( LAYER_GRID ) );
666  auto view = GetGalCanvas()->GetView();
667  view->GetPainter()->GetSettings()->ImportLegacyColors( &cds );
668  GetGalCanvas()->Refresh();
669  }
670 
671  enableGALSpecificMenus();
672 
673  // Force colors to be legacy-compatible in case they were changed in GAL
674  if( !aEnable )
675  {
676  cds.SetLegacyMode( true );
677  Refresh();
678  }
679 
680  // Re-create the layer manager to allow arbitrary colors when GAL is enabled
682 }
683 
684 
686 {
687  // some menus are active only in GAL mode and do nothing in legacy mode.
688  // So enable or disable them, depending on the display mode
689 
690  ReCreateMenuBar();
691 
692  if( GetMenuBar() )
693  {
694  // Enable / disable some menus which are usable only on GAL
695  pcbnew_ids id_list[] =
696  {
703  ID_MENU_PCB_FLIP_VIEW
704  };
705 
706  bool enbl = IsGalCanvasActive();
707 
708  for( unsigned ii = 0; ii < DIM( id_list ); ii++ )
709  {
710  if( GetMenuBar()->FindItem( id_list[ii] ) )
711  GetMenuBar()->FindItem( id_list[ii] )->Enable( enbl );
712  }
713 
714  // Update settings for GAL menus
715  auto view = GetGalCanvas()->GetView();
716  GetMenuBar()->FindItem( ID_MENU_PCB_FLIP_VIEW )->Check( view->IsMirroredX() );
717  }
718 }
719 
720 
721 void PCB_EDIT_FRAME::ShowBoardSetupDialog( wxCommandEvent& event )
722 {
723  DIALOG_BOARD_SETUP dlg( this );
724 
725  if( dlg.ShowModal() == wxID_OK )
726  {
727  Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_PCB, GetProjectFileParameters() );
728 
730  ReCreateAuxiliaryToolbar();
731 
732  if( IsGalCanvasActive() )
733  {
734  for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
735  GetGalCanvas()->GetView()->Update( module );
736 
737  GetGalCanvas()->Refresh();
738  }
739 
740  //this event causes the routing tool to reload its design rules information
742  m_toolManager->ProcessEvent( toolEvent );
743 
744  OnModify();
745  }
746 }
747 
748 
749 void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
750 {
752 
753  wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
754 
755  m_configSettings.Load( aCfg );
756 
757  double dtmp;
758  aCfg->Read( PlotLineWidthEntry, &dtmp, 0.1 ); // stored in mm
759  dtmp = std::max( 0.01, std::min( dtmp, 5.0 ) );
760 
761  g_DrawDefaultLineThickness = Millimeter2iu( dtmp );
762 
763  aCfg->Read( ShowMicrowaveEntry, &m_show_microwave_tools );
764  aCfg->Read( ShowLayerManagerEntry, &m_show_layer_manager_tools );
765 
766  aCfg->Read( ShowPageLimitsEntry, &m_showPageLimits );
767 }
768 
769 
770 void PCB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
771 {
772  m_configSettings.Save( aCfg );
773 
775 
776  wxConfigSaveSetups( aCfg, GetConfigurationSettings() );
777 
778  // This value is stored in mm )
779  aCfg->Write( PlotLineWidthEntry, MM_PER_IU * g_DrawDefaultLineThickness );
780  aCfg->Write( ShowMicrowaveEntry, (long) m_show_microwave_tools );
781  aCfg->Write( ShowLayerManagerEntry, (long)m_show_layer_manager_tools );
782  aCfg->Write( ShowPageLimitsEntry, m_showPageLimits );
783 }
784 
785 
787 {
788  return IsElementVisible( LAYER_GRID );
789 }
790 
791 
793 {
794  SetElementVisibility( LAYER_GRID, aVisible );
795 }
796 
797 
799 {
800  return Settings().Colors().GetItemColor( LAYER_GRID );
801 }
802 
803 
805 {
806 
807  Settings().Colors().SetItemColor( LAYER_GRID, aColor );
808 
809  if( IsGalCanvasActive() )
810  {
811  GetGalCanvas()->GetGAL()->SetGridColor( aColor );
812  }
813 }
814 
815 
817 {
818  int copperlayercnt = GetBoard()->GetCopperLayerCount( );
819  PCB_LAYER_ID currLayer = GetActiveLayer();
820 
821  if( !GetDesignSettings().m_MicroViasAllowed )
822  return false; // Obvious..
823 
824  if( copperlayercnt < 4 )
825  return false; // Only on multilayer boards..
826 
827  if( ( currLayer == B_Cu )
828  || ( currLayer == F_Cu )
829  || ( currLayer == copperlayercnt - 2 )
830  || ( currLayer == In1_Cu ) )
831  return true;
832 
833  return false;
834 }
835 
836 
838 {
840 
841  syncLayerWidgetLayer();
842 
843  if( IsGalCanvasActive() )
844  {
845  m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
846  GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
847 
848  GetGalCanvas()->SetHighContrastLayer( aLayer );
849  GetGalCanvas()->Refresh();
850  }
851 }
852 
853 
855 {
856  UpdateTitle();
857 
858  // Re-create layers manager based on layer info in board
859  ReFillLayerWidget();
860  ReCreateLayerBox();
861 
862  // Sync layer and item visibility
863  syncLayerVisibilities();
864  syncLayerWidgetLayer();
865  syncRenderStates();
866 
867  // Update the tracks / vias available sizes list:
868  ReCreateAuxiliaryToolbar();
869 
870  // Update the RATSNEST items, which were not loaded at the time
871  // BOARD::SetVisibleElements() was called from within any PLUGIN.
872  // See case LAYER_RATSNEST: in BOARD::SetElementVisibility()
873  GetBoard()->SetVisibleElements( GetBoard()->GetVisibleElements() );
874 
875  // Display the loaded board:
876  Zoom_Automatique( false );
877 
878  Refresh();
879 
880  SetMsgPanel( GetBoard() );
881  SetStatusText( wxEmptyString );
882 }
883 
884 
886 {
887  m_Layers->SelectLayer( GetActiveLayer() );
888  m_Layers->OnLayerSelected();
889 }
890 
891 
893 {
894  m_Layers->ReFillRender();
895 }
896 
897 
899 {
900  m_Layers->SyncLayerVisibilities();
901  static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
902 }
903 
904 
905 void PCB_EDIT_FRAME::OnUpdateLayerAlpha( wxUpdateUIEvent & )
906 {
907  m_Layers->SyncLayerAlphaIndicators();
908 }
909 
910 
912 {
913  return GetBoard()->IsElementVisible( aElement );
914 }
915 
916 
917 void PCB_EDIT_FRAME::SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState )
918 {
919  GetGalCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
920  GetBoard()->SetElementVisibility( aElement, aNewState );
921  m_Layers->SetRenderState( aElement, aNewState );
922 }
923 
924 
926 {
928 
930  m_Layers->SetRenderState( ii, true );
931 }
932 
933 
935 {
936  // call my base class
938 
939  // update the layer manager
940  m_Layers->Freeze();
941 
942  wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_Layers );
943  pane_info.Caption( _( "Visibles" ) );
944  m_auimgr.Update();
945 
946  m_Layers->SetLayersManagerTabsText();
947  ReFillLayerWidget();
948  // m_Layers->ReFillRender(); // syncRenderStates() does this
949 
950  // upate the layer widget to match board visibility states, both layers and render columns.
951  syncLayerVisibilities();
952  syncLayerWidgetLayer();
953  syncRenderStates();
954 
955  m_Layers->Thaw();
956 
957  // pcbnew-specific toolbars
958  ReCreateMicrowaveVToolbar();
959 }
960 
961 
963 {
964  wxFileName absoluteFileName = m_lastNetListRead;
965  wxFileName pcbFileName = GetBoard()->GetFileName();
966 
967  if( !absoluteFileName.MakeAbsolute( pcbFileName.GetPath() ) || !absoluteFileName.FileExists() )
968  {
969  absoluteFileName.Clear();
970  m_lastNetListRead = wxEmptyString;
971  }
972 
973  return absoluteFileName.GetFullPath();
974 }
975 
976 
977 void PCB_EDIT_FRAME::SetLastNetListRead( const wxString& aLastNetListRead )
978 {
979  wxFileName relativeFileName = aLastNetListRead;
980  wxFileName pcbFileName = GetBoard()->GetFileName();
981 
982  if( relativeFileName.MakeRelativeTo( pcbFileName.GetPath() )
983  && relativeFileName.GetFullPath() != aLastNetListRead )
984  {
985  m_lastNetListRead = relativeFileName.GetFullPath();
986  }
987 }
988 
989 
991 {
993 
994  Update3DView();
995 
996  m_ZoneFillsDirty = true;
997 }
998 
999 
1000 void PCB_EDIT_FRAME::ExportSVG( wxCommandEvent& event )
1001 {
1002  InvokeExportSVG( this, GetBoard() );
1003 }
1004 
1005 
1007 {
1008  wxFileName fileName = GetBoard()->GetFileName();
1009  wxString fileinfo;
1010 
1011  if( fileName.IsOk() && fileName.FileExists() )
1012  fileinfo = fileName.IsFileWritable() ? wxString( wxEmptyString ) : _( " [Read Only]" );
1013  else
1014  fileinfo = _( " [Unsaved]" );
1015 
1016  SetTitle( wxString::Format( _( "Pcbnew" ) + wxT( " \u2014 %s%s" ),
1017  fileName.GetFullPath(),
1018  fileinfo ) );
1019 }
1020 
1021 
1023 {
1024  // Update the layer manager and other widgets from the board setup
1025  // (layer and items visibility, colors ...)
1026 
1027  // Rebuild list of nets (full ratsnest rebuild)
1028  Compile_Ratsnest( NULL, true );
1030 
1031  // Update info shown by the horizontal toolbars
1032  ReCreateLayerBox();
1033 
1034  // Update the layer manager
1035  m_Layers->Freeze();
1036  ReFillLayerWidget();
1037  // m_Layers->ReFillRender(); // syncRenderStates() does this
1038 
1039  // upate the layer widget to match board visibility states, both layers and render columns.
1040  syncLayerVisibilities();
1041  syncLayerWidgetLayer();
1042  syncRenderStates();
1043 
1044  m_Layers->Thaw();
1045 }
1046 
1047 
1048 #if defined( KICAD_SCRIPTING_WXPYTHON )
1049 
1050 void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent )
1051 {
1052 
1053  wxWindow * pythonPanelFrame = findPythonConsole();
1054  bool pythonPanelShown = true;
1055 
1056  if( pythonPanelFrame == NULL )
1057  pythonPanelFrame = CreatePythonShellWindow( this, pythonConsoleNameId() );
1058  else
1059  pythonPanelShown = ! pythonPanelFrame->IsShown();
1060 
1061  if( pythonPanelFrame )
1062  pythonPanelFrame->Show( pythonPanelShown );
1063  else
1064  wxMessageBox( wxT( "Error: unable to create the Python Console" ) );
1065 }
1066 #endif
1067 
1068 
1069 void PCB_EDIT_FRAME::OnLayerColorChange( wxCommandEvent& aEvent )
1070 {
1071  ReCreateLayerBox();
1072 }
1073 
1074 
1075 void PCB_EDIT_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent )
1076 {
1077  // switches currently used canvas (default / Cairo / OpenGL).
1079 
1080  // The base class method *does not reinit* the layers manager.
1081  // We must upate the layer widget to match board visibility states,
1082  // both layers and render columns.
1083  syncLayerVisibilities();
1084  syncLayerWidgetLayer();
1085  syncRenderStates();
1086 }
1087 
1088 void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
1089 {
1090  // Force rebuild the dialog if currently open because the old dialog can be not up to date
1091  // if the board (or units) has changed
1092  wxWindow* dlg = wxWindow::FindWindowByName( DLG_WINDOW_NAME );
1093 
1094  if( dlg )
1095  dlg->Destroy();
1096 
1097  dlg = new DIALOG_PLOT( this );
1098  dlg->Show( true );
1099 }
1100 
1101 
1102 bool PCB_EDIT_FRAME::SetCurrentNetClass( const wxString& aNetClassName )
1103 {
1104  bool change = GetDesignSettings().SetCurrentNetClass( aNetClassName );
1105 
1106  if( change )
1107  {
1108  ReCreateAuxiliaryToolbar();
1109  }
1110 
1111  return change;
1112 }
1113 
1114 
1115 void PCB_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
1116 {
1117  DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() );
1118  dlg.ShowModal();
1119 }
1120 
1121 
1122 void PCB_EDIT_FRAME::OnUpdatePCBFromSch( wxCommandEvent& event )
1123 {
1124  if( Kiface().IsSingle() )
1125  {
1126  DisplayError( this, _( "Cannot update the PCB, because Pcbnew is "
1127  "opened in stand-alone mode. In order to create or update "
1128  "PCBs from schematics, you need to launch the KiCad project manager "
1129  "and create a PCB project." ) );
1130  return;
1131  }
1132  else
1133  {
1134  // Update PCB requires a netlist. Therefore the schematic editor must be running
1135  // If this is not the case, open the schematic editor
1136  KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, true );
1137 
1138  if( !frame->IsShown() )
1139  {
1140  wxFileName schfn( Prj().GetProjectPath(), Prj().GetProjectName(), SchematicFileExtension );
1141 
1142  frame->OpenProjectFiles( std::vector<wxString>( 1, schfn.GetFullPath() ) );
1143  // Because the schematic editor frame is not on screen, iconize it:
1144  // However, another valid option is to do not iconize the schematic editor frame
1145  // and show it
1146  frame->Iconize( true );
1147  // we show the schematic editor frame, because do not show is seen as
1148  // a not yet opened schematic by Kicad manager, which is not the case
1149  frame->Show( true );
1150  }
1151 
1153  }
1154 }
1155 
1156 
1157 void PCB_EDIT_FRAME::OnRunEeschema( wxCommandEvent& event )
1158 {
1159  wxString msg;
1160  wxFileName schfn( Prj().GetProjectPath(), Prj().GetProjectName(), SchematicFileExtension );
1161 
1162  if( !schfn.FileExists() )
1163  {
1164  msg.Printf( _( "Schematic file \"%s\" not found." ), schfn.GetFullPath() );
1165  wxMessageBox( msg, _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
1166  return;
1167  }
1168 
1169  if( Kiface().IsSingle() )
1170  {
1171  wxString filename = wxT( "\"" ) + schfn.GetFullPath( wxPATH_NATIVE ) + wxT( "\"" );
1172  ExecuteFile( this, EESCHEMA_EXE, filename );
1173  }
1174  else
1175  {
1176  KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, false );
1177 
1178  // Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls
1179  // Kiway.Player( FRAME_SCH, true )
1180  // therefore, the schematic editor is sometimes running, but the schematic project
1181  // is not loaded, if the library editor was called, and the dialog field editor was used.
1182  // On linux, it happens the first time the schematic editor is launched, if
1183  // library editor was running, and the dialog field editor was open
1184  // On Windows, it happens always after the library editor was called,
1185  // and the dialog field editor was used
1186  if( !frame )
1187  {
1188  try
1189  {
1190  frame = Kiway().Player( FRAME_SCH, true );
1191  }
1192  catch( const IO_ERROR& err )
1193  {
1194  wxMessageBox( _( "Eeschema failed to load:\n" ) + err.What(),
1195  _( "KiCad Error" ), wxOK | wxICON_ERROR, this );
1196  return;
1197  }
1198  }
1199 
1200  if( !frame->IsShown() ) // the frame exists, (created by the dialog field editor)
1201  // but no project loaded.
1202  {
1203  frame->OpenProjectFiles( std::vector<wxString>( 1, schfn.GetFullPath() ) );
1204  frame->Show( true );
1205  }
1206 
1207  // On Windows, Raise() does not bring the window on screen, when iconized or not shown
1208  // On linux, Raise() brings the window on screen, but this code works fine
1209  if( frame->IsIconized() )
1210  {
1211  frame->Iconize( false );
1212  // If an iconized frame was created by Pcbnew, Iconize( false ) is not enough
1213  // to show the frame at its normal size: Maximize should be called.
1214  frame->Maximize( false );
1215  }
1216 
1217  frame->Raise();
1218  }
1219 }
1220 
1221 
1222 void PCB_EDIT_FRAME::OnFlipPcbView( wxCommandEvent& evt )
1223 {
1224  auto view = GetGalCanvas()->GetView();
1225  view->SetMirror( evt.IsChecked(), false );
1226  view->RecacheAllItems();
1227  Refresh();
1228 }
1229 
1230 
1232 {
1233  // Reload Python plugins if they are newer than
1234  // the already loaded, and load new plugins
1235 #if defined(KICAD_SCRIPTING)
1236  //Reload plugin list: reload Python plugins if they are newer than
1237  // the already loaded, and load new plugins
1239 
1240  #if defined(KICAD_SCRIPTING_ACTION_MENU)
1241  // Action plugins can be modified, therefore the plugins menu
1242  // must be updated:
1243  RebuildActionPluginMenus();
1244  // Recreate top toolbar to add action plugin buttons
1245  ReCreateHToolbar();
1246  #endif
1247 #endif
1248 }
1249 
1250 
1252 {
1253  if( Module == NULL )
1254  return;
1255 
1256 #ifdef __WXMAC__
1257  // avoid Avoid "writes" in the dialog, creates errors with WxOverlay and NSView & Modal
1258  // Raising an Exception - Fixes #764678
1259  DC = NULL;
1260 #endif
1261 
1262  DIALOG_FOOTPRINT_BOARD_EDITOR* dlg = new DIALOG_FOOTPRINT_BOARD_EDITOR( this, Module, DC );
1263 
1264  int retvalue = dlg->ShowModal();
1265  /* retvalue =
1266  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_WANT_UPDATE_FP if update footprint
1267  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_WANT_EXCHANGE_FP if change footprint
1268  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_WANT_MODEDIT for a goto editor command
1269  * FP_PRM_EDITOR_RETVALUE::PRM_EDITOR_EDIT_OK for normal edit
1270  */
1271 
1272  dlg->Close();
1273  dlg->Destroy();
1274 
1276  {
1277 #ifdef __WXMAC__
1278  // If something edited, push a refresh request
1279  m_canvas->Refresh();
1280 #endif
1281  }
1283  {
1285 
1286  editor->Load_Module_From_BOARD( Module );
1287  SetCurItem( NULL );
1288 
1289  editor->Show( true );
1290  editor->Raise(); // Iconize( false );
1291  }
1292 
1294  {
1296 
1297  editor->LoadModuleFromLibrary( Module->GetFPID() );
1298  SetCurItem( NULL );
1299 
1300  editor->Show( true );
1301  editor->Raise(); // Iconize( false );
1302  }
1303 
1305  {
1306  InstallExchangeModuleFrame( Module, true, true );
1307  }
1308 
1310  {
1311  InstallExchangeModuleFrame( Module, false, true );
1312  }
1313 }
1314 
1315 
1317  bool selectedMode )
1318 {
1319  DIALOG_EXCHANGE_FOOTPRINTS dialog( this, aModule, updateMode, selectedMode );
1320 
1321  return dialog.ShowQuasiModal();
1322 }
1323 
1324 
1326 {
1328 
1329  ReCreateMicrowaveVToolbar();
1330 
1331  Layout();
1332  SendSizeEvent();
1333 }
1334 
1335 
1336 void PCB_EDIT_FRAME::LockModule( MODULE* aModule, bool aLocked )
1337 {
1338  const wxString ModulesMaskSelection = wxT( "*" );
1339  if( aModule )
1340  {
1341  aModule->SetLocked( aLocked );
1342  SetMsgPanel( aModule );
1343  OnModify();
1344  }
1345  else
1346  {
1347  aModule = GetBoard()->m_Modules;
1348 
1349  for( ; aModule != NULL; aModule = aModule->Next() )
1350  {
1351  if( WildCompareString( ModulesMaskSelection, aModule->GetReference() ) )
1352  {
1353  aModule->SetLocked( aLocked );
1354  OnModify();
1355  }
1356  }
1357  }
1358 }
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.
#define DIM(x)
of elements in an array
Definition: macros.h:98
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:215
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
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:123
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:193
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:237
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()
The common library.
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:553
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
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:286
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:278
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:170
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:463
pcbnew_ids
Definition: pcbnew_id.h:16
DLIST< MODULE > m_Modules
Definition: class_board.h:248
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:171
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:296
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