KiCad PCB EDA Suite
pcbframe.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 2013-2017 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
32 #include <fctsys.h>
33 #include <kiface_i.h>
34 #include <pgm_base.h>
35 #include <class_drawpanel.h>
36 #include <confirm.h>
37 #include <wxPcbStruct.h>
38 #include <collectors.h>
39 #include <build_version.h>
40 #include <macros.h>
42 #include <msgpanel.h>
43 #include <fp_lib_table.h>
44 #include <bitmaps.h>
45 
46 #include <pcbnew.h>
47 #include <pcbnew_id.h>
48 #include <drc_stuff.h>
49 #include <layer_widget.h>
50 #include <dialog_design_rules.h>
51 #include <class_pcb_layer_widget.h>
52 #include <hotkeys.h>
53 #include <config_params.h>
54 #include <module_editor_frame.h>
55 #include <dialog_helpers.h>
56 #include <dialog_plot.h>
58 #include <convert_to_biu.h>
59 #include <view/view.h>
60 #include <view/view_controls.h>
61 #include <pcb_painter.h>
62 #include <invoke_pcb_dialog.h>
63 
64 #include <class_track.h>
65 #include <class_board.h>
66 #include <class_module.h>
67 #include <worksheet_viewitem.h>
68 #include <connectivity.h>
69 #include <ratsnest_viewitem.h>
70 
71 #include <tool/tool_manager.h>
72 #include <tool/tool_dispatcher.h>
73 #include <tools/pcb_actions.h>
74 
76 
77 #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
78 #include <python_scripting.h>
79 #endif
80 
81 #include <pcb_draw_panel_gal.h>
83 #include <functional>
84 
85 using namespace std::placeholders;
86 
89 
90 static const wxString PlotLineWidthEntry = "PlotLineWidth_mm";
91 static const wxString MagneticPadsEntry = "PcbMagPadOpt";
92 static const wxString MagneticTracksEntry = "PcbMagTrackOpt";
93 static const wxString ShowMicrowaveEntry = "ShowMicrowaveTools";
94 static const wxString ShowLayerManagerEntry = "ShowLayerManagerTools";
95 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
96 
98 
99 
100 BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
101  EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, PCB_EDIT_FRAME::OnSockRequestServer )
102  EVT_SOCKET( ID_EDA_SOCKET_EVENT, PCB_EDIT_FRAME::OnSockRequest )
103 
104  EVT_CHOICE( ID_ON_ZOOM_SELECT, PCB_EDIT_FRAME::OnSelectZoom )
105  EVT_CHOICE( ID_ON_GRID_SELECT, PCB_EDIT_FRAME::OnSelectGrid )
106 
107  EVT_CLOSE( PCB_EDIT_FRAME::OnCloseWindow )
108  EVT_SIZE( PCB_EDIT_FRAME::OnSize )
109 
110  EVT_TOOL( ID_LOAD_FILE, PCB_EDIT_FRAME::Files_io )
113  EVT_TOOL( ID_NEW_BOARD, PCB_EDIT_FRAME::Files_io )
115  EVT_TOOL( ID_OPEN_MODULE_EDITOR, PCB_EDIT_FRAME::Process_Special_Functions )
116  EVT_TOOL( ID_OPEN_MODULE_VIEWER, PCB_EDIT_FRAME::Process_Special_Functions )
117 
118  // Menu Files:
119  EVT_MENU( ID_MAIN_MENUBAR, PCB_EDIT_FRAME::Process_Special_Functions )
121 
126  EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PCB_EDIT_FRAME::OnFileHistory )
127 
128  EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter )
129 
130  EVT_MENU( ID_GEN_EXPORT_SPECCTRA, PCB_EDIT_FRAME::ExportToSpecctra )
136 
137  EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,PCB_EDIT_FRAME::ImportSpecctraSession )
138  EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, PCB_EDIT_FRAME::ImportSpecctraDesign )
139  EVT_MENU( ID_GEN_IMPORT_DXF_FILE, PCB_EDIT_FRAME::Process_Special_Functions )
140 
141  EVT_MENU( ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
143 
144  EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit )
145 
146  // menu Config
147  EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, PCB_EDIT_FRAME::OnConfigurePcbOptions )
148  EVT_MENU( ID_PCB_LIB_TABLE_EDIT, PCB_EDIT_FRAME::Process_Config )
149  EVT_MENU( ID_PCB_LIB_WIZARD, PCB_EDIT_FRAME::Process_Config )
152  EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config )
153  EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config )
155  PCB_EDIT_FRAME::Process_Config )
158  EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config )
159  EVT_MENU( ID_PCB_LAYERS_SETUP, PCB_EDIT_FRAME::Process_Config )
160  EVT_MENU( ID_PCB_MASK_CLEARANCE, PCB_EDIT_FRAME::Process_Config )
161  EVT_MENU( ID_PCB_PAD_SETUP, PCB_EDIT_FRAME::Process_Config )
162  EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config )
163  EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config )
164  EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, PCB_EDIT_FRAME::InstallDisplayOptionsDialog )
165  EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions )
166 
167  // menu Postprocess
168  EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, PCB_EDIT_FRAME::GenFootprintsPositionFile )
169  EVT_MENU( ID_PCB_GEN_DRILL_FILE, PCB_EDIT_FRAME::InstallDrillFrame )
171  EVT_MENU( ID_PCB_GEN_CMP_FILE, PCB_EDIT_FRAME::RecreateCmpFileFromBoard )
172  EVT_MENU( ID_PCB_GEN_BOM_FILE_FROM_BOARD, PCB_EDIT_FRAME::RecreateBOMFileFromBoard )
173 
174  // menu Miscellaneous
175  EVT_MENU( ID_MENU_LIST_NETS, PCB_EDIT_FRAME::ListNetsAndSelect )
176  EVT_MENU( ID_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE, PCB_EDIT_FRAME::Process_Special_Functions )
177  EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions )
178  EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions )
179  EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions )
181  PCB_EDIT_FRAME::OnResetModuleTextSizes )
182 
183  // Menu Help
184  EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
185  EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
186  EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
187  EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
188 
189  // Menu 3D Frame
191 
192  // Switching canvases
196 
197  // Menu Get Design Rules Editor
199 
200  // Horizontal toolbar
201  EVT_TOOL( ID_RUN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
202  EVT_TOOL( ID_SHEET_SET, EDA_DRAW_FRAME::Process_PageSettings )
203  EVT_TOOL( wxID_CUT, PCB_EDIT_FRAME::Process_Special_Functions )
204  EVT_TOOL( wxID_COPY, PCB_EDIT_FRAME::Process_Special_Functions )
205  EVT_TOOL( wxID_PASTE, PCB_EDIT_FRAME::Process_Special_Functions )
206  EVT_TOOL( wxID_UNDO, PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList )
207  EVT_TOOL( wxID_REDO, PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList )
208  EVT_TOOL( wxID_PRINT, PCB_EDIT_FRAME::ToPrinter )
210  EVT_TOOL( ID_GEN_PLOT, PCB_EDIT_FRAME::Process_Special_Functions )
211  EVT_TOOL( ID_FIND_ITEMS, PCB_EDIT_FRAME::Process_Special_Functions )
212  EVT_TOOL( ID_GET_NETLIST, PCB_EDIT_FRAME::Process_Special_Functions )
213  EVT_TOOL( ID_DRC_CONTROL, PCB_EDIT_FRAME::Process_Special_Functions )
214  EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::Process_Special_Functions )
215  EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
216  EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions )
217  EVT_CHOICE( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
218  EVT_CHOICE( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
219  EVT_TOOL( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
220  EVT_TOOL( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnSelectAutoPlaceMode )
221  EVT_TOOL( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, PCB_EDIT_FRAME::Access_to_External_Tool )
222 
223 
224 #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
225  EVT_TOOL( ID_TOOLBARH_PCB_ACTION_PLUGIN_REFRESH, PCB_EDIT_FRAME::OnActionPluginRefresh )
226 #endif
227 
228 #if defined( KICAD_SCRIPTING_WXPYTHON )
229  // has meaning only with KICAD_SCRIPTING_WXPYTHON enabled
230  EVT_TOOL( ID_TOOLBARH_PCB_SCRIPTING_CONSOLE, PCB_EDIT_FRAME::ScriptingConsoleEnableDisable )
232  PCB_EDIT_FRAME::OnUpdateScriptingConsoleState )
233 #endif
234 
235  // Option toolbar
239  PCB_EDIT_FRAME::OnSelectOptionToolbar )
241  PCB_EDIT_FRAME::OnSelectOptionToolbar )
243  PCB_EDIT_FRAME::OnSelectOptionToolbar )
245  PCB_EDIT_FRAME::OnSelectOptionToolbar )
247  PCB_EDIT_FRAME::OnSelectOptionToolbar )
249  PCB_EDIT_FRAME::OnSelectOptionToolbar )
250 
251  EVT_TOOL( ID_UPDATE_PCB_FROM_SCH, PCB_EDIT_FRAME::OnUpdatePCBFromSch )
252 
254  PCB_EDIT_FRAME::OnSelectOptionToolbar )
255 
257  PCB_EDIT_FRAME::OnSelectOptionToolbar )
258 
259  // Vertical main toolbar:
261  EVT_TOOL( ID_ZOOM_SELECTION, PCB_EDIT_FRAME::OnSelectTool )
263  PCB_EDIT_FRAME::OnSelectTool )
264 
266  PCB_EDIT_FRAME::ProcessMuWaveFunctions )
267 
269  PCB_EDIT_FRAME::Process_Special_Functions )
270 
271  // Tracks and vias sizes general options
274  PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
275 
276  // popup menus
277  EVT_MENU( ID_POPUP_PCB_DELETE_TRACKSEG, PCB_EDIT_FRAME::Process_Special_Functions )
279  PCB_EDIT_FRAME::Process_Special_Functions )
280 
281  // User interface update event handlers.
282  EVT_UPDATE_UI( ID_SAVE_BOARD, PCB_EDIT_FRAME::OnUpdateSave )
283  EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::OnUpdateLayerPair )
284  EVT_UPDATE_UI( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::OnUpdateLayerSelectBox )
285  EVT_UPDATE_UI( ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnUpdateDrcEnable )
286  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_RATSNEST, PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest )
287  EVT_UPDATE_UI( ID_TB_OPTIONS_AUTO_DEL_TRACK, PCB_EDIT_FRAME::OnUpdateAutoDeleteTrack )
288  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, PCB_EDIT_FRAME::OnUpdateViaDrawMode )
289  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, PCB_EDIT_FRAME::OnUpdateTraceDrawMode )
290  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE,
291  PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode )
292  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
293  PCB_EDIT_FRAME::OnUpdateShowLayerManager )
294  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
295  PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar )
296  EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
297  EVT_UPDATE_UI( ID_ZOOM_SELECTION, PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
298  EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
299  EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
300  PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth )
301  EVT_UPDATE_UI( ID_POPUP_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth )
303  PCB_EDIT_FRAME::OnUpdateSelectCustomTrackWidth )
304  EVT_UPDATE_UI( ID_AUX_TOOLBAR_PCB_VIA_SIZE, PCB_EDIT_FRAME::OnUpdateSelectViaSize )
305  EVT_UPDATE_UI( ID_TOOLBARH_PCB_MODE_MODULE, PCB_EDIT_FRAME::OnUpdateAutoPlaceModulesMode )
306  EVT_UPDATE_UI( ID_TOOLBARH_PCB_MODE_TRACKS, PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode )
308  PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
310  PCB_EDIT_FRAME::OnUpdateSelectViaSize )
311  EVT_UPDATE_UI_RANGE( ID_PCB_HIGHLIGHT_BUTT, ID_PCB_MEASUREMENT_TOOL,
312  PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
313  EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY,
314  PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle )
315  EVT_UPDATE_UI_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
316  PCB_EDIT_FRAME::OnUpdateMuWaveToolbar )
317 
318  EVT_COMMAND( wxID_ANY, LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE, PCB_EDIT_FRAME::OnLayerColorChange )
319 END_EVENT_TABLE()
320 
321 
322 PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
323  PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB, wxT( "Pcbnew" ), wxDefaultPosition,
325 {
326  m_showBorderAndTitleBlock = true; // true to display sheet references
327  m_showAxis = false; // true to display X and Y axis
328  m_showOriginAxis = true;
329  m_showGridAxis = true;
330  m_SelTrackWidthBox = NULL;
331  m_SelViaSizeBox = NULL;
332  m_SelLayerBox = NULL;
333  m_show_microwave_tools = false;
334  m_show_layer_manager_tools = true;
335  m_hotkeysDescrList = g_Board_Editor_Hokeys_Descr;
336  m_hasAutoSave = true;
337  m_microWaveToolBar = NULL;
338 
339  m_rotationAngle = 900;
340 
341  // Create GAL canvas
342  EDA_DRAW_PANEL_GAL* galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),
343  m_FrameSize,
344  GetGalDisplayOptions(),
346 
347  SetGalCanvas( galCanvas );
348 
349  SetBoard( new BOARD() );
350 
351  // Create the PCB_LAYER_WIDGET *after* SetBoard():
352 
353  wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
354  int pointSize = font.GetPointSize();
355  int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
356 
357  // printf( "pointSize:%d 80%%:%d\n", pointSize, (pointSize*8)/10 );
358 
359  if( screenHeight <= 900 )
360  pointSize = (pointSize * 8) / 10;
361 
362  m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), pointSize );
363 
364  m_drc = new DRC( this ); // these 2 objects point to each other
365 
366  wxIcon icon;
367  icon.CopyFromBitmap( KiBitmap( icon_pcbnew_xpm ) );
368  SetIcon( icon );
369 
370  // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
371  // initialize parameters in m_LayersManager
372  LoadSettings( config() );
373 
374  SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU() ) );
375  GetScreen()->SetMaxUndoItems( m_UndoRedoCountMax );
376 
377  // PCB drawings start in the upper left corner.
378  GetScreen()->m_Center = false;
379 
380  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
381 
382  GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER );
383  GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
384 
385  if( m_canvas )
386  m_canvas->SetEnableBlockCommands( true );
387 
388  ReCreateMenuBar();
389  ReCreateHToolbar();
390  ReCreateAuxiliaryToolbar();
391  ReCreateVToolbar();
392  ReCreateOptToolbar();
393 
394  ReCreateMicrowaveVToolbar();
395 
396  m_auimgr.SetManagedWindow( this );
397 
398  EDA_PANEINFO horiz;
399  horiz.HorizontalToolbarPane();
400 
401  EDA_PANEINFO vert;
402  vert.VerticalToolbarPane();
403 
404  EDA_PANEINFO mesg;
405  mesg.MessageToolbarPane();
406 
407  // Create a wxAuiPaneInfo for the Layers Manager, not derived from the template.
408  // LAYER_WIDGET is floatable, but initially docked at far right
409  EDA_PANEINFO lyrs;
410  lyrs.LayersToolbarPane();
411  lyrs.MinSize( m_Layers->GetBestSize() ); // updated in ReFillLayerWidget
412  lyrs.BestSize( m_Layers->GetBestSize() );
413  lyrs.Caption( _( "Visibles" ) );
414  lyrs.TopDockable( false ).BottomDockable( false );
415 
416  if( m_mainToolBar ) // The main horizontal toolbar
417  {
418  m_auimgr.AddPane( m_mainToolBar,
419  wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top().Row( 0 ) );
420  }
421 
422  if( m_auxiliaryToolBar ) // the auxiliary horizontal toolbar, that shows track and via sizes, zoom ...)
423  {
424  m_auimgr.AddPane( m_auxiliaryToolBar,
425  wxAuiPaneInfo( horiz ).Name( wxT( "m_auxiliaryToolBar" ) ).Top().Row( 1 ) );
426  }
427 
428  if( m_microWaveToolBar ) // The auxiliary vertical right toolbar (currently microwave tools)
429  m_auimgr.AddPane( m_microWaveToolBar,
430  wxAuiPaneInfo( vert ).Name( wxT( "m_microWaveToolBar" ) ).
431  Right().Layer( 1 ).Position(1).Hide() );
432 
433  if( m_drawToolBar ) // The main right vertical toolbar
434  m_auimgr.AddPane( m_drawToolBar,
435  wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right().Layer( 2 ) );
436 
437  // Add the layer manager ( most right side of pcbframe )
438  m_auimgr.AddPane( m_Layers, lyrs.Name( wxT( "m_LayersManagerToolBar" ) ).Right().Layer( 3 ) );
439 
440  if( m_optionsToolBar ) // The left vertical toolbar (fast acces display options of Pcbnew)
441  {
442  m_auimgr.AddPane( m_optionsToolBar,
443  wxAuiPaneInfo( vert ).Name( wxT( "m_optionsToolBar" ) ).Left().Layer(1) );
444 
445  m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );
446  m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
447  }
448 
449  if( m_canvas )
450  m_auimgr.AddPane( m_canvas,
451  wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
452 
453  if( GetGalCanvas() )
454  m_auimgr.AddPane( (wxWindow*) GetGalCanvas(),
455  wxAuiPaneInfo().Name( wxT( "DrawFrameGal" ) ).CentrePane().Hide() );
456 
457  if( m_messagePanel )
458  m_auimgr.AddPane( m_messagePanel,
459  wxAuiPaneInfo( mesg ).Name( wxT( "MsgPanel" ) ).Bottom().Layer(10) );
460 
461  ReFillLayerWidget(); // this is near end because contents establish size
462  m_Layers->ReFillRender(); // Update colors in Render after the config is read
463  syncLayerWidgetLayer();
464 
465  m_auimgr.Update();
466 
467  setupTools();
468 
469  Zoom_Automatique( false );
470 
471  EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = loadCanvasTypeSetting();
472 
473  if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
474  {
475  if( GetGalCanvas()->SwitchBackend( canvasType ) )
476  UseGalCanvas( true );
477  }
478 
479  enableGALSpecificMenus();
480 
481  // disable Export STEP item if kicad2step does not exist
482  wxString strK2S = Pgm().GetExecutablePath();
483  #ifdef __WXMAC__
484  strK2S += "Contents/MacOS/";
485  #endif
486  wxFileName appK2S( strK2S, "kicad2step" );
487 
488  #ifdef _WIN32
489  appK2S.SetExt( "exe" );
490  #endif
491 
492  if( !appK2S.FileExists() )
493  GetMenuBar()->FindItem( ID_GEN_EXPORT_FILE_STEP )->Enable( false );
494 }
495 
496 
498 {
499  delete m_drc;
500 }
501 
502 
504 {
506 
507  if( IsGalCanvasActive() )
508  {
509  aBoard->GetConnectivity()->Build( aBoard );
510 
511  // reload the worksheet
512  SetPageSettings( aBoard->GetPageSettings() );
513  }
514 }
515 
516 
518 {
519  return m_Pcb;
520 }
521 
522 
523 void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
524 {
525  PCB_BASE_FRAME::SetPageSettings( aPageSettings );
526 
527  if( IsGalCanvasActive() )
528  {
529  PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
530 
531  // Prepare worksheet template
532  KIGFX::WORKSHEET_VIEWITEM* worksheet;
533  worksheet = new KIGFX::WORKSHEET_VIEWITEM( &m_Pcb->GetPageSettings(),
534  &m_Pcb->GetTitleBlock() );
535  worksheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
536 
537  BASE_SCREEN* screen = GetScreen();
538 
539  if( screen != NULL )
540  {
541  worksheet->SetSheetNumber( screen->m_ScreenNumber );
542  worksheet->SetSheetCount( screen->m_NumberOfScreens );
543  }
544 
545  // PCB_DRAW_PANEL_GAL takes ownership of the worksheet
546  drawPanel->SetWorksheet( worksheet );
547  }
548 }
549 
550 
552 {
553  if( GetScreen() )
554  return GetScreen()->IsSave();
555 
556  return false;
557 }
558 
559 
561 {
562  // Create the manager and dispatcher & route draw panel events to the dispatcher
563  m_toolManager = new TOOL_MANAGER;
564  m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
565  GetGalCanvas()->GetViewControls(), this );
566  m_actions = new PCB_ACTIONS();
567  m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
568 
569  // Register tools
570  m_actions->RegisterAllTools( m_toolManager );
571  m_toolManager->InitTools();
572 
573  // Run the selection tool, it is supposed to be always active
574  m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
575 }
576 
577 
579 {
580  m_Layers->ReFill();
581 
582  wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );
583 
584  wxSize bestz = m_Layers->GetBestSize();
585 
586  lyrs.MinSize( bestz );
587  lyrs.BestSize( bestz );
588  lyrs.FloatingSize( bestz );
589 
590  if( lyrs.IsDocked() )
591  m_auimgr.Update();
592  else
593  m_Layers->SetSize( bestz );
594 }
595 
596 
597 void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event )
598 {
599  Close( false );
600 }
601 
602 
603 void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
604 {
605  m_canvas->SetAbortRequest( true );
606 
607  if( GetScreen()->IsModify() )
608  {
609  wxString msg = wxString::Format( _(
610  "Save the changes in\n"
611  "'%s'\n"
612  "before closing?" ),
613  GetChars( GetBoard()->GetFileName() )
614  );
615 
616  int ii = DisplayExitDialog( this, msg );
617  switch( ii )
618  {
619  case wxID_CANCEL:
620  Event.Veto();
621  return;
622 
623  case wxID_NO:
624  break;
625 
626  case wxID_YES:
627  // save the board. if the board has no name,
628  // the ID_SAVE_BOARD_AS will actually made
629  Files_io_from_id( ID_SAVE_BOARD );
630  break;
631  }
632  }
633 
634  if( IsGalCanvasActive() )
635  {
636  // On Windows 7 / 32 bits, on OpenGL mode only, Pcbnew crashes
637  // when closing this frame if a footprint was selected, and the footprint editor called
638  // to edit this footprint, and when closing pcbnew if this footprint is still selected
639  // See https://bugs.launchpad.net/kicad/+bug/1655858
640  // I think this is certainly a OpenGL event fired after frame deletion, so this workaround
641  // avoid the crash (JPC)
642  GetGalCanvas()->SetEvtHandlerEnabled( false );
643  }
644 
645  GetGalCanvas()->StopDrawing();
646 
647  // Delete the auto save file if it exists.
648  wxFileName fn = GetBoard()->GetFileName();
649 
650  // Auto save file name is the normal file name prefixed with '_autosave'.
651  fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
652 
653  // When the auto save feature does not have write access to the board file path, it falls
654  // back to a platform specific user temporary file path.
655  if( !fn.IsOk() || !fn.IsDirWritable() )
656  fn.SetPath( wxFileName::GetTempDir() );
657 
658  wxLogTrace( traceAutoSave, "Deleting auto save file <" + fn.GetFullPath() + ">" );
659 
660  // Remove the auto save file on a normal close of Pcbnew.
661  if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
662  {
663  wxString msg = wxString::Format( _(
664  "The auto save file '%s' could not be removed!" ),
665  GetChars( fn.GetFullPath() )
666  );
667 
668  wxMessageBox( msg, Pgm().App().GetAppName(), wxOK | wxICON_ERROR, this );
669  }
670 
671  // Delete board structs and undo/redo lists, to avoid crash on exit
672  // when deleting some structs (mainly in undo/redo lists) too late
673  Clear_Pcb( false );
674 
675  // do not show the window because ScreenPcb will be deleted and we do not
676  // want any paint event
677  Show( false );
678 
679  Destroy();
680 }
681 
682 
683 void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
684 {
685  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
686 
687  if( draw3DFrame )
688  {
689  // Raising the window does not show the window on Windows if iconized.
690  // This should work on any platform.
691  if( draw3DFrame->IsIconized() )
692  draw3DFrame->Iconize( false );
693 
694  draw3DFrame->Raise();
695 
696  // Raising the window does not set the focus on Linux. This should work on any platform.
697  if( wxWindow::FindFocus() != draw3DFrame )
698  draw3DFrame->SetFocus();
699 
700  return;
701  }
702 
703  draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
704  draw3DFrame->SetDefaultFileName( GetBoard()->GetFileName() );
705  draw3DFrame->Raise(); // Needed with some Window Managers
706  draw3DFrame->Show( true );
707 }
708 
709 
710 void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
711 {
712  if( !aEnable )
713  Compile_Ratsnest( NULL, true );
714 
716 
717  if( aEnable )
718  {
719  COLORS_DESIGN_SETTINGS& cds = Settings().Colors();
720  GetGalCanvas()->GetGAL()->SetGridColor( cds.GetLayerColor( LAYER_GRID ) );
721  }
722 
723  enableGALSpecificMenus();
724 
725  // Force colors to be legacy-compatible in case they were changed in GAL
726  if( !aEnable )
727  {
728  forceColorsToLegacy();
729  Refresh();
730  }
731 
732  // Re-create the layer manager to allow arbitrary colors when GAL is enabled
734 }
735 
736 
738 {
739  COLORS_DESIGN_SETTINGS& cds = Settings().Colors();
740 
741  for( unsigned i = 0; i < DIM( cds.m_LayersColors ); i++ )
742  {
743  COLOR4D c = cds.GetLayerColor( i );
744  c.SetToNearestLegacyColor();
745  // Note the alpha chanel is not modified. Therefore the value
746  // is the previous value used in GAL canvas.
747  cds.SetLayerColor( i, c );
748  }
749 }
750 
751 
753 {
754  // some menus are active only in GAL mode and do nothing in legacy mode.
755  // So enable or disable them, depending on the display mode
756 
757  ReCreateMenuBar();
758 
759  if( GetMenuBar() )
760  {
761  // Enable / disable some menus which are usable only on GAL
762  pcbnew_ids id_list[] =
763  {
770  ID_MENU_PCB_FLIP_VIEW
771  };
772 
773  bool enbl = IsGalCanvasActive();
774 
775  for( unsigned ii = 0; ii < DIM( id_list ); ii++ )
776  {
777  if( GetMenuBar()->FindItem( id_list[ii] ) )
778  GetMenuBar()->FindItem( id_list[ii] )->Enable( enbl );
779  }
780  }
781 }
782 
783 
784 void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
785 {
786  DIALOG_DESIGN_RULES dR_editor( this );
787  int returncode = dR_editor.ShowModal();
788 
789  if( returncode == wxID_OK ) // New rules, or others changes.
790  {
791  ReCreateLayerBox();
792  ReCreateAuxiliaryToolbar();
793  OnModify();
794  }
795 }
796 
797 
798 void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
799 {
801 
802  wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
803 
804  m_configSettings.Load( aCfg );
805 
806  double dtmp;
807  aCfg->Read( PlotLineWidthEntry, &dtmp, 0.1 ); // stored in mm
808 
809  if( dtmp < 0.01 )
810  dtmp = 0.01;
811 
812  if( dtmp > 5.0 )
813  dtmp = 5.0;
814 
815  g_DrawDefaultLineThickness = Millimeter2iu( dtmp );
816 
817  aCfg->Read( ShowMicrowaveEntry, &m_show_microwave_tools );
818  aCfg->Read( ShowLayerManagerEntry, &m_show_layer_manager_tools );
819  aCfg->Read( ShowPageLimitsEntry, &m_showPageLimits );
820 }
821 
822 
823 void PCB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
824 {
825  m_configSettings.Save( aCfg );
826 
828 
829  wxConfigSaveSetups( aCfg, GetConfigurationSettings() );
830 
831  // This value is stored in mm )
832  aCfg->Write( PlotLineWidthEntry, MM_PER_IU * g_DrawDefaultLineThickness );
833  aCfg->Write( ShowMicrowaveEntry, (long) m_show_microwave_tools );
834  aCfg->Write( ShowLayerManagerEntry, (long)m_show_layer_manager_tools );
835  aCfg->Write( ShowPageLimitsEntry, m_showPageLimits );
836 }
837 
838 
840 {
841  return IsElementVisible( LAYER_GRID );
842 }
843 
844 
846 {
847  SetElementVisibility( LAYER_GRID, aVisible );
848 }
849 
850 
852 {
853  return Settings().Colors().GetItemColor( LAYER_GRID );
854 }
855 
856 
858 {
859 
860  Settings().Colors().SetItemColor( LAYER_GRID, aColor );
861 
862  if( IsGalCanvasActive() )
863  {
864  GetGalCanvas()->GetGAL()->SetGridColor( aColor );
865  }
866 }
867 
868 
870 {
871  int copperlayercnt = GetBoard()->GetCopperLayerCount( );
872  PCB_LAYER_ID currLayer = GetActiveLayer();
873 
874  if( !GetDesignSettings().m_MicroViasAllowed )
875  return false; // Obvious..
876 
877  if( copperlayercnt < 4 )
878  return false; // Only on multilayer boards..
879 
880  if( ( currLayer == B_Cu )
881  || ( currLayer == F_Cu )
882  || ( currLayer == copperlayercnt - 2 )
883  || ( currLayer == In1_Cu ) )
884  return true;
885 
886  return false;
887 }
888 
889 
891 {
893 
894  syncLayerWidgetLayer();
895 
896  if( IsGalCanvasActive() )
897  {
898  m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
899  GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
900 
901  GetGalCanvas()->SetHighContrastLayer( aLayer );
902  GetGalCanvas()->Refresh();
903  }
904 }
905 
906 
908 {
909  m_Layers->SelectLayer( GetActiveLayer() );
910  m_Layers->OnLayerSelected();
911 }
912 
913 
915 {
916  m_Layers->SyncRenderStates();
917 }
918 
919 
921 {
922  m_Layers->SyncLayerVisibilities();
923  static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
924 }
925 
926 
928 {
929  PCB_BASE_FRAME::unitsChangeRefresh(); // Update the grid size select box.
930 
931  ReCreateAuxiliaryToolbar();
932 }
933 
934 
936 {
937  return GetBoard()->IsElementVisible( aElement );
938 }
939 
940 
941 void PCB_EDIT_FRAME::SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState )
942 {
943  GetGalCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
944  GetBoard()->SetElementVisibility( aElement, aNewState );
945  m_Layers->SetRenderState( aElement, aNewState );
946 }
947 
948 
950 {
952 
954  m_Layers->SetRenderState( ii, true );
955 }
956 
957 
959 {
960  // call my base class
962 
963  m_Layers->SetLayersManagerTabsText();
964 
965  wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_Layers );
966 
967  pane_info.Caption( _( "Visibles" ) );
968  m_auimgr.Update();
969  ReFillLayerWidget();
970 }
971 
972 
974 {
975  wxFileName absoluteFileName = m_lastNetListRead;
976  wxFileName pcbFileName = GetBoard()->GetFileName();
977 
978  if( !absoluteFileName.MakeAbsolute( pcbFileName.GetPath() ) || !absoluteFileName.FileExists() )
979  {
980  absoluteFileName.Clear();
981  m_lastNetListRead = wxEmptyString;
982  }
983 
984  return absoluteFileName.GetFullPath();
985 }
986 
987 
988 void PCB_EDIT_FRAME::SetLastNetListRead( const wxString& aLastNetListRead )
989 {
990  wxFileName relativeFileName = aLastNetListRead;
991  wxFileName pcbFileName = GetBoard()->GetFileName();
992 
993  if( relativeFileName.MakeRelativeTo( pcbFileName.GetPath() )
994  && relativeFileName.GetFullPath() != aLastNetListRead )
995  {
996  m_lastNetListRead = relativeFileName.GetFullPath();
997  }
998 }
999 
1000 
1002 {
1004 
1005  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
1006 
1007  if( draw3DFrame )
1008  draw3DFrame->ReloadRequest();
1009 }
1010 
1011 
1012 void PCB_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
1013 {
1014  PCB_PLOT_PARAMS plot_prms = GetPlotSettings();
1015 
1016  // we don't want dialogs knowing about complex wxFrame functions so
1017  // pass everything the dialog needs without reference to *this frame's class.
1018  if( InvokeSVGPrint( this, GetBoard(), &plot_prms ) )
1019  {
1020  if( !plot_prms.IsSameAs( GetPlotSettings(), false ) )
1021  {
1022  // First, mark board as modified only for parameters saved in file
1023  if( !plot_prms.IsSameAs( GetPlotSettings(), true ) )
1024  OnModify();
1025 
1026  // Now, save any change, for the session
1027  SetPlotSettings( plot_prms );
1028  }
1029  }
1030 }
1031 
1032 
1034 {
1035  wxFileName fileName = GetBoard()->GetFileName();
1036  wxString fileinfo;
1037 
1038  if( fileName.IsOk() && fileName.FileExists() )
1039  {
1040  fileinfo = fileName.IsFileWritable()
1041  ? wxString( wxEmptyString )
1042  : _( " [Read Only]" );
1043  }
1044  else
1045  {
1046  fileinfo = _( " [new file]" );
1047  }
1048 
1049  wxString title;
1050  title.Printf( L"Pcbnew \u2014 %s%s",
1051  fileName.GetFullPath(),
1052  fileinfo );
1053 
1054  SetTitle( title );
1055 }
1056 
1057 
1059 {
1060  // Update the layer manager and other widgets from the board setup
1061  // (layer and items visibility, colors ...)
1062 
1063  // Rebuild list of nets (full ratsnest rebuild)
1064  Compile_Ratsnest( NULL, true );
1066 
1067  // Update info shown by the horizontal toolbars
1068  ReCreateLayerBox();
1069 
1070  // Update the layer manager
1071  m_Layers->Freeze();
1072  ReFillLayerWidget();
1073  m_Layers->ReFillRender();
1074 
1075  // upate the layer widget to match board visibility states, both layers and render columns.
1076  syncLayerVisibilities();
1077  syncLayerWidgetLayer();
1078  syncRenderStates();
1079 
1080  m_Layers->Thaw();
1081 }
1082 
1083 
1084 #if defined( KICAD_SCRIPTING_WXPYTHON )
1085 
1086 void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent )
1087 {
1088 
1089  wxWindow * pythonPanelFrame = findPythonConsole();
1090  bool pythonPanelShown = true;
1091 
1092  if( pythonPanelFrame == NULL )
1093  pythonPanelFrame = CreatePythonShellWindow( this, pythonConsoleNameId() );
1094  else
1095  pythonPanelShown = ! pythonPanelFrame->IsShown();
1096 
1097  if( pythonPanelFrame )
1098  pythonPanelFrame->Show( pythonPanelShown );
1099  else
1100  wxMessageBox( wxT( "Error: unable to create the Python Console" ) );
1101 }
1102 #endif
1103 
1104 
1105 void PCB_EDIT_FRAME::OnSelectAutoPlaceMode( wxCommandEvent& aEvent )
1106 {
1107  // Automatic placement of modules and tracks is a mutually exclusive operation so
1108  // clear the other tool if one of the two is selected.
1109  // Be careful: this event function is called both by the
1110  // ID_TOOLBARH_PCB_MODE_MODULE and the ID_TOOLBARH_PCB_MODE_TRACKS tool
1111  // Therefore we should avoid a race condition when deselecting one of these tools
1112  // inside this function (seems happen on some Linux/wxWidgets versions)
1113  // when the other tool is selected
1114 
1115  switch( aEvent.GetId() )
1116  {
1117  case ID_TOOLBARH_PCB_MODE_MODULE:
1118  if( aEvent.IsChecked() &&
1119  m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
1120  {
1121  m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_TRACKS, false );
1122  }
1123  break;
1124 
1125  case ID_TOOLBARH_PCB_MODE_TRACKS:
1126  if( aEvent.IsChecked() &&
1127  m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
1128  {
1129  m_mainToolBar->ToggleTool( ID_TOOLBARH_PCB_MODE_MODULE, false );
1130  }
1131  break;
1132  }
1133 }
1134 
1135 
1136 void PCB_EDIT_FRAME::OnLayerColorChange( wxCommandEvent& aEvent )
1137 {
1138  ReCreateLayerBox();
1139 }
1140 
1141 
1142 void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
1143 {
1144  // switches currently used canvas (default / Cairo / OpenGL).
1145  PCB_BASE_FRAME::SwitchCanvas( aEvent );
1146 
1147  // The base class method reinit the layers manager.
1148  // We must upate the layer widget to match board visibility states,
1149  // both layers and render columns.
1150  syncLayerVisibilities();
1151  syncLayerWidgetLayer();
1152  syncRenderStates();
1153 }
1154 
1155 void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
1156 {
1157  DIALOG_PLOT dlg( this );
1158 
1159  dlg.ShowModal();
1160 }
1161 
1162 
1163 bool PCB_EDIT_FRAME::SetCurrentNetClass( const wxString& aNetClassName )
1164 {
1165  bool change = GetDesignSettings().SetCurrentNetClass( aNetClassName );
1166 
1167  if( change )
1168  {
1169  ReCreateAuxiliaryToolbar();
1170  }
1171 
1172  return change;
1173 }
1174 
1175 
1176 void PCB_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
1177 {
1178  Pgm().ConfigurePaths( this );
1179 }
1180 
1181 
1182 void PCB_EDIT_FRAME::OnUpdatePCBFromSch( wxCommandEvent& event )
1183 {
1184  if( Kiface().IsSingle() )
1185  {
1186  DisplayError( this, _( "Cannot update the PCB, because Pcbnew is "
1187  "opened in stand-alone mode. In order to create or update "
1188  "PCBs from schematics, you need to launch the KiCad project manager "
1189  "and create a PCB project." ) );
1190  return;
1191  }
1192  else
1193  {
1194  KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, true );
1195  wxFileName schfn( Prj().GetProjectPath(), Prj().GetProjectName(), SchematicFileExtension );
1196 
1197  if( !frame->IsVisible() )
1198  {
1199  frame->OpenProjectFiles( std::vector<wxString>( 1, schfn.GetFullPath() ) );
1200  frame->Show( false );
1201  }
1202 
1204  }
1205 }
1206 
1207 
1208 void PCB_EDIT_FRAME::OnFlipPcbView( wxCommandEvent& evt )
1209 {
1210  auto view = GetGalCanvas()->GetView();
1211  view->SetMirror( evt.IsChecked(), false );
1212  view->RecacheAllItems();
1213  Refresh();
1214 }
1215 
1216 
1218 {
1219  // Reload Python plugins if they are newer than
1220  // the already loaded, and load new plugins
1221 #if defined(KICAD_SCRIPTING)
1222  //Reload plugin list: reload Python plugins if they are newer than
1223  // the already loaded, and load new plugins
1225 
1226  #if defined(KICAD_SCRIPTING_ACTION_MENU)
1227  // Action plugins can be modified, therefore the plugins menu
1228  // must be updated:
1229  RebuildActionPluginMenus();
1230  #endif
1231 #endif
1232 }
1233 
1234 
1236 {
1237  DIALOG_EXCHANGE_MODULE dialog( this, Module );
1238 
1239  return dialog.ShowQuasiModal();
1240 }
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.
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:487
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
Definition: pcbframe.cpp:823
void syncRenderStates()
Function syncRenderStates updates the "Render" checkboxes in the layer widget according to current to...
Definition: pcbframe.cpp:914
void UpdateTitle()
Function UpdateTitle sets the main window title bar text.
Definition: pcbframe.cpp:1033
#define DIM(x)
of elements in an array
Definition: macros.h:98
virtual void SwitchCanvas(wxCommandEvent &aEvent)
switches currently used canvas (default / Cairo / OpenGL).
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Definition: wxstruct.h:55
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
Definition: pcbframe.cpp:1001
void SetPageSettings(const PAGE_INFO &aPageSettings) override
>
Definition: pcbframe.cpp:523
Definition of class FOOTPRINT_EDIT_FRAME.
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
Definition: pcbframe.cpp:941
Class that draws missing connections on a PCB.
virtual void unitsChangeRefresh() override
Function unitsChangeRefresh is called when when the units setting has changed to allow for any derive...
void syncLayerWidgetLayer()
Function syncLayerWidgetLayer updates the currently layer "selection" within the PCB_LAYER_WIDGET.
Definition: pcbframe.cpp:907
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
void OnConfigurePaths(wxCommandEvent &aEvent)
Definition: pcbframe.cpp:1176
virtual void unitsChangeRefresh() override
Function unitsChangeRefresh is called when when the units setting has changed to allow for any derive...
Definition: pcbframe.cpp:927
int InstallExchangeModuleFrame(MODULE *ExchangeModuleModule)
Definition: pcbframe.cpp:1235
void UseGalCanvas(bool aEnable) override
>
Definition: pcbframe.cpp:710
void ToPlotter(wxCommandEvent &event)
Function ToPlotter Open a dialog frame to create plot and drill files relative to the current board...
Definition: pcbframe.cpp:1155
This file is part of the common library.
VTBL_ENTRY const wxString & GetExecutablePath() const
Definition: pgm_base.h:173
void SetLastNetListRead(const wxString &aNetListFile)
Set the last net list successfully read by the net list dialog box.
Definition: pcbframe.cpp:988
Class PCB_LAYER_WIDGET is here to implement the abstract functions of LAYER_WIDGET so they may be tie...
static const wxString ShowPageLimitsEntry
Definition: pcbframe.cpp:95
VIEW_CONTROLS class definition.
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
Definition: pcbframe.cpp:798
PROJECT & Prj()
Definition: kicad.cpp:270
void SVG_Print(wxCommandEvent &event)
Function SVG_Print shows the print SVG file dialog.
Definition: pcbframe.cpp:1012
Class BOARD to handle a board.
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectTool PCB_EDIT_FRAME::Process_Special_Functions PCB_EDIT_FRAME::Process_Special_Functions EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR
static const wxString MagneticTracksEntry
Definition: pcbframe.cpp:92
int GetCopperLayerCount() const
Function GetCopperLayerCount.
void OnLayerColorChange(wxCommandEvent &aEvent)
Definition: pcbframe.cpp:1136
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
The common library.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
void SetVisibleAlls()
Function SetVisibleAlls changes the bit-mask of visible element categories and layers.
static const wxString MagneticPadsEntry
Definition: pcbframe.cpp:91
void SetLayerColor(LAYER_NUM aLayer, COLOR4D aColor)
Function SetLayerColor sets the color for aLayer which is one of the layer indices given in pcbstruct...
virtual void SetGridColor(COLOR4D aColor) override
Function SetGridColor() , virtual.
Definition: pcbframe.cpp:857
virtual void forceColorsToLegacy() override
>
Definition: pcbframe.cpp:737
EVT_MENU_RANGE(ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, PCB_EDIT_FRAME::Process_Config) EVT_MENU(ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES
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...
Definition: pcbframe.cpp:920
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectTool PCB_EDIT_FRAME::Process_Special_Functions PCB_EDIT_FRAME::Process_Special_Functions PCB_EDIT_FRAME::OnUpdateShowLayerManager PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth PCB_EDIT_FRAME::OnUpdateSelectTrackWidth EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8, PCB_EDIT_FRAME::OnUpdateSelectViaSize) EVT_UPDATE_UI_RANGE(ID_PCB_HIGHLIGHT_BUTT
void OnCloseWindow(wxCloseEvent &Event) override
Definition: pcbframe.cpp:603
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:54
EDA_PANEINFO & LayersToolbarPane()
Function LayersToolbarPane Change *this to a layers toolbar for KiCad.
Definition: wxstruct.h:539
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
Definition: pcbframe.cpp:1163
void SetVisibleAlls()
Function SetVisibleAlls Set the status of all visible element categories and layers to VISIBLE...
Definition: pcbframe.cpp:949
PCB_EDIT_FRAME::OnResetModuleTextSizes EVT_TOOL(ID_TB_OPTIONS_DRC_OFF, PCB_EDIT_FRAME::OnSelectOptionToolbar) EVT_TOOL(ID_TB_OPTIONS_SHOW_RATSNEST
Specialization of the wxAuiPaneInfo class for KiCad panels.
Definition: wxstruct.h:478
virtual bool IsGridVisible() const override
Function IsGridVisible() , virtual.
Definition: pcbframe.cpp:839
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectTool PCB_EDIT_FRAME::Process_Special_Functions PCB_EDIT_FRAME::Process_Special_Functions PCB_EDIT_FRAME::OnUpdateShowLayerManager PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth ID_POPUP_PCB_SELECT_WIDTH8
Definition: pcbframe.cpp:307
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:170
Pcbnew hotkeys.
static const wxString PlotLineWidthEntry
Definition: pcbframe.cpp:90
void UseGalCanvas(bool aEnable) override
>
This file contains miscellaneous commonly used macros and functions.
virtual bool isAutoSaveRequired() const override
Function isautoSaveRequired returns true if the board has been modified.
Definition: pcbframe.cpp:551
bool InvokeSVGPrint(wxTopLevelWindow *aCaller, BOARD *aBoard, PCB_PLOT_PARAMS *aSettings)
Function InvokeSVGPrint shows the SVG print dialog.
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EDA_BASE_FRAME::OnSelectPreferredEditor EVT_COMBOBOX(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, GERBVIEW_FRAME::OnSelectActiveLayer) EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hokeys_Descr[]
VTBL_ENTRY void ConfigurePaths(wxWindow *aParent=NULL)
Function ConfigurePaths.
Definition: pgm_base.cpp:905
Class that handles properties and drawing of worksheet layout.
Class TOOL_MANAGER.
Definition: tool_manager.h:49
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
EDA_PANEINFO & VerticalToolbarPane()
Function VerticalToolbarPane Change *this to a vertical toolbar for KiCad.
Definition: wxstruct.h:505
bool IsElementVisible(GAL_LAYER_ID aElement) const
Function IsElementVisible tests whether a given element category is visible.
Definition: pcbframe.cpp:935
static const wxString ShowLayerManagerEntry
Definition: pcbframe.cpp:94
PCB_LAYER_ID
A quick note on layer IDs:
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, KIWAY_PLAYER *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:302
COLOR4D m_LayersColors[LAYER_ID_COUNT]
Layer colors (tracks and graphic items)
void SetSheetName(const std::string &aSheetName)
Function SetSheetName() Sets the sheet name displayed in the title block.
BOARD_ITEM_CONTAINER * GetModel() const override
>
Definition: pcbframe.cpp:517
void OnSelectOptionToolbar(wxCommandEvent &event)
Definition: tool_pcb.cpp:728
void Refresh()
Update the board display after modifying it bu 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:234
int ShowQuasiModal()
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectTool EVT_TOOL_RANGE(ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD, PCB_EDIT_FRAME::ProcessMuWaveFunctions) EVT_MENU_RANGE(ID_POPUP_PCB_START_RANGE
EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER_NAME, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser) EVT_MENU_RANGE(ID_LANGUAGE_CHOICE
virtual ~PCB_EDIT_FRAME()
Definition: pcbframe.cpp:497
The common library.
Helper dialog and control classes.
void ShowChangedLanguage() override
Function ShowChangedLanguage redraws the menus and what not in current language.
Definition: pcbframe.cpp:958
virtual COLOR4D GetGridColor() override
Function GetGridColor() , virtual.
Definition: pcbframe.cpp:851
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:257
void SetSheetNumber(int aSheetNumber)
Function SetSheetNumber() Changes the sheet number displayed in the title block.
virtual void SwitchCanvas(wxCommandEvent &aEvent) override
switches currently used canvas (default / Cairo / OpenGL).
Definition: pcbframe.cpp:1142
void BuildConnectivity()
Builds or rebuilds the board connectivity database for the board, especially the list of connected it...
void OnQuit(wxCommandEvent &event)
Definition: pcbframe.cpp:597
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility, colors ...)
Definition: pcbframe.cpp:1058
int g_DrawDefaultLineThickness
Default line thickness in internal units used to draw or plot items using a default thickness line va...
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
Function SetActiveLayer will change the currently active layer to aLayer.
static const wxString ShowMicrowaveEntry
Definition: pcbframe.cpp:93
ID_POPUP_GRID_USER
Definition: draw_frame.cpp:108
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectTool PCB_EDIT_FRAME::Process_Special_Functions PCB_EDIT_FRAME::Process_Special_Functions PCB_EDIT_FRAME::OnUpdateShowLayerManager PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth PCB_EDIT_FRAME::OnUpdateSelectTrackWidth PCB_EDIT_FRAME::OnUpdateVerticalToolbar ID_PCB_MUWAVE_END_CMD
Definition: pcbframe.cpp:315
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board...
void Show3D_Frame(wxCommandEvent &event) override
Function Show3D_Frame displays the 3D view of current printed circuit board.
Definition: pcbframe.cpp:683
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file...
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:547
void ShowDesignRulesEditor(wxCommandEvent &event)
Function ShowDesignRulesEditor displays the Design Rules Editor.
Definition: pcbframe.cpp:784
Class TOOL_DISPATCHER.
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY
Definition: pcbframe.cpp:253
Class DIALOG_PLOT is the dialog to set the plot options, and create plot files in various formats...
Definition: dialog_plot.h:37
void OnSelectAutoPlaceMode(wxCommandEvent &aEvent)
Definition: pcbframe.cpp:1105
const wxString SchematicFileExtension
BOARD * GetBoard()
ID_PREFERENCES_HOTKEY_END
void enableGALSpecificMenus()
an helper function to enable some menus only active when the display is switched to GAL mode and whic...
Definition: pcbframe.cpp:752
void PythonPluginsReloadBase()
Helper function PythonPluginsReloadBase Reload Python plugins if they are newer than the already load...
Definition: pcbnew.cpp:289
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:77
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.
Definition: pcbframe.cpp:973
static TOOL_ACTION layerChanged
Definition: pcb_actions.h:267
EDA_PANEINFO & MessageToolbarPane()
Function MessageToolbarPane Change *this to a message pane for KiCad.
Definition: wxstruct.h:524
int DisplayExitDialog(wxWindow *parent, const wxString &aMessage)
Function DisplayExitDialog displays a dialog with 3 buttons: Save and Exit Cancel Exit without save...
Definition: confirm.cpp:59
Class PCB_ACTIONS.
Definition: pcb_actions.h:42
void OnUpdatePCBFromSch(wxCommandEvent &event)
Definition: pcbframe.cpp:1182
void wxConfigSaveSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigSaveSetups writes aList of PARAM_CFG_ARRAY elements to save configuration values to ...
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
see class PGM_BASE
void SetBoard(BOARD *aBoard) override
>
Definition: pcbframe.cpp:503
Declaration of the eda_3d_viewer class.
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::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectTool ID_POPUP_PCB_END_RANGE
Definition: pcbframe.cpp:268
virtual void SetGridVisibility(bool aVisible) override
Function SetGridVisibility() , virtual It may be overloaded by derived classes if you want to store/r...
Definition: pcbframe.cpp:845
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
pcbnew_ids
Definition: pcbnew_id.h:16
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
VTBL_ENTRY void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, const std::string &aPayload, wxWindow *aSource=NULL)
Function ExpressMail send aPayload to aDestination from aSource.
Definition: kiway.cpp:387
Class DRC is the Design Rule Checker, and performs all the DRC tests.
Definition: drc_stuff.h:158
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.
Definition: wxstruct.h:117
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:96
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectTool PCB_EDIT_FRAME::Process_Special_Functions ID_POPUP_GENERAL_END_RANGE
Definition: pcbframe.cpp:278
bool IsMicroViaAcceptable(void)
Function IsMicroViaAcceptable return true if a microvia can be placed on the board.
Definition: pcbframe.cpp:869
Class EDA_3D_VIEWER Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard...
Definition: eda_3d_viewer.h:50
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...
Definition: pcbframe.cpp:578
#define PCB_EDIT_FRAME_NAME
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
Definition: wxPcbStruct.h:78
Message panel definition file.
void SetDefaultFileName(const wxString &aFn)
Function SetDefaultFileName Set the default file name (eg: to be suggested to a screenshot) ...
Definition: eda_3d_viewer.h:93
void PythonPluginsReload()
Reload the Python plugins if they are newer than the already loaded, and load new plugins if any Do n...
Definition: pcbframe.cpp:1217
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)
Definition: pcbframe.cpp:1208
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
virtual void ShowChangedLanguage()
Function ShowChangedLanguage redraws the menus and what not in current language.
Definition: basicframe.cpp:261
virtual void SetActiveLayer(PCB_LAYER_ID aLayer) override
Function SetActiveLayer will change the currently active layer to aLayer and also update the PCB_LAYE...
Definition: pcbframe.cpp:890
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar ID_PCB_MEASUREMENT_TOOL
Definition: pcbframe.cpp:262
void ReloadRequest()
Request reloading the 3D view.
void setupTools()
Definition: pcbframe.cpp:560
KIWAY Kiway
const wxChar traceAutoSave[]
Flag to enable auto save feature debug tracing.
Definition: basicframe.cpp:53
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39