int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) { VECTOR2D* origin = aEvent.Parameter<VECTOR2D*>(); if( origin ) { setOrigin( getView(), m_frame, m_gridOrigin, *origin ); delete origin; } else { Activate(); PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>(); assert( picker ); // TODO it will not check the toolbar button in module editor, as it uses a different ID.. m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL, _( "Adjust grid origin" ) ); picker->SetClickHandler( boost::bind( setOrigin, getView(), m_frame, m_gridOrigin, _1 ) ); picker->Activate(); Wait(); } return 0; }
int PCB_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent ) { Activate(); PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>(); assert( picker ); m_frame->SetToolID( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxCURSOR_PENCIL, _( "Adjust zero" ) ); picker->SetClickHandler( boost::bind( setDrillOrigin, getView(), m_frame, m_placeOrigin, _1 ) ); picker->Activate(); Wait(); return 0; }
int PCB_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent ) { Activate(); PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>(); assert( picker ); m_frame->SetToolID( ID_PCB_HIGHLIGHT_BUTT, wxCURSOR_PENCIL, _( "Highlight net" ) ); picker->SetClickHandler( boost::bind( highlightNet, m_toolMgr, _1 ) ); picker->SetSnapping( false ); picker->Activate(); Wait(); return 0; }
int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) { Activate(); PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>(); assert( picker ); // TODO it will not check the toolbar button in the module editor, as it uses a different ID.. m_frame->SetToolID( ID_PCB_DELETE_ITEM_BUTT, wxCURSOR_PENCIL, _( "Delete item" ) ); picker->SetSnapping( false ); picker->SetClickHandler( boost::bind( deleteItem, m_toolMgr, _1 ) ); picker->Activate(); Wait(); return 0; }