void FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint( wxCommandEvent& event ) { PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); wxString libname = m_libraryName + wxT( "." ) + LegacyFootprintLibPathExtension; MODULE* oldmodule = GetBoard()->m_Modules; MODULE* module = LoadModuleFromLibrary( libname, parent->FootprintLibs(), false ); if( module ) { module->SetPosition( wxPoint( 0, 0 ) ); // Only one footprint allowed: remove the previous footprint (if exists) if( oldmodule ) { GetBoard()->Remove( oldmodule ); delete oldmodule; } m_footprintName = FROM_UTF8( module->GetFPID().GetFootprintName().c_str() ); module->ClearFlags(); SetCurItem( NULL ); Zoom_Automatique( false ); m_canvas->Refresh(); Update3D_Frame(); m_footprintList->SetStringSelection( m_footprintName ); } }