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 <fctsys.h>
28 #include <kiface_i.h>
29 #include <help_common_strings.h>
30 #include <dialog_helpers.h>
31 #include <pcb_edit_frame.h>
32 #include <confirm.h>
33 #include <bitmaps.h>
34 #include <class_board.h>
35 #include <tool/action_toolbar.h>
36 #include <tool/actions.h>
37 #include <pcbnew.h>
38 #include <pcb_layer_box_selector.h>
39 #include <view/view.h>
40 #include <wx/wupdlock.h>
41 #include <memory>
42 #include <pgm_base.h>
43 #include <tools/pcb_actions.h>
44 #include <pcbnew_id.h>
45 
46 extern bool IsWxPythonLoaded();
47 
48 #define SEL_LAYER_HELP _( \
49  "Show active layer selections\nand select layer pair for route and place via" )
50 
51 
52 /* Data to build the layer pair indicator button */
53 static std::unique_ptr<wxBitmap> LayerPairBitmap;
54 
55 #define BM_LAYERICON_SIZE 24
57 {
58  // 0 = draw pixel with active layer color
59  // 1 = draw pixel with top layer color (top/bottom layer used inautoroute and place via)
60  // 2 = draw pixel with bottom layer color
61  // 3 = draw pixel with via color
62  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0 },
63  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0 },
64  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0 },
65  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
66  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 },
67  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
68  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 },
69  { 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0 },
70  { 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 0, 1, 1, 1, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
71  { 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
72  { 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
73  { 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 1, 1, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
74  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
75  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
76  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
77  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 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 };
85 
86 
87 void PCB_EDIT_FRAME::PrepareLayerIndicator( bool aForceRebuild )
88 {
89  int ii, jj;
90  COLOR4D active_layer_color, top_color, bottom_color, via_color, background_color;
91  bool change = aForceRebuild;
92 
93  int requested_scale;
94  Pgm().CommonSettings()->Read( ICON_SCALE_KEY, &requested_scale, 0 );
95 
96  if( m_prevIconVal.previous_requested_scale != requested_scale )
97  {
98  m_prevIconVal.previous_requested_scale = requested_scale;
99  change = true;
100  }
101 
102  active_layer_color = Settings().Colors().GetLayerColor( GetActiveLayer() );
103 
104  if( m_prevIconVal.previous_active_layer_color != active_layer_color )
105  {
106  m_prevIconVal.previous_active_layer_color = active_layer_color;
107  change = true;
108  }
109 
110  top_color = Settings().Colors().GetLayerColor( GetScreen()->m_Route_Layer_TOP );
111 
113  {
115  change = true;
116  }
117 
118  bottom_color = Settings().Colors().GetLayerColor( GetScreen()->m_Route_Layer_BOTTOM );
119 
121  {
123  change = true;
124  }
125 
126  int via_type = GetDesignSettings().m_CurrentViaType;
127  via_color = Settings().Colors().GetItemColor( LAYER_VIAS + via_type );
128 
129  if( m_prevIconVal.previous_via_color != via_color )
130  {
131  m_prevIconVal.previous_via_color = via_color;
132  change = true;
133  }
134 
135  background_color = Settings().Colors().GetItemColor( LAYER_PCB_BACKGROUND );
136 
137  if( m_prevIconVal.previous_background_color != background_color )
138  {
139  m_prevIconVal.previous_background_color = background_color;
140  change = true;
141  }
142 
143  if( change || !LayerPairBitmap )
144  {
145  LayerPairBitmap = std::make_unique<wxBitmap>( 24, 24 );
146 
147  // Draw the icon, with colors according to the active layer and layer pairs for via
148  // command (change layer)
149  wxMemoryDC iconDC;
150  iconDC.SelectObject( *LayerPairBitmap );
151  wxBrush brush;
152  wxPen pen;
153  int buttonColor = -1;
154 
155  brush.SetStyle( wxBRUSHSTYLE_SOLID );
156  brush.SetColour( background_color.WithAlpha(1.0).ToColour() );
157  iconDC.SetBrush( brush );
158  iconDC.DrawRectangle( 0, 0, BM_LAYERICON_SIZE, BM_LAYERICON_SIZE );
159 
160  for( ii = 0; ii < BM_LAYERICON_SIZE; ii++ )
161  {
162  for( jj = 0; jj < BM_LAYERICON_SIZE; jj++ )
163  {
164  if( s_BitmapLayerIcon[ii][jj] != buttonColor )
165  {
166  switch( s_BitmapLayerIcon[ii][jj] )
167  {
168  default:
169  case 0: pen.SetColour( active_layer_color.ToColour() ); break;
170  case 1: pen.SetColour( top_color.ToColour() ); break;
171  case 2: pen.SetColour( bottom_color.ToColour() ); break;
172  case 3: pen.SetColour( via_color.ToColour() ); break;
173  }
174 
175  buttonColor = s_BitmapLayerIcon[ii][jj];
176  iconDC.SetPen( pen );
177  }
178 
179  iconDC.DrawPoint( jj, ii );
180  }
181  }
182 
183  // Deselect the bitmap from the DC in order to delete the MemoryDC safely without
184  // deleting the bitmap
185  iconDC.SelectObject( wxNullBitmap );
186 
187  // Scale the bitmap
188  const int scale = ( requested_scale <= 0 ) ? KiIconScale( this ) : requested_scale;
189  wxImage image = LayerPairBitmap->ConvertToImage();
190 
191  // "NEAREST" causes less mixing of colors
192  image.Rescale( scale * image.GetWidth() / 4, scale * image.GetHeight() / 4,
193  wxIMAGE_QUALITY_NEAREST );
194 
195  LayerPairBitmap = std::make_unique<wxBitmap>( image );
196  }
197 
198  if( m_mainToolBar )
199  {
201  m_mainToolBar->Refresh();
202  }
203 }
204 
205 
207 {
208  // Note:
209  // To rebuild the aui toolbar, the more easy way is to clear ( calling m_mainToolBar.Clear() )
210  // all wxAuiToolBarItems.
211  // However the wxAuiToolBarItems are not the owners of controls managed by
212  // them and therefore do not delete them
213  // So we do not recreate them after clearing the tools.
214 
215  wxString msg;
216 
217  wxWindowUpdateLocker dummy( this );
218 
219  if( m_mainToolBar )
220  m_mainToolBar->Clear();
221  else
222  m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
223  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
224 
225 #define ADD_TOOL( id, xpm, tooltip ) \
226  m_mainToolBar->AddTool( id, wxEmptyString, KiScaledBitmap( xpm, this ), tooltip );
227 
228  // Set up toolbar
229  if( Kiface().IsSingle() )
230  {
233  }
234 
236 
239 
244 
248 
251 
258 
262 
266 
268 
269  if( m_SelLayerBox == nullptr )
270  {
272  m_SelLayerBox->SetBoardFrame( this );
273  }
274 
275  ReCreateLayerBox( false );
276  m_mainToolBar->AddControl( m_SelLayerBox );
277 
279  PrepareLayerIndicator( true ); // Force rebuild of the bitmap with the active layer colors
280 
283 
284  // Access to the scripting console
285 #if defined(KICAD_SCRIPTING_WXPYTHON)
286  if( IsWxPythonLoaded() )
287  {
290 
291 #if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
292  AddActionPluginTools();
293 #endif
294  }
295 #endif
296 
297  // after adding the buttons to the toolbar, must call Realize() to reflect the changes
298  m_mainToolBar->Realize();
299 
300 #undef ADD_TOOL
301 }
302 
303 
305 {
306  // Note:
307  // To rebuild the aui toolbar, the more easy way is to clear ( calling m_mainToolBar.Clear() )
308  // all wxAuiToolBarItems.
309  // However the wxAuiToolBarItems are not the owners of controls managed by
310  // them and therefore do not delete them
311  // So we do not recreate them after clearing the tools.
312 
313  wxWindowUpdateLocker dummy( this );
314 
315  if( m_optionsToolBar )
316  m_optionsToolBar->Clear();
317  else
319  wxDefaultPosition, wxDefaultSize,
320  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
321 
323 
328 
332 
337 
343 
344  // Tools to show/hide toolbars:
348 
350  m_optionsToolBar->Realize();
351 }
352 
353 
355 {
356  wxWindowUpdateLocker dummy( this );
357 
358  if( m_drawToolBar )
359  m_drawToolBar->Clear();
360  else
361  m_drawToolBar = new ACTION_TOOLBAR( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
362  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
363 
367 
374 
384 
389 
390  m_drawToolBar->Realize();
391 }
392 
393 
394 /* Create the auxiliary vertical right toolbar, showing tools for microwave applications
395  */
397 {
398  wxWindowUpdateLocker dummy(this);
399 
400  if( m_microWaveToolBar )
401  m_microWaveToolBar->Clear();
402  else
403  m_microWaveToolBar = new ACTION_TOOLBAR( this, ID_MICROWAVE_V_TOOLBAR, wxDefaultPosition,
404  wxDefaultSize,
405  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
406 
407  // Set up toolbar
410 
415 
416  m_microWaveToolBar->Realize();
417 }
418 
419 
421 {
422  wxWindowUpdateLocker dummy( this );
423 
424  if( m_auxiliaryToolBar )
425  {
428 
429  // combobox sizes can have changed: apply new best sizes
430  wxAuiToolBarItem* item = m_auxiliaryToolBar->FindTool( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH );
431  item->SetMinSize( m_SelTrackWidthBox->GetBestSize() );
433  item->SetMinSize( m_SelViaSizeBox->GetBestSize() );
434 
435  m_auxiliaryToolBar->Realize();
436  m_auimgr.Update();
437  return;
438  }
439 
441  wxDefaultPosition, wxDefaultSize,
442  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
443 
444  /* Set up toolbar items */
445 
446  // Creates box to display and choose tracks widths:
447  if( m_SelTrackWidthBox == nullptr )
449  wxDefaultPosition, wxDefaultSize, 0, NULL );
450 
452  m_auxiliaryToolBar->AddControl( m_SelTrackWidthBox );
453 
454  // Creates box to display and choose vias diameters:
455 
456  if( m_SelViaSizeBox == nullptr )
458  wxDefaultPosition, wxDefaultSize, 0, NULL );
459 
461  m_auxiliaryToolBar->AddControl( m_SelViaSizeBox );
463 
464  // Creates box to display and choose strategy to handle tracks an vias sizes:
466  KiScaledBitmap( auto_track_width_xpm, this ),
467  _( "Auto track width: when starting on an existing track "
468  "use its width\notherwise, use current width setting" ),
469  wxITEM_CHECK );
470 
471  // Add the box to display and select the current grid size:
473 
474  if( m_gridSelectBox == nullptr )
476  wxDefaultPosition, wxDefaultSize, 0, NULL );
477 
479 
480  m_auxiliaryToolBar->AddControl( m_gridSelectBox );
481 
482  // Add the box to display and select the current Zoom
484 
485  if( m_zoomSelectBox == nullptr )
487  wxDefaultPosition, wxDefaultSize, 0, NULL );
488 
490  m_auxiliaryToolBar->AddControl( m_zoomSelectBox );
491 
492  // after adding the buttons to the toolbar, must call Realize()
493  m_auxiliaryToolBar->Realize();
494 }
495 
496 
497 void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, bool aEdit )
498 {
499  if( aTrackWidthSelectBox == NULL )
500  return;
501 
502  wxString msg;
503  bool mmFirst = GetUserUnits() != INCHES;
504 
505  aTrackWidthSelectBox->Clear();
506 
507  for( unsigned ii = 0; ii < GetDesignSettings().m_TrackWidthList.size(); ii++ )
508  {
509  int size = GetDesignSettings().m_TrackWidthList[ii];
510 
511  double valueMils = To_User_Unit( INCHES, size ) * 1000;
512  double value_mm = To_User_Unit( MILLIMETRES, size );
513 
514  if( mmFirst )
515  msg.Printf( _( "Track: %.3f mm (%.2f mils)" ), value_mm, valueMils );
516  else
517  msg.Printf( _( "Track: %.2f mils (%.3f mm)" ), valueMils, value_mm );
518 
519  // Mark the netclass track width value (the first in list)
520  if( ii == 0 )
521  msg << wxT( " *" );
522 
523  aTrackWidthSelectBox->Append( msg );
524  }
525 
526  if( aEdit )
527  {
528  aTrackWidthSelectBox->Append( wxT( "---" ) );
529  aTrackWidthSelectBox->Append( _( "Edit pre-defined sizes..." ) );
530  }
531 
532  if( GetDesignSettings().GetTrackWidthIndex() >= GetDesignSettings().m_TrackWidthList.size() )
534 
535  aTrackWidthSelectBox->SetSelection( GetDesignSettings().GetTrackWidthIndex() );
536 }
537 
538 
539 void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, bool aEdit )
540 {
541  if( aViaSizeSelectBox == NULL )
542  return;
543 
544  aViaSizeSelectBox->Clear();
545 
546  bool mmFirst = GetUserUnits() != INCHES;
547 
548  for( unsigned ii = 0; ii < GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
549  {
551  wxString msg, mmStr, milsStr;
552 
553  double diam = To_User_Unit( MILLIMETRES, viaDimension.m_Diameter );
554  double hole = To_User_Unit( MILLIMETRES, viaDimension.m_Drill );
555 
556  if( hole > 0 )
557  mmStr.Printf( _( "%.2f / %.2f mm" ), diam, hole );
558  else
559  mmStr.Printf( _( "%.2f mm" ), diam );
560 
561  diam = To_User_Unit( INCHES, viaDimension.m_Diameter ) * 1000;
562  hole = To_User_Unit( INCHES, viaDimension.m_Drill ) * 1000;
563 
564  if( hole > 0 )
565  milsStr.Printf( _( "%.1f / %.1f mils" ), diam, hole );
566  else
567  milsStr.Printf( _( "%.1f mils" ), diam );
568 
569  msg.Printf( _( "Via: %s (%s)" ), mmFirst ? mmStr : milsStr, mmFirst ? milsStr : mmStr );
570 
571  // Mark the netclass via size value (the first in list)
572  if( ii == 0 )
573  msg << wxT( " *" );
574 
575  aViaSizeSelectBox->Append( msg );
576  }
577 
578  if( aEdit )
579  {
580  aViaSizeSelectBox->Append( wxT( "---" ) );
581  aViaSizeSelectBox->Append( _( "Edit pre-defined sizes..." ) );
582  }
583 
584  if( GetDesignSettings().GetViaSizeIndex() >= GetDesignSettings().m_ViasDimensionsList.size() )
586 
587  aViaSizeSelectBox->SetSelection( GetDesignSettings().GetViaSizeIndex() );
588 }
589 
590 
591 void PCB_EDIT_FRAME::ReCreateLayerBox( bool aForceResizeToolbar )
592 {
593  if( m_SelLayerBox == NULL || m_mainToolBar == NULL )
594  return;
595 
596  m_SelLayerBox->SetToolTip( _( "+/- to switch" ) );
598 
599  if( aForceResizeToolbar )
600  {
601  // the layer box can have its size changed
602  // Update the aui manager, to take in account the new size
603  m_auimgr.Update();
604  }
605 }
606 
607 
609 {
610  // show auxiliary Vertical layers and visibility manager toolbar
612  m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
613  m_auimgr.Update();
614 }
615 
616 
618 {
620  m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools );
621  m_auimgr.Update();
622 }
623 
624 
625 void PCB_EDIT_FRAME::OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent )
626 {
627  if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_TRACK_WIDTH )
628  {
629  if( m_SelTrackWidthBox->GetSelection() != (int) GetDesignSettings().GetTrackWidthIndex() )
630  m_SelTrackWidthBox->SetSelection( GetDesignSettings().GetTrackWidthIndex() );
631  }
632 }
633 
634 
635 void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent )
636 {
637  if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_VIA_SIZE )
638  {
639  if( m_SelViaSizeBox->GetSelection() != (int) GetDesignSettings().GetViaSizeIndex() )
640  m_SelViaSizeBox->SetSelection( GetDesignSettings().GetViaSizeIndex() );
641  }
642 }
643 
644 
645 void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
646 {
648 }
649 
650 
652 {
653  return m_auimgr.GetPane( "LayersManager" ).IsShown();
654 }
655 
657 {
658  return m_auimgr.GetPane( "MicrowaveToolbar" ).IsShown();
659 }
660 
661 
663 {
664 #define TOGGLE_TOOL( toolbar, tool ) toolbar->Toggle( tool, IsCurrentTool( tool ) )
665 
668  int zoneMode = opts->m_DisplayZonesMode;
669 
670  m_mainToolBar->Toggle( ACTIONS::save, GetScreen() && GetScreen()->IsModify() );
671  m_mainToolBar->Toggle( ACTIONS::undo, GetScreen() && GetScreen()->GetUndoCommandCount() > 0 );
672  m_mainToolBar->Toggle( ACTIONS::redo, GetScreen() && GetScreen()->GetRedoCommandCount() > 0 );
674 #if defined(KICAD_SCRIPTING_WXPYTHON)
675  if( IsWxPythonLoaded() )
676  {
677  wxMiniFrame* console = (wxMiniFrame *) PCB_EDIT_FRAME::findPythonConsole();
678  m_mainToolBar->Toggle( PCB_ACTIONS::showPythonConsole, console && console->IsShown() );
679  }
680 #endif
681  m_mainToolBar->Refresh();
682 
684 
694 
702  m_optionsToolBar->Refresh();
703 
723  m_drawToolBar->Refresh();
724 
730  m_microWaveToolBar->Refresh();
731 }
static TOOL_ACTION drawLine
Definition: pcb_actions.h:149
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:161
Class ACTION_TOOLBAR.
void SetTrackWidthIndex(unsigned aIndex)
Function SetTrackWidthIndex sets the current track width list index to aIndex.
VIATYPE_T m_CurrentViaType
(VIA_BLIND_BURIED, VIA_THROUGH, VIA_MICROVIA)
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
static TOOL_ACTION selectLayerPair
Definition: pcb_actions.h:136
static TOOL_ACTION zoomInCenter
Definition: actions.h:89
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]
static TOOL_ACTION drillOrigin
Definition: pcb_actions.h:410
ACTION_TOOLBAR * m_auxiliaryToolBar
This file is part of the common library.
static TOOL_ACTION drawArc
Definition: pcb_actions.h:152
std::vector< int > m_TrackWidthList
ACTION_TOOLBAR * m_optionsToolBar
static TOOL_ACTION microwaveCreateStubArc
Definition: pcb_actions.h:388
static TOOL_ACTION ratsnestLineMode
Definition: pcb_actions.h:227
static const bool TOGGLE
static TOOL_ACTION zoomTool
Definition: actions.h:94
static TOOL_ACTION zoneDisplayOutlines
Definition: pcb_actions.h:234
void OnUpdateLayerSelectBox(wxUpdateUIEvent &aEvent)
wxChoice * m_SelViaSizeBox
static TOOL_ACTION drawZoneKeepout
Definition: pcb_actions.h:157
int KiIconScale(wxWindow *aWindow)
Return the automatic scale factor that would be used for a given window by KiScaledBitmap and KiScale...
Definition: bitmap.cpp:89
static TOOL_ACTION zoneDisplayDisable
Definition: pcb_actions.h:233
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:92
static TOOL_ACTION drawPolygon
Definition: pcb_actions.h:150
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:247
static TOOL_ACTION microwaveCreateLine
Definition: pcb_actions.h:392
#define TOGGLE_TOOL(toolbar, tool)
static TOOL_ACTION showPythonConsole
Definition: pcb_actions.h:328
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
static TOOL_ACTION showLayersManager
Definition: pcb_actions.h:326
static TOOL_ACTION updatePcbFromSchematic
Definition: actions.h:152
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:416
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:77
#define BM_LAYERICON_SIZE
wxChoice * m_SelTrackWidthBox
static wxWindow * findPythonConsole()
static TOOL_ACTION imperialUnits
Definition: actions.h:135
wxChoice * m_gridSelectBox
static TOOL_ACTION placeText
Definition: pcb_actions.h:153
bool IsGridVisible() const override
Function IsGridVisible() , virtual.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:51
static TOOL_ACTION zoomOutCenter
Definition: actions.h:90
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
bool m_show_layer_manager_tools
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
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:407
static TOOL_ACTION measureTool
Definition: actions.h:143
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
static TOOL_ACTION drawDimension
Definition: pcb_actions.h:154
static TOOL_ACTION toggleGrid
Definition: actions.h:131
unsigned GetViaSizeIndex() const
Function GetViaSizeIndex.
PCB_GENERAL_SETTINGS & Settings()
static TOOL_ACTION open
Definition: actions.h:53
double To_User_Unit(EDA_UNITS_T 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:93
static TOOL_ACTION showFootprintBrowser
Definition: actions.h:150
static TOOL_ACTION save
Definition: actions.h:54
Definition: common.h:155
wxChoice * m_zoomSelectBox
static TOOL_ACTION doNew
Definition: actions.h:47
strings common to toolbars and menubar
void ReCreateVToolbar() override
unsigned GetTrackWidthIndex() const
Function GetTrackWidthIndex.
static TOOL_ACTION togglePolarCoords
Definition: actions.h:138
Helper dialog and control classes.
static TOOL_ACTION showRatsnest
Definition: pcb_actions.h:226
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:384
static TOOL_ACTION plot
Definition: actions.h:61
static TOOL_ACTION drawVia
Definition: pcb_actions.h:156
static TOOL_ACTION showEeschema
Definition: pcb_actions.h:412
#define ICON_SCALE_KEY
Definition: pgm_base.h:47
#define _(s)
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:204
static TOOL_ACTION placeTarget
Definition: pcb_actions.h:160
void SyncToolbars() override
Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.
static TOOL_ACTION boardSetup
Definition: pcb_actions.h:299
COLORS_DESIGN_SETTINGS & Colors()
void UpdateGridSelectBox()
static TOOL_ACTION microwaveCreateStub
Definition: pcb_actions.h:386
void PrepareLayerIndicator(bool aForceRebuild=false)
bool IsWxPythonLoaded()
static TOOL_ACTION padDisplayMode
Definition: pcb_actions.h:229
static TOOL_ACTION drawCircle
Definition: pcb_actions.h:151
static TOOL_ACTION viaDisplayMode
Definition: pcb_actions.h:230
static TOOL_ACTION metricUnits
Definition: actions.h:136
static TOOL_ACTION redo
Definition: actions.h:68
static TOOL_ACTION microwaveCreateFunctionShape
Definition: pcb_actions.h:390
static TOOL_ACTION showMicrowaveToolbar
Definition: pcb_actions.h:327
const int scale
see class PGM_BASE
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.
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:179
LAYER_TOOLBAR_ICON_VALUES m_prevIconVal
static TOOL_ACTION zoomRedraw
Definition: actions.h:86
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:323
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:74
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:97
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
static TOOL_ACTION gridSetOrigin
Definition: actions.h:128
void updateZoomSelectBox()
static std::unique_ptr< wxBitmap > LayerPairBitmap
static TOOL_ACTION highContrastMode
Definition: actions.h:98
static TOOL_ACTION showFootprintEditor
Definition: actions.h:151
bool m_fullscreenCursor
Fullscreen crosshair or small cross
static TOOL_ACTION drawZone
Definition: pcb_actions.h:155
void ReCreateAuxiliaryToolbar() override
static TOOL_ACTION trackDisplayMode
Definition: pcb_actions.h:228
static TOOL_ACTION selectionTool
Definition: actions.h:142
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
static TOOL_ACTION zoneDisplayEnable
Definition: pcb_actions.h:232
ACTION_TOOLBAR * m_drawToolBar