/** * Function SelectCurrentFootprint * Selects the current footprint name and display it */ void FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint( wxCommandEvent& event ) { wxString libname = m_libraryName + wxT(".") + LegacyFootprintLibPathExtension; MODULE* oldmodule = GetBoard()->m_Modules; MODULE * module = Load_Module_From_Library( libname, false ); if( module ) { module->SetPosition( wxPoint( 0, 0 ) ); // Only one fotprint allowed: remove the previous footprint (if exists) if( oldmodule ) { GetBoard()->Remove( oldmodule ); delete oldmodule; } m_footprintName = module->GetLibRef(); module->ClearFlags(); SetCurItem( NULL ); Zoom_Automatique( false ); m_canvas->Refresh( ); Update3D_Frame(); m_FootprintList->SetStringSelection( m_footprintName ); } }