2007-06-05 12:10:51 +00:00
|
|
|
/*******************/
|
|
|
|
/* File: cvpcb.cpp */
|
|
|
|
/*******************/
|
|
|
|
#define MAIN
|
|
|
|
#define eda_global
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include "cvpcb.h"
|
|
|
|
#include "trigo.h"
|
|
|
|
#include "gr_basic.h"
|
|
|
|
|
|
|
|
#include "bitmaps.h"
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
#include "id.h"
|
|
|
|
|
|
|
|
wxString g_Main_Title = wxT("Cvpcb");
|
|
|
|
|
|
|
|
// Create a new application object
|
|
|
|
IMPLEMENT_APP(WinEDA_App)
|
|
|
|
|
|
|
|
/* fonctions locales */
|
|
|
|
|
|
|
|
/************************************/
|
|
|
|
/* Called to initialize the program */
|
|
|
|
/************************************/
|
|
|
|
|
2007-09-13 11:55:46 +00:00
|
|
|
bool WinEDA_App::OnInit()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
wxString msg;
|
|
|
|
wxString currCWD = wxGetCwd();
|
|
|
|
|
2007-10-26 06:08:19 +00:00
|
|
|
g_EDA_Appl = this;
|
2007-06-05 12:10:51 +00:00
|
|
|
InitEDA_Appl( wxT("cvpcb") );
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
if ( m_Checker && m_Checker->IsAnotherRunning() )
|
|
|
|
{
|
2007-06-05 12:10:51 +00:00
|
|
|
if ( ! IsOK(NULL, _("Cvpcb is already running, Continue?") ) )
|
2007-05-06 16:03:28 +00:00
|
|
|
return false;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GetSettings(); // read current setup
|
|
|
|
|
|
|
|
wxSetWorkingDirectory(currCWD); // mofifie par GetSetting
|
|
|
|
SetRealLibraryPath( wxT("modules") );
|
|
|
|
|
|
|
|
if(argc > 1 )
|
|
|
|
{
|
|
|
|
NetInNameBuffer = argv[1];
|
|
|
|
NetNameBuffer = argv[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! NetInNameBuffer.IsEmpty() )
|
|
|
|
wxSetWorkingDirectory( wxPathOnly(NetInNameBuffer) );
|
|
|
|
g_DrawBgColor = BLACK;
|
|
|
|
|
|
|
|
Read_Config(NetInNameBuffer);
|
|
|
|
|
|
|
|
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion();
|
|
|
|
m_CvpcbFrame = new WinEDA_CvpcbFrame(this, Title);
|
|
|
|
|
|
|
|
msg.Printf( wxT("Modules: %d"), nblib);
|
|
|
|
m_CvpcbFrame->SetStatusText(msg,2);
|
|
|
|
|
|
|
|
// Show the frame
|
|
|
|
SetTopWindow(m_CvpcbFrame);
|
|
|
|
|
|
|
|
m_CvpcbFrame->Show(TRUE);
|
|
|
|
|
|
|
|
listlib();
|
|
|
|
m_CvpcbFrame->BuildFootprintListBox();
|
|
|
|
|
|
|
|
if( ! NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */
|
|
|
|
{
|
|
|
|
FFileName = MakeFileName(NetDirBuffer,
|
|
|
|
NetInNameBuffer, NetInExtBuffer);
|
|
|
|
|
|
|
|
m_CvpcbFrame->ReadNetListe();
|
|
|
|
}
|
|
|
|
else /* Mise a jour du titre de la fenetre principale */
|
|
|
|
{
|
|
|
|
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion();
|
|
|
|
msg.Printf( wxT("%s {%s%c} [no file]"),
|
|
|
|
Title.GetData(), wxGetCwd().GetData(), DIR_SEP);
|
|
|
|
m_CvpcbFrame->SetTitle(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|