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@verizon.net>
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  _( "Erase all layers" ) );
58 
59  m_mainToolBar->AddTool( wxID_FILE, wxEmptyString, KiScaledBitmap( load_gerber_xpm, this ),
60  _( "Load a new Gerber file 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  _( "Load an excellon drill file 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 auto" ), GerbviewHokeysDescr, HK_ZOOM_AUTO, IS_COMMENT );
85  m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg );
86 
87  m_mainToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiScaledBitmap( zoom_area_xpm, this ),
88  _( "Zoom to selection" ), wxITEM_CHECK );
89 
91 
94  wxDefaultPosition, wxDefaultSize, 0,NULL);
96 
97  m_mainToolBar->AddControl( m_SelLayerBox );
98 
99  m_TextInfo = new wxTextCtrl( m_mainToolBar, wxID_ANY, wxEmptyString, wxDefaultPosition,
100  wxDefaultSize, wxTE_READONLY );
101  m_mainToolBar->AddControl( m_TextInfo );
102 
103  // after adding the buttons to the toolbar, must call Realize() to reflect the changes
104  m_mainToolBar->Realize();
105 }
106 
107 
109 {
110  wxWindowUpdateLocker dummy( this );
111  wxStaticText* text;
112 
113  if( !m_auxiliaryToolBar )
114  m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize,
115  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
116 
117  // Creates box to display and choose components:
118  if( !m_SelComponentBox )
119  {
120  m_SelComponentBox = new wxChoice( m_auxiliaryToolBar,
122  m_SelComponentBox->SetToolTip( _("Select a component and highlight items belonging to this component") );
123  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("Cmp:") );
124  m_auxiliaryToolBar->AddControl( text );
125  m_auxiliaryToolBar->AddControl( m_SelComponentBox );
127  }
128 
129  // Creates choice box to display net names and highlight selected:
130  if( !m_SelNetnameBox )
131  {
132  m_SelNetnameBox = new wxChoice( m_auxiliaryToolBar,
134  m_SelNetnameBox->SetToolTip( _("Select a net name and highlight graphic items belonging to this net") );
135  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("Net:") );
136  m_auxiliaryToolBar->AddControl( text );
137  m_auxiliaryToolBar->AddControl( m_SelNetnameBox );
139  }
140 
141  // Creates choice box to display aperture attributes and highlight selected:
143  {
146  m_SelAperAttributesBox->SetToolTip( _("Select an aperture attribute and highlight graphic items having this attribute") );
147  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("Attr:") );
148  m_auxiliaryToolBar->AddControl( text );
151  }
152 
153  if( !m_DCodeSelector )
154  {
157  wxDefaultPosition, wxSize( 150, -1 ) );
158  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("DCode:") );
159  m_auxiliaryToolBar->AddControl( text );
160  m_auxiliaryToolBar->AddControl( m_DCodeSelector );
161  }
162 
167 
168  // combobox sizes can have changed: apply new best sizes
169  auto item = m_auxiliaryToolBar->FindTool( ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE );
170  item->SetMinSize( m_SelComponentBox->GetBestSize() );
171 
173  item->SetMinSize( m_SelNetnameBox->GetBestSize() );
174 
176  item->SetMinSize( m_SelAperAttributesBox->GetBestSize() );
177 
178  // after adding the buttons to the toolbar, must call Realize()
179  m_auxiliaryToolBar->Realize();
180 }
181 
182 
184 {
185  if( m_drawToolBar )
186  return;
187 
188  m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
189  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
190 
191  // Set up toolbar
192  m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiScaledBitmap( cursor_xpm, this ) );
194 
195  m_drawToolBar->Realize();
196 }
197 
198 
200 {
201  if( m_optionsToolBar )
202  m_optionsToolBar->Clear();
203  else
204  m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
205  KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
206 
207  // TODO: these can be moved to the 'proper' vertical toolbar if and when there are
208  // actual tools to put there. That, or I'll get around to implementing configurable
209  // toolbars.
210  m_optionsToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiScaledBitmap( cursor_xpm, this ),
211  wxEmptyString, wxITEM_CHECK );
212 
213  if( IsGalCanvasActive() )
214  {
215  m_optionsToolBar->AddTool( ID_TB_MEASUREMENT_TOOL, wxEmptyString,
216  KiScaledBitmap( measurement_xpm, this ),
217  _( "Measure distance between two points" ),
218  wxITEM_CHECK );
219  }
220 
222 
223  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiScaledBitmap( grid_xpm, this ),
224  _( "Turn grid off" ), wxITEM_CHECK );
225 
226  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
227  KiScaledBitmap( polar_coord_xpm, this ),
228  _( "Turn polar coordinate on" ), wxITEM_CHECK );
229 
230  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
231  KiScaledBitmap( unit_inch_xpm, this ),
232  _( "Set units to inches" ), wxITEM_CHECK );
233 
234  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
235  KiScaledBitmap( unit_mm_xpm, this ),
236  _( "Set units to millimeters" ), wxITEM_CHECK );
237 
238 #ifndef __APPLE__
239  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
240  KiScaledBitmap( cursor_shape_xpm, this ),
241  _( "Change cursor shape" ), wxITEM_CHECK );
242 #else
243  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
244  KiScaledBitmap( cursor_shape_xpm, this ),
245  _( "Change cursor shape (not supported in Legacy graphics)" ),
246  wxITEM_CHECK );
247 #endif
248 
251  KiScaledBitmap( pad_sketch_xpm, this ),
252  _( "Show spots in sketch mode" ), wxITEM_CHECK );
253 
254  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LINES_SKETCH, wxEmptyString,
255  KiScaledBitmap( showtrack_xpm, this ),
256  _( "Show lines in sketch mode" ), wxITEM_CHECK );
257 
258  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString,
259  KiScaledBitmap( opt_show_polygon_xpm, this ),
260  _( "Show polygons in sketch mode" ),
261  wxITEM_CHECK );
262 
263  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, wxEmptyString,
264  KiScaledBitmap( gerbview_show_negative_objects_xpm, this ),
265  _( "Show negatives objects in ghost color" ),
266  wxITEM_CHECK );
267 
268  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString,
269  KiScaledBitmap( show_dcodenumber_xpm, this ),
270  _( "Show dcode number" ), wxITEM_CHECK );
271 
272  // tools to select draw mode in GerbView, unused in GAL
273  if( !IsGalCanvasActive() )
274  {
276  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, wxEmptyString,
277  KiScaledBitmap( gbr_select_mode0_xpm, this ),
278  _( "Show layers in raw mode\n"
279  "(could have problems with negative items when more than one gerber file is shown)" ),
280  wxITEM_CHECK );
281  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString,
282  KiScaledBitmap( gbr_select_mode1_xpm, this ),
283  _( "Show layers in stacked mode\n"
284  "(show negative items without artifacts)" ),
285  wxITEM_CHECK );
286  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString,
287  KiScaledBitmap( gbr_select_mode2_xpm, this ),
288  _( "Show layers in transparency mode\n"
289  "(show negative items without artifacts)" ),
290  wxITEM_CHECK );
291  }
292  else
293  {
294  m_optionsToolBar->AddTool( ID_TB_OPTIONS_DIFF_MODE, wxEmptyString,
295  KiScaledBitmap( gbr_select_mode2_xpm, this ),
296  _( "Show layers in diff (compare) mode" ),
297  wxITEM_CHECK );
298 
299  m_optionsToolBar->AddTool( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, wxEmptyString,
300  KiScaledBitmap( contrast_mode_xpm, this ),
301  _( "Enable high contrast display mode" ),
302  wxITEM_CHECK );
303 
304  }
305 
306  // Tools to show/hide toolbars:
309  wxEmptyString,
310  KiScaledBitmap( layers_manager_xpm, this ),
311  _( "Show/hide the layers manager toolbar" ),
312  wxITEM_CHECK );
313 
314 
315  m_optionsToolBar->Realize();
316 }
317 
318 
319 #define NO_SELECTION_STRING _("<No selection>")
320 
322 {
323  m_DCodeSelector->Clear();
324 
325  // Add an empty string to deselect net highlight
327 
328  int layer = GetActiveLayer();
329  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
330 
331  if( !gerber || gerber->GetDcodesCount() == 0 )
332  {
333  if( m_DCodeSelector->GetSelection() != 0 )
334  m_DCodeSelector->SetSelection( 0 );
335 
336  return;
337  }
338 
339  // Build the aperture list of the current layer, and add it to the combo box:
340  wxArrayString dcode_list;
341  wxString msg;
342  const char* units = g_UserUnit == INCHES ? "mils" : "mm";
343  double scale = g_UserUnit == INCHES ? IU_PER_MILS : IU_PER_MM;
344 
345  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
346  {
347  D_CODE* dcode = gerber->GetDCODE( ii + FIRST_DCODE );
348 
349  if( dcode == NULL )
350  continue;
351 
352  if( !dcode->m_InUse && !dcode->m_Defined )
353  continue;
354 
355  msg.Printf( "tool %d [%.3fx%.3f %s] %s",
356  dcode->m_Num_Dcode,
357  dcode->m_Size.y / scale, dcode->m_Size.x / scale,
358  units,
360  );
361  if( !dcode->m_AperFunction.IsEmpty() )
362  msg << ", " << dcode->m_AperFunction;
363 
364  dcode_list.Add( msg );
365  }
366 
367  m_DCodeSelector->AppendDCodeList( dcode_list );
368 
369  if( dcode_list.size() > 1 )
370  {
371  wxSize size = m_DCodeSelector->GetBestSize();
372  size.x = std::max( size.x, 100 );
373  m_DCodeSelector->SetMinSize( size );
374  m_auimgr.Update();
375  }
376 }
377 
379 {
380  m_SelComponentBox->Clear();
381 
382  // Build the full list of component names from the partial lists stored in each file image
383  std::map<wxString, int> full_list;
384 
385  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
386  {
387  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
388 
389  if( gerber == NULL ) // Graphic layer not yet used
390  continue;
391 
392  full_list.insert( gerber->m_ComponentsList.begin(), gerber->m_ComponentsList.end() );
393  }
394 
395  // Add an empty string to deselect net highlight
397 
398  // Now copy the list to the choice box
399  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
400  {
401  m_SelComponentBox->Append( ii->first );
402  }
403 
404  m_SelComponentBox->SetSelection( 0 );
405 }
406 
407 
409 {
410  m_SelNetnameBox->Clear();
411 
412  // Build the full list of netnames from the partial lists stored in each file image
413  std::map<wxString, int> full_list;
414 
415  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
416  {
417  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
418 
419  if( gerber == NULL ) // Graphic layer not yet used
420  continue;
421 
422  full_list.insert( gerber->m_NetnamesList.begin(), gerber->m_NetnamesList.end() );
423  }
424 
425  // Add an empty string to deselect net highlight
427 
428  // Now copy the list to the choice box
429  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
430  {
431  m_SelNetnameBox->Append( ii->first );
432  }
433 
434  m_SelNetnameBox->SetSelection( 0 );
435 }
436 
437 
439 {
440  m_SelAperAttributesBox->Clear();
441 
442  // Build the full list of netnames from the partial lists stored in each file image
443  std::map<wxString, int> full_list;
444 
445  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
446  {
447  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
448 
449  if( gerber == NULL ) // Graphic layer not yet used
450  continue;
451 
452  if( gerber->GetDcodesCount() == 0 )
453  continue;
454 
455  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
456  {
457  D_CODE* aperture = gerber->GetDCODE( ii + FIRST_DCODE );
458 
459  if( aperture == NULL )
460  continue;
461 
462  if( !aperture->m_InUse && !aperture->m_Defined )
463  continue;
464 
465  if( !aperture->m_AperFunction.IsEmpty() )
466  full_list.insert( std::make_pair( aperture->m_AperFunction, 0 ) );
467  }
468  }
469 
470  // Add an empty string to deselect net highlight
472 
473  // Now copy the list to the choice box
474  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
475  {
476  m_SelAperAttributesBox->Append( ii->first );
477  }
478 
479  m_SelAperAttributesBox->SetSelection( 0 );
480 }
481 
482 void GERBVIEW_FRAME::OnUpdateDrawMode( wxUpdateUIEvent& aEvent )
483 {
484  switch( aEvent.GetId() )
485  {
487  aEvent.Check( GetDisplayMode() == 0 );
488  break;
489 
491  aEvent.Check( GetDisplayMode() == 1 );
492  break;
493 
495  aEvent.Check( GetDisplayMode() == 2 );
496  break;
497 
498  default:
499  break;
500  }
501 }
502 
503 
504 void GERBVIEW_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
505 {
506  aEvent.Check( m_DisplayOptions.m_DisplayPolarCood );
507 }
508 
509 void GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode( wxUpdateUIEvent& aEvent )
510 {
512 }
513 
514 
515 void GERBVIEW_FRAME::OnUpdateLinesDrawMode( wxUpdateUIEvent& aEvent )
516 {
517  aEvent.Check( !m_DisplayOptions.m_DisplayLinesFill );
518 }
519 
520 
521 void GERBVIEW_FRAME::OnUpdatePolygonsDrawMode( wxUpdateUIEvent& aEvent )
522 {
523  aEvent.Check( !m_DisplayOptions.m_DisplayPolygonsFill );
524 }
525 
526 
527 void GERBVIEW_FRAME::OnUpdateShowDCodes( wxUpdateUIEvent& aEvent )
528 {
529  aEvent.Check( IsElementVisible( LAYER_DCODES ) );
530 }
531 
532 
533 void GERBVIEW_FRAME::OnUpdateShowNegativeItems( wxUpdateUIEvent& aEvent )
534 {
535  aEvent.Check( IsElementVisible( LAYER_NEGATIVE_OBJECTS ) );
536 }
537 
538 
539 void GERBVIEW_FRAME::OnUpdateDiffMode( wxUpdateUIEvent& aEvent )
540 {
541  aEvent.Check( m_DisplayOptions.m_DiffMode );
542 }
543 
544 
545 void GERBVIEW_FRAME::OnUpdateHighContrastMode( wxUpdateUIEvent& aEvent )
546 {
547  aEvent.Check( m_DisplayOptions.m_HighContrastMode );
548 }
549 
550 
551 void GERBVIEW_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
552 {
553  aEvent.Check( m_show_layer_manager_tools );
554 
555  if( m_optionsToolBar )
556  {
558  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Hide layers manager" ) );
559  else
560  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Show layers manager" ) );
561  }
562 }
563 
564 
565 void GERBVIEW_FRAME::OnUpdateSelectDCode( wxUpdateUIEvent& aEvent )
566 {
567  if( !m_DCodeSelector )
568  return;
569 
570  int layer = GetActiveLayer();
571  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
572  int selected = ( gerber ) ? gerber->m_Selected_Tool : 0;
573 
574  aEvent.Enable( gerber != NULL );
575 
576  if( m_DCodeSelector->GetSelectedDCodeId() != selected )
577  {
578  m_DCodeSelector->SetDCodeSelection( selected );
579  // Be sure the selection can be made. If no, set to
580  // a correct value
581  if( gerber )
583  }
584 }
585 
586 
587 void GERBVIEW_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
588 {
589  if( m_SelLayerBox->GetSelection() != GetActiveLayer() )
590  {
591  m_SelLayerBox->SetSelection( GetActiveLayer() );
592  }
593 }
void OnUpdateHighContrastMode(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)
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
void OnUpdateFlashedItemsDrawMode(wxUpdateUIEvent &aEvent)
Definition: id.h:241
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:122
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
void ReCreateHToolbar() override
void updateComponentListSelectBox()
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_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:129
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 OnUpdatePolygonsDrawMode(wxUpdateUIEvent &aEvent)
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:874
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:126
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EDA_BASE_FRAME::OnSelectPreferredEditor GERBVIEW_FRAME::Process_Special_Functions ID_TB_OPTIONS_SHOW_GBR_MODE_2
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:56
wxTextCtrl * m_TextInfo
DCODE_SELECTION_BOX * m_DCodeSelector
wxAuiToolBar * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window...
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 OnUpdateLinesDrawMode(wxUpdateUIEvent &aEvent)
void OnUpdateShowLayerManager(wxUpdateUIEvent &aEvent)