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-2018 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 
27 #include <fctsys.h>
28 
29 #include <common.h>
30 #include <gerbview.h>
31 #include <gerbview_frame.h>
32 #include <bitmaps.h>
33 #include <gerbview_id.h>
34 #include <hotkeys.h>
35 #include <gerber_file_image.h>
36 #include <gerber_file_image_list.h>
37 #include <gbr_layer_box_selector.h>
38 #include <DCodeSelectionbox.h>
39 #include <dialog_helpers.h>
40 #include <bitmaps.h>
41 
42 #include <wx/wupdlock.h>
43 
45 {
46  wxString msg;
47 
48  if( m_mainToolBar )
49  m_mainToolBar->Clear();
50  else
51  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
52  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
53 
54  // Set up toolbar
55  m_mainToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
56  KiScaledBitmap( delete_gerber_xpm, this ),
57  _( "Clear 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( ID_GERBVIEW_SET_PAGE_BORDER, wxEmptyString, KiScaledBitmap( sheetset_xpm, this ),
68  _( "Show/hide frame reference and select paper size for printing" ) );
69 
70  m_mainToolBar->AddSeparator();
71  m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiScaledBitmap( print_button_xpm, this ),
72  _( "Print layers" ) );
73 
75  msg = AddHotkeyName( _( "Redraw view" ), GerbviewHokeysDescr, HK_ZOOM_REDRAW, IS_COMMENT );
76  m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiScaledBitmap( zoom_redraw_xpm, this ), msg );
77 
78  msg = AddHotkeyName( _( "Zoom in" ), GerbviewHokeysDescr, HK_ZOOM_IN, IS_COMMENT );
79  m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiScaledBitmap( zoom_in_xpm, this ), msg );
80 
81  msg = AddHotkeyName( _( "Zoom out" ), GerbviewHokeysDescr, HK_ZOOM_OUT, IS_COMMENT );
82  m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiScaledBitmap( zoom_out_xpm, this ), msg );
83 
84  msg = AddHotkeyName( _( "Zoom to fit" ), GerbviewHokeysDescr, HK_ZOOM_AUTO, IS_COMMENT );
85  m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
86  KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg );
87 
88  m_mainToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiScaledBitmap( zoom_area_xpm, this ),
89  _( "Zoom to selection" ), wxITEM_CHECK );
90 
92 
95  wxDefaultPosition, wxDefaultSize, 0, NULL );
97 
98  m_mainToolBar->AddControl( m_SelLayerBox );
99 
100  m_TextInfo = new wxTextCtrl( m_mainToolBar, wxID_ANY, wxEmptyString, wxDefaultPosition,
101  wxDefaultSize, wxTE_READONLY );
102  m_mainToolBar->AddControl( m_TextInfo );
103 
104  // after adding the buttons to the toolbar, must call Realize() to reflect the changes
105  m_mainToolBar->Realize();
106 }
107 
108 
110 {
111  wxWindowUpdateLocker dummy( this );
112  wxStaticText* text;
113 
114  if( !m_auxiliaryToolBar )
115  m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition,
116  wxDefaultSize,
117  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
118 
119  // Creates box to display and choose components:
120  if( !m_SelComponentBox )
121  {
122  m_SelComponentBox = new wxChoice( m_auxiliaryToolBar,
124  m_SelComponentBox->SetToolTip( _("Select a component and highlight items belonging to this component") );
125  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Cmp: ") );
126  m_auxiliaryToolBar->AddControl( text );
127  m_auxiliaryToolBar->AddControl( m_SelComponentBox );
129  }
130 
131  // Creates choice box to display net names and highlight selected:
132  if( !m_SelNetnameBox )
133  {
134  m_SelNetnameBox = new wxChoice( m_auxiliaryToolBar,
136  m_SelNetnameBox->SetToolTip( _("Select a net name and highlight graphic items belonging to this net") );
137  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Net:" ) );
138  m_auxiliaryToolBar->AddControl( text );
139  m_auxiliaryToolBar->AddControl( m_SelNetnameBox );
141  }
142 
143  // Creates choice box to display aperture attributes and highlight selected:
145  {
148  m_SelAperAttributesBox->SetToolTip( _("Select an aperture attribute and highlight graphic items having this attribute") );
149  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "Attr:" ) );
150  m_auxiliaryToolBar->AddControl( text );
153  }
154 
155  if( !m_DCodeSelector )
156  {
159  wxDefaultPosition, wxSize( 150, -1 ) );
160  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _( "DCode:" ) );
161  m_auxiliaryToolBar->AddControl( text );
162  m_auxiliaryToolBar->AddControl( m_DCodeSelector );
163  }
164 
169 
170  // combobox sizes can have changed: apply new best sizes
171  auto item = m_auxiliaryToolBar->FindTool( ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE );
172  item->SetMinSize( m_SelComponentBox->GetBestSize() );
173 
175  item->SetMinSize( m_SelNetnameBox->GetBestSize() );
176 
178  item->SetMinSize( m_SelAperAttributesBox->GetBestSize() );
179 
180  // after adding the buttons to the toolbar, must call Realize()
181  m_auxiliaryToolBar->Realize();
182 }
183 
184 
186 {
187  if( m_drawToolBar )
188  return;
189 
190  m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
191  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
192 
193  // Set up toolbar
194  m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString,
195  KiScaledBitmap( cursor_xpm, this ) );
197 
198  m_drawToolBar->Realize();
199 }
200 
201 
203 {
204  if( m_optionsToolBar )
205  m_optionsToolBar->Clear();
206  else
207  m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
208  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
209 
210  // TODO: these can be moved to the 'proper' vertical toolbar if and when there are
211  // actual tools to put there. That, or I'll get around to implementing configurable
212  // toolbars.
213  m_optionsToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString,
214  KiScaledBitmap( cursor_xpm, this ),
215  wxEmptyString, wxITEM_CHECK );
216 
217  if( IsGalCanvasActive() )
218  {
219  m_optionsToolBar->AddTool( ID_TB_MEASUREMENT_TOOL, wxEmptyString,
220  KiScaledBitmap( measurement_xpm, this ),
221  _( "Measure distance between two points" ),
222  wxITEM_CHECK );
223  }
224 
226 
227  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString,
228  KiScaledBitmap( grid_xpm, this ),
229  _( "Turn grid off" ), wxITEM_CHECK );
230 
231  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
232  KiScaledBitmap( polar_coord_xpm, this ),
233  _( "Turn polar coordinates on" ), wxITEM_CHECK );
234 
235  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
236  KiScaledBitmap( unit_inch_xpm, this ),
237  _( "Set units to inches" ), wxITEM_CHECK );
238 
239  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
240  KiScaledBitmap( unit_mm_xpm, this ),
241  _( "Set units to millimeters" ), wxITEM_CHECK );
242 
243 #ifndef __APPLE__
244  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
245  KiScaledBitmap( cursor_shape_xpm, this ),
246  _( "Change cursor shape" ), wxITEM_CHECK );
247 #else
248  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
249  KiScaledBitmap( cursor_shape_xpm, this ),
250  _( "Change cursor shape (not supported in Legacy Toolset)" ),
251  wxITEM_CHECK );
252 #endif
253 
256  KiScaledBitmap( pad_sketch_xpm, this ),
257  _( "Show flashed items in outline mode" ), wxITEM_CHECK );
258 
259  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LINES_SKETCH, wxEmptyString,
260  KiScaledBitmap( showtrack_xpm, this ),
261  _( "Show lines in outline mode" ), wxITEM_CHECK );
262 
263  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString,
264  KiScaledBitmap( opt_show_polygon_xpm, this ),
265  _( "Show polygons in outline mode" ),
266  wxITEM_CHECK );
267 
268  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, wxEmptyString,
269  KiScaledBitmap( gerbview_show_negative_objects_xpm, this ),
270  _( "Show negatives objects in ghost color" ),
271  wxITEM_CHECK );
272 
273  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString,
274  KiScaledBitmap( show_dcodenumber_xpm, this ),
275  _( "Show dcode number" ), wxITEM_CHECK );
276 
277  // tools to select draw mode in GerbView, unused in GAL
278  if( !IsGalCanvasActive() )
279  {
281  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, wxEmptyString,
282  KiScaledBitmap( gbr_select_mode0_xpm, this ),
283  _( "Show layers in raw mode\n"
284  "(could have problems with negative items when more than one gerber file is shown)" ),
285  wxITEM_RADIO );
286  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString,
287  KiScaledBitmap( gbr_select_mode1_xpm, this ),
288  _( "Show layers in stacked mode\n"
289  "(show negative items without artifacts)" ),
290  wxITEM_RADIO );
291  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString,
292  KiScaledBitmap( gbr_select_mode2_xpm, this ),
293  _( "Show layers in transparency mode\n"
294  "(show negative items without artifacts)" ),
295  wxITEM_RADIO );
296  }
297  else
298  {
299  m_optionsToolBar->AddTool( ID_TB_OPTIONS_DIFF_MODE, wxEmptyString,
300  KiScaledBitmap( gbr_select_mode2_xpm, this ),
301  _( "Show layers in diff (compare) mode" ),
302  wxITEM_CHECK );
303 
304  m_optionsToolBar->AddTool( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, wxEmptyString,
305  KiScaledBitmap( contrast_mode_xpm, this ),
306  _( "Enable high contrast display mode" ),
307  wxITEM_CHECK );
308 
309  }
310 
311  // Tools to show/hide toolbars:
314  wxEmptyString,
315  KiScaledBitmap( layers_manager_xpm, this ),
316  _( "Show/hide the layers manager toolbar" ),
317  wxITEM_CHECK );
318 
319 
320  m_optionsToolBar->Realize();
321 }
322 
323 
324 #define NO_SELECTION_STRING _("<No selection>")
325 
327 {
328  m_DCodeSelector->Clear();
329 
330  // Add an empty string to deselect net highlight
332 
333  int layer = GetActiveLayer();
334  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
335 
336  if( !gerber || gerber->GetDcodesCount() == 0 )
337  {
338  if( m_DCodeSelector->GetSelection() != 0 )
339  m_DCodeSelector->SetSelection( 0 );
340 
341  return;
342  }
343 
344  // Build the aperture list of the current layer, and add it to the combo box:
345  wxArrayString dcode_list;
346  wxString msg;
347  const char* units = g_UserUnit == INCHES ? "mils" : "mm";
348  double scale = g_UserUnit == INCHES ? IU_PER_MILS : IU_PER_MM;
349 
350  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
351  {
352  D_CODE* dcode = gerber->GetDCODE( ii + FIRST_DCODE );
353 
354  if( dcode == NULL )
355  continue;
356 
357  if( !dcode->m_InUse && !dcode->m_Defined )
358  continue;
359 
360  msg.Printf( "tool %d [%.3fx%.3f %s] %s",
361  dcode->m_Num_Dcode,
362  dcode->m_Size.y / scale, dcode->m_Size.x / scale,
363  units,
365  );
366  if( !dcode->m_AperFunction.IsEmpty() )
367  msg << ", " << dcode->m_AperFunction;
368 
369  dcode_list.Add( msg );
370  }
371 
372  m_DCodeSelector->AppendDCodeList( dcode_list );
373 
374  if( dcode_list.size() > 1 )
375  {
376  wxSize size = m_DCodeSelector->GetBestSize();
377  size.x = std::max( size.x, 100 );
378  m_DCodeSelector->SetMinSize( size );
379  m_auimgr.Update();
380  }
381 }
382 
383 
385 {
386  m_SelComponentBox->Clear();
387 
388  // Build the full list of component names from the partial lists stored in each file image
389  std::map<wxString, int> full_list;
390 
391  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
392  {
393  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
394 
395  if( gerber == NULL ) // Graphic layer not yet used
396  continue;
397 
398  full_list.insert( gerber->m_ComponentsList.begin(), gerber->m_ComponentsList.end() );
399  }
400 
401  // Add an empty string to deselect net highlight
403 
404  // Now copy the list to the choice box
405  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
406  {
407  m_SelComponentBox->Append( ii->first );
408  }
409 
410  m_SelComponentBox->SetSelection( 0 );
411 }
412 
413 
415 {
416  m_SelNetnameBox->Clear();
417 
418  // Build the full list of netnames from the partial lists stored in each file image
419  std::map<wxString, int> full_list;
420 
421  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
422  {
423  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
424 
425  if( gerber == NULL ) // Graphic layer not yet used
426  continue;
427 
428  full_list.insert( gerber->m_NetnamesList.begin(), gerber->m_NetnamesList.end() );
429  }
430 
431  // Add an empty string to deselect net highlight
433 
434  // Now copy the list to the choice box
435  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
436  {
437  m_SelNetnameBox->Append( ii->first );
438  }
439 
440  m_SelNetnameBox->SetSelection( 0 );
441 }
442 
443 
445 {
446  m_SelAperAttributesBox->Clear();
447 
448  // Build the full list of netnames from the partial lists stored in each file image
449  std::map<wxString, int> full_list;
450 
451  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
452  {
453  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
454 
455  if( gerber == NULL ) // Graphic layer not yet used
456  continue;
457 
458  if( gerber->GetDcodesCount() == 0 )
459  continue;
460 
461  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
462  {
463  D_CODE* aperture = gerber->GetDCODE( ii + FIRST_DCODE );
464 
465  if( aperture == NULL )
466  continue;
467 
468  if( !aperture->m_InUse && !aperture->m_Defined )
469  continue;
470 
471  if( !aperture->m_AperFunction.IsEmpty() )
472  full_list.insert( std::make_pair( aperture->m_AperFunction, 0 ) );
473  }
474  }
475 
476  // Add an empty string to deselect net highlight
478 
479  // Now copy the list to the choice box
480  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
481  {
482  m_SelAperAttributesBox->Append( ii->first );
483  }
484 
485  m_SelAperAttributesBox->SetSelection( 0 );
486 }
487 
488 
489 void GERBVIEW_FRAME::OnUpdateDrawMode( wxUpdateUIEvent& aEvent )
490 {
491  switch( aEvent.GetId() )
492  {
494  aEvent.Check( GetDisplayMode() == 0 );
495  break;
496 
498  aEvent.Check( GetDisplayMode() == 1 );
499  break;
500 
502  aEvent.Check( GetDisplayMode() == 2 );
503  break;
504 
505  default:
506  break;
507  }
508 }
509 
510 
511 void GERBVIEW_FRAME::OnToggleCoordType( wxCommandEvent& aEvent )
512 {
514 
515  UpdateStatusBar();
516 }
517 
518 
519 void GERBVIEW_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
520 {
521  aEvent.Check( m_DisplayOptions.m_DisplayPolarCood );
522 
523  if( m_optionsToolBar )
526  _( "Turn on rectangular coordinates" ) :
527  _( "Turn on polar coordinates" ) );
528 }
529 
530 
531 void GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode( wxUpdateUIEvent& aEvent )
532 {
534 
535  if( m_optionsToolBar )
538  _( "Show flashed items in outline mode" ) :
539  _( "Show flashed items in fill mode" ) );
540 }
541 
542 
543 void GERBVIEW_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
544 {
545  aEvent.Check( !m_DisplayOptions.m_DisplayLinesFill );
546 
547  if( m_optionsToolBar )
550  _( "Show lines in outline mode" ) :
551  _( "Show lines in fill mode" ) );
552 }
553 
554 
555 void GERBVIEW_FRAME::OnUpdatePolygonDrawMode( wxUpdateUIEvent& aEvent )
556 {
557  aEvent.Check( !m_DisplayOptions.m_DisplayPolygonsFill );
558 
559  if( m_optionsToolBar )
562  _( "Show polygons in outline mode" ) :
563  _( "Show polygons in fill mode" ) );
564 }
565 
566 
567 void GERBVIEW_FRAME::OnUpdateShowDCodes( wxUpdateUIEvent& aEvent )
568 {
569  aEvent.Check( IsElementVisible( LAYER_DCODES ) );
570 
571  if( m_optionsToolBar )
572  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_DCODES,
574  _( "Hide DCodes" ) : _( "Show DCodes" ) );
575 }
576 
577 
578 void GERBVIEW_FRAME::OnUpdateShowNegativeItems( wxUpdateUIEvent& aEvent )
579 {
580  aEvent.Check( IsElementVisible( LAYER_NEGATIVE_OBJECTS ) );
581 
582  if( m_optionsToolBar )
585  _( "Show negative objects in normal color" ) :
586  _( "Show negative objects in ghost color" ) );
587 }
588 
589 
590 void GERBVIEW_FRAME::OnUpdateDiffMode( wxUpdateUIEvent& aEvent )
591 {
592  aEvent.Check( m_DisplayOptions.m_DiffMode );
593 
594  if( m_optionsToolBar )
595  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DIFF_MODE,
597  _( "Show layers in normal mode" ) :
598  _( "Show layers in differential mode" ) );
599 }
600 
601 
602 void GERBVIEW_FRAME::OnUpdateHighContrastMode( wxUpdateUIEvent& aEvent )
603 {
604  aEvent.Check( m_DisplayOptions.m_HighContrastMode );
605 
606  if( m_optionsToolBar )
609  _( "Disable high contrast mode" ) :
610  _( "Enable high contrast mode" ) );
611 }
612 
613 
614 void GERBVIEW_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
615 {
616  aEvent.Check( m_show_layer_manager_tools );
617 
618  if( m_optionsToolBar )
619  {
621  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _( "Hide layers manager" ) );
622  else
623  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _( "Show layers manager" ) );
624  }
625 }
626 
627 
628 void GERBVIEW_FRAME::OnUpdateSelectDCode( wxUpdateUIEvent& aEvent )
629 {
630  if( !m_DCodeSelector )
631  return;
632 
633  int layer = GetActiveLayer();
634  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
635  int selected = ( gerber ) ? gerber->m_Selected_Tool : 0;
636 
637  aEvent.Enable( gerber != NULL );
638 
639  if( m_DCodeSelector->GetSelectedDCodeId() != selected )
640  {
641  m_DCodeSelector->SetDCodeSelection( selected );
642  // Be sure the selection can be made. If no, set to
643  // a correct value
644  if( gerber )
646  }
647 }
648 
649 
650 void GERBVIEW_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
651 {
652  if( m_SelLayerBox->GetSelection() != GetActiveLayer() )
653  {
654  m_SelLayerBox->SetSelection( GetActiveLayer() );
655  }
656 }
void OnUpdateHighContrastMode(wxUpdateUIEvent &aEvent)
void OnUpdateLineDrawMode(wxUpdateUIEvent &aEvent)
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE...
void OnUpdateSelectDCode(wxUpdateUIEvent &aEvent)
void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
int GetDisplayMode()
Function GetDisplayMode.
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config GERBVIEW_FRAME::OnSelectActiveLayer GERBVIEW_FRAME::OnToggleShowLayerManager GERBVIEW_FRAME::OnSelectHighlightChoice GERBVIEW_FRAME::OnUpdateShowLayerManager ID_TB_OPTIONS_SHOW_GBR_MODE_2
void OnUpdateFlashedItemsDrawMode(wxUpdateUIEvent &aEvent)
Definition: id.h:242
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
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
wxBitmap KiScaledBitmap(BITMAP_DEF aBitmap, EDA_BASE_FRAME *aWindow)
Function KiScaledBitmap Constructs a wxBitmap from a memory record, scaling it if device DPI demands ...
Definition: bitmap.cpp:114
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
wxChoice * m_SelNetnameBox
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:123
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.
wxAuiToolBar * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window...
Definition: draw_frame.h:131
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:138
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
Definition: common.h:145
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 IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:887
bool m_DisplayPolarCood
Option to display coordinates in status bar in X,Y or Polar coords.
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
void OnUpdateShowNegativeItems(wxUpdateUIEvent &aEvent)
void AppendDCodeList(const wxArrayString &aChoices)
Function AppendDCodeList.
wxAuiToolBar * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:135
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
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)
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
wxTextCtrl * m_TextInfo
DCODE_SELECTION_BOX * m_DCodeSelector
void updateAperAttributesSelectBox()
wxChoice * m_SelAperAttributesBox
const int scale
wxString AddHotkeyName(const wxString &aText, EDA_HOTKEY **aList, int aCommandId, HOTKEY_ACTION_TYPE aShortCutType)
Function AddHotkeyName Add the key name from the Command id value ( m_Idcommand member value) ...
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)
bool IsElementVisible(GERBVIEW_LAYER_ID aItemIdVisible) const
Function IsElementVisible tests whether a given element category is visible.
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
struct EDA_HOTKEY_CONFIG GerbviewHokeysDescr[]
void OnUpdateCoordType(wxUpdateUIEvent &aEvent)
The common library.
void KiScaledSeparator(wxAuiToolBar *aToolbar, EDA_BASE_FRAME *aWindow)
Function KiScaledSeparator Adds a separator to the given toolbar scaled the same way as KiScaledBitma...
Definition: bitmap.cpp:146
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
#define NO_SELECTION_STRING
wxChoice * m_SelComponentBox
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
bool m_show_layer_manager_tools
std::map< wxString, int > m_ComponentsList
void OnUpdateShowLayerManager(wxUpdateUIEvent &aEvent)