KiCad PCB EDA Suite
toolbars_gerber.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) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #include <fctsys.h>
23 
24 #include <common.h>
25 #include <gerbview.h>
26 #include <gerbview_frame.h>
27 #include <bitmaps.h>
28 #include <gerbview_id.h>
29 #include <hotkeys.h>
30 #include <gerber_file_image.h>
31 #include <gerber_file_image_list.h>
32 #include <gbr_layer_box_selector.h>
33 #include <DCodeSelectionbox.h>
34 #include <dialog_helpers.h>
35 #include <bitmaps.h>
36 #include <kicad_string.h>
37 #include <wx/wupdlock.h>
38 #include <tool/actions.h>
39 
41 {
42  wxString msg;
43 
44  if( m_mainToolBar )
45  m_mainToolBar->Clear();
46  else
47  m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
48  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
49 
50  // Set up toolbar
51  m_mainToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
52  KiScaledBitmap( delete_gerber_xpm, this ),
53  _( "Clear all layers" ) );
54 
55  m_mainToolBar->AddTool( ID_GERBVIEW_RELOAD_ALL, wxEmptyString,
56  KiScaledBitmap( reload2_xpm, this ),
57  _( "Reload all layers" ) );
58 
59  m_mainToolBar->AddTool( wxID_FILE, wxEmptyString, KiScaledBitmap( load_gerber_xpm, this ),
60  _( "Open Gerber file(s) on the current layer. Previous data will be deleted" ) );
61 
62  m_mainToolBar->AddTool( ID_GERBVIEW_LOAD_DRILL_FILE, wxEmptyString,
63  KiScaledBitmap( gerbview_drill_file_xpm, this ),
64  _( "Open Excellon drill file(s) on the current layer. Previous data will be deleted" ) );
65 
67  m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiScaledBitmap( print_button_xpm, this ),
68  _( "Print layers" ) );
69 
70  m_mainToolBar->AddSeparator();
76 
77 
79 
82  wxDefaultPosition, wxDefaultSize, 0, NULL );
84 
85  m_mainToolBar->AddControl( m_SelLayerBox );
86 
87  m_TextInfo = new wxTextCtrl( m_mainToolBar, wxID_ANY, wxEmptyString, wxDefaultPosition,
88  wxDefaultSize, wxTE_READONLY );
89  m_mainToolBar->AddControl( m_TextInfo );
90 
91  // after adding the buttons to the toolbar, must call Realize() to reflect the changes
92  m_mainToolBar->Realize();
93 }
94 
95 
97 {
98  wxWindowUpdateLocker dummy( this );
99  wxStaticText* text;
100 
101  if( !m_auxiliaryToolBar )
103  wxDefaultPosition, wxDefaultSize,
104  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
105 
106  // Creates box to display and choose components:
107  if( !m_SelComponentBox )
108  {
109  m_SelComponentBox = new wxChoice( m_auxiliaryToolBar,
111  m_SelComponentBox->SetToolTip( _("Highlight items belonging to this component") );
112  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Cmp: ") );
113  m_auxiliaryToolBar->AddControl( text );
114  m_auxiliaryToolBar->AddControl( m_SelComponentBox );
115  m_auxiliaryToolBar->AddSpacer( 5 );
116  }
117 
118  // Creates choice box to display net names and highlight selected:
119  if( !m_SelNetnameBox )
120  {
121  m_SelNetnameBox = new wxChoice( m_auxiliaryToolBar,
123  m_SelNetnameBox->SetToolTip( _("Highlight items belonging to this net") );
124  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Net:" ) );
125  m_auxiliaryToolBar->AddControl( text );
126  m_auxiliaryToolBar->AddControl( m_SelNetnameBox );
127  m_auxiliaryToolBar->AddSpacer( 5 );
128  }
129 
130  // Creates choice box to display aperture attributes and highlight selected:
132  {
135  m_SelAperAttributesBox->SetToolTip( _("Highlight items with this aperture attribute") );
136  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Attr:" ) );
137  m_auxiliaryToolBar->AddControl( text );
139  m_auxiliaryToolBar->AddSpacer( 5 );
140  }
141 
142  if( !m_DCodeSelector )
143  {
146  wxDefaultPosition, wxSize( 150, -1 ) );
147  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "DCode:" ) );
148  m_auxiliaryToolBar->AddControl( text );
149  m_auxiliaryToolBar->AddControl( m_DCodeSelector );
150  }
151 
152  if( !m_gridSelectBox )
153  {
156  wxDefaultPosition, wxDefaultSize, 0, nullptr );
157  m_auxiliaryToolBar->AddControl( m_gridSelectBox );
158  }
159 
160  if( !m_zoomSelectBox )
161  {
164  wxDefaultPosition, wxDefaultSize, 0, nullptr );
165  m_auxiliaryToolBar->AddControl( m_zoomSelectBox );
166  }
167 
174 
175  // combobox sizes can have changed: apply new best sizes
176  auto item = m_auxiliaryToolBar->FindTool( ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE );
177  item->SetMinSize( m_SelComponentBox->GetBestSize() );
178 
180  item->SetMinSize( m_SelNetnameBox->GetBestSize() );
181 
183  item->SetMinSize( m_SelAperAttributesBox->GetBestSize() );
184 
185  item = m_auxiliaryToolBar->FindTool( ID_ON_GRID_SELECT );
186  item->SetMinSize( m_gridSelectBox->GetBestSize() );
187 
188  item = m_auxiliaryToolBar->FindTool( ID_ON_ZOOM_SELECT );
189  item->SetMinSize( m_zoomSelectBox->GetBestSize() );
190 
191  // after adding the buttons to the toolbar, must call Realize()
192  m_auxiliaryToolBar->Realize();
193 }
194 
195 
197 {
198  if( m_drawToolBar )
199  return;
200 
201  m_drawToolBar = new ACTION_TOOLBAR( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
202  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
203 
204  m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, _( "Select item" ),
205  KiScaledBitmap( cursor_xpm, this ) );
206  m_drawToolBar->AddSeparator();
207 
208  m_drawToolBar->Realize();
209 }
210 
211 
213 {
214  if( m_optionsToolBar )
215  m_optionsToolBar->Clear();
216  else
217  m_optionsToolBar = new ACTION_TOOLBAR( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
218  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
219 
220  // TODO: these can be moved to the 'proper' vertical toolbar if and when there are
221  // actual tools to put there. That, or I'll get around to implementing configurable
222  // toolbars.
223  m_optionsToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString,
224  KiScaledBitmap( cursor_xpm, this ),
225  wxEmptyString, wxITEM_CHECK );
226 
227  m_optionsToolBar->AddTool( ID_TB_MEASUREMENT_TOOL, wxEmptyString,
228  KiScaledBitmap( measurement_xpm, this ),
229  _( "Measure distance between two points" ),
230  wxITEM_CHECK );
231 
232  m_optionsToolBar->AddSeparator();
234 
235  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
236  KiScaledBitmap( polar_coord_xpm, this ),
237  _( "Display polar coordinates" ), wxITEM_CHECK );
238 
242 
245  KiScaledBitmap( pad_sketch_xpm, this ),
246  _( "Show flashed items in outline mode" ), wxITEM_CHECK );
247 
248  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LINES_SKETCH, wxEmptyString,
249  KiScaledBitmap( showtrack_xpm, this ),
250  _( "Show lines in outline mode" ), wxITEM_CHECK );
251 
252  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString,
253  KiScaledBitmap( opt_show_polygon_xpm, this ),
254  _( "Show polygons in outline mode" ),
255  wxITEM_CHECK );
256 
257  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, wxEmptyString,
258  KiScaledBitmap( gerbview_show_negative_objects_xpm, this ),
259  _( "Show negatives objects in ghost color" ),
260  wxITEM_CHECK );
261 
262  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString,
263  KiScaledBitmap( show_dcodenumber_xpm, this ),
264  _( "Show dcode number" ), wxITEM_CHECK );
265 
266  m_optionsToolBar->AddTool( ID_TB_OPTIONS_DIFF_MODE, wxEmptyString,
267  KiScaledBitmap( gbr_select_mode2_xpm, this ),
268  _( "Show layers in diff (compare) mode" ),
269  wxITEM_CHECK );
270 
271  m_optionsToolBar->AddTool( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, wxEmptyString,
272  KiScaledBitmap( contrast_mode_xpm, this ),
273  _( "Enable high contrast display mode" ),
274  wxITEM_CHECK );
275 
276  // Tools to show/hide toolbars:
279  wxEmptyString,
280  KiScaledBitmap( layers_manager_xpm, this ),
281  _( "Show/hide the layers manager toolbar" ),
282  wxITEM_CHECK );
283 
284  m_optionsToolBar->Realize();
285 }
286 
287 
288 #define NO_SELECTION_STRING _("<No selection>")
289 
291 {
292  m_DCodeSelector->Clear();
293 
294  // Add an empty string to deselect net highlight
296 
297  int layer = GetActiveLayer();
298  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
299 
300  if( !gerber || gerber->GetDcodesCount() == 0 )
301  {
302  if( m_DCodeSelector->GetSelection() != 0 )
303  m_DCodeSelector->SetSelection( 0 );
304 
305  return;
306  }
307 
308  // Build the aperture list of the current layer, and add it to the combo box:
309  wxArrayString dcode_list;
310  wxString msg;
311  const char* units = GetUserUnits() == INCHES ? "mils" : "mm";
312  double scale = GetUserUnits() == INCHES ? IU_PER_MILS : IU_PER_MM;
313 
314  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
315  {
316  D_CODE* dcode = gerber->GetDCODE( ii + FIRST_DCODE );
317 
318  if( dcode == NULL )
319  continue;
320 
321  if( !dcode->m_InUse && !dcode->m_Defined )
322  continue;
323 
324  msg.Printf( "tool %d [%.3fx%.3f %s] %s",
325  dcode->m_Num_Dcode,
326  dcode->m_Size.y / scale, dcode->m_Size.x / scale,
327  units,
329  );
330  if( !dcode->m_AperFunction.IsEmpty() )
331  msg << ", " << dcode->m_AperFunction;
332 
333  dcode_list.Add( msg );
334  }
335 
336  m_DCodeSelector->AppendDCodeList( dcode_list );
337 
338  if( dcode_list.size() > 1 )
339  {
340  wxSize size = m_DCodeSelector->GetBestSize();
341  size.x = std::max( size.x, 100 );
342  m_DCodeSelector->SetMinSize( size );
343  m_auimgr.Update();
344  }
345 }
346 
347 
349 {
350  m_SelComponentBox->Clear();
351 
352  // Build the full list of component names from the partial lists stored in each file image
353  std::map<wxString, int> full_list;
354 
355  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
356  {
357  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
358 
359  if( gerber == NULL ) // Graphic layer not yet used
360  continue;
361 
362  full_list.insert( gerber->m_ComponentsList.begin(), gerber->m_ComponentsList.end() );
363  }
364 
365  // Add an empty string to deselect net highlight
367 
368  // Now copy the list to the choice box
369  for( auto& ii : full_list )
370  m_SelComponentBox->Append( ii.first );
371 
372  m_SelComponentBox->SetSelection( 0 );
373 }
374 
375 
377 {
378  m_SelNetnameBox->Clear();
379 
380  // Build the full list of netnames from the partial lists stored in each file image
381  std::map<wxString, int> full_list;
382 
383  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
384  {
385  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
386 
387  if( gerber == NULL ) // Graphic layer not yet used
388  continue;
389 
390  full_list.insert( gerber->m_NetnamesList.begin(), gerber->m_NetnamesList.end() );
391  }
392 
393  // Add an empty string to deselect net highlight
395 
396  // Now copy the list to the choice box
397  for( auto& ii : full_list )
398  m_SelNetnameBox->Append( UnescapeString( ii.first ) );
399 
400  m_SelNetnameBox->SetSelection( 0 );
401 }
402 
403 
405 {
406  m_SelAperAttributesBox->Clear();
407 
408  // Build the full list of netnames from the partial lists stored in each file image
409  std::map<wxString, int> full_list;
410 
411  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
412  {
413  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
414 
415  if( gerber == NULL ) // Graphic layer not yet used
416  continue;
417 
418  if( gerber->GetDcodesCount() == 0 )
419  continue;
420 
421  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
422  {
423  D_CODE* aperture = gerber->GetDCODE( ii + FIRST_DCODE );
424 
425  if( aperture == NULL )
426  continue;
427 
428  if( !aperture->m_InUse && !aperture->m_Defined )
429  continue;
430 
431  if( !aperture->m_AperFunction.IsEmpty() )
432  full_list.insert( std::make_pair( aperture->m_AperFunction, 0 ) );
433  }
434  }
435 
436  // Add an empty string to deselect net highlight
438 
439  // Now copy the list to the choice box
440  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
441  {
442  m_SelAperAttributesBox->Append( ii->first );
443  }
444 
445  m_SelAperAttributesBox->SetSelection( 0 );
446 }
447 
448 
449 void GERBVIEW_FRAME::OnUpdateDrawMode( wxUpdateUIEvent& aEvent )
450 {
451  switch( aEvent.GetId() )
452  {
454  aEvent.Check( GetDisplayMode() == 0 );
455  break;
456 
458  aEvent.Check( GetDisplayMode() == 1 );
459  break;
460 
462  aEvent.Check( GetDisplayMode() == 2 );
463  break;
464 
465  default:
466  break;
467  }
468 }
469 
470 
471 void GERBVIEW_FRAME::OnToggleCoordType( wxCommandEvent& aEvent )
472 {
474 
475  UpdateStatusBar();
476 }
477 
478 
479 void GERBVIEW_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
480 {
481  aEvent.Check( m_DisplayOptions.m_DisplayPolarCood );
482 
483  if( m_optionsToolBar )
486  _( "Turn on rectangular coordinates" ) :
487  _( "Turn on polar coordinates" ) );
488 }
489 
490 
491 void GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode( wxUpdateUIEvent& aEvent )
492 {
494 
495  if( m_optionsToolBar )
498  _( "Show flashed items in outline mode" ) :
499  _( "Show flashed items in fill mode" ) );
500 }
501 
502 
503 void GERBVIEW_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
504 {
505  aEvent.Check( !m_DisplayOptions.m_DisplayLinesFill );
506 
507  if( m_optionsToolBar )
510  _( "Show lines in outline mode" ) :
511  _( "Show lines in fill mode" ) );
512 }
513 
514 
515 void GERBVIEW_FRAME::OnUpdatePolygonDrawMode( wxUpdateUIEvent& aEvent )
516 {
517  aEvent.Check( !m_DisplayOptions.m_DisplayPolygonsFill );
518 
519  if( m_optionsToolBar )
522  _( "Show polygons in outline mode" ) :
523  _( "Show polygons in fill mode" ) );
524 }
525 
526 
527 void GERBVIEW_FRAME::OnUpdateShowDCodes( wxUpdateUIEvent& aEvent )
528 {
529  aEvent.Check( IsElementVisible( LAYER_DCODES ) );
530 
531  if( m_optionsToolBar )
532  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_DCODES,
534  _( "Hide DCodes" ) : _( "Show DCodes" ) );
535 }
536 
537 
538 void GERBVIEW_FRAME::OnUpdateShowNegativeItems( wxUpdateUIEvent& aEvent )
539 {
540  aEvent.Check( IsElementVisible( LAYER_NEGATIVE_OBJECTS ) );
541 
542  if( m_optionsToolBar )
545  _( "Show negative objects in normal color" ) :
546  _( "Show negative objects in ghost color" ) );
547 }
548 
549 
550 void GERBVIEW_FRAME::OnUpdateDiffMode( wxUpdateUIEvent& aEvent )
551 {
552  aEvent.Check( m_DisplayOptions.m_DiffMode );
553 
554  if( m_optionsToolBar )
555  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DIFF_MODE,
557  _( "Show layers in normal mode" ) :
558  _( "Show layers in differential mode" ) );
559 }
560 
561 
562 void GERBVIEW_FRAME::OnUpdateHighContrastMode( wxUpdateUIEvent& aEvent )
563 {
564  aEvent.Check( m_DisplayOptions.m_HighContrastMode );
565 
566  if( m_optionsToolBar )
569  _( "Disable high contrast mode" ) :
570  _( "Enable high contrast mode" ) );
571 }
572 
573 
574 void GERBVIEW_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
575 {
576  aEvent.Check( m_show_layer_manager_tools );
577 
578  if( m_optionsToolBar )
579  {
581  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _( "Hide layers manager" ) );
582  else
583  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _( "Show layers manager" ) );
584  }
585 }
586 
587 
588 void GERBVIEW_FRAME::OnUpdateSelectDCode( wxUpdateUIEvent& aEvent )
589 {
590  if( !m_DCodeSelector )
591  return;
592 
593  int layer = GetActiveLayer();
594  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
595  int selected = ( gerber ) ? gerber->m_Selected_Tool : 0;
596 
597  aEvent.Enable( gerber != NULL );
598 
599  if( m_DCodeSelector->GetSelectedDCodeId() != selected )
600  {
601  m_DCodeSelector->SetDCodeSelection( selected );
602  // Be sure the selection can be made. If no, set to
603  // a correct value
604  if( gerber )
606  }
607 }
608 
609 
610 void GERBVIEW_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
611 {
612  if( m_SelLayerBox->GetSelection() != GetActiveLayer() )
613  {
614  m_SelLayerBox->SetSelection( GetActiveLayer() );
615  }
616 }
617 
618 
620 {
622  m_mainToolBar->Refresh();
623 
627 
630 
631  m_optionsToolBar->Refresh();
632 }
void OnUpdateHighContrastMode(wxUpdateUIEvent &aEvent)
void OnUpdateLineDrawMode(wxUpdateUIEvent &aEvent)
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
Class ACTION_TOOLBAR.
static TOOL_ACTION zoomInCenter
Definition: actions.h:60
void OnUpdateSelectDCode(wxUpdateUIEvent &aEvent)
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:949
void UpdateStatusBar() override
Update the status bar information.
ACTION_TOOLBAR * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window.
Definition: draw_frame.h:159
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
ACTION_TOOLBAR * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:166
int GetDisplayMode()
Function GetDisplayMode.
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
static const bool TOGGLE
static TOOL_ACTION zoomTool
Definition: actions.h:65
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
virtual bool IsGridVisible() const
Definition: draw_frame.h:533
void OnUpdateFlashedItemsDrawMode(wxUpdateUIEvent &aEvent)
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE.
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
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:63
GBR_LAYER_BOX_SELECTOR * m_SelLayerBox
void SetDCodeSelection(int aDCodeId)
Function SetDCodeSelection.
void OnUpdateLayerSelectBox(wxUpdateUIEvent &aEvent)
bool m_HighContrastMode
High contrast mode (dim un-highlighted objects)
void updateNetnameListSelectBox()
wxAuiManager m_auimgr
ACTION_TOOLBAR * m_mainToolBar
Definition: draw_frame.h:156
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
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
static TOOL_ACTION imperialUnits
Definition: actions.h:102
wxChoice * m_gridSelectBox
Definition: draw_frame.h:153
static TOOL_ACTION zoomOutCenter
Definition: actions.h:61
wxChoice * m_SelNetnameBox
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
void ReCreateHToolbar() override
void updateComponentListSelectBox()
void OnUpdatePolygonDrawMode(wxUpdateUIEvent &aEvent)
bool m_Defined
false if the aperture is not defined in the header
Definition: dcode.h:104
bool m_DiffMode
Display layers in diff mode.
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectActiveLayer GERBVIEW_FRAME::OnToggleShowLayerManager GERBVIEW_FRAME::OnSelectHighlightChoice GERBVIEW_FRAME::OnUpdateShowLayerManager ID_TB_OPTIONS_SHOW_GBR_MODE_2
void OnToggleCoordType(wxCommandEvent &aEvent)
void ReCreateAuxiliaryToolbar() override
void ReCreateVToolbar() override
Function ReCreateVToolbar creates or updates the right vertical toolbar.
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
#define FIRST_DCODE
Definition: dcode.h:71
static TOOL_ACTION toggleGrid
Definition: actions.h:98
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:289
Definition: common.h:158
wxChoice * m_zoomSelectBox
Definition: draw_frame.h:154
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
int GetSelectedDCodeId()
Function GetSelectedDCodeId.
void OnUpdateDiffMode(wxUpdateUIEvent &aEvent)
static const wxChar * ShowApertureType(APERTURE_T aType)
Function ShowApertureType returns a character string telling what type of aperture type aType is.
Definition: dcode.cpp:95
Helper dialog and control classes.
bool IsElementVisible(int aLayerID) const
Function IsElementVisible tests whether a given element category is visible.
bool m_DisplayPolarCood
Option to display coordinates in status bar in X,Y or Polar coords.
void OnUpdateShowNegativeItems(wxUpdateUIEvent &aEvent)
void SyncMenusAndToolbars() override
Update the toolbars and menus (mostly settings/check buttons/checkboxes) with the current controller ...
void AppendDCodeList(const wxArrayString &aChoices)
Function AppendDCodeList.
std::map< wxString, int > m_NetnamesList
void ReCreateOptToolbar()
Create or update the left vertical toolbar (option toolbar.
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE
Definition: dcode.h:105
void OnUpdateShowDCodes(wxUpdateUIEvent &aEvent)
wxTextCtrl * m_TextInfo
DCODE_SELECTION_BOX * m_DCodeSelector
static TOOL_ACTION metricUnits
Definition: actions.h:103
void updateAperAttributesSelectBox()
wxChoice * m_SelAperAttributesBox
const int scale
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
#define max(a, b)
Definition: auxiliary.h:86
void OnUpdateDrawMode(wxUpdateUIEvent &aEvent)
static TOOL_ACTION zoomRedraw
Definition: actions.h:57
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:123
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
void OnUpdateCoordType(wxUpdateUIEvent &aEvent)
void Toggle(const TOOL_ACTION &aAction, bool aState)
#define IU_PER_MILS
Definition: plotter.cpp:134
The common library.
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
#define NO_SELECTION_STRING
wxChoice * m_SelComponentBox
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:68
bool m_show_layer_manager_tools
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
std::map< wxString, int > m_ComponentsList
bool m_fullscreenCursor
Fullscreen crosshair or small cross
int GetToolId() const
Definition: draw_frame.h:524
void OnUpdateShowLayerManager(wxUpdateUIEvent &aEvent)
ACTION_TOOLBAR * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:163