KiCad PCB EDA Suite
toolbars_pcb_editor.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) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2012 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 1992-2019 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 
27 #include <bitmaps.h>
28 #include <class_board.h>
29 #include <confirm.h>
30 #include <dialog_helpers.h>
31 #include <fctsys.h>
32 #include <kiface_i.h>
33 #include <memory>
34 #include <pcb_edit_frame.h>
35 #include <pcb_layer_box_selector.h>
36 #include <pcbnew.h>
37 #include <pcbnew_id.h>
38 #include <pcbnew_settings.h>
39 #include <pgm_base.h>
42 #include <tool/action_toolbar.h>
43 #include <tool/actions.h>
44 #include <tools/pcb_actions.h>
45 #include <view/view.h>
46 #include <wx/wupdlock.h>
47 
48 extern bool IsWxPythonLoaded();
49 
50 #define SEL_LAYER_HELP _( \
51  "Show active layer selections\nand select layer pair for route and place via" )
52 
53 
54 /* Data to build the layer pair indicator button */
55 static std::unique_ptr<wxBitmap> LayerPairBitmap;
56 
57 #define BM_LAYERICON_SIZE 24
59 {
60  // 0 = draw pixel with active layer color
61  // 1 = draw pixel with top layer color (top/bottom layer used inautoroute and place via)
62  // 2 = draw pixel with bottom layer color
63  // 3 = draw pixel with via color
64  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0 },
65  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0 },
66  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 },
67  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
68  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 },
69  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
70  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 },
71  { 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0 },
72  { 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 0, 1, 1, 1, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
73  { 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
74  { 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
75  { 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 1, 1, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
76  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
77  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
78  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
79  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
80  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
81  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
82  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
83  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
84  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
85  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
86 };
87 
88 
89 void PCB_EDIT_FRAME::PrepareLayerIndicator( bool aForceRebuild )
90 {
91  int ii, jj;
92  COLOR4D active_layer_color, top_color, bottom_color, via_color, background_color;
93  bool change = aForceRebuild;
94 
95  int requested_scale = Pgm().GetCommonSettings()->m_Appearance.icon_scale;
96 
97  if( m_prevIconVal.previous_requested_scale != requested_scale )
98  {
99  m_prevIconVal.previous_requested_scale = requested_scale;
100  change = true;
101  }
102 
103  active_layer_color = ColorSettings()->GetColor( GetActiveLayer() );
104 
105  if( m_prevIconVal.previous_active_layer_color != active_layer_color )
106  {
107  m_prevIconVal.previous_active_layer_color = active_layer_color;
108  change = true;
109  }
110 
111  top_color = ColorSettings()->GetColor( GetScreen()->m_Route_Layer_TOP );
112 
114  {
116  change = true;
117  }
118 
119  bottom_color = ColorSettings()->GetColor( GetScreen()->m_Route_Layer_BOTTOM );
120 
122  {
124  change = true;
125  }
126 
127  int via_type = static_cast<int>( GetDesignSettings().m_CurrentViaType );
128  via_color = ColorSettings()->GetColor( LAYER_VIAS + via_type );
129 
130  if( m_prevIconVal.previous_via_color != via_color )
131  {
132  m_prevIconVal.previous_via_color = via_color;
133  change = true;
134  }
135 
136  background_color = ColorSettings()->GetColor( LAYER_PCB_BACKGROUND );
137 
138  if( m_prevIconVal.previous_background_color != background_color )
139  {
140  m_prevIconVal.previous_background_color = background_color;
141  change = true;
142  }
143 
144  if( change || !LayerPairBitmap )
145  {
146  LayerPairBitmap = std::make_unique<wxBitmap>( 24, 24 );
147 
148  // Draw the icon, with colors according to the active layer and layer pairs for via
149  // command (change layer)
150  wxMemoryDC iconDC;
151  iconDC.SelectObject( *LayerPairBitmap );
152  wxBrush brush;
153  wxPen pen;
154  int buttonColor = -1;
155 
156  brush.SetStyle( wxBRUSHSTYLE_SOLID );
157  brush.SetColour( background_color.WithAlpha(1.0).ToColour() );
158  iconDC.SetBrush( brush );
159  iconDC.DrawRectangle( 0, 0, BM_LAYERICON_SIZE, BM_LAYERICON_SIZE );
160 
161  for( ii = 0; ii < BM_LAYERICON_SIZE; ii++ )
162  {
163  for( jj = 0; jj < BM_LAYERICON_SIZE; jj++ )
164  {
165  if( s_BitmapLayerIcon[ii][jj] != buttonColor )
166  {
167  switch( s_BitmapLayerIcon[ii][jj] )
168  {
169  default:
170  case 0: pen.SetColour( active_layer_color.ToColour() ); break;
171  case 1: pen.SetColour( top_color.ToColour() ); break;
172  case 2: pen.SetColour( bottom_color.ToColour() ); break;
173  case 3: pen.SetColour( via_color.ToColour() ); break;
174  }
175 
176  buttonColor = s_BitmapLayerIcon[ii][jj];
177  iconDC.SetPen( pen );
178  }
179 
180  iconDC.DrawPoint( jj, ii );
181  }
182  }
183 
184  // Deselect the bitmap from the DC in order to delete the MemoryDC safely without
185  // deleting the bitmap
186  iconDC.SelectObject( wxNullBitmap );
187 
188  // Scale the bitmap
189  const int scale = ( requested_scale <= 0 ) ? KiIconScale( this ) : requested_scale;
190  wxImage image = LayerPairBitmap->ConvertToImage();
191 
192  // "NEAREST" causes less mixing of colors
193  image.Rescale( scale * image.GetWidth() / 4, scale * image.GetHeight() / 4,
194  wxIMAGE_QUALITY_NEAREST );
195 
196  LayerPairBitmap = std::make_unique<wxBitmap>( image );
197  }
198 
199  if( m_mainToolBar )
200  {
202  m_mainToolBar->Refresh();
203  }
204 }
205 
206 
208 {
209  // Note:
210  // To rebuild the aui toolbar, the more easy way is to clear ( calling m_mainToolBar.Clear() )
211  // all wxAuiToolBarItems.
212  // However the wxAuiToolBarItems are not the owners of controls managed by
213  // them and therefore do not delete them
214  // So we do not recreate them after clearing the tools.
215 
216  wxString msg;
217 
218  wxWindowUpdateLocker dummy( this );
219 
220  if( m_mainToolBar )
221  m_mainToolBar->Clear();
222  else
223  m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
224  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
225 
226 #define ADD_TOOL( id, xpm, tooltip ) \
227  m_mainToolBar->AddTool( id, wxEmptyString, KiScaledBitmap( xpm, this ), tooltip );
228 
229  // Set up toolbar
230  if( Kiface().IsSingle() )
231  {
234  }
235 
237 
240 
245 
249 
252 
259 
263 
267 
269 
270  if( m_SelLayerBox == nullptr )
271  {
273  m_SelLayerBox->SetBoardFrame( this );
274  }
275 
276  ReCreateLayerBox( false );
277  m_mainToolBar->AddControl( m_SelLayerBox );
278 
280  PrepareLayerIndicator( true ); // Force rebuild of the bitmap with the active layer colors
281 
284 
285  // Access to the scripting console
286 #if defined(KICAD_SCRIPTING_WXPYTHON)
287  if( IsWxPythonLoaded() )
288  {
291 
292 #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
293  AddActionPluginTools();
294 #endif
295  }
296 #endif
297 
298  // after adding the buttons to the toolbar, must call Realize() to reflect the changes
299  m_mainToolBar->Realize();
300 
301 #undef ADD_TOOL
302 }
303 
304 
306 {
307  // Note:
308  // To rebuild the aui toolbar, the more easy way is to clear ( calling m_mainToolBar.Clear() )
309  // all wxAuiToolBarItems.
310  // However the wxAuiToolBarItems are not the owners of controls managed by
311  // them and therefore do not delete them
312  // So we do not recreate them after clearing the tools.
313 
314  wxWindowUpdateLocker dummy( this );
315 
316  if( m_optionsToolBar )
317  m_optionsToolBar->Clear();
318  else
320  wxDefaultPosition, wxDefaultSize,
321  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
322 
324 
329 
333 
338 
344 
345  // Tools to show/hide toolbars:
349 
351  m_optionsToolBar->Realize();
352 }
353 
354 
356 {
357  wxWindowUpdateLocker dummy( this );
358 
359  if( m_drawToolBar )
360  m_drawToolBar->Clear();
361  else
362  m_drawToolBar = new ACTION_TOOLBAR( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
363  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
364 
368 
375 
385 
390 
391  m_drawToolBar->Realize();
392 }
393 
394 
395 /* Create the auxiliary vertical right toolbar, showing tools for microwave applications
396  */
398 {
399  wxWindowUpdateLocker dummy(this);
400 
401  if( m_microWaveToolBar )
402  m_microWaveToolBar->Clear();
403  else
404  m_microWaveToolBar = new ACTION_TOOLBAR( this, ID_MICROWAVE_V_TOOLBAR, wxDefaultPosition,
405  wxDefaultSize,
406  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
407 
408  // Set up toolbar
411 
416 
417  m_microWaveToolBar->Realize();
418 }
419 
420 
422 {
423  wxWindowUpdateLocker dummy( this );
424 
425  if( m_auxiliaryToolBar )
426  {
429 
430  // combobox sizes can have changed: apply new best sizes
431  wxAuiToolBarItem* item = m_auxiliaryToolBar->FindTool( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH );
432  item->SetMinSize( m_SelTrackWidthBox->GetBestSize() );
434  item->SetMinSize( m_SelViaSizeBox->GetBestSize() );
435 
436  m_auxiliaryToolBar->Realize();
437  m_auimgr.Update();
438  return;
439  }
440 
442  wxDefaultPosition, wxDefaultSize,
443  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
444 
445  /* Set up toolbar items */
446 
447  // Creates box to display and choose tracks widths:
448  if( m_SelTrackWidthBox == nullptr )
450  wxDefaultPosition, wxDefaultSize, 0, NULL );
451 
453  m_auxiliaryToolBar->AddControl( m_SelTrackWidthBox );
454 
455  // Creates box to display and choose vias diameters:
456 
457  if( m_SelViaSizeBox == nullptr )
459  wxDefaultPosition, wxDefaultSize, 0, NULL );
460 
462  m_auxiliaryToolBar->AddControl( m_SelViaSizeBox );
464 
465  // Creates box to display and choose strategy to handle tracks an vias sizes:
468  _( "Auto track width: when starting on an existing track "
469  "use its width\notherwise, use current width setting" ),
470  wxITEM_CHECK );
471 
472  // Add the box to display and select the current grid size:
474 
475  if( m_gridSelectBox == nullptr )
477  wxDefaultPosition, wxDefaultSize, 0, NULL );
478 
480 
481  m_auxiliaryToolBar->AddControl( m_gridSelectBox );
482 
483  // Add the box to display and select the current Zoom
485 
486  if( m_zoomSelectBox == nullptr )
488  wxDefaultPosition, wxDefaultSize, 0, NULL );
489 
491  m_auxiliaryToolBar->AddControl( m_zoomSelectBox );
492 
493  // after adding the buttons to the toolbar, must call Realize()
494  m_auxiliaryToolBar->Realize();
495 }
496 
497 
498 void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, bool aEdit )
499 {
500  if( aTrackWidthSelectBox == NULL )
501  return;
502 
503  wxString msg;
504  bool mmFirst = GetUserUnits() != EDA_UNITS::INCHES;
505 
506  aTrackWidthSelectBox->Clear();
507 
508  for( unsigned ii = 0; ii < GetDesignSettings().m_TrackWidthList.size(); ii++ )
509  {
510  int size = GetDesignSettings().m_TrackWidthList[ii];
511 
512  double valueMils = To_User_Unit( EDA_UNITS::INCHES, size ) * 1000;
513  double value_mm = To_User_Unit( EDA_UNITS::MILLIMETRES, size );
514 
515  if( mmFirst )
516  msg.Printf( _( "Track: %.3f mm (%.2f mils)" ), value_mm, valueMils );
517  else
518  msg.Printf( _( "Track: %.2f mils (%.3f mm)" ), valueMils, value_mm );
519 
520  // Mark the netclass track width value (the first in list)
521  if( ii == 0 )
522  msg << wxT( " *" );
523 
524  aTrackWidthSelectBox->Append( msg );
525  }
526 
527  if( aEdit )
528  {
529  aTrackWidthSelectBox->Append( wxT( "---" ) );
530  aTrackWidthSelectBox->Append( _( "Edit pre-defined sizes..." ) );
531  }
532 
533  if( GetDesignSettings().GetTrackWidthIndex() >= GetDesignSettings().m_TrackWidthList.size() )
535 
536  aTrackWidthSelectBox->SetSelection( GetDesignSettings().GetTrackWidthIndex() );
537 }
538 
539 
540 void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, bool aEdit )
541 {
542  if( aViaSizeSelectBox == NULL )
543  return;
544 
545  aViaSizeSelectBox->Clear();
546 
547  bool mmFirst = GetUserUnits() != EDA_UNITS::INCHES;
548 
549  for( unsigned ii = 0; ii < GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
550  {
552  wxString msg, mmStr, milsStr;
553 
554  double diam = To_User_Unit( EDA_UNITS::MILLIMETRES, viaDimension.m_Diameter );
555  double hole = To_User_Unit( EDA_UNITS::MILLIMETRES, viaDimension.m_Drill );
556 
557  if( hole > 0 )
558  mmStr.Printf( _( "%.2f / %.2f mm" ), diam, hole );
559  else
560  mmStr.Printf( _( "%.2f mm" ), diam );
561 
562  diam = To_User_Unit( EDA_UNITS::INCHES, viaDimension.m_Diameter ) * 1000;
563  hole = To_User_Unit( EDA_UNITS::INCHES, viaDimension.m_Drill ) * 1000;
564 
565  if( hole > 0 )
566  milsStr.Printf( _( "%.1f / %.1f mils" ), diam, hole );
567  else
568  milsStr.Printf( _( "%.1f mils" ), diam );
569 
570  msg.Printf( _( "Via: %s (%s)" ), mmFirst ? mmStr : milsStr, mmFirst ? milsStr : mmStr );
571 
572  // Mark the netclass via size value (the first in list)
573  if( ii == 0 )
574  msg << wxT( " *" );
575 
576  aViaSizeSelectBox->Append( msg );
577  }
578 
579  if( aEdit )
580  {
581  aViaSizeSelectBox->Append( wxT( "---" ) );
582  aViaSizeSelectBox->Append( _( "Edit pre-defined sizes..." ) );
583  }
584 
585  if( GetDesignSettings().GetViaSizeIndex() >= GetDesignSettings().m_ViasDimensionsList.size() )
587 
588  aViaSizeSelectBox->SetSelection( GetDesignSettings().GetViaSizeIndex() );
589 }
590 
591 
592 void PCB_EDIT_FRAME::ReCreateLayerBox( bool aForceResizeToolbar )
593 {
594  if( m_SelLayerBox == NULL || m_mainToolBar == NULL )
595  return;
596 
597  m_SelLayerBox->SetToolTip( _( "+/- to switch" ) );
599 
600  if( aForceResizeToolbar )
601  {
602  // the layer box can have its size changed
603  // Update the aui manager, to take in account the new size
604  m_auimgr.Update();
605  }
606 }
607 
608 
610 {
611  // show auxiliary Vertical layers and visibility manager toolbar
613  m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
614  m_auimgr.Update();
615 }
616 
617 
619 {
621  m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools );
622  m_auimgr.Update();
623 }
624 
625 
626 void PCB_EDIT_FRAME::OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent )
627 {
628  if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_TRACK_WIDTH )
629  {
630  if( m_SelTrackWidthBox->GetSelection() != (int) GetDesignSettings().GetTrackWidthIndex() )
631  m_SelTrackWidthBox->SetSelection( GetDesignSettings().GetTrackWidthIndex() );
632  }
633 }
634 
635 
636 void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent )
637 {
638  if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_VIA_SIZE )
639  {
640  if( m_SelViaSizeBox->GetSelection() != (int) GetDesignSettings().GetViaSizeIndex() )
641  m_SelViaSizeBox->SetSelection( GetDesignSettings().GetViaSizeIndex() );
642  }
643 }
644 
645 
646 void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
647 {
649 }
650 
651 
653 {
654  return m_auimgr.GetPane( "LayersManager" ).IsShown();
655 }
656 
658 {
659  return m_auimgr.GetPane( "MicrowaveToolbar" ).IsShown();
660 }
661 
662 
664 {
665 #define TOGGLE_TOOL( toolbar, tool ) toolbar->Toggle( tool, IsCurrentTool( tool ) )
666 
668  return;
669 
670  auto& opts = GetDisplayOptions();
672  int zoneMode = opts.m_DisplayZonesMode;
673 
675  m_mainToolBar->Toggle( ACTIONS::undo, GetScreen() && GetScreen()->GetUndoCommandCount() > 0 );
676  m_mainToolBar->Toggle( ACTIONS::redo, GetScreen() && GetScreen()->GetRedoCommandCount() > 0 );
678 #if defined(KICAD_SCRIPTING_WXPYTHON)
679  if( IsWxPythonLoaded() )
680  {
681  wxMiniFrame* console = (wxMiniFrame *) PCB_EDIT_FRAME::findPythonConsole();
682  m_mainToolBar->Toggle( PCB_ACTIONS::showPythonConsole, console && console->IsShown() );
683  }
684 #endif
685  m_mainToolBar->Refresh();
686 
688 
694  m_optionsToolBar->Toggle( PCB_ACTIONS::showRatsnest, opts.m_ShowGlobalRatsnest );
695  m_optionsToolBar->Toggle( PCB_ACTIONS::ratsnestLineMode, opts.m_DisplayRatsnestLinesCurved );
698 
702  m_optionsToolBar->Toggle( PCB_ACTIONS::trackDisplayMode, !opts.m_DisplayPcbTrackFill );
703  m_optionsToolBar->Toggle( PCB_ACTIONS::viaDisplayMode, !opts.m_DisplayViaFill );
704  m_optionsToolBar->Toggle( PCB_ACTIONS::padDisplayMode, !opts.m_DisplayPadFill );
705  m_optionsToolBar->Toggle( ACTIONS::highContrastMode, opts.m_ContrastModeDisplay );
706  m_optionsToolBar->Refresh();
707 
727  m_drawToolBar->Refresh();
728 
734  m_microWaveToolBar->Refresh();
735 }
double To_User_Unit(EDA_UNITS aUnit, double aValue, bool aUseMils)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:95
static TOOL_ACTION drawLine
Definition: pcb_actions.h:148
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
static TOOL_ACTION placeModule
Definition: pcb_actions.h:160
ACTION_TOOLBAR.
void SetTrackWidthIndex(unsigned aIndex)
Function SetTrackWidthIndex sets the current track width list index to aIndex.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
static TOOL_ACTION selectLayerPair
Definition: pcb_actions.h:135
static TOOL_ACTION zoomInCenter
Definition: actions.h:90
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
static TOOL_ACTION pageSettings
Definition: actions.h:59
static const char s_BitmapLayerIcon[BM_LAYERICON_SIZE][BM_LAYERICON_SIZE]
virtual bool IsGridVisible() const override
Function IsGridVisible()
static TOOL_ACTION drillOrigin
Definition: pcb_actions.h:414
ACTION_TOOLBAR * m_auxiliaryToolBar
This file is part of the common library.
static TOOL_ACTION drawArc
Definition: pcb_actions.h:151
std::vector< int > m_TrackWidthList
ACTION_TOOLBAR * m_optionsToolBar
static TOOL_ACTION microwaveCreateStubArc
Definition: pcb_actions.h:392
static TOOL_ACTION ratsnestLineMode
Definition: pcb_actions.h:228
static const bool TOGGLE
static TOOL_ACTION zoomTool
Definition: actions.h:95
static TOOL_ACTION zoneDisplayOutlines
Definition: pcb_actions.h:235
void OnUpdateLayerSelectBox(wxUpdateUIEvent &aEvent)
wxChoice * m_SelViaSizeBox
static TOOL_ACTION drawZoneKeepout
Definition: pcb_actions.h:156
int KiIconScale(wxWindow *aWindow)
Return the automatic scale factor that would be used for a given window by KiScaledBitmap and KiScale...
Definition: bitmap.cpp:90
static TOOL_ACTION zoneDisplayDisable
Definition: pcb_actions.h:234
void Add(const TOOL_ACTION &aAction, bool aIsToggleEntry=false)
Function Add() Adds a TOOL_ACTION-based button to the toolbar.
static TOOL_ACTION zoomFitScreen
Definition: actions.h:93
static TOOL_ACTION drawPolygon
Definition: pcb_actions.h:149
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Re create the layer Box by clearing the old list, and building le new one, from the new layers names ...
COLOR4D WithAlpha(double aAlpha) const
Function WithAlpha Returns a colour with the same colour, but the given alpha.
Definition: color4d.h:248
static TOOL_ACTION microwaveCreateLine
Definition: pcb_actions.h:396
#define TOGGLE_TOOL(toolbar, tool)
static TOOL_ACTION showPythonConsole
Definition: pcb_actions.h:329
static TOOL_ACTION showLayersManager
Definition: pcb_actions.h:327
static TOOL_ACTION updatePcbFromSchematic
Definition: actions.h:156
Class to display a pcb layer list in a wxBitmapComboBox.
wxAuiManager m_auimgr
bool m_show_microwave_tools
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
ACTION_TOOLBAR * m_mainToolBar
void ReCreateHToolbar() override
static TOOL_ACTION print
Definition: actions.h:60
static TOOL_ACTION localRatsnestTool
Definition: pcb_actions.h:420
wxBitmap KiScaledBitmap(BITMAP_DEF aBitmap, EDA_BASE_FRAME *aWindow)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:116
static TOOL_ACTION find
Definition: actions.h:78
#define BM_LAYERICON_SIZE
wxChoice * m_SelTrackWidthBox
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use Display options are relative to...
static wxWindow * findPythonConsole()
static TOOL_ACTION imperialUnits
Definition: actions.h:139
wxChoice * m_gridSelectBox
static TOOL_ACTION placeText
Definition: pcb_actions.h:152
static TOOL_ACTION zoomOutCenter
Definition: actions.h:91
bool m_show_layer_manager_tools
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
void UpdateTrackWidthSelectBox(wxChoice *aTrackWidthSelectBox, bool aEdit=true)
void SetViaSizeIndex(unsigned aIndex)
Function SetViaSizeIndex sets the current via size list index to aIndex.
static TOOL_ACTION highlightNetTool
Definition: pcb_actions.h:411
static TOOL_ACTION measureTool
Definition: actions.h:147
static TOOL_ACTION drawDimension
Definition: pcb_actions.h:153
#define NULL
bool IsContentModified() override
Get if the current board has been modified but not saved.
static TOOL_ACTION toggleGrid
Definition: actions.h:135
unsigned GetViaSizeIndex() const
Function GetViaSizeIndex.
static TOOL_ACTION open
Definition: actions.h:53
static TOOL_ACTION showFootprintBrowser
Definition: actions.h:154
COLOR_SETTINGS * ColorSettings()
Helper to retrieve the current color settings.
static TOOL_ACTION save
Definition: actions.h:54
wxChoice * m_zoomSelectBox
static TOOL_ACTION doNew
Definition: actions.h:47
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
void ReCreateVToolbar() override
unsigned GetTrackWidthIndex() const
Function GetTrackWidthIndex.
static TOOL_ACTION togglePolarCoords
Definition: actions.h:142
Helper dialog and control classes.
static TOOL_ACTION showRatsnest
Definition: pcb_actions.h:227
ACTION_TOOLBAR * m_microWaveToolBar
The auxiliary right vertical tool bar used to access the microwave tools.
int SetLayerSelection(LAYER_NUM layer)
static TOOL_ACTION microwaveCreateGap
Definition: pcb_actions.h:388
static TOOL_ACTION plot
Definition: actions.h:61
static TOOL_ACTION drawVia
Definition: pcb_actions.h:155
static TOOL_ACTION showEeschema
Definition: pcb_actions.h:416
const BITMAP_OPAQUE auto_track_width_xpm[1]
static TOOL_ACTION placeTarget
Definition: pcb_actions.h:159
void SyncToolbars() override
Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.
static TOOL_ACTION boardSetup
Definition: pcb_actions.h:300
void UpdateGridSelectBox()
static TOOL_ACTION microwaveCreateStub
Definition: pcb_actions.h:390
void PrepareLayerIndicator(bool aForceRebuild=false)
bool IsWxPythonLoaded()
static TOOL_ACTION padDisplayMode
Definition: pcb_actions.h:230
static TOOL_ACTION drawCircle
Definition: pcb_actions.h:150
static TOOL_ACTION viaDisplayMode
Definition: pcb_actions.h:231
static TOOL_ACTION metricUnits
Definition: actions.h:140
static TOOL_ACTION redo
Definition: actions.h:68
COLOR4D GetColor(int aLayer) const
static TOOL_ACTION microwaveCreateFunctionShape
Definition: pcb_actions.h:394
static TOOL_ACTION showMicrowaveToolbar
Definition: pcb_actions.h:328
const int scale
see class PGM_BASE
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
Definition: pcb_actions.h:178
LAYER_TOOLBAR_ICON_VALUES m_prevIconVal
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION zoomRedraw
Definition: actions.h:87
void OnUpdateSelectViaSize(wxUpdateUIEvent &aEvent)
void ReCreateOptToolbar() override
void SetToolBitmap(const TOOL_ACTION &aAction, const wxBitmap &aBitmap)
Function SetToolBitmap() Updates the bitmap of a particular tool.
void Toggle(const TOOL_ACTION &aAction, bool aState)
Applies the default toggle action.
static TOOL_ACTION runDRC
Definition: pcb_actions.h:324
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
void KiScaledSeparator(wxAuiToolBar *aToolbar, EDA_BASE_FRAME *aWindow)
Add a separator to the given toolbar scaled the same way as KiScaledBitmap.
Definition: bitmap.cpp:167
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
static TOOL_ACTION deleteTool
Definition: actions.h:75
void OnUpdateSelectTrackWidth(wxUpdateUIEvent &aEvent)
static TOOL_ACTION undo
Definition: actions.h:67
void UpdateViaSizeSelectBox(wxChoice *aViaSizeSelectBox, bool aEdit=true)
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:98
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
static TOOL_ACTION gridSetOrigin
Definition: actions.h:132
void updateZoomSelectBox()
static std::unique_ptr< wxBitmap > LayerPairBitmap
static TOOL_ACTION highContrastMode
Definition: actions.h:99
static TOOL_ACTION showFootprintEditor
Definition: actions.h:155
bool m_fullscreenCursor
Fullscreen crosshair or small cross
static TOOL_ACTION drawZone
Definition: pcb_actions.h:154
void ReCreateAuxiliaryToolbar() override
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
static TOOL_ACTION trackDisplayMode
Definition: pcb_actions.h:229
static TOOL_ACTION selectionTool
Definition: actions.h:146
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40
static TOOL_ACTION zoneDisplayEnable
Definition: pcb_actions.h:233
ACTION_TOOLBAR * m_drawToolBar