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-2016 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>
41 #include <dialog_helpers.h>
45 
46 #include <tool/tool_manager.h>
47 #include <gerbview_painter.h>
48 #include <view/view.h>
49 
50 
51 // Event table:
52 
53 BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME )
54  EVT_CLOSE( GERBVIEW_FRAME::OnCloseWindow )
55  EVT_SIZE( GERBVIEW_FRAME::OnSize )
56 
57  EVT_TOOL( wxID_FILE, GERBVIEW_FRAME::Files_io )
63  EVT_TOOL( ID_GERBVIEW_SET_PAGE_BORDER, GERBVIEW_FRAME::Process_Special_Functions )
64 
65  // Menu Files:
66  EVT_MENU( wxID_FILE, GERBVIEW_FRAME::Files_io )
67  EVT_MENU( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
68  EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, GERBVIEW_FRAME::ExportDataInPcbnewFormat )
69 
70  EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, GERBVIEW_FRAME::OnGbrFileHistory )
71 
73  GERBVIEW_FRAME::OnDrlFileHistory )
74 
76  GERBVIEW_FRAME::OnZipFileHistory )
77 
79  GERBVIEW_FRAME::OnJobFileHistory )
80 
81  EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit )
82 
83  // menu Preferences
85  GERBVIEW_FRAME::Process_Config )
86 
88  GERBVIEW_FRAME::OnSelectOptionToolbar )
89  EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::InstallGerberOptionsDialog )
90  EVT_UPDATE_UI( ID_MENU_CANVAS_LEGACY, GERBVIEW_FRAME::OnUpdateSwitchCanvas )
91  EVT_UPDATE_UI( ID_MENU_CANVAS_CAIRO, GERBVIEW_FRAME::OnUpdateSwitchCanvas )
92  EVT_UPDATE_UI( ID_MENU_CANVAS_OPENGL, GERBVIEW_FRAME::OnUpdateSwitchCanvas )
93  EVT_MENU( ID_MENU_CANVAS_LEGACY, GERBVIEW_FRAME::SwitchCanvas )
94  EVT_MENU( ID_MENU_CANVAS_CAIRO, GERBVIEW_FRAME::SwitchCanvas )
95  EVT_MENU( ID_MENU_CANVAS_OPENGL, GERBVIEW_FRAME::SwitchCanvas )
96 
97  // menu Postprocess
98  EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions )
99  EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::OnShowGerberSourceFile )
101  EDA_BASE_FRAME::OnSelectPreferredEditor )
102 
103  // menu Miscellaneous
104  EVT_MENU( ID_GERBVIEW_ERASE_CURR_LAYER, GERBVIEW_FRAME::Process_Special_Functions )
105 
106  // Menu Help
107  EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
108  EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
109  EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
110  EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
111 
112  EVT_TOOL( wxID_UNDO, GERBVIEW_FRAME::Process_Special_Functions )
113  EVT_TOOL( wxID_PRINT, GERBVIEW_FRAME::ToPrinter )
115  GERBVIEW_FRAME::OnSelectActiveLayer )
116 
118 
119  // Vertical toolbar:
120  EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions )
121 
123  GERBVIEW_FRAME::Process_Special_Functions )
124 
125  // Option toolbar
126  //EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions ) // mentioned below
127  EVT_TOOL( ID_ZOOM_SELECTION, GERBVIEW_FRAME::Process_Special_Functions )
128  EVT_TOOL( ID_TB_MEASUREMENT_TOOL, GERBVIEW_FRAME::Process_Special_Functions )
129  EVT_TOOL( ID_TB_OPTIONS_SHOW_POLAR_COORD, GERBVIEW_FRAME::OnSelectOptionToolbar )
132  EVT_TOOL( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnSelectOptionToolbar )
134  GERBVIEW_FRAME::OnSelectOptionToolbar )
135  EVT_TOOL( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnSelectOptionToolbar )
138  GERBVIEW_FRAME::OnSelectDisplayMode )
139  EVT_TOOL( ID_TB_OPTIONS_DIFF_MODE, GERBVIEW_FRAME::OnSelectOptionToolbar )
140  EVT_TOOL( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, GERBVIEW_FRAME::OnSelectOptionToolbar )
141 
142  // Auxiliary horizontal toolbar
143  EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
144  EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
145  EVT_CHOICE( ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice )
146 
147  // Right click context menu
148  EVT_MENU( ID_HIGHLIGHT_CMP_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
149  EVT_MENU( ID_HIGHLIGHT_NET_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
150  EVT_MENU( ID_HIGHLIGHT_APER_ATTRIBUTE_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
151  EVT_MENU( ID_HIGHLIGHT_REMOVE_ALL, GERBVIEW_FRAME::Process_Special_Functions )
152 
153  EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::OnUpdateSelectTool )
154  EVT_UPDATE_UI( ID_ZOOM_SELECTION, GERBVIEW_FRAME::OnUpdateSelectTool )
155  EVT_UPDATE_UI( ID_TB_MEASUREMENT_TOOL, GERBVIEW_FRAME::OnUpdateSelectTool )
156  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLAR_COORD, GERBVIEW_FRAME::OnUpdateCoordType )
157  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH,
158  GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode )
159  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnUpdateLinesDrawMode )
160  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, GERBVIEW_FRAME::OnUpdatePolygonsDrawMode )
161  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnUpdateShowDCodes )
162  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_NEGATIVE_ITEMS, GERBVIEW_FRAME::OnUpdateShowNegativeItems )
163  EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
164  GERBVIEW_FRAME::OnUpdateShowLayerManager )
165  EVT_UPDATE_UI( ID_TB_OPTIONS_DIFF_MODE, GERBVIEW_FRAME::OnUpdateDiffMode )
166  EVT_UPDATE_UI( ID_TB_OPTIONS_HIGH_CONTRAST_MODE, GERBVIEW_FRAME::OnUpdateHighContrastMode )
167 
168  EVT_UPDATE_UI( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnUpdateSelectDCode )
169  EVT_UPDATE_UI( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
170  GERBVIEW_FRAME::OnUpdateLayerSelectBox )
171  EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2,
172  GERBVIEW_FRAME::OnUpdateDrawMode )
173 
174 END_EVENT_TABLE()
175 
176 
177 /* Handles the selection of tools, menu, and popup menu commands.
178  */
179 void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
180 {
181  int id = event.GetId();
182 
183  switch( id )
184  {
186  case ID_POPUP_ZOOM_BLOCK:
187  break;
188 
190  m_canvas->EndMouseCapture();
191 
192  if( GetScreen()->m_BlockLocate.GetCommand() != BLOCK_IDLE )
193  {
194  /* Should not be executed, except bug */
195  GetScreen()->m_BlockLocate.SetCommand( BLOCK_IDLE );
196  GetScreen()->m_BlockLocate.SetState( STATE_NO_BLOCK );
197  GetScreen()->m_BlockLocate.ClearItemsList();
198  }
199 
200  if( GetToolId() == ID_NO_TOOL_SELECTED )
201  SetNoToolSelected();
202  else
203  m_canvas->SetCursor( (wxStockCursor) m_canvas->GetCurrentCursor() );
204  break;
205 
206  default:
207  m_canvas->EndMouseCapture();
208  break;
209  }
210 
211  INSTALL_UNBUFFERED_DC( dc, m_canvas );
212  GERBER_DRAW_ITEM* currItem = (GERBER_DRAW_ITEM*) GetScreen()->GetCurItem();
213 
214  switch( id )
215  {
216  case ID_GERBVIEW_SET_PAGE_BORDER:
217  {
218  DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this );
219 
220  if( dlg.ShowModal() == wxID_OK )
221  m_canvas->Refresh();
222  }
223  break;
224 
225  case ID_GERBVIEW_ERASE_CURR_LAYER:
226  Erase_Current_DrawLayer( true );
227  ClearMsgPanel();
228  break;
229 
230  case ID_NO_TOOL_SELECTED:
231  SetNoToolSelected();
232  break;
233 
234  case ID_ZOOM_SELECTION:
235  // This tool is located on the main toolbar: switch it on or off on click
236  if( GetToolId() != ID_ZOOM_SELECTION )
237  SetToolID( ID_ZOOM_SELECTION, wxCURSOR_MAGNIFIER, _( "Zoom to selection" ) );
238  else
239  SetNoToolSelected();
240  break;
241 
242  case ID_TB_MEASUREMENT_TOOL:
243  SetToolID( id, wxCURSOR_DEFAULT, _( "Unsupported tool in this canvas" ) );
244  break;
245 
247  SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
248  break;
249 
251  break;
252 
253  case ID_GERBVIEW_SHOW_LIST_DCODES:
254  Liste_D_Codes();
255  break;
256 
258  GetScreen()->m_BlockLocate.SetCommand( BLOCK_MOVE );
259  m_canvas->SetAutoPanRequest( false );
260  HandleBlockPlace( &dc );
261  break;
262 
263  case ID_POPUP_ZOOM_BLOCK:
264  GetScreen()->m_BlockLocate.SetCommand( BLOCK_ZOOM );
265  GetScreen()->m_BlockLocate.SetMessageBlock( this );
266  HandleBlockEnd( &dc );
267  break;
268 
269  case ID_HIGHLIGHT_CMP_ITEMS:
270  if( m_SelComponentBox->SetStringSelection( currItem->GetNetAttributes().m_Cmpref ) )
271  m_canvas->Refresh();
272  break;
273 
274  case ID_HIGHLIGHT_NET_ITEMS:
275  if( m_SelNetnameBox->SetStringSelection( currItem->GetNetAttributes().m_Netname ) )
276  m_canvas->Refresh();
277  break;
278 
279  case ID_HIGHLIGHT_APER_ATTRIBUTE_ITEMS:
280  {
281  D_CODE* apertDescr = currItem->GetDcodeDescr();
282  if( m_SelAperAttributesBox->SetStringSelection( apertDescr->m_AperFunction ) )
283  m_canvas->Refresh();
284  }
285  break;
286 
287  case ID_HIGHLIGHT_REMOVE_ALL:
288  m_SelComponentBox->SetSelection( 0 );
289  m_SelNetnameBox->SetSelection( 0 );
290  m_SelAperAttributesBox->SetSelection( 0 );
291 
292  if( GetGbrImage( GetActiveLayer() ) )
293  GetGbrImage( GetActiveLayer() )->m_Selected_Tool = 0;
294 
295  m_canvas->Refresh();
296  break;
297 
298  default:
299  wxFAIL_MSG( wxT( "GERBVIEW_FRAME::Process_Special_Functions error" ) );
300  break;
301  }
302 }
303 
304 
305 void GERBVIEW_FRAME::OnSelectHighlightChoice( wxCommandEvent& event )
306 {
307  if( IsGalCanvasActive() )
308  {
309  auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>( GetGalCanvas()->GetView()->GetPainter() )->GetSettings();
310 
311  switch( event.GetId() )
312  {
314  settings->m_componentHighlightString = m_SelComponentBox->GetStringSelection();
315  break;
316 
318  settings->m_netHighlightString = m_SelNetnameBox->GetStringSelection();
319  break;
320 
322  settings->m_attributeHighlightString = m_SelAperAttributesBox->GetStringSelection();
323  break;
324 
325  }
326 
328  GetGalCanvas()->Refresh();
329  }
330  else
331  m_canvas->Refresh();
332 }
333 
334 
335 void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event )
336 {
337  GERBER_FILE_IMAGE* gerber_image = GetGbrImage( GetActiveLayer() );
338 
339  if( gerber_image )
340  {
341  int tool = m_DCodeSelector->GetSelectedDCodeId();
342 
343  if( tool != gerber_image->m_Selected_Tool )
344  {
345  gerber_image->m_Selected_Tool = tool;
346  m_canvas->Refresh();
347  }
348  }
349 }
350 
351 
352 void GERBVIEW_FRAME::OnSelectActiveLayer( wxCommandEvent& event )
353 {
354  int layer = GetActiveLayer();
355 
356  SetActiveLayer( event.GetSelection() );
357 
358  if( layer != GetActiveLayer() )
359  {
361  m_canvas->Refresh();
362  }
363 }
364 
365 
366 void GERBVIEW_FRAME::OnShowGerberSourceFile( wxCommandEvent& event )
367 {
368  int layer = GetActiveLayer();
369  GERBER_FILE_IMAGE* gerber_layer = GetGbrImage( layer );
370 
371  if( gerber_layer )
372  {
373  wxString editorname = Pgm().GetEditorName();
374  if( !editorname.IsEmpty() )
375  {
376  wxFileName fn( gerber_layer->m_FileName );
377 
378  // Call the editor only if the Gerber/drill source file is available.
379  // This is not always the case, because it can be a temporary file
380  // if it comes from a zip archive.
381  if( !fn.FileExists() )
382  {
383  wxString msg;
384  msg.Printf( _( "Source file '%s' is not available" ),
385  GetChars( fn.GetFullPath() ) );
386  wxMessageBox( msg );
387  }
388  else
389  ExecuteFile( this, editorname, QuoteFullPath( fn ) );
390  }
391  else
392  wxMessageBox( _( "No editor defined. Please select one" ) );
393  }
394 
395  else
396  {
397  wxString msg;
398  msg.Printf( _( "No file loaded on the active layer %d" ), layer + 1 );
399  wxMessageBox( msg );
400  }
401 }
402 
403 
404 void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
405 {
406  int oldMode = GetDisplayMode();
407 
408  switch( event.GetId() )
409  {
411  SetDisplayMode( 0 );
412  break;
413 
415  SetDisplayMode( 1 );
416  break;
417 
419  SetDisplayMode( 2 );
420  break;
421  }
422 
423  if( GetDisplayMode() != oldMode )
424  m_canvas->Refresh();
425 }
426 
427 
428 void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event )
429 {
430  Close( true );
431 }
432 
433 
435 {
436  // call my base class
438 
440 
441  wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_LayersManager );
442  pane_info.Caption( _( "Visibles" ) );
443  m_auimgr.Update();
444 
446 }
447 
448 
449 void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
450 {
451  int id = event.GetId();
452  bool state;
453 
454  switch( id )
455  {
457  state = ! m_show_layer_manager_tools;
459  break;
460 
461  default:
462  state = m_optionsToolBar->GetToolToggled( id );
463  break;
464  }
465 
466  switch( id )
467  {
470  break;
471 
475  m_canvas->Refresh( true );
476  break;
477 
481  m_canvas->Refresh( true );
482  break;
483 
487  m_canvas->Refresh( true );
488  break;
489 
492  m_canvas->Refresh( true );
493  break;
494 
497  m_canvas->Refresh( true );
498  break;
499 
503  m_canvas->Refresh( true );
504  break;
505 
509  m_canvas->Refresh( true );
510  break;
511 
513 
514  // show/hide auxiliary Vertical layers and visibility manager toolbar
516  m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );
517  m_auimgr.Update();
518  GetMenuBar()->SetLabel( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
520  _("Hide &Layers Manager" ) : _("Show &Layers Manager" ));
521  break;
522 
523  // collect GAL-only tools here:
525  SetToolID( id, wxCURSOR_DEFAULT, _( "Unsupported tool in this canvas" ) );
526  break;
527 
528  default:
529  wxMessageBox( wxT( "GERBVIEW_FRAME::OnSelectOptionToolbar error" ) );
530  break;
531  }
532 }
533 
534 
535 void GERBVIEW_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent )
536 {
537  aEvent.Check( GetToolId() == aEvent.GetId() );
538 }
539 
540 
541 void GERBVIEW_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
542 {
543  bool use_gal = false;
545 
546  switch( aEvent.GetId() )
547  {
549  break;
550 
553 
554  if( use_gal )
556  break;
557 
560 
561  if( use_gal )
563  break;
564  }
565 
566  saveCanvasTypeSetting( canvasType );
567  UseGalCanvas( use_gal );
568  wxUpdateUIEvent e;
570 }
571 
572 
573 void GERBVIEW_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent )
574 {
575  wxMenuBar* menuBar = GetMenuBar();
576  EDA_DRAW_PANEL_GAL* gal_canvas = GetGalCanvas();
578 
579  if( IsGalCanvasActive() && gal_canvas )
580  canvasType = gal_canvas->GetBackend();
581 
582  struct { int menuId; int galType; } menuList[] =
583  {
587  };
588 
589  for( auto ii: menuList )
590  {
591  wxMenuItem* item = menuBar->FindItem( ii.menuId );
592  if( ii.galType == canvasType )
593  {
594  item->Check( true );
595  }
596  }
597 }
void OnSelectHighlightChoice(wxCommandEvent &event)
Handles the changing of the highlighted component/net/attribute.
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EDA_BASE_FRAME::OnSelectPreferredEditor GERBVIEW_FRAME::Process_Special_Functions GERBVIEW_FRAME::OnSelectDisplayMode EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR
This file is part of the common library TODO brief description.
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:325
GAL_TYPE GetBackend() const
Function GetBackend Returns the type of backend currently used by GAL canvas.
void OnUpdateSelectTool(wxUpdateUIEvent &aEvent)
int GetDisplayMode()
Function GetDisplayMode.
GERBVIEW_FRAME::OnZipFileHistory ID_PREFERENCES_HOTKEY_END
virtual bool SwitchBackend(GAL_TYPE aGalType)
Function SwitchBackend Switches method of rendering graphics.
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EDA_BASE_FRAME::OnSelectPreferredEditor GERBVIEW_FRAME::Process_Special_Functions EVT_TOOL(ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, GERBVIEW_FRAME::OnSelectOptionToolbar) EVT_TOOL_RANGE(ID_TB_OPTIONS_SHOW_GBR_MODE_0
void OnQuit(wxCommandEvent &event)
Function OnQuit called on request of application quit.
GERBER_LAYER_WIDGET * m_LayersManager
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1253
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
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
bool m_HighContrastMode
High contrast mode (dim un-highlighted objects)
wxAuiManager m_auimgr
Definition: wxstruct.h:149
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences 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::OnUpdateLoadModuleFromBoard FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard EVT_UPDATE_UI_RANGE(ID_MODEDIT_PAD_TOOL, ID_MODEDIT_MEASUREMENT_TOOL, FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:54
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...
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EDA_BASE_FRAME::OnSelectPreferredEditor EVT_COMBOBOX(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, GERBVIEW_FRAME::OnSelectActiveLayer) EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE
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 ...
bool m_DiffMode
Display layers in diff mode.
FOOTPRINT_EDIT_FRAME::Process_Special_Functions EVT_TOOL_RANGE(ID_MODEDIT_PAD_TOOL, ID_MODEDIT_MEASUREMENT_TOOL, FOOTPRINT_EDIT_FRAME::OnVerticalToolbar) EVT_MENU(ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
a helper to handle the real device context used in KiCad
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:126
Class GERBVIEW_PAINTER Contains methods for drawing GerbView-specific items.
GBR_DISPLAY_OPTIONS m_DisplayOptions
void applyDisplaySettingsToGAL()
Updates the GAL with display settings changes.
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.
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
Helper dialog and control classes.
wxString m_Netname
for items associated to a net: the netname
#define EVT_SELECT_DCODE
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:862
bool m_DisplayPolarCood
Option to display coordinates in status bar in X,Y or Polar coords.
virtual void UseGalCanvas(bool aEnable) override
>
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg)
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
Definition: draw_frame.cpp:546
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
void OnShowGerberSourceFile(wxCommandEvent &event)
Function OnShowGerberSourceFile Call the preferred editor to show (and edit) the gerber source file l...
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EDA_BASE_FRAME::OnSelectPreferredEditor GERBVIEW_FRAME::Process_Special_Functions ID_TB_OPTIONS_SHOW_GBR_MODE_2
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it bu 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
DCODE_SELECTION_BOX * m_DCodeSelector
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
const GBR_NETLIST_METADATA & GetNetAttributes() const
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).
Dialog to show/hide frame reference and select paper size for printing.
wxString QuoteFullPath(wxFileName &fn, wxPathFormat format)
Quote return value of wxFileName::GetFullPath().
Definition: gestfich.cpp:417
void SetElementVisibility(GERBVIEW_LAYER_ID aItemIdVisible, bool aNewState)
Function SetElementVisibility changes the visibility of an element category.
#define INSTALL_UNBUFFERED_DC(name, parent)
int GetToolId() const
Definition: draw_frame.h:471
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:117
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EDA_BASE_FRAME::OnSelectPreferredEditor ID_POPUP_GENERAL_END_RANGE
void SwitchCanvas(wxCommandEvent &aEvent)
switches currently used canvas (default / Cairo / OpenGL).
wxChoice * m_SelComponentBox
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:338
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:870
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
bool m_show_layer_manager_tools
bool saveCanvasTypeSetting(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Stores the canvas type in the application settings.
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
bool OnLayerSelected()
Function OnLayerSelected ensure the active layer is visible, and other layers not visible when m_alwa...
virtual void ShowChangedLanguage()
Function ShowChangedLanguage redraws the menus and what not in current language.
Definition: basicframe.cpp:261
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::Process_Config EVT_MENU(ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG, GERBVIEW_FRAME::OnSelectOptionToolbar) EVT_MENU(ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR
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.