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-2016 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
31 #include <fctsys.h>
32 
33 #include <common.h>
34 #include <gerbview.h>
35 #include <gerbview_frame.h>
36 #include <bitmaps.h>
37 #include <gerbview_id.h>
38 #include <hotkeys.h>
43 #include <dialog_helpers.h>
44 #include <bitmaps.h>
45 
46 #include <wx/wupdlock.h>
47 
49 {
50  wxString msg;
51 
52  if( m_mainToolBar != NULL )
53  return;
54 
55  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
56  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
57 
58  // Set up toolbar
59  m_mainToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
60  KiBitmap( gerbview_clear_layers_xpm ),
61  _( "Erase all layers" ) );
62 
63  m_mainToolBar->AddTool( wxID_FILE, wxEmptyString, KiBitmap( gerber_file_xpm ),
64  _( "Load a new Gerber file on the current layer. Previous data will be deleted" ) );
65 
66  m_mainToolBar->AddTool( ID_GERBVIEW_LOAD_DRILL_FILE, wxEmptyString,
67  KiBitmap( gerbview_drill_file_xpm ),
68  _( "Load an excellon drill file on the current layer. Previous data will be deleted" ) );
69 
70  m_mainToolBar->AddSeparator();
71  m_mainToolBar->AddTool( ID_GERBVIEW_SET_PAGE_BORDER, wxEmptyString, KiBitmap( sheetset_xpm ),
72  _( "Show/hide frame reference and select paper size for printing" ) );
73 
74  m_mainToolBar->AddSeparator();
75  m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiBitmap( print_button_xpm ),
76  _( "Print layers" ) );
77 
78  m_mainToolBar->AddSeparator();
79  msg = AddHotkeyName( _( "Zoom in" ), GerbviewHokeysDescr, HK_ZOOM_IN, IS_COMMENT );
80  m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
81 
82  msg = AddHotkeyName( _( "Zoom out" ), GerbviewHokeysDescr, HK_ZOOM_OUT, IS_COMMENT );
83  m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
84 
85  msg = AddHotkeyName( _( "Redraw view" ), GerbviewHokeysDescr, HK_ZOOM_REDRAW, IS_COMMENT );
86  m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
87 
88  msg = AddHotkeyName( _( "Zoom auto" ), GerbviewHokeysDescr, HK_ZOOM_AUTO, IS_COMMENT );
89  m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
90 
91  m_mainToolBar->AddSeparator();
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 
109 {
110  wxWindowUpdateLocker dummy( this );
111 
112  if( m_auxiliaryToolBar )
113  {
118 
119  // combobox sizes can have changed: apply new best sizes
120  wxSize size;
121  size = m_SelComponentBox->GetBestSize();
122  size.x = std::max( size.x, 100 );
123  m_SelComponentBox->SetMinSize( size );
124 
125  size = m_SelNetnameBox->GetBestSize();
126  size.x = std::max( size.x, 100 );
127  m_SelNetnameBox->SetMinSize( size );
128 
129  size = m_SelAperAttributesBox->GetBestSize();
130  size.x = std::max( size.x, 100 );
131  m_SelAperAttributesBox->SetMinSize( size );
132 
133  size = m_DCodeSelector->GetBestSize();
134  size.x = std::max( size.x, 100 );
135  m_DCodeSelector->SetMinSize( size );
136 
137  m_auimgr.Update();
138  return;
139  }
140 
141  m_auxiliaryToolBar = new wxAuiToolBar( this, ID_AUX_TOOLBAR, wxDefaultPosition, wxDefaultSize,
142  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
143 
144  // Creates box to display and choose components:
145  wxStaticText* text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("Cmp:") );
146  m_auxiliaryToolBar->AddControl( text );
147  m_SelComponentBox = new wxChoice( m_auxiliaryToolBar,
149  m_SelComponentBox->SetToolTip( _("Select a component and highlight items belonging to this component") );
151  m_auxiliaryToolBar->AddControl( m_SelComponentBox );
152  m_auxiliaryToolBar->AddSeparator();
153 
154  // Creates choice box to display net names and highlight selected:
155  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("Net:") );
156  m_auxiliaryToolBar->AddControl( text );
157  m_SelNetnameBox = new wxChoice( m_auxiliaryToolBar,
159  m_SelNetnameBox->SetToolTip( _("Select a net name and highlight graphic items belonging to this net") );
160  m_auxiliaryToolBar->AddControl( m_SelNetnameBox );
162  m_auxiliaryToolBar->AddSeparator();
163 
164  // Creates choice box to display aperture attributes and highlight selected:
165  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("Attr:") );
166  m_auxiliaryToolBar->AddControl( text );
169  m_SelAperAttributesBox->SetToolTip( _("Select an aperture attribute and highlight graphic items having this attribute") );
172 
173  m_auxiliaryToolBar->AddSeparator();
174  text = new wxStaticText( m_auxiliaryToolBar, wxID_ANY, _("DCode:") );
175  m_auxiliaryToolBar->AddControl( text );
178  wxDefaultPosition, wxSize( 150, -1 ) );
180  m_auxiliaryToolBar->AddControl( m_DCodeSelector );
181 
182  // after adding the buttons to the toolbar, must call Realize()
183  m_auxiliaryToolBar->Realize();
184 }
185 
186 
188 {
189  if( m_drawToolBar )
190  return;
191 
192  m_drawToolBar = new wxAuiToolBar( this, ID_V_TOOLBAR, wxDefaultPosition, wxDefaultSize,
193  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
194 
195  // Set up toolbar
196  m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ) );
197  m_drawToolBar->AddSeparator();
198 
199  m_drawToolBar->Realize();
200 }
201 
202 
204 {
205  if( m_optionsToolBar )
206  return;
207 
208  // creation of tool bar options
209  m_optionsToolBar = new wxAuiToolBar( this, ID_OPT_TOOLBAR, wxDefaultPosition, wxDefaultSize,
210  wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_VERTICAL );
211 
212  // TODO: these can be moved to the 'proper' vertical toolbar if and when there are
213  // actual tools to put there. That, or I'll get around to implementing configurable
214  // toolbars.
215  m_optionsToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
216  wxEmptyString, wxITEM_CHECK );
217 
218  m_optionsToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiBitmap( zoom_area_xpm ),
219  _( "Zoom to selection" ), wxITEM_CHECK );
220 
221  m_optionsToolBar->AddSeparator();
222 
223  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
224  _( "Turn grid off" ), wxITEM_CHECK );
225 
226  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
227  KiBitmap( polar_coord_xpm ),
228  _( "Turn polar coordinate on" ), wxITEM_CHECK );
229 
230  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
231  KiBitmap( unit_inch_xpm ),
232  _( "Set units to inches" ), wxITEM_CHECK );
233 
234  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
235  KiBitmap( unit_mm_xpm ),
236  _( "Set units to millimeters" ), wxITEM_CHECK );
237 
238 #ifndef __APPLE__
239  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
240  KiBitmap( cursor_shape_xpm ),
241  _( "Change cursor shape" ), wxITEM_CHECK );
242 #endif // !__APPLE__
243 
244  m_optionsToolBar->AddSeparator();
246  KiBitmap( pad_sketch_xpm ),
247  _( "Show spots in sketch mode" ), wxITEM_CHECK );
248 
249  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LINES_SKETCH, wxEmptyString,
250  KiBitmap( showtrack_xpm ),
251  _( "Show lines in sketch mode" ), wxITEM_CHECK );
252 
253  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, wxEmptyString,
254  KiBitmap( opt_show_polygon_xpm ),
255  _( "Show polygons in sketch mode" ),
256  wxITEM_CHECK );
257 
258  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, wxEmptyString,
259  KiBitmap( gerbview_show_negative_objects_xpm ),
260  _( "Show negatives objects in ghost color" ),
261  wxITEM_CHECK );
262 
263  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_DCODES, wxEmptyString,
264  KiBitmap( show_dcodenumber_xpm ),
265  _( "Show dcode number" ), wxITEM_CHECK );
266 
267  // tools to select draw mode in GerbView
268  m_optionsToolBar->AddSeparator();
269  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, wxEmptyString,
270  KiBitmap( gbr_select_mode0_xpm ),
271  _( "Show layers in raw mode \
272 (could have problems with negative items when more than one gerber file is shown)" ),
273  wxITEM_CHECK );
274  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString,
275  KiBitmap( gbr_select_mode1_xpm ),
276  _( "Show layers in stacked mode \
277 (show negative items without artifacts, sometimes slow)" ),
278  wxITEM_CHECK );
279  m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString,
280  KiBitmap( gbr_select_mode2_xpm ),
281  _( "Show layers in transparency mode \
282 (show negative items without artifacts, sometimes slow)" ),
283  wxITEM_CHECK );
284 
285  // Tools to show/hide toolbars:
286  m_optionsToolBar->AddSeparator();
288  wxEmptyString,
289  KiBitmap( layers_manager_xpm ),
290  _( "Show/hide the layers manager toolbar" ),
291  wxITEM_CHECK );
292 
293 
294  m_optionsToolBar->Realize();
295 }
296 
297 
298 #define NO_SELECTION_STRING _("<No selection>")
299 
301 {
302  m_DCodeSelector->Clear();
303 
304  // Add an empty string to deselect net highlight
306 
307  int layer = getActiveLayer();
308  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
309 
310  if( !gerber || gerber->GetDcodesCount() == 0 )
311  {
312  if( m_DCodeSelector->GetSelection() != 0 )
313  m_DCodeSelector->SetSelection( 0 );
314 
315  return;
316  }
317 
318  // Build the aperture list of the current layer, and add it to the combo box:
319  wxArrayString dcode_list;
320  wxString msg;
321  const char* units = g_UserUnit == INCHES ? "mils" : "mm";
322  double scale = g_UserUnit == INCHES ? IU_PER_MILS : IU_PER_MM;
323 
324  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
325  {
326  D_CODE* dcode = gerber->GetDCODE( ii + FIRST_DCODE, false );
327 
328  if( dcode == NULL )
329  continue;
330 
331  if( !dcode->m_InUse && !dcode->m_Defined )
332  continue;
333 
334  msg.Printf( "tool %d [%.3fx%.3f %s] %s",
335  dcode->m_Num_Dcode,
336  dcode->m_Size.y / scale, dcode->m_Size.x / scale,
337  units,
339  );
340  if( !dcode->m_AperFunction.IsEmpty() )
341  msg << ", " << dcode->m_AperFunction;
342 
343  dcode_list.Add( msg );
344  }
345 
346  m_DCodeSelector->AppendDCodeList( dcode_list );
347 
348  if( dcode_list.size() > 1 )
349  {
350  wxSize size = m_DCodeSelector->GetBestSize();
351  size.x = std::max( size.x, 100 );
352  m_DCodeSelector->SetMinSize( size );
353  m_auimgr.Update();
354  }
355 }
356 
358 {
359  m_SelComponentBox->Clear();
360 
361  // Build the full list of component names from the partial lists stored in each file image
362  std::map<wxString, int> full_list;
363 
364  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
365  {
366  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
367 
368  if( gerber == NULL ) // Graphic layer not yet used
369  continue;
370 
371  full_list.insert( gerber->m_ComponentsList.begin(), gerber->m_ComponentsList.end() );
372  }
373 
374  // Add an empty string to deselect net highlight
376 
377  // Now copy the list to the choice box
378  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
379  {
380  m_SelComponentBox->Append( ii->first );
381  }
382 
383  m_SelComponentBox->SetSelection( 0 );
384 }
385 
386 
388 {
389  m_SelNetnameBox->Clear();
390 
391  // Build the full list of netnames from the partial lists stored in each file image
392  std::map<wxString, int> full_list;
393 
394  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
395  {
396  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
397 
398  if( gerber == NULL ) // Graphic layer not yet used
399  continue;
400 
401  full_list.insert( gerber->m_NetnamesList.begin(), gerber->m_NetnamesList.end() );
402  }
403 
404  // Add an empty string to deselect net highlight
406 
407  // Now copy the list to the choice box
408  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
409  {
410  m_SelNetnameBox->Append( ii->first );
411  }
412 
413  m_SelNetnameBox->SetSelection( 0 );
414 }
415 
416 
418 {
419  m_SelAperAttributesBox->Clear();
420 
421  // Build the full list of netnames from the partial lists stored in each file image
422  std::map<wxString, int> full_list;
423 
424  for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
425  {
426  GERBER_FILE_IMAGE* gerber = GetImagesList()->GetGbrImage( layer );
427 
428  if( gerber == NULL ) // Graphic layer not yet used
429  continue;
430 
431  if( gerber->GetDcodesCount() == 0 )
432  continue;
433 
434  for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
435  {
436  D_CODE* aperture = gerber->GetDCODE( ii + FIRST_DCODE, false );
437 
438  if( aperture == NULL )
439  continue;
440 
441  if( !aperture->m_InUse && !aperture->m_Defined )
442  continue;
443 
444  if( !aperture->m_AperFunction.IsEmpty() )
445  full_list.insert( std::make_pair( aperture->m_AperFunction, 0 ) );
446  }
447  }
448 
449  // Add an empty string to deselect net highlight
451 
452  // Now copy the list to the choice box
453  for( auto ii = full_list.begin(); ii != full_list.end(); ++ii )
454  {
455  m_SelAperAttributesBox->Append( ii->first );
456  }
457 
458  m_SelAperAttributesBox->SetSelection( 0 );
459 }
460 
461 void GERBVIEW_FRAME::OnUpdateDrawMode( wxUpdateUIEvent& aEvent )
462 {
463  switch( aEvent.GetId() )
464  {
466  aEvent.Check( GetDisplayMode() == 0 );
467  break;
468 
470  aEvent.Check( GetDisplayMode() == 1 );
471  break;
472 
474  aEvent.Check( GetDisplayMode() == 2 );
475  break;
476 
477  default:
478  break;
479  }
480 }
481 
482 
483 void GERBVIEW_FRAME::OnUpdateCoordType( wxUpdateUIEvent& aEvent )
484 {
485  aEvent.Check( m_DisplayOptions.m_DisplayPolarCood );
486 }
487 
488 void GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode( wxUpdateUIEvent& aEvent )
489 {
491 }
492 
493 
494 void GERBVIEW_FRAME::OnUpdateLinesDrawMode( wxUpdateUIEvent& aEvent )
495 {
496  aEvent.Check( !m_DisplayOptions.m_DisplayLinesFill );
497 }
498 
499 
500 void GERBVIEW_FRAME::OnUpdatePolygonsDrawMode( wxUpdateUIEvent& aEvent )
501 {
502  aEvent.Check( !m_DisplayOptions.m_DisplayPolygonsFill );
503 }
504 
505 
506 void GERBVIEW_FRAME::OnUpdateShowDCodes( wxUpdateUIEvent& aEvent )
507 {
508  aEvent.Check( IsElementVisible( DCODES_VISIBLE ) );
509 }
510 
511 
512 void GERBVIEW_FRAME::OnUpdateShowNegativeItems( wxUpdateUIEvent& aEvent )
513 {
514  aEvent.Check( IsElementVisible( NEGATIVE_OBJECTS_VISIBLE ) );
515 }
516 
517 
518 void GERBVIEW_FRAME::OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent )
519 {
520  aEvent.Check( m_show_layer_manager_tools );
521 
522  if( m_optionsToolBar )
523  {
525  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Hide layers manager" ) );
526  else
527  m_optionsToolBar->SetToolShortHelp( aEvent.GetId(), _("Show layers manager" ) );
528  }
529 }
530 
531 
532 void GERBVIEW_FRAME::OnUpdateSelectDCode( wxUpdateUIEvent& aEvent )
533 {
534  if( !m_DCodeSelector )
535  return;
536 
537  int layer = getActiveLayer();
538  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
539  int selected = ( gerber ) ? gerber->m_Selected_Tool : 0;
540 
541  aEvent.Enable( gerber != NULL );
542 
543  if( m_DCodeSelector->GetSelectedDCodeId() != selected )
544  {
545  m_DCodeSelector->SetDCodeSelection( selected );
546  // Be sure the selection can be made. If no, set to
547  // a correct value
548  if( gerber )
550  }
551 }
552 
553 
554 void GERBVIEW_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
555 {
556  if( m_SelLayerBox->GetSelection() != getActiveLayer() )
557  {
558  m_SelLayerBox->SetSelection( getActiveLayer() );
559  }
560 }
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
void OnUpdateSelectDCode(wxUpdateUIEvent &aEvent)
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:98
int GetDisplayMode()
Function GetDisplayMode.
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:106
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:99
void OnUpdateFlashedItemsDrawMode(wxUpdateUIEvent &aEvent)
Definition: id.h:232
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.
D_CODE * GetDCODE(int aDCODE, bool aCreateIfNoExist=true)
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE...
void OnUpdateLayerSelectBox(wxUpdateUIEvent &aEvent)
void updateNetnameListSelectBox()
wxAuiManager m_auimgr
Definition: wxstruct.h:139
wxChoice * m_SelNetnameBox
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:121
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
void ReCreateHToolbar() override
void updateComponentListSelectBox()
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
bool m_Defined
false if the aperture is not defined in the header
Definition: dcode.h:108
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:125
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:70
Definition: common.h:145
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:100
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
int GetSelectedDCodeId()
Function GetSelectedDCodeId.
void OnUpdatePolygonsDrawMode(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:94
Helper dialog and control classes.
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:122
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:135
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:109
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:81
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)
int getActiveLayer()
Function getActiveLayer returns the active layer.
#define TOOLS_MAX_COUNT
Definition: dcode.h:72
struct EDA_HOTKEY_CONFIG GerbviewHokeysDescr[]
void OnUpdateCoordType(wxUpdateUIEvent &aEvent)
The common library.
#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
bool IsElementVisible(GERBER_VISIBLE_ID aItemIdVisible) const
Function IsElementVisible tests whether a given element category is visible.
void OnUpdateLinesDrawMode(wxUpdateUIEvent &aEvent)
void OnUpdateShowLayerManager(wxUpdateUIEvent &aEvent)