KiCad PCB EDA Suite
events_called_functions.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) 2011-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #include <fctsys.h>
31 #include <pgm_base.h>
32 #include <class_drawpanel.h>
33 #include <gestfich.h>
34 
35 #include <gerbview.h>
36 #include <gerbview_frame.h>
37 #include <kicad_device_context.h>
38 #include <gerbview_id.h>
39 #include <gerber_file_image.h>
40 #include <gerber_file_image_list.h>
41 #include <dialog_helpers.h>
42 #include <DCodeSelectionbox.h>
43 #include <gerbview_layer_widget.h>
44 
47 #include <tool/tool_manager.h>
48 #include <gerbview_painter.h>
49 #include <view/view.h>
50 
51 
52 // Event table:
53 
54 BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME )
55  EVT_CLOSE( GERBVIEW_FRAME::OnCloseWindow )
56  EVT_SIZE( GERBVIEW_FRAME::OnSize )
57 
58  EVT_TOOL( wxID_FILE, GERBVIEW_FRAME::Files_io )
65 
66  // Menu Files:
67  EVT_MENU( wxID_FILE, GERBVIEW_FRAME::Files_io )
68  EVT_MENU( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
69  EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, GERBVIEW_FRAME::ExportDataInPcbnewFormat )
70 
71  EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, GERBVIEW_FRAME::OnGbrFileHistory )
72 
74  GERBVIEW_FRAME::OnDrlFileHistory )
75 
77  GERBVIEW_FRAME::OnZipFileHistory )
78 
80  GERBVIEW_FRAME::OnJobFileHistory )
81 
82  EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit )
83 
84  // menu Preferences
86 
87  EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::Process_Config )
88  EVT_UPDATE_UI( ID_MENU_CANVAS_LEGACY, GERBVIEW_FRAME::OnUpdateSwitchCanvas )
89  EVT_UPDATE_UI( ID_MENU_CANVAS_CAIRO, GERBVIEW_FRAME::OnUpdateSwitchCanvas )
90  EVT_UPDATE_UI( ID_MENU_CANVAS_OPENGL, GERBVIEW_FRAME::OnUpdateSwitchCanvas )
91  EVT_MENU( ID_MENU_CANVAS_LEGACY, GERBVIEW_FRAME::OnSwitchCanvas )
92  EVT_MENU( ID_MENU_CANVAS_CAIRO, GERBVIEW_FRAME::OnSwitchCanvas )
93  EVT_MENU( ID_MENU_CANVAS_OPENGL, GERBVIEW_FRAME::OnSwitchCanvas )
94 
95  // menu Postprocess
96  EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions )
97  EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::OnShowGerberSourceFile )
98 
99  // menu Miscellaneous
100  EVT_MENU( ID_GERBVIEW_ERASE_CURR_LAYER, GERBVIEW_FRAME::Process_Special_Functions )
101 
102  // Menu Help
103  EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
104  EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
105  EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
106  EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
107 
108  EVT_TOOL( wxID_UNDO, GERBVIEW_FRAME::Process_Special_Functions )
109  EVT_TOOL( wxID_PRINT, GERBVIEW_FRAME::ToPrinter )
111  GERBVIEW_FRAME::OnSelectActiveLayer )
112 
114 
115  EVT_MENU( ID_MENU_ZOOM_SELECTION, GERBVIEW_FRAME::Process_Special_Functions )
116 
117  // Vertical toolbar:
118  EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions )
119 
121  GERBVIEW_FRAME::Process_Special_Functions )
122 
123  // Option toolbar
124  //EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions ) // mentioned below
125  EVT_TOOL( ID_ZOOM_SELECTION, GERBVIEW_FRAME::Process_Special_Functions )
126  EVT_TOOL( ID_TB_MEASUREMENT_TOOL, GERBVIEW_FRAME::Process_Special_Functions )
128  EVT_TOOL( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, GERBVIEW_FRAME::OnTogglePolygonDrawMode )
132  GERBVIEW_FRAME::OnToggleShowLayerManager )
133  EVT_TOOL( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnSelectOptionToolbar )
136  GERBVIEW_FRAME::OnSelectDisplayMode )
137  EVT_TOOL( ID_TB_OPTIONS_DIFF_MODE, GERBVIEW_FRAME::OnSelectOptionToolbar )
138  EVT_TOOL( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, GERBVIEW_FRAME::OnSelectOptionToolbar )
139 
140  // Auxiliary horizontal toolbar
141  EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
142  EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
144  GERBVIEW_FRAME::OnSelectHighlightChoice )
145  EVT_CHOICE( ID_ON_ZOOM_SELECT, GERBVIEW_FRAME::OnSelectZoom )
146  EVT_CHOICE( ID_ON_GRID_SELECT, GERBVIEW_FRAME::OnSelectGrid )
147 
148  // Right click context menu
149  EVT_MENU( ID_HIGHLIGHT_CMP_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
150  EVT_MENU( ID_HIGHLIGHT_NET_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
151  EVT_MENU( ID_HIGHLIGHT_APER_ATTRIBUTE_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
152  EVT_MENU( ID_HIGHLIGHT_REMOVE_ALL, GERBVIEW_FRAME::Process_Special_Functions )
153 
154  EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::OnUpdateSelectTool )
155  EVT_UPDATE_UI( ID_ZOOM_SELECTION, GERBVIEW_FRAME::OnUpdateSelectTool )
156  EVT_UPDATE_UI( ID_TB_MEASUREMENT_TOOL, GERBVIEW_FRAME::OnUpdateSelectTool )
157  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLAR_COORD, GERBVIEW_FRAME::OnUpdateCoordType )
158  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH,
159  GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode )
160  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnUpdateLineDrawMode )
161  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, GERBVIEW_FRAME::OnUpdatePolygonDrawMode )
162  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnUpdateShowDCodes )
163  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, GERBVIEW_FRAME::OnUpdateShowNegativeItems )
164  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
165  GERBVIEW_FRAME::OnUpdateShowLayerManager )
166  EVT_UPDATE_UI( ID_TB_OPTIONS_DIFF_MODE, GERBVIEW_FRAME::OnUpdateDiffMode )
167  EVT_UPDATE_UI( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, GERBVIEW_FRAME::OnUpdateHighContrastMode )
168  EVT_UPDATE_UI( ID_ON_GRID_SELECT, GERBVIEW_FRAME::OnUpdateSelectGrid )
169  EVT_UPDATE_UI( ID_ON_ZOOM_SELECT, GERBVIEW_FRAME::OnUpdateSelectZoom )
170 
171  EVT_UPDATE_UI( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnUpdateSelectDCode )
172  EVT_UPDATE_UI( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
173  GERBVIEW_FRAME::OnUpdateLayerSelectBox )
174  EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2,
175  GERBVIEW_FRAME::OnUpdateDrawMode )
176 
177 END_EVENT_TABLE()
178 
179 
180 /* Handles the selection of tools, menu, and popup menu commands.
181  */
182 void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
183 {
184  int id = event.GetId();
185 
186  switch( id )
187  {
189  case ID_POPUP_ZOOM_BLOCK:
190  break;
191 
193  m_canvas->EndMouseCapture();
194 
195  if( GetScreen()->m_BlockLocate.GetCommand() != BLOCK_IDLE )
196  {
197  /* Should not be executed, except bug */
198  GetScreen()->m_BlockLocate.SetCommand( BLOCK_IDLE );
199  GetScreen()->m_BlockLocate.SetState( STATE_NO_BLOCK );
200  GetScreen()->m_BlockLocate.ClearItemsList();
201  }
202 
203  if( GetToolId() == ID_NO_TOOL_SELECTED )
204  SetNoToolSelected();
205  else
206  m_canvas->SetCursor( (wxStockCursor) m_canvas->GetCurrentCursor() );
207  break;
208 
209  default:
210  m_canvas->EndMouseCapture();
211  break;
212  }
213 
214  GERBER_DRAW_ITEM* currItem = (GERBER_DRAW_ITEM*) GetScreen()->GetCurItem();
215 
216  switch( id )
217  {
218  case ID_GERBVIEW_ERASE_CURR_LAYER:
219  Erase_Current_DrawLayer( true );
220  ClearMsgPanel();
221  break;
222 
223  case ID_NO_TOOL_SELECTED:
224  SetNoToolSelected();
225  break;
226 
227  case ID_MENU_ZOOM_SELECTION:
228  case ID_ZOOM_SELECTION:
229  // This tool is located on the main toolbar: switch it on or off on click
230  if( GetToolId() != ID_ZOOM_SELECTION )
231  SetToolID( ID_ZOOM_SELECTION, wxCURSOR_MAGNIFIER, _( "Zoom to selection" ) );
232  else
233  SetNoToolSelected();
234  break;
235 
236  case ID_TB_MEASUREMENT_TOOL:
237  SetToolID( id, wxCURSOR_DEFAULT, _( "Unsupported tool in this canvas" ) );
238  break;
239 
241  SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
242  break;
243 
245  break;
246 
247  case ID_GERBVIEW_SHOW_LIST_DCODES:
248  Liste_D_Codes();
249  break;
250 
252  if( !IsGalCanvasActive() )
253  {
254  INSTALL_UNBUFFERED_DC( dc, m_canvas );
255  GetScreen()->m_BlockLocate.SetCommand( BLOCK_MOVE );
256  m_canvas->SetAutoPanRequest( false );
257  HandleBlockPlace( &dc );
258  }
259  break;
260 
261  case ID_POPUP_ZOOM_BLOCK:
262  if( !IsGalCanvasActive() )
263  {
264  INSTALL_UNBUFFERED_DC( dc, m_canvas );
265  GetScreen()->m_BlockLocate.SetCommand( BLOCK_ZOOM );
266  GetScreen()->m_BlockLocate.SetMessageBlock( this );
267  HandleBlockEnd( &dc );
268  }
269  break;
270 
271  case ID_HIGHLIGHT_CMP_ITEMS:
272  if( m_SelComponentBox->SetStringSelection( currItem->GetNetAttributes().m_Cmpref ) )
273  m_canvas->Refresh();
274  break;
275 
276  case ID_HIGHLIGHT_NET_ITEMS:
277  if( m_SelNetnameBox->SetStringSelection( currItem->GetNetAttributes().m_Netname ) )
278  m_canvas->Refresh();
279  break;
280 
281  case ID_HIGHLIGHT_APER_ATTRIBUTE_ITEMS:
282  {
283  D_CODE* apertDescr = currItem->GetDcodeDescr();
284  if( m_SelAperAttributesBox->SetStringSelection( apertDescr->m_AperFunction ) )
285  m_canvas->Refresh();
286  }
287  break;
288 
289  case ID_HIGHLIGHT_REMOVE_ALL:
290  m_SelComponentBox->SetSelection( 0 );
291  m_SelNetnameBox->SetSelection( 0 );
292  m_SelAperAttributesBox->SetSelection( 0 );
293 
294  if( GetGbrImage( GetActiveLayer() ) )
295  GetGbrImage( GetActiveLayer() )->m_Selected_Tool = 0;
296 
297  m_canvas->Refresh();
298  break;
299 
300  default:
301  wxFAIL_MSG( wxT( "GERBVIEW_FRAME::Process_Special_Functions error" ) );
302  break;
303  }
304 }
305 
306 
307 void GERBVIEW_FRAME::OnSelectHighlightChoice( wxCommandEvent& event )
308 {
309  if( IsGalCanvasActive() )
310  {
311  auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>( GetGalCanvas()->GetView()->GetPainter() )->GetSettings();
312 
313  switch( event.GetId() )
314  {
316  settings->m_componentHighlightString = m_SelComponentBox->GetStringSelection();
317  break;
318 
320  settings->m_netHighlightString = m_SelNetnameBox->GetStringSelection();
321  break;
322 
324  settings->m_attributeHighlightString = m_SelAperAttributesBox->GetStringSelection();
325  break;
326 
327  }
328 
330  GetGalCanvas()->Refresh();
331  }
332  else
333  m_canvas->Refresh();
334 }
335 
336 
337 void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event )
338 {
339  GERBER_FILE_IMAGE* gerber_image = GetGbrImage( GetActiveLayer() );
340 
341  if( gerber_image )
342  {
343  int tool = m_DCodeSelector->GetSelectedDCodeId();
344 
345  if( tool != gerber_image->m_Selected_Tool )
346  {
347  gerber_image->m_Selected_Tool = tool;
348  m_canvas->Refresh();
349  }
350  }
351 }
352 
353 
354 void GERBVIEW_FRAME::OnSelectActiveLayer( wxCommandEvent& event )
355 {
356  SetActiveLayer( event.GetSelection(), true );
357 }
358 
359 
360 void GERBVIEW_FRAME::OnShowGerberSourceFile( wxCommandEvent& event )
361 {
362  int layer = GetActiveLayer();
363  GERBER_FILE_IMAGE* gerber_layer = GetGbrImage( layer );
364 
365  if( gerber_layer )
366  {
367  wxString editorname = Pgm().GetEditorName();
368 
369  if( !editorname.IsEmpty() )
370  {
371  wxFileName fn( gerber_layer->m_FileName );
372 
373  // Call the editor only if the Gerber/drill source file is available.
374  // This is not always the case, because it can be a temporary file
375  // if it comes from a zip archive.
376  if( !fn.FileExists() )
377  {
378  wxString msg;
379  msg.Printf( _( "Source file \"%s\" is not available" ),
380  GetChars( fn.GetFullPath() ) );
381  wxMessageBox( msg );
382  }
383  else
384  ExecuteFile( this, editorname, QuoteFullPath( fn ) );
385  }
386  else
387  wxMessageBox( _( "No editor defined. Please select one" ) );
388  }
389  else
390  {
391  wxString msg;
392  msg.Printf( _( "No file loaded on the active layer %d" ), layer + 1 );
393  wxMessageBox( msg );
394  }
395 }
396 
397 
398 void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
399 {
400  int oldMode = GetDisplayMode();
401 
402  switch( event.GetId() )
403  {
405  SetDisplayMode( 0 );
406  break;
407 
409  SetDisplayMode( 1 );
410  break;
411 
413  SetDisplayMode( 2 );
414  break;
415  }
416 
417  if( GetDisplayMode() != oldMode )
418  m_canvas->Refresh();
419 }
420 
421 
422 void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event )
423 {
424  Close( true );
425 }
426 
427 
429 {
430  // call my base class
432 
434 
435  wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_LayersManager );
436  pane_info.Caption( _( "Visibles" ) );
437  m_auimgr.Update();
438 
440 }
441 
442 
443 void GERBVIEW_FRAME::OnToggleShowLayerManager( wxCommandEvent& aEvent )
444 {
446 
447  // show/hide auxiliary Vertical layers and visibility manager toolbar
448  m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
449  m_auimgr.Update();
450 }
451 
452 
453 void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
454 {
455  int id = event.GetId();
456  bool needs_refresh = false;
457 
459 
460  switch( id )
461  {
464  m_canvas->Refresh( true );
465  break;
466 
469  m_canvas->Refresh( true );
470  break;
471 
473  options.m_DiffMode = !options.m_DiffMode;
474  needs_refresh = true;
475  break;
476 
478  options.m_HighContrastMode = !options.m_HighContrastMode;
479  needs_refresh = true;
480  break;
481 
482  // collect GAL-only tools here:
484  SetToolID( id, wxCURSOR_DEFAULT, _( "Unsupported tool in this canvas" ) );
485  break;
486 
487  default:
488  wxMessageBox( wxT( "GERBVIEW_FRAME::OnSelectOptionToolbar error" ) );
489  break;
490  }
491 
492  if( needs_refresh )
493  UpdateDisplayOptions( options );
494 }
495 
496 
497 void GERBVIEW_FRAME::OnTogglePolygonDrawMode( wxCommandEvent& aEvent )
498 {
501 
502  UpdateDisplayOptions( options );
503 }
504 
505 
506 void GERBVIEW_FRAME::OnToggleLineDrawMode( wxCommandEvent& aEvent )
507 {
510 
511  UpdateDisplayOptions( options );
512 }
513 
514 
515 void GERBVIEW_FRAME::OnToggleFlashItemDrawMode( wxCommandEvent& aEvent )
516 {
519 
520  UpdateDisplayOptions( options );
521 }
522 
523 
524 void GERBVIEW_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent )
525 {
526  aEvent.Check( GetToolId() == aEvent.GetId() );
527 }
528 
529 
530 void GERBVIEW_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent )
531 {
532  switch( aEvent.GetId() )
533  {
536  break;
537 
540  break;
541 
544  break;
545  }
546 }
547 
548 
549 void GERBVIEW_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent )
550 {
551  wxMenuBar* menuBar = GetMenuBar();
552  EDA_DRAW_PANEL_GAL* gal_canvas = GetGalCanvas();
554 
555  if( IsGalCanvasActive() && gal_canvas )
556  canvasType = gal_canvas->GetBackend();
557 
558  struct { int menuId; int galType; } menuList[] =
559  {
563  };
564 
565  for( auto ii: menuList )
566  {
567  wxMenuItem* item = menuBar->FindItem( ii.menuId );
568  if( ii.galType == canvasType )
569  {
570  item->Check( true );
571  }
572  }
573 }
void OnSelectHighlightChoice(wxCommandEvent &event)
Handles the changing of the highlighted component/net/attribute.
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
SCH_EDIT_FRAME::OnSelectTool SCH_EDIT_FRAME::OnEditItem ID_POPUP_GENERAL_END_RANGE
This file is part of the common library TODO brief description.
GAL_TYPE GetBackend() const
Function GetBackend Returns the type of backend currently used by GAL canvas.
void OnUpdateSelectTool(wxUpdateUIEvent &aEvent)
void OnToggleShowLayerManager(wxCommandEvent &aEvent)
int GetDisplayMode()
Function GetDisplayMode.
void OnQuit(wxCommandEvent &event)
Function OnQuit called on request of application quit.
GERBER_LAYER_WIDGET * m_LayersManager
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1434
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
Function SetActiveLayer will change the currently active layer to aLayer and also update the GERBER_L...
wxString m_Cmpref
the component reference parent of the data
void OnToggleFlashItemDrawMode(wxCommandEvent &aEvent)
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
bool m_HighContrastMode
High contrast mode (dim un-highlighted objects)
wxAuiManager m_auimgr
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Visibility flag has changed.
Definition: view_item.h:56
The base class for create windows for drawing purpose.
Definition: draw_frame.h:78
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
void OnSelectActiveDCode(wxCommandEvent &event)
Function OnSelectActiveDCode Selects the active DCode for the current active layer.
wxChoice * m_SelNetnameBox
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
void OnSelectDisplayMode(wxCommandEvent &event)
Function OnSelectDisplayMode called on a display mode selection Mode selection can be fast display...
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
void SetLayersManagerTabsText()
Function SetLayersManagerTabsText Update the layer manager tabs labels Useful when changing Language ...
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectActiveLayer GERBVIEW_FRAME::OnToggleShowLayerManager EVT_TOOL_RANGE(ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2, GERBVIEW_FRAME::OnSelectDisplayMode) EVT_CHOICE(ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE
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 UpdateDisplayOptions(const GBR_DISPLAY_OPTIONS &aOptions)
Updates the display options and refreshes the view as needed.
a helper to handle the real device context used in KiCad
Class GERBVIEW_PAINTER Contains methods for drawing GerbView-specific items.
FOOTPRINT_EDIT_FRAME::OnVerticalToolbar FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard EVT_UPDATE_UI_RANGE(ID_MODEDIT_PAD_TOOL, ID_MODEDIT_MEASUREMENT_TOOL, FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
int GetSelectedDCodeId()
Function GetSelectedDCodeId.
void ShowChangedLanguage() override
Function ShowChangedLanguage redraws the menus and what not in current language.
Helper dialog and control classes.
wxString m_Netname
for items associated to a net: the netname
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:921
virtual bool SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Changes the current rendering backend.
EVT_TOOL(ID_FOOTPRINT_WIZARD_SELECT_WIZARD, FOOTPRINT_WIZARD_FRAME::SelectCurrentWizard) EVT_TOOL(ID_FOOTPRINT_WIZARD_RESET_TO_DEFAULT
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg)
Set the tool command ID to aId and sets the cursor to aCursor.
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
void OnTogglePolygonDrawMode(wxCommandEvent &aEvent)
void OnShowGerberSourceFile(wxCommandEvent &event)
Function OnShowGerberSourceFile Call the preferred editor to show (and edit) the gerber source file l...
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void OnSelectOptionToolbar(wxCommandEvent &event)
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE ...
Definition: dcode.h:105
FOOTPRINT_EDIT_FRAME::OnVerticalToolbar EVT_MENU(ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, FOOTPRINT_EDIT_FRAME::ProcessPreferences) EVT_MENU(ID_PCB_LIB_TABLE_EDIT
DCODE_SELECTION_BOX * m_DCodeSelector
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:123
const GBR_NETLIST_METADATA & GetNetAttributes() const
void OnToggleLineDrawMode(wxCommandEvent &aEvent)
wxChoice * m_SelAperAttributesBox
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
see class PGM_BASE
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void OnUpdateSwitchCanvas(wxUpdateUIEvent &aEvent)
Update UI called when switches currently used canvas (default / Cairo / OpenGL).
wxString QuoteFullPath(wxFileName &fn, wxPathFormat format)
Quote return value of wxFileName::GetFullPath().
Definition: gestfich.cpp:417
void OnSwitchCanvas(wxCommandEvent &aEvent)
switches currently used canvas (default / Cairo / OpenGL).
#define INSTALL_UNBUFFERED_DC(name, parent)
int GetToolId() const
Definition: draw_frame.h:519
wxChoice * m_SelComponentBox
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:203
#define EVT_SELECT_DCODE
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:928
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectActiveLayer GERBVIEW_FRAME::OnToggleShowLayerManager GERBVIEW_FRAME::OnSelectHighlightChoice EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
bool m_show_layer_manager_tools
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
int ExecuteFile(wxWindow *frame, const wxString &ExecFile, const wxString &param, wxProcess *callback)
Function ExecuteFile calls the executable file ExecFile with the command line parameters param...
Definition: gestfich.cpp:208
virtual void ShowChangedLanguage()
Function ShowChangedLanguage redraws the menus and what not in current language.
void SetElementVisibility(int aLayerID, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
void ReFillLayerWidget()
Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading new ...
void OnSelectActiveLayer(wxCommandEvent &event)
Function OnSelectActiveLayer Selects the active layer:
void SetDisplayMode(int aMode)
Function SetDisplayMode.
bool IsElementVisible(int aLayerID) const
Function IsElementVisible tests whether a given element category is visible.