2007-05-06 16:03:28 +00:00
|
|
|
/*********************************************************************/
|
|
|
|
/** setvisu.cpp: initialisations de l'ecran d'affichage du composant **/
|
|
|
|
/*********************************************************************/
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
|
|
|
#include "wxstruct.h"
|
|
|
|
#include "common.h"
|
|
|
|
#include "cvpcb.h"
|
|
|
|
#include "3d_viewer.h"
|
|
|
|
#include "id.h"
|
|
|
|
#include "bitmaps.h"
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
/*******************************************/
|
2007-09-13 11:55:46 +00:00
|
|
|
void WinEDA_CvpcbFrame::CreateScreenCmp()
|
2007-05-06 16:03:28 +00:00
|
|
|
/*******************************************/
|
|
|
|
/* Creation de la fenetre d'affichage du composant
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
wxString msg, FootprintName;
|
|
|
|
bool IsNew = FALSE;
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
FootprintName = m_FootprintList->GetSelectedFootprint();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
if ( DrawFrame == NULL)
|
|
|
|
{
|
|
|
|
DrawFrame = new WinEDA_DisplayFrame(this, m_Parent, _("Module"),
|
|
|
|
wxPoint(0,0) , wxSize(600,400) );
|
|
|
|
IsNew = TRUE;
|
|
|
|
}
|
|
|
|
else DrawFrame->Maximize(FALSE);
|
|
|
|
|
|
|
|
DrawFrame->SetFocus(); /* Active entree clavier */
|
|
|
|
DrawFrame->Show(TRUE);
|
|
|
|
|
|
|
|
if( ! FootprintName.IsEmpty() )
|
|
|
|
{
|
|
|
|
msg = _("Footprint: ") + FootprintName;
|
2007-06-05 12:10:51 +00:00
|
|
|
DrawFrame->SetTitle(msg);
|
2007-05-06 16:03:28 +00:00
|
|
|
STOREMOD * Module = GetModuleDescrByName(FootprintName);
|
2007-06-05 12:10:51 +00:00
|
|
|
msg = _("Lib: ");
|
|
|
|
if ( Module ) msg += Module->m_LibName;
|
2007-05-06 16:03:28 +00:00
|
|
|
else msg += wxT("???");
|
|
|
|
DrawFrame->SetStatusText(msg, 0);
|
|
|
|
if ( DrawFrame->m_Pcb->m_Modules )
|
|
|
|
{
|
|
|
|
DeleteStructure( DrawFrame->m_Pcb->m_Modules );
|
|
|
|
DrawFrame->m_Pcb->m_Modules = NULL;
|
|
|
|
}
|
|
|
|
DrawFrame->m_Pcb->m_Modules = DrawFrame->Get_Module(FootprintName);
|
|
|
|
DrawFrame->Zoom_Automatique(FALSE);
|
|
|
|
if ( DrawFrame->m_Draw3DFrame )
|
|
|
|
DrawFrame->m_Draw3DFrame->NewDisplay();
|
|
|
|
}
|
|
|
|
|
|
|
|
else if ( !IsNew )
|
|
|
|
{
|
|
|
|
DrawFrame->ReDrawPanel();
|
|
|
|
if ( DrawFrame->m_Draw3DFrame )
|
|
|
|
DrawFrame->m_Draw3DFrame->NewDisplay();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|