diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 4b81f604ec..1e07c80bff 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -1279,6 +1279,29 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) m_canvas->Refresh(); break; + case ID_POPUP_PCB_SPREAD_ALL_MODULES: + if( !IsOK( this, + _("Not locked footprints inside the board will be moved. OK?") ) ) + break; + // Fall through + case ID_POPUP_PCB_SPREAD_NEW_MODULES: + if( GetBoard()->m_Modules == NULL ) + { + DisplayError( this, _( "No footprint found!" ) ); + return; + } + else + { + MODULE* footprint = GetBoard()->m_Modules; + std::vector footprintList; + for( ; footprint != NULL; footprint = footprint->Next() ) + footprintList.push_back( footprint ); + + SpreadFootprints( &footprintList, id == ID_POPUP_PCB_SPREAD_NEW_MODULES, + true, GetCrossHairPosition() ); + } + break; + default: wxString msg; msg.Printf( wxT( "PCB_EDIT_FRAME::Process_Special_Functions() unknown event id %d" ), id ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index db6122a0a1..e38fe58c94 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -274,6 +274,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_MENU( ID_POPUP_PCB_DELETE_TRACKSEG, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_POPUP_PCB_SPREAD_ALL_MODULES, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_POPUP_PCB_SPREAD_NEW_MODULES, PCB_EDIT_FRAME::Process_Special_Functions ) // User interface update event handlers. EVT_UPDATE_UI( ID_SAVE_BOARD, PCB_EDIT_FRAME::OnUpdateSave )