KiCad PCB EDA Suite
events_called_functions.cpp File Reference

GerbView command event functions. More...

Go to the source code of this file.

Functions

 EVT_MENU_RANGE (ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
 
GERBVIEW_FRAME::OnZipFileHistory EVT_MENU_RANGE (ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, GERBVIEW_FRAME::Process_Config) EVT_MENU(ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG
 
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectOptionToolbar EVT_MENU (ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor) EVT_COMBOBOX(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER
 
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectOptionToolbar GERBVIEW_FRAME::OnSelectActiveLayer EVT_MENU_RANGE (ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, GERBVIEW_FRAME::Process_Special_Functions) EVT_TOOL(ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR
 
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectOptionToolbar GERBVIEW_FRAME::OnSelectActiveLayer GERBVIEW_FRAME::OnSelectOptionToolbar EVT_TOOL_RANGE (ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2, GERBVIEW_FRAME::OnSelectDisplayMode) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH
 
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectOptionToolbar GERBVIEW_FRAME::OnSelectActiveLayer GERBVIEW_FRAME::OnSelectOptionToolbar GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode EVT_UPDATE_UI (ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, GERBVIEW_FRAME::OnUpdateShowLayerManager) EVT_UPDATE_UI(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER
 
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectOptionToolbar GERBVIEW_FRAME::OnSelectActiveLayer GERBVIEW_FRAME::OnSelectOptionToolbar GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode GERBVIEW_FRAME::OnUpdateLayerSelectBox EVT_UPDATE_UI_RANGE (ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2, GERBVIEW_FRAME::OnUpdateDrawMode) void GERBVIEW_FRAME
 

Variables

 ID_GERBVIEW_ZIP_FILE9
 

Detailed Description

GerbView command event functions.

Definition in file events_called_functions.cpp.

Function Documentation

Definition at line 151 of file events_called_functions.cpp.

References BLOCK_IDLE, BLOCK_MOVE, BLOCK_ZOOM, GERBER_DRAW_ITEM::GetDcodeDescr(), GERBER_DRAW_ITEM::GetNetAttributes(), ID_POPUP_CANCEL_CURRENT_COMMAND, ID_POPUP_CLOSE_CURRENT_TOOL, ID_POPUP_PLACE_BLOCK, ID_POPUP_ZOOM_BLOCK, INSTALL_UNBUFFERED_DC, D_CODE::m_AperFunction, GBR_NETLIST_METADATA::m_Cmpref, GBR_NETLIST_METADATA::m_Netname, and STATE_NO_BLOCK.

160 {
161  int id = event.GetId();
162 
163  switch( id )
164  {
166  case ID_POPUP_ZOOM_BLOCK:
167  break;
168 
170  m_canvas->EndMouseCapture();
171 
172  if( GetScreen()->m_BlockLocate.GetCommand() != BLOCK_IDLE )
173  {
174  /* Should not be executed, except bug */
175  GetScreen()->m_BlockLocate.SetCommand( BLOCK_IDLE );
176  GetScreen()->m_BlockLocate.SetState( STATE_NO_BLOCK );
177  GetScreen()->m_BlockLocate.ClearItemsList();
178  }
179 
180  if( GetToolId() == ID_NO_TOOL_SELECTED )
181  SetNoToolSelected();
182  else
183  m_canvas->SetCursor( (wxStockCursor) m_canvas->GetCurrentCursor() );
184  break;
185 
186  default:
187  m_canvas->EndMouseCapture();
188  break;
189  }
190 
191  INSTALL_UNBUFFERED_DC( dc, m_canvas );
192  GERBER_DRAW_ITEM* currItem = (GERBER_DRAW_ITEM*) GetScreen()->GetCurItem();
193 
194  switch( id )
195  {
197  {
198  DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this );
199 
200  if( dlg.ShowModal() == wxID_OK )
201  m_canvas->Refresh();
202  }
203  break;
204 
206  Erase_Current_DrawLayer( true );
207  ClearMsgPanel();
208  break;
209 
210  case ID_NO_TOOL_SELECTED:
211  SetNoToolSelected();
212  break;
213 
214  case ID_ZOOM_SELECTION:
215  // This tool is located on the main toolbar: switch it on or off on click
216  if( GetToolId() != ID_ZOOM_SELECTION )
217  SetToolID( ID_ZOOM_SELECTION, wxCURSOR_MAGNIFIER, _( "Zoom to selection" ) );
218  else
219  SetNoToolSelected();
220  break;
221 
223  SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString );
224  break;
225 
227  break;
228 
230  Liste_D_Codes();
231  break;
232 
234  GetScreen()->m_BlockLocate.SetCommand( BLOCK_MOVE );
235  m_canvas->SetAutoPanRequest( false );
236  HandleBlockPlace( &dc );
237  break;
238 
239  case ID_POPUP_ZOOM_BLOCK:
240  GetScreen()->m_BlockLocate.SetCommand( BLOCK_ZOOM );
241  GetScreen()->m_BlockLocate.SetMessageBlock( this );
242  HandleBlockEnd( &dc );
243  break;
244 
248  m_canvas->Refresh();
249  break;
250 
252  if( m_SelComponentBox->SetStringSelection( currItem->GetNetAttributes().m_Cmpref ) )
253  m_canvas->Refresh();
254  break;
255 
257  if( m_SelNetnameBox->SetStringSelection( currItem->GetNetAttributes().m_Netname ) )
258  m_canvas->Refresh();
259  break;
260 
262  {
263  D_CODE* apertDescr = currItem->GetDcodeDescr();
264  if( m_SelAperAttributesBox->SetStringSelection( apertDescr->m_AperFunction ) )
265  m_canvas->Refresh();
266  }
267  break;
268 
270  m_SelComponentBox->SetSelection( 0 );
271  m_SelNetnameBox->SetSelection( 0 );
272  m_SelAperAttributesBox->SetSelection( 0 );
273 
274  if( GetGbrImage( getActiveLayer() ) )
275  GetGbrImage( getActiveLayer() )->m_Selected_Tool = 0;
276 
277  m_canvas->Refresh();
278  break;
279 
280  default:
281  wxFAIL_MSG( wxT( "GERBVIEW_FRAME::Process_Special_Functions error" ) );
282  break;
283  }
284 }
D_CODE * GetDcodeDescr()
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
wxString m_Cmpref
the component reference parent of the data
wxString m_Netname
for items associated to a net: the netname
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE ...
Definition: dcode.h:109
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:81
#define INSTALL_UNBUFFERED_DC(name, parent)
const GBR_NETLIST_METADATA & GetNetAttributes()

Variable Documentation

ID_GERBVIEW_ZIP_FILE9

Definition at line 70 of file events_called_functions.cpp.