@ -466,59 +466,43 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
void DISPLAY_FOOTPRINTS_FRAME : : InitDisplay ( )
{
wxString msg ;
CVPCB_MAINFRAME * parentframe = ( CVPCB_MAINFRAME * ) GetParent ( ) ;
MODULE * module = nullptr ;
const FOOTPRINT_INFO * module_info = nullptr ;
CVPCB_MAINFRAME * parentframe = ( CVPCB_MAINFRAME * ) GetParent ( ) ;
if ( GetBoard ( ) - > m_Modules . GetCount ( ) )
GetBoard ( ) - > m_Modules . DeleteAll ( ) ;
wxString footprintName = parentframe - > GetSelectedFootprint ( ) ;
if ( ! footprintName . IsEmpty ( ) )
if ( footprintName . IsEmpty ( ) )
{
msg . Printf ( _ ( " Footprint: %s " ) , GetChars ( footprintName ) ) ;
SetTitle ( msg ) ;
const FOOTPRINT_INFO * module_info =
parentframe - > m_FootprintsList - > GetModuleInfo ( footprintName ) ;
const wxChar * libname ;
COMPONENT * comp = parentframe - > GetSelectedComponent ( ) ;
if ( module_info )
libname = GetChars ( module_info - > GetNickname ( ) ) ;
else
libname = GetChars ( wxT ( " ??? " ) ) ;
msg . Printf ( _ ( " Lib: %s " ) , libname ) ;
if ( comp )
footprintName = comp - > GetFPID ( ) . GetUniStringLibId ( ) ;
}
SetStatusText ( msg , 0 ) ;
if ( ! footprintName . IsEmpty ( ) )
{
SetTitle ( wxString : : Format ( _ ( " Footprint: %s " ) , footprintName ) ) ;
if ( GetBoard ( ) - > m_Modules . GetCount ( ) )
{
// there is only one module in the list
GetBoard ( ) - > m_Modules . DeleteAll ( ) ;
}
module = Get_Module ( footprintName ) ;
MODULE * module = Get_Module ( footprintName ) ;
module_info = parentframe - > m_FootprintsList - > GetModuleInfo ( footprintName ) ;
}
if ( module )
GetBoard ( ) - > m_Modules . PushBack ( module ) ;
if ( module )
GetBoard ( ) - > m_Modules . PushBack ( module ) ;
Zoom_Automatique ( false ) ;
}
else // No footprint to display. Erase old footprint, if any
{
if ( GetBoard ( ) - > m_Modules . GetCount ( ) )
{
GetBoard ( ) - > m_Modules . DeleteAll ( ) ;
Zoom_Automatique ( false ) ;
SetStatusText ( wxEmptyString , 0 ) ;
}
}
if ( module_info )
SetStatusText ( wxString : : Format ( _ ( " Lib: %s " ) , module_info - > GetNickname ( ) ) , 0 ) ;
else
SetStatusText ( wxEmptyString , 0 ) ;
// Display new cursor coordinates and zoom value:
UpdateStatusBar ( ) ;
Zoom_Automatique ( false ) ;
GetCanvas ( ) - > Refresh ( ) ;
Update3DView ( ) ;
}