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
|
|
|
/*******************************************/
|
2007-10-03 15:21:13 +00:00
|
|
|
|
2007-10-27 12:24:09 +00:00
|
|
|
/* Create or Update the frame showing the current highlighted footprint
|
|
|
|
* and (if showed) the 3D display frame
|
2007-10-03 15:21:13 +00:00
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-10-03 15:21:13 +00:00
|
|
|
wxString msg, FootprintName;
|
|
|
|
bool IsNew = FALSE;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
FootprintName = m_FootprintList->GetSelectedFootprint();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
if( DrawFrame == NULL )
|
|
|
|
{
|
|
|
|
DrawFrame = new WinEDA_DisplayFrame( this, m_Parent, _( "Module" ),
|
2007-10-27 12:24:09 +00:00
|
|
|
wxPoint( 0, 0 ), wxSize( 600,
|
|
|
|
400 ),
|
|
|
|
KICAD_DEFAULT_DRAWFRAME_STYLE |
|
|
|
|
wxFRAME_FLOAT_ON_PARENT );
|
2007-10-03 15:21:13 +00:00
|
|
|
IsNew = TRUE;
|
2007-10-27 12:24:09 +00:00
|
|
|
DrawFrame->Show( TRUE );
|
2007-10-03 15:21:13 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
if( !FootprintName.IsEmpty() )
|
|
|
|
{
|
|
|
|
msg = _( "Footprint: " ) + FootprintName;
|
|
|
|
DrawFrame->SetTitle( msg );
|
|
|
|
STOREMOD* Module = GetModuleDescrByName( FootprintName );
|
|
|
|
msg = _( "Lib: " );
|
2007-10-27 12:24:09 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
if( Module )
|
|
|
|
msg += Module->m_LibName;
|
|
|
|
else
|
|
|
|
msg += wxT( "???" );
|
2007-10-27 12:24:09 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
DrawFrame->SetStatusText( msg, 0 );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
if( DrawFrame->m_Pcb->m_Modules )
|
|
|
|
{
|
|
|
|
// there is only one module in the list
|
|
|
|
DrawFrame->m_Pcb->m_Modules->DeleteStructure();
|
2007-10-27 12:24:09 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
DrawFrame->m_Pcb->m_Modules = NULL;
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-10-03 15:21:13 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
2007-10-27 12:24:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************/
|
|
|
|
void WinEDA_DisplayFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|
|
|
/*******************************************************************/
|
|
|
|
/* Draws the current highlighted footprint */
|
|
|
|
{
|
|
|
|
if( !m_Pcb )
|
|
|
|
return;
|
|
|
|
|
|
|
|
MODULE* Module = m_Pcb->m_Modules;
|
|
|
|
|
|
|
|
ActiveScreen = (PCB_SCREEN*) GetScreen();
|
|
|
|
|
|
|
|
if( EraseBg )
|
|
|
|
DrawPanel->EraseScreen( DC );
|
|
|
|
|
|
|
|
DrawPanel->DrawBackGround( DC );
|
|
|
|
|
|
|
|
if( Module )
|
|
|
|
{
|
2008-04-01 05:21:50 +00:00
|
|
|
Module->Draw( DrawPanel, DC, GR_COPY );
|
2007-10-27 12:24:09 +00:00
|
|
|
Module->Display_Infos( this );
|
|
|
|
}
|
|
|
|
|
|
|
|
Affiche_Status_Box();
|
|
|
|
DrawPanel->Trace_Curseur( DC );
|
|
|
|
}
|