Commit aa51c05d authored by stambaughw's avatar stambaughw

CVPcb code refactoring, global variable elimination, and UI updates.

* Add methods to read and write project file parameters using dynamically defined list.
* Remove all global variables defined in CVPcb code.
* Dynamically define project file settings so class member variables can be used.
* Separate reading and writing application settings from project file settings.
* Make application UI objects and dialogs respect system UI font.
* Remove non-standard widget colors from CVPcb dialogs.
* Changed CVPcb object link list implementation to use wxList.
* Changed project library and path dialog to make OK button save project file instead of confusing "Save Cfg" button.
* Eliminate some duplicate file wildcard and extension definitions.
* The usual code reformatting, commenting, and spelling fixes.
parent bd3b4baa
...@@ -53,6 +53,7 @@ const wxString SchematicFileExtension( wxT( "sch" ) ); ...@@ -53,6 +53,7 @@ const wxString SchematicFileExtension( wxT( "sch" ) );
const wxString BoardFileExtension( wxT( "brd" ) ); const wxString BoardFileExtension( wxT( "brd" ) );
const wxString NetlistFileExtension( wxT( "net" ) ); const wxString NetlistFileExtension( wxT( "net" ) );
const wxString GerberFileExtension( wxT( "pho" ) ); const wxString GerberFileExtension( wxT( "pho" ) );
const wxString PdfFileExtension( wxT( "pdf" ) );
/* Proper wxFileDialog wild card definitions. */ /* Proper wxFileDialog wild card definitions. */
const wxString ProjectFileWildcard( _( "Kicad project files (*.pro)|*.pro" ) ); const wxString ProjectFileWildcard( _( "Kicad project files (*.pro)|*.pro" ) );
...@@ -60,6 +61,7 @@ const wxString BoardFileWildcard( _( "Kicad PCB files (*.brd)|*.brd") ); ...@@ -60,6 +61,7 @@ const wxString BoardFileWildcard( _( "Kicad PCB files (*.brd)|*.brd") );
const wxString SchematicFileWildcard( _( "Kicad schematic files (*.sch)|*.sch" ) ); const wxString SchematicFileWildcard( _( "Kicad schematic files (*.sch)|*.sch" ) );
const wxString NetlistFileWildcard( _( "Kicad netlist files (*.net)|*.net" ) ); const wxString NetlistFileWildcard( _( "Kicad netlist files (*.net)|*.net" ) );
const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) ); const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) );
const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) );
const wxString AllFilesWildcard( _( "All files (*)|*") ); const wxString AllFilesWildcard( _( "All files (*)|*") );
......
...@@ -149,7 +149,7 @@ bool GetAssociatedDocument( wxFrame* aFrame, ...@@ -149,7 +149,7 @@ bool GetAssociatedDocument( wxFrame* aFrame,
if( !wxFileExists( fullfilename ) ) if( !wxFileExists( fullfilename ) )
{ {
msg = _( "Doc File " ); msg = _( "Doc File " );
msg << wxT("\"") << fullfilename << wxT("\"") << _( " not found" ); msg << wxT("\"") << aDocName << wxT("\"") << _( " not found" );
DisplayError( aFrame, msg ); DisplayError( aFrame, msg );
return FALSE; return FALSE;
} }
......
...@@ -179,6 +179,62 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName, ...@@ -179,6 +179,62 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
m_ProjectConfig = NULL; m_ProjectConfig = NULL;
} }
void WinEDA_App::WriteProjectConfig( const wxString& fileName,
const wxString& GroupName,
const PARAM_CFG_ARRAY& params )
{
PARAM_CFG_BASE* param;
wxString msg;
size_t i;
ReCreatePrjConfig( fileName, GroupName, FORCE_LOCAL_CONFIG );
/* Write date ( surtout pour eviter bug de wxFileConfig
* qui se trompe de rubrique si declaration [xx] en premiere ligne
* (en fait si groupe vide) */
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
msg = DateAndTime();
m_ProjectConfig->Write( wxT( "update" ), msg );
msg = GetAppName();
m_ProjectConfig->Write( wxT( "last_client" ), msg );
/* Save parameters */
m_ProjectConfig->DeleteGroup( GroupName ); // Erase all datas
m_ProjectConfig->Flush();
m_ProjectConfig->SetPath( GroupName );
m_ProjectConfig->Write( wxT( "version" ), CONFIG_VERSION );
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
for( i = 0; i < params.GetCount(); i++ )
{
param = &params[i];
if( param->m_Group )
m_ProjectConfig->SetPath( param->m_Group );
else
m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup )
continue;
if ( param->m_Type == PARAM_COMMAND_ERASE ) // Erase all data
{
if( param->m_Ident )
m_ProjectConfig->DeleteGroup( param->m_Ident );
}
else
param->SaveParam( m_ProjectConfig );
}
m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP );
delete m_ProjectConfig;
m_ProjectConfig = NULL;
}
/*****************************************************************/ /*****************************************************************/
void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList ) void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
/*****************************************************************/ /*****************************************************************/
...@@ -277,6 +333,60 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, ...@@ -277,6 +333,60 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
} }
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName,
const PARAM_CFG_ARRAY& params,
bool Load_Only_if_New )
{
size_t i;
PARAM_CFG_BASE* param;
wxString timestamp;
ReCreatePrjConfig( local_config_filename, GroupName, false );
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
timestamp = m_ProjectConfig->Read( wxT( "update" ) );
if( Load_Only_if_New && ( !timestamp.IsEmpty() )
&& (timestamp == m_CurrentOptionFileDateAndTime) )
{
return false;
}
m_CurrentOptionFileDateAndTime = timestamp;
if( !g_Prj_Default_Config_FullFilename.IsEmpty() )
m_CurrentOptionFile = g_Prj_Default_Config_FullFilename;
else
{
if( wxPathOnly( g_Prj_Config_LocalFilename ).IsEmpty() )
m_CurrentOptionFile = wxGetCwd() + STRING_DIR_SEP +
g_Prj_Config_LocalFilename;
else
m_CurrentOptionFile = g_Prj_Config_LocalFilename;
}
for( i = 0; i < params.GetCount(); i++ )
{
param = &params[i];
if( param->m_Group )
m_ProjectConfig->SetPath( param->m_Group );
else
m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup )
continue;
param->ReadParam( m_ProjectConfig );
}
delete m_ProjectConfig;
m_ProjectConfig = NULL;
return true;
}
/***************************************************************/ /***************************************************************/
void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList ) void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList )
/***************************************************************/ /***************************************************************/
......
...@@ -26,7 +26,6 @@ WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent, ...@@ -26,7 +26,6 @@ WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent,
m_Title = new wxStaticText( parent, -1, Title ); m_Title = new wxStaticText( parent, -1, Title );
m_Title->SetForegroundColour( wxColour( 200, 0, 0 ) );
BoxSizer->Add( m_Title, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 ); BoxSizer->Add( m_Title, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 );
m_FrameText = new wxTextCtrl( parent, -1, TextToEdit, wxDefaultPosition, Size ); m_FrameText = new wxTextCtrl( parent, -1, TextToEdit, wxDefaultPosition, Size );
......
...@@ -21,7 +21,6 @@ set(CVPCB_SRCS ...@@ -21,7 +21,6 @@ set(CVPCB_SRCS
listboxes.cpp listboxes.cpp
listlib.cpp listlib.cpp
loadcmp.cpp loadcmp.cpp
memoire.cpp
menucfg.cpp menucfg.cpp
readschematicnetlist.cpp readschematicnetlist.cpp
savecmp.cpp savecmp.cpp
...@@ -29,17 +28,6 @@ set(CVPCB_SRCS ...@@ -29,17 +28,6 @@ set(CVPCB_SRCS
tool_cvpcb.cpp tool_cvpcb.cpp
writenetlistpcbnew.cpp) writenetlistpcbnew.cpp)
set(CVPCB_EXTRA_SRCS
# ../pcbnew/class_board_item.cpp
# ../pcbnew/class_drawsegment.cpp
# ../pcbnew/class_edge_mod.cpp
# ../pcbnew/class_equipot.cpp
# ../pcbnew/class_module.cpp
# ../pcbnew/class_text_mod.cpp
../pcbnew/ioascii.cpp
# ../pcbnew/tracemod.cpp
)
if(WIN32) if(WIN32)
if(MINGW) if(MINGW)
# CVPCB_RESOURCES variable is set by the macro. # CVPCB_RESOURCES variable is set by the macro.
...@@ -58,7 +46,7 @@ if(APPLE) ...@@ -58,7 +46,7 @@ if(APPLE)
set(MACOSX_BUNDLE_NAME cvpcb) set(MACOSX_BUNDLE_NAME cvpcb)
endif(APPLE) endif(APPLE)
add_executable(cvpcb WIN32 MACOSX_BUNDLE ${CVPCB_SRCS} ${CVPCB_EXTRA_SRCS} ${CVPCB_RESOURCES}) add_executable(cvpcb WIN32 MACOSX_BUNDLE ${CVPCB_SRCS} ${CVPCB_RESOURCES})
target_link_libraries(cvpcb 3d-viewer common pcbcommon polygon bitmaps kbool ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES}) target_link_libraries(cvpcb 3d-viewer common pcbcommon polygon bitmaps kbool ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES})
......
...@@ -29,40 +29,66 @@ public: ...@@ -29,40 +29,66 @@ public:
}; };
/* routines locales : */ /*
static int auto_select( WinEDA_CvpcbFrame* frame, * read the string between quotes and put it in aTarget
STORECMP* Cmp, * put text in aTarget
AUTOMODULE* BaseListeMod ); * return a pointer to the last read char (the second quote if Ok)
static char * ReadQuotedText(wxString & aTarget, char * aText); */
char * ReadQuotedText(wxString & aTarget, char * aText)
{
// search the first quote:
for( ; *aText != 0; aText++ )
{
if( *aText == QUOTE )
break;
}
/*************************************************************/ if ( *aText == 0 )
void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event ) return NULL;
/*************************************************************/
/* Called by the automatic association button aText++;
* Read *.equ files to try to find acorresponding footprint for(; *aText != 0; aText++ )
* for each component that is not already linked to a footprint ( a "free" component ) {
if( *aText == QUOTE )
break;
aTarget.Append(*aText);
}
return aText;
}
/*
* Called by the automatic association button
* Read *.equ files to try to find corresponding footprint
* for each component that is not already linked to a footprint ( a "free"
* component )
* format of a line: * format of a line:
* 'cmp_ref' 'footprint_name' * 'cmp_ref' 'footprint_name'
*/ */
void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
{ {
COMPONENT_LIST::iterator iCmp;
FOOTPRINT_LIST::iterator iFp;
wxFileName fn; wxFileName fn;
wxString msg, tmp; wxString msg, tmp;
char Line[1024]; char Line[1024];
FILE* file; FILE* file;
AUTOMODULE* ItemModule, * NextMod; AUTOMODULE* ItemModule, * NextMod;
AUTOMODULE* BaseListeMod = NULL; AUTOMODULE* BaseListeMod = NULL;
STORECMP* Component; COMPONENT* Component;
FOOTPRINT* footprint;
size_t ii;
int nb_correspondances = 0; int nb_correspondances = 0;
if( nbcomp <= 0 ) if( m_components.empty() )
return; return;
/* recherche des equivalences a travers les fichiers possibles */ /* recherche des equivalences a travers les fichiers possibles */
for( unsigned ii = 0; ii < g_ListName_Equ.GetCount(); ii++ ) for( ii = 0; ii < m_AliasLibNames.GetCount(); ii++ )
{ {
fn = g_ListName_Equ[ii]; fn = m_AliasLibNames[ii];
fn.SetExt( EquivFileExtension ); fn.SetExt( FootprintAliasFileExtension );
tmp = wxGetApp().FindLibraryPath( fn ); tmp = wxGetApp().FindLibraryPath( fn );
...@@ -110,100 +136,49 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event ) ...@@ -110,100 +136,49 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
fclose( file ); fclose( file );
} }
/* display some info */ /* display some info */
msg.Printf( _( "%d equivalences" ), nb_correspondances ); msg.Printf( _( "%d equivalences" ), nb_correspondances );
SetStatusText( msg, 0 ); SetStatusText( msg, 0 );
wxMessageBox(msg); wxMessageBox(msg);
Component = g_BaseListeCmp; for( iCmp = m_components.begin(); iCmp != m_components.end(); ++iCmp )
for( unsigned ii = 0; Component != NULL; Component = Component->Pnext, ii++ )
{
m_ListCmp->SetSelection( ii, TRUE );
if( Component->m_Module.IsEmpty() )
auto_select( this, Component, BaseListeMod );
}
/* free memory: */
for( ItemModule = BaseListeMod; ItemModule != NULL; ItemModule = NextMod )
{
NextMod = ItemModule->Pnext;
delete ItemModule;
}
BaseListeMod = NULL;
}
/***************************************************/
char * ReadQuotedText(wxString & aTarget, char * aText)
/***************************************************/
/** read the string between quotes and put it in aTarget
* put text in aTarget
* return a pointer to the last read char (the second quote if Ok)
*/
{
// search the first quote:
for( ; *aText != 0; aText++ )
{ {
if( *aText == QUOTE ) Component = *iCmp;
break; m_ListCmp->SetSelection( m_components.IndexOf( Component ), TRUE );
}
if ( *aText == 0 ) if( Component->m_Module.IsEmpty() )
return NULL;
aText++;
for(; *aText != 0; aText++ )
{ {
if( *aText == QUOTE )
break;
aTarget.Append(*aText);
}
return aText;
}
/****************************************************************/
int auto_select( WinEDA_CvpcbFrame* frame, STORECMP* Cmp,
AUTOMODULE* BaseListeMod )
/****************************************************************/
/* associe automatiquement composant et Module
* Retourne;
* 0 si OK
* 1 si module specifie non trouve en liste librairie
* 2 si pas de module specifie dans la liste des equivalences
*/
{
AUTOMODULE* ItemModule;
STOREMOD* Module;
wxString msg;
/* examen de la liste des correspondances */
ItemModule = BaseListeMod; ItemModule = BaseListeMod;
for( ; ItemModule != NULL; ItemModule = ItemModule->Pnext ) for( ; ItemModule != NULL; ItemModule = ItemModule->Pnext )
{ {
if( ItemModule->m_Name.CmpNoCase( Cmp->m_Valeur ) != 0 ) if( ItemModule->m_Name.CmpNoCase( Component->m_Valeur ) != 0 )
continue; continue;
/* Correspondance trouvee, recherche nom module dans la liste des for( iFp = m_footprints.begin(); iFp != m_footprints.end(); ++iFp )
* modules disponibles en librairie */
Module = g_BaseListePkg;
for( ; Module != NULL; Module = Module->Pnext )
{ {
if( ItemModule->m_LibName.CmpNoCase( Module->m_Module ) == 0 ) footprint = *iFp;
if( ItemModule->m_LibName.CmpNoCase( footprint->m_Module ) == 0 )
{ {
frame->SetNewPkg( Module->m_Module ); SetNewPkg( footprint->m_Module );
return 0; break;
} }
} }
msg.Printf( _( "Component %s: Footprint %s not found in libraries" ), msg.Printf( _( "Component %s: Footprint %s not found in " \
Cmp->m_Valeur.GetData(), ItemModule->m_LibName.GetData() ); "libraries" ), Component->m_Valeur.GetData(),
DisplayError( frame, msg, 10 ); ItemModule->m_LibName.GetData() );
return 2; DisplayError( this, msg, 10 );
}
}
}
/* free memory: */
for( ItemModule = BaseListeMod; ItemModule != NULL; ItemModule = NextMod )
{
NextMod = ItemModule->Pnext;
delete ItemModule;
} }
return 1; BaseListeMod = NULL;
} }
...@@ -8,74 +8,105 @@ ...@@ -8,74 +8,105 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "gestfich.h" #include "gestfich.h"
#include "param_config.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "cfg.h"
/* Routines Locales */
/**/
#define GROUP wxT("/cvpcb")
#define GROUPLIB wxT("/pcbnew/libraries")
#define GROUPEQU wxT("/cvpcb/libraries")
/**************************************************/
void Read_Config( const wxString& FileName )
/**************************************************/
/* lit la configuration /**
* Return project file parameter list for CVPcb.
*
* Populate the project file parameter array specific to CVPcb if it hasn't
* already been populated and return a reference to the array to the caller.
* Creating the parameter list at run time has the advantage of being able
* to define local variables. The old method of statically building the array
* at compile time requiring global variable definitions.
*/
const PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void )
{
if( !m_projectFileParams.IsEmpty() )
return m_projectFileParams;
m_projectFileParams.Add( new PARAM_CFG_BASE( GROUPLIB,
PARAM_COMMAND_ERASE ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ModuleLibNames,
GROUPLIB ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ),
&m_AliasLibNames,
GROUPEQU ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ),
&m_NetlistFileExtension ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
&m_UserLibraryPath,
GROUPLIB ) );
return m_projectFileParams;
}
/**
* lit la configuration
* 1 - lit cvpcb.cnf * 1 - lit cvpcb.cnf
* 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf * 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut * 3 - si non trouve: init des variables aux valeurs par defaut
* *
* Remarque: * Remarque:
* le chemin de l'executable cvpcb.exe doit etre dans BinDir * le chemin de l'executable cvpcb.exe doit etre dans BinDir
*
*/ */
void WinEDA_CvpcbFrame::LoadProjectFile( const wxString& FileName )
{ {
wxFileName fn = FileName; wxFileName fn = FileName;
/* Init des valeurs par defaut */ /* Init des valeurs par defaut */
g_LibName_List.Clear(); m_ModuleLibNames.Clear();
g_ListName_Equ.Clear(); m_AliasLibNames.Clear();
if( fn.GetExt() != ProjectFileExtension ) if( fn.GetExt() != ProjectFileExtension )
fn.SetExt( ProjectFileExtension ); fn.SetExt( ProjectFileExtension );
wxGetApp().RemoveLibraryPath( g_UserLibDirBuffer ); wxGetApp().RemoveLibraryPath( m_UserLibraryPath );
wxGetApp().ReadProjectConfig( fn.GetFullPath(), wxGetApp().ReadProjectConfig( fn.GetFullPath(), GROUP,
GROUP, ParamCfgList, FALSE ); GetProjectFileParameters(), FALSE );
if( g_NetlistFileExtension.IsEmpty() ) if( m_NetlistFileExtension.IsEmpty() )
g_NetlistFileExtension = wxT( "net" ); m_NetlistFileExtension = wxT( "net" );
/* User library path takes precedent over default library search paths. */ /* User library path takes precedent over default library search paths. */
wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1 ); wxGetApp().InsertLibraryPath( m_UserLibraryPath, 1 );
} }
/************************************************************/
void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event )
/************************************************************/
/* fonction relai d'appel a Save_Config, /* fonction relai d'appel a Save_Config,
* la vraie fonction de sauvegarde de la config * la vraie fonction de sauvegarde de la config
*/ */
void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event )
{ {
Save_Config( this, m_NetlistFileName.GetFullPath() ); SaveProjectFile( m_NetlistFileName.GetFullPath() );
} }
void Save_Config( wxWindow* parent, const wxString& fileName ) void WinEDA_CvpcbFrame::SaveProjectFile( const wxString& fileName )
{ {
wxFileName fn = fileName; wxFileName fn = fileName;
fn.SetExt( ProjectFileExtension ); fn.SetExt( ProjectFileExtension );
wxFileDialog dlg( parent, _( "Save Project File" ), fn.GetPath(), wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(),
fn.GetFullName(), ProjectFileWildcard, wxFD_SAVE ); fn.GetFullName(), ProjectFileWildcard, wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return; return;
/* ecriture de la configuration */ /* ecriture de la configuration */
wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP, ParamCfgList ); wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP,
GetProjectFileParameters() );
} }
/*******************************************************/
/** cfg.h : configuration: definition des structures **/
/*******************************************************/
#include "param_config.h"
#define INSETUP TRUE
#define GROUP wxT("/cvpcb")
#define GROUPCOMMON wxT("/common")
#define GROUPLIB wxT("/pcbnew/libraries")
#define GROUPEQU wxT("/cvpcb/libraries")
/* Liste des parametres */
static PARAM_CFG_BASE CommandCfg
(
GROUPLIB, /* identification de groupe */
PARAM_COMMAND_ERASE /* type */
);
static PARAM_CFG_LIBNAME_LIST LibNameBufCfg
(
wxT("LibName"), /* identification */
&g_LibName_List, /* Adresse du parametre */
GROUPLIB
);
static PARAM_CFG_LIBNAME_LIST EquivNameBufCfg
(
wxT("EquName"), /* identification */
&g_ListName_Equ, /* Adresse du parametre */
GROUPEQU
);
static PARAM_CFG_WXSTRING NetInExtBufCfg
(
wxT("NetIExt"), /* identification */
&g_NetlistFileExtension
);
static PARAM_CFG_WXSTRING NetDirBufCfg
(
wxT("NetDir"), /* identification */
&g_UserNetDirBuffer, /* Adresse du parametre */
GROUPCOMMON
);
static PARAM_CFG_WXSTRING UserLibDirBufCfg
(
wxT("LibDir"), /* identification */
&g_UserLibDirBuffer, /* Adresse du parametre */
GROUPLIB
);
static PARAM_CFG_BOOL DisplayPadFillCfg
(
INSETUP,
wxT("DiPadFi"), /* identification */
&DisplayOpt.DisplayPadFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */
);
static PARAM_CFG_BOOL DisplayPadNumCfg
(
INSETUP,
wxT("DiPadNu"), /* identification */
&DisplayOpt.DisplayPadNum, /* Adresse du parametre */
TRUE /* Valeur par defaut */
);
static PARAM_CFG_BOOL DisplayPadNoConnCfg
(
INSETUP,
wxT("DiPadNC"), /* identification */
&DisplayOpt.DisplayPadNoConn, /* Adresse du parametre */
FALSE /* Valeur par defaut */
);
static PARAM_CFG_BOOL DisplayPadIsolCfg
(
INSETUP,
wxT("DiPadMg"), /* identification */
&DisplayOpt.DisplayPadIsol, /* Adresse du parametre */
FALSE /* Valeur par defaut */
);
static PARAM_CFG_INT DisplayModEdgeCfg
(
INSETUP,
wxT("DiModEd"), /* identification */
&DisplayOpt.DisplayModEdge, /* Adresse du parametre */
1, /* Valeur par defaut */
0, 1 /* Valeurs extremes */
);
static PARAM_CFG_INT DisplayModTextCfg
(
INSETUP,
wxT("DiModTx"), /* identification */
&DisplayOpt.DisplayModText, /* Adresse du parametre */
1, /* Valeur par defaut */
0, 1 /* Valeurs extremes */
);
static PARAM_CFG_BOOL DisplayPcbTrackFillCfg
(
INSETUP,
wxT("DiPcbTF"), /* identification */
&DisplayOpt.DisplayPcbTrackFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */
);
static PARAM_CFG_BASE * ParamCfgList[] =
{
& CommandCfg,
& NetInExtBufCfg,
& NetDirBufCfg,
& UserLibDirBufCfg,
& LibNameBufCfg,
& EquivNameBufCfg,
& DisplayPadFillCfg,
& DisplayPadNumCfg,
& DisplayPadNoConnCfg,
& DisplayPadIsolCfg,
& DisplayModEdgeCfg,
& DisplayModTextCfg,
& DisplayPcbTrackFillCfg,
NULL
};
...@@ -2,58 +2,73 @@ ...@@ -2,58 +2,73 @@
/* class_cvpcb.cpp */ /* class_cvpcb.cpp */
/*******************/ /*******************/
// For compilers that support precompilation, includes "wx.h". #include "fctsys.h"
#include "wx/wxprec.h" #include "kicad_string.h"
#ifdef __BORLANDC__ #include "cvpcb.h"
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you #include <wx/listimpl.cpp>
// need because it includes almost all "standard" wxWindows headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "fctsys.h"
#include "common.h"
#include "cvpcb.h" WX_DEFINE_LIST( PIN_LIST );
STORECMP::STORECMP() PIN::PIN()
{ {
Pnext = Pback = NULL; m_Index = 0; /* variable utilisee selon types de netlistes */
m_Type = STRUCT_COMPONENT; m_PinType = 0; /* code type electrique ( Entree Sortie Passive..) */
m_Pins = NULL; }
m_Num = 0;
m_Multi = 0; int compare( const PIN** item1, const PIN** item2 )
{
return StrLenNumICmp( (*item1)->m_PinNum.GetData(),
(*item2)->m_PinNum.GetData(), 4 );
}
bool same_pin_number( const PIN* item1, const PIN* item2 )
{
wxASSERT( item1 != NULL && item2 != NULL );
return ( item1->m_PinNum == item2->m_PinNum );
} }
STORECMP::~STORECMP() bool same_pin_net( const PIN* item1, const PIN* item2 )
{ {
STOREPIN * Pin, * NextPin; wxASSERT( item1 != NULL && item2 != NULL );
for( Pin = m_Pins; Pin != NULL; Pin = NextPin ) return ( item1->m_PinNet == item2->m_PinNet );
{
NextPin = Pin->Pnext; delete Pin;
}
} }
WX_DEFINE_LIST( COMPONENT_LIST );
STOREMOD::STOREMOD() COMPONENT::COMPONENT()
{ {
Pnext = Pback = NULL;
m_Type = STRUCT_MODULE;
m_Num = 0; m_Num = 0;
m_Multi = 0;
} }
COMPONENT::~COMPONENT()
{
m_Pins.DeleteContents( true );
m_Pins.Clear();
}
STOREPIN::STOREPIN() int compare( const COMPONENT** item1, const COMPONENT** item2 )
{ {
m_Type = STRUCT_PIN; /* Type de la structure */ return StrNumICmp( (*item1)->m_Reference.GetData(),
Pnext = NULL; /* Chainage avant */ (*item2)->m_Reference.GetData() );
m_Index = 0; /* variable utilisee selon types de netlistes */ }
m_PinType = 0; /* code type electrique ( Entree Sortie Passive..) */
WX_DEFINE_LIST( FOOTPRINT_LIST );
FOOTPRINT::FOOTPRINT()
{
m_Num = 0;
} }
int compare( const FOOTPRINT** item1, const FOOTPRINT** item2 )
{
return StrNumICmp( (*item1)->m_Module.GetData(),
(*item2)->m_Module.GetData() );
}
...@@ -4,17 +4,16 @@ ...@@ -4,17 +4,16 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "gestfich.h" #include "gestfich.h"
#include "id.h" #include "id.h"
#include "param_config.h"
#include <wx/fontdlg.h>
#include "3d_viewer.h" #include "3d_viewer.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "pcbnew.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "cvstruct.h" #include "cvstruct.h"
...@@ -25,10 +24,15 @@ ...@@ -25,10 +24,15 @@
#define FRAME_MIN_SIZE_Y 300 #define FRAME_MIN_SIZE_Y 300
// option key to close cvpcb after saving files
static const wxString KeepCvpcbOpenEntry( wxT( "KeepCvpcbOpen" ) );
static const wxString FootprintDocFileEntry( wxT( "footprints_doc_file" ) );
/*************************************/ /*************************************/
/* Event table for WinEDA_CvpcbFrame */ /* Event table for WinEDA_CvpcbFrame */
/*************************************/ /*************************************/
BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, WinEDA_BasicFrame )
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_CvpcbFrame::LoadNetList ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_CvpcbFrame::LoadNetList )
// Menu events // Menu events
...@@ -46,10 +50,9 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame ) ...@@ -46,10 +50,9 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame )
WinEDA_CvpcbFrame::ConfigCvpcb ) WinEDA_CvpcbFrame::ConfigCvpcb )
EVT_MENU( ID_CONFIG_SAVE, EVT_MENU( ID_CONFIG_SAVE,
WinEDA_CvpcbFrame::Update_Config ) WinEDA_CvpcbFrame::Update_Config )
EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
WinEDA_CvpcbFrame::OnKeepOpenOnSave )
EVT_MENU_RANGE( ID_PREFERENCES_FONT_DIALOG,
ID_PREFERENCES_FONT_END,
WinEDA_CvpcbFrame::ProcessFontPreferences )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, EVT_MENU_RANGE( ID_LANGUAGE_CHOICE,
ID_LANGUAGE_CHOICE_END, ID_LANGUAGE_CHOICE_END,
WinEDA_CvpcbFrame::SetLanguage ) WinEDA_CvpcbFrame::SetLanguage )
...@@ -94,6 +97,9 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame ) ...@@ -94,6 +97,9 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame )
WinEDA_CvpcbFrame::OnLeftDClick ) WinEDA_CvpcbFrame::OnLeftDClick )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST,
WinEDA_CvpcbFrame::OnSelectComponent ) WinEDA_CvpcbFrame::OnSelectComponent )
EVT_UPDATE_UI( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
WinEDA_CvpcbFrame::OnUpdateKeepOpenOnSave )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -110,6 +116,19 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) : ...@@ -110,6 +116,19 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
m_FootprintList = NULL; m_FootprintList = NULL;
DrawFrame = NULL; DrawFrame = NULL;
m_HToolBar = NULL; m_HToolBar = NULL;
m_modified = false;
m_rightJustify = false;
m_isEESchemaNetlist = false;
m_KeepCvpcbOpen = false;
m_undefinedComponentCnt = 0;
/* Name of the document footprint list
* usually located in share/modules/footprints_doc
* this is of the responsibility to users to create this file
* if they want to have a list of footprints
*/
m_DocModulesFileName = DEFAULT_FOOTPRINTS_LIST_FILENAME;
// Give an icon // Give an icon
#ifdef __WINDOWS__ #ifdef __WINDOWS__
...@@ -178,6 +197,48 @@ WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame() ...@@ -178,6 +197,48 @@ WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame()
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ); ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST );
config->Write( wxT( FILTERFOOTPRINTKEY ), state ); config->Write( wxT( FILTERFOOTPRINTKEY ), state );
} }
m_footprints.DeleteContents( true );
m_footprints.Clear();
m_components.DeleteContents( true );
m_components.Clear();
}
/**
* Load Cvpcb main frame specific configuration settings.
*
* Don't forget to call this base method from any derived classes or the
* settings will not get loaded.
*/
void WinEDA_CvpcbFrame::LoadSettings()
{
wxASSERT( wxGetApp().m_EDA_Config != NULL );
wxConfig* cfg = wxGetApp().m_EDA_Config;
WinEDA_BasicFrame::LoadSettings();
cfg->Read( KeepCvpcbOpenEntry, &m_KeepCvpcbOpen, false );
cfg->Read( FootprintDocFileEntry, &m_DocModulesFileName,
DEFAULT_FOOTPRINTS_LIST_FILENAME );
}
/**
* Save Cvpcb frame specific configuration settings.
*
* Don't forget to call this base method from any derived classes or the
* settings will not get saved.
*/
void WinEDA_CvpcbFrame::SaveSettings()
{
wxASSERT( wxGetApp().m_EDA_Config != NULL );
wxConfig* cfg = wxGetApp().m_EDA_Config;
WinEDA_BasicFrame::SaveSettings();
cfg->Write( KeepCvpcbOpenEntry, m_KeepCvpcbOpen );
cfg->Write( FootprintDocFileEntry, m_DocModulesFileName );
} }
...@@ -203,7 +264,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -203,7 +264,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
{ {
int diag; int diag;
if( modified ) if( m_modified )
{ {
unsigned ii; unsigned ii;
wxMessageDialog dialog( this, wxMessageDialog dialog( this,
...@@ -226,7 +287,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -226,7 +287,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
case wxID_YES: case wxID_YES:
diag = SaveNetList( wxEmptyString ); diag = SaveNetList( wxEmptyString );
if( diag > 0 ) if( diag > 0 )
modified = 0; m_modified = false;
else if( diag == 0 ) else if( diag == 0 )
{ {
if( !IsOK( this, if( !IsOK( this,
...@@ -252,12 +313,8 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -252,12 +313,8 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
SetLastProject( m_NetlistFileName.GetFullPath() ); SetLastProject( m_NetlistFileName.GetFullPath() );
} }
FreeMemoryModules(); m_modified = false;
FreeMemoryComponents();
modified = 0;
SaveSettings(); SaveSettings();
Destroy(); Destroy();
return; return;
} }
...@@ -275,28 +332,34 @@ void WinEDA_CvpcbFrame::OnChar( wxKeyEvent& event ) ...@@ -275,28 +332,34 @@ void WinEDA_CvpcbFrame::OnChar( wxKeyEvent& event )
void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event ) void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event )
/*******************************************************/ /*******************************************************/
{ {
STORECMP* Composant; COMPONENT_LIST::iterator i;
int ii, selection;; COMPONENT* Component;
int ii = 0;
int selection;
if( m_components.empty() )
return;
Composant = g_BaseListeCmp;
selection = m_ListCmp->GetSelection(); selection = m_ListCmp->GetSelection();
if( selection < 0 ) if( selection < 0 )
selection = 0; selection = 0;
for( ii = 0; Composant != NULL; Composant = Composant->Pnext ) for( i = m_components.begin(); i != m_components.end(); ++i )
{ {
if( Composant->m_Module.IsEmpty() && (ii > selection) ) Component = *i;
break;
ii++;
}
if( Composant == NULL ) if( Component->m_Module.IsEmpty() && ii > selection )
{ {
wxBell(); ii = selection; m_ListCmp->SetSelection( ii );
return;
} }
if( g_BaseListeCmp ) ii++;
m_ListCmp->SetSelection( ii ); }
wxBell();
m_ListCmp->SetSelection( selection );
} }
...@@ -304,35 +367,34 @@ void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event ) ...@@ -304,35 +367,34 @@ void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event )
void WinEDA_CvpcbFrame::ToPreviousNA( wxCommandEvent& event ) void WinEDA_CvpcbFrame::ToPreviousNA( wxCommandEvent& event )
/**********************************************************/ /**********************************************************/
{ {
STORECMP* Composant; COMPONENT_LIST::reverse_iterator i;
int ii, selection; COMPONENT* Component;
int ii;
int selection;
Composant = g_BaseListeCmp; if( m_components.empty() )
return;
ii = m_ListCmp->GetCount() - 1;
selection = m_ListCmp->GetSelection(); selection = m_ListCmp->GetSelection();
if( selection < 0 ) if( selection < 0 )
selection = 0; selection = m_ListCmp->GetCount() - 1;
for( ii = 0; Composant != NULL; Composant = Composant->Pnext ) for( i = m_components.rbegin(); i != m_components.rend(); ++i )
{ {
if( ii == selection ) Component = *i;
break;
ii++;
}
for( ; Composant != NULL; Composant = Composant->Pback ) if( Component->m_Module.IsEmpty() && ii < selection )
{ {
if( Composant->m_Module.IsEmpty() && (ii != selection) ) m_ListCmp->SetSelection( ii );
break; return;
ii--;
} }
ii--;
if( Composant == NULL )
{
wxBell(); ii = selection;
} }
if( g_BaseListeCmp ) wxBell();
m_ListCmp->SetSelection( ii ); m_ListCmp->SetSelection( selection );
} }
...@@ -342,8 +404,8 @@ void WinEDA_CvpcbFrame::SaveQuitCvpcb( wxCommandEvent& event ) ...@@ -342,8 +404,8 @@ void WinEDA_CvpcbFrame::SaveQuitCvpcb( wxCommandEvent& event )
{ {
if( SaveNetList( wxEmptyString ) > 0 ) if( SaveNetList( wxEmptyString ) > 0 )
{ {
modified = 0; m_modified = false;
if ( ! g_KeepCvpcbOpen ) if ( ! m_KeepCvpcbOpen )
Close( TRUE ); Close( TRUE );
} }
} }
...@@ -356,33 +418,32 @@ void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event ) ...@@ -356,33 +418,32 @@ void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event )
/* Supprime toutes les associations deja faites /* Supprime toutes les associations deja faites
*/ */
{ {
int ii; COMPONENT_LIST::iterator i;
STORECMP* Composant; COMPONENT* Component;
wxString Line; wxString Line;
if( IsOK( this, _( "Delete selections" ) ) ) if( IsOK( this, _( "Delete selections" ) ) )
{ {
Composant = g_BaseListeCmp; for( i = m_components.begin(); i != m_components.end(); ++i )
for( ii = 0; Composant != NULL; Composant = Composant->Pnext, ii++ )
{ {
Composant->m_Module.Empty(); Component = *i;
m_ListCmp->SetSelection( ii ); Component->m_Module.Empty();
SetNewPkg( wxEmptyString ); SetNewPkg( wxEmptyString );
} }
m_ListCmp->SetSelection( 0 ); m_ListCmp->SetSelection( 0 );
composants_non_affectes = nbcomp; m_undefinedComponentCnt = m_components.GetCount();
} }
Line.Printf( _( "Components: %d (free: %d)" ), nbcomp, Line.Printf( _( "Components: %d (free: %d)" ), m_components.GetCount(),
composants_non_affectes ); m_components.GetCount() );
SetStatusText( Line, 1 ); SetStatusText( Line, 1 );
} }
/* /*
* Called when click on Load Netlist button or by file history menu entries * Called when click on Load Netlist button or by file history menu entries
* Read a netlist slected by user * Read a netlist selected by user
*/ */
void WinEDA_CvpcbFrame::LoadNetList( wxCommandEvent& event ) void WinEDA_CvpcbFrame::LoadNetList( wxCommandEvent& event )
{ {
...@@ -445,6 +506,12 @@ void WinEDA_CvpcbFrame::ConfigCvpcb( wxCommandEvent& event ) ...@@ -445,6 +506,12 @@ void WinEDA_CvpcbFrame::ConfigCvpcb( wxCommandEvent& event )
} }
void WinEDA_CvpcbFrame::OnKeepOpenOnSave( wxCommandEvent& event )
{
m_KeepCvpcbOpen = event.IsChecked();
}
/************************************************************/ /************************************************************/
void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event ) void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event )
/************************************************************/ /************************************************************/
...@@ -459,29 +526,6 @@ void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event ) ...@@ -459,29 +526,6 @@ void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event )
} }
/****************************************************************/
void WinEDA_CvpcbFrame::AddFontSelectionMenu( wxMenu* main_menu )
/*****************************************************************/
/* create the submenu for fonte selection and setup fonte size
*/
{
wxMenu* fontmenu = new wxMenu();
ADD_MENUITEM( fontmenu,
ID_PREFERENCES_FONT_DIALOG,
_( "Dialog boxes" ),
fonts_xpm );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( main_menu,
fontmenu,
ID_PREFERENCES_FONT,
_( "&Font" ),
_( "Choose font type and size for dialogs, information and status box" ),
fonts_xpm );
}
/********************************************************/ /********************************************************/
void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event ) void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
/********************************************************/ /********************************************************/
...@@ -499,34 +543,8 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event ) ...@@ -499,34 +543,8 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event ) void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
/*************************************************************/ /*************************************************************/
{ {
wxConfig* cfg = wxGetApp().m_EDA_CommonConfig; GetAssociatedDocument( this, m_DocModulesFileName,
cfg->Read( DOC_FOOTPRINTS_LIST_KEY, g_DocModulesFileName ); &wxGetApp().GetLibraryPathList() );
GetAssociatedDocument( this, g_DocModulesFileName, &wxGetApp().GetLibraryPathList() );
}
/********************************************************************/
void WinEDA_CvpcbFrame::ProcessFontPreferences( wxCommandEvent& event )
/********************************************************************/
{
int id = event.GetId();
wxFont font;
switch( id )
{
case ID_PREFERENCES_FONT:
case ID_PREFERENCES_FONT_DIALOG:
WinEDA_BasicFrame::ProcessFontPreferences( id );
break;
default:
DisplayError( this,
wxT( "WinEDA_DrawFrame::ProcessFontPreferences " \
"Internal Error" ) );
break;
}
} }
...@@ -550,7 +568,7 @@ void WinEDA_CvpcbFrame::OnLeftDClick( wxListEvent& event ) ...@@ -550,7 +568,7 @@ void WinEDA_CvpcbFrame::OnLeftDClick( wxListEvent& event )
void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event ) void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
/*************************************************************/ /*************************************************************/
{ {
STORECMP* Component; COMPONENT* Component;
int selection; int selection;
if( !m_HToolBar->GetToolState( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) ) if( !m_HToolBar->GetToolState( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
...@@ -566,13 +584,7 @@ void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event ) ...@@ -566,13 +584,7 @@ void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
return; return;
} }
Component = g_BaseListeCmp; Component = m_components[ selection ];
for( int ii = 0; Component != NULL; Component = Component->Pnext )
{
if( ii == selection )
break;
ii++;
}
if( Component == NULL ) if( Component == NULL )
{ {
...@@ -580,7 +592,7 @@ void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event ) ...@@ -580,7 +592,7 @@ void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
return; return;
} }
m_FootprintList->SetFootprintFilteredList( Component ); m_FootprintList->SetFootprintFilteredList( Component, m_footprints );
} }
...@@ -595,3 +607,9 @@ void WinEDA_CvpcbFrame::OnSelectFilteringFootprint( wxCommandEvent& event ) ...@@ -595,3 +607,9 @@ void WinEDA_CvpcbFrame::OnSelectFilteringFootprint( wxCommandEvent& event )
OnSelectComponent( l_event ); OnSelectComponent( l_event );
} }
void WinEDA_CvpcbFrame::OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event )
{
event.Check( m_KeepCvpcbOpen );
}
...@@ -22,53 +22,20 @@ ...@@ -22,53 +22,20 @@
/* Constant string definitions for CvPcb */ /* Constant string definitions for CvPcb */
const wxString ComponentFileExtension( wxT( "cmp" ) ); const wxString ComponentFileExtension( wxT( "cmp" ) );
const wxString RetroFileExtension( wxT( "stf" ) ); const wxString RetroFileExtension( wxT( "stf" ) );
const wxString EquivFileExtension( wxT( "equ" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) );
// Wildcard for footprint libraries filesnames
const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file " \
"(*.mod)|*.mod" ) );
// Wildcard for schematic retroannotation (import footprint names in schematic): // Wildcard for schematic retroannotation (import footprint names in schematic):
const wxString RetroFileWildcard( _( "Kicad component list files (*.stf)|*.stf" ) ); const wxString RetroFileWildcard( _( "Kicad component list files " \
"(*.stf)|*.stf" ) );
// Wildcard for alias footprint files const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files " \
const wxString EquivFileWildcard( _( "Kicad footprint alias files (*.equ)|*.equ" ) ); "(*.equ)|*.equ" ) );
const wxString titleLibLoadError( _( "Library Load Error" ) ); const wxString titleLibLoadError( _( "Library Load Error" ) );
/* Global variables used in CVPcb. */
int g_FlagEESchema;
int Rjustify;
int modified;
int nbcomp;
int nblib;
int composants_non_affectes;
// Option to keep cvpcb open after saving netlist files
bool g_KeepCvpcbOpen = false;
STOREMOD* g_BaseListePkg = NULL;
STORECMP* g_BaseListeCmp = NULL;
wxString g_UserNetDirBuffer; // Netlist path (void = current working directory)
wxString g_NetlistFileExtension;
wxArrayString g_ListName_Equ; // list of .equ files to load
/* Name of the document footprint list
* usually located in share/modules/footprints_doc
* this is of the responsability to users to create this file
* if they want to have a list of footprints
*/
wxString g_DocModulesFileName = DEFAULT_FOOTPRINTS_LIST_FILENAME;
// Create a new application object // Create a new application object
IMPLEMENT_APP( WinEDA_App ) IMPLEMENT_APP( WinEDA_App )
/* fonctions locales */
/************************************/ /************************************/
/* Called to initialize the program */ /* Called to initialize the program */
...@@ -105,17 +72,10 @@ bool WinEDA_App::OnInit() ...@@ -105,17 +72,10 @@ bool WinEDA_App::OnInit()
wxString Title = GetTitle() + wxT( " " ) + GetBuildVersion(); wxString Title = GetTitle() + wxT( " " ) + GetBuildVersion();
frame = new WinEDA_CvpcbFrame( Title ); frame = new WinEDA_CvpcbFrame( Title );
msg.Printf( wxT( "Modules: %d" ), nblib );
frame->SetStatusText( msg, 2 );
// Show the frame // Show the frame
SetTopWindow( frame ); SetTopWindow( frame );
Read_Config( fn.GetFullPath() ); frame->LoadProjectFile( fn.GetFullPath() );
long tmp;
if ( wxGetApp().m_EDA_CommonConfig->Read( CLOSE_OPTION_KEY, & tmp) )
g_KeepCvpcbOpen = tmp;
frame->Show( TRUE ); frame->Show( TRUE );
frame->BuildFootprintListBox(); frame->BuildFootprintListBox();
...@@ -125,13 +85,13 @@ bool WinEDA_App::OnInit() ...@@ -125,13 +85,13 @@ bool WinEDA_App::OnInit()
if( frame->ReadNetList() ) if( frame->ReadNetList() )
{ {
g_NetlistFileExtension = fn.GetExt(); frame->m_NetlistFileExtension = fn.GetExt();
return true; return true;
} }
} }
listlib(); LoadFootprintFiles( frame->m_ModuleLibNames, frame->m_footprints );
g_NetlistFileExtension = wxT( "net" ); frame->m_NetlistFileExtension = wxT( "net" );
frame->m_NetlistFileName.Clear(); frame->m_NetlistFileName.Clear();
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() + frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() +
wxGetCwd() + wxFileName::GetPathSeparator() + wxGetCwd() + wxFileName::GetPathSeparator() +
......
...@@ -8,12 +8,8 @@ ...@@ -8,12 +8,8 @@
#include "pcbcommon.h" #include "pcbcommon.h"
// config for footprints doc file acces // config for footprints doc file acces
#define DOC_FOOTPRINTS_LIST_KEY wxT( "footprints_doc_file" )
#define DEFAULT_FOOTPRINTS_LIST_FILENAME wxT( "footprints_doc/footprints.pdf" ) #define DEFAULT_FOOTPRINTS_LIST_FILENAME wxT( "footprints_doc/footprints.pdf" )
// option key to close cvpcb after saving files
#define CLOSE_OPTION_KEY wxT( "KeepCvpcbOpen" )
// Define print format to display a schematic component line // Define print format to display a schematic component line
#define CMP_FORMAT wxT( "%3d %8s - %16s : %-.32s" ) #define CMP_FORMAT wxT( "%3d %8s - %16s : %-.32s" )
...@@ -27,19 +23,9 @@ ...@@ -27,19 +23,9 @@
#define TYPE_VIEWLOGIC_NET 4 #define TYPE_VIEWLOGIC_NET 4
enum TypeOfStruct { class PIN
STRUCT_NOT_INIT,
STRUCT_COMPONENT,
STRUCT_PIN,
STRUCT_MODULE,
STRUCT_PSEUDOMODULE
};
class STOREPIN
{ {
public: public:
int m_Type; /* Type de la structure */
STOREPIN* Pnext; /* Chainage avant */
int m_Index; /* variable utilisee selon types de netlistes */ int m_Index; /* variable utilisee selon types de netlistes */
int m_PinType; /* code type electrique ( Entree Sortie Passive..) */ int m_PinType; /* code type electrique ( Entree Sortie Passive..) */
wxString m_PinNet; /* Pointeur sur le texte nom de net */ wxString m_PinNet; /* Pointeur sur le texte nom de net */
...@@ -47,18 +33,25 @@ public: ...@@ -47,18 +33,25 @@ public:
wxString m_PinName; wxString m_PinName;
wxString m_Repere; /* utilise selon formats de netliste */ wxString m_Repere; /* utilise selon formats de netliste */
STOREPIN(); PIN();
}; };
class STORECMP WX_DECLARE_LIST( PIN, PIN_LIST );
/* PIN object list sort function. */
extern int compare( const PIN** item1, const PIN** item2 );
/* PIN object comparison functions. */
extern bool same_pin_number( const PIN* item1, const PIN* item2 );
extern bool same_pin_net( const PIN* item1, const PIN* item2 );
class COMPONENT
{ {
public: public:
int m_Type; /* Type de la structure */
STORECMP* Pnext; /* Chainage avant */
STORECMP* Pback; /* Chainage arriere */
int m_Num; /* Numero d'ordre */ int m_Num; /* Numero d'ordre */
int m_Multi; /* Nombre d' unites par boitier */ int m_Multi; /* Nombre d' unites par boitier */
STOREPIN* m_Pins; /* pointeur sur la liste des Pins */ PIN_LIST m_Pins; /* pointeur sur la liste des Pins */
wxString m_Reference; /* U3, R5 ... */ wxString m_Reference; /* U3, R5 ... */
wxString m_Valeur; /* 7400, 47K ... */ wxString m_Valeur; /* 7400, 47K ... */
wxString m_TimeStamp; /* Signature temporelle ("00000000" si absente) */ wxString m_TimeStamp; /* Signature temporelle ("00000000" si absente) */
...@@ -67,71 +60,43 @@ public: ...@@ -67,71 +60,43 @@ public:
wxArrayString m_FootprintFilter; /* List of allowed footprints (wildcart allowed wxArrayString m_FootprintFilter; /* List of allowed footprints (wildcart allowed
* if void: no filtering */ * if void: no filtering */
STORECMP(); COMPONENT();
~STORECMP(); ~COMPONENT();
}; };
class STOREMOD WX_DECLARE_LIST( COMPONENT, COMPONENT_LIST );
/* COMPONENT object list sort function. */
extern int compare( const COMPONENT** item1, const COMPONENT** item2 );
class FOOTPRINT
{ {
public: public:
int m_Type; /* Type de la structure */
STOREMOD* Pnext; /* Chainage avant */
STOREMOD* Pback; /* Chainage arriere */
wxString m_Module; /* Nom du module */ wxString m_Module; /* Nom du module */
wxString m_LibName; /* Nom de la librairie contenant ce module */ wxString m_LibName; /* Nom de la librairie contenant ce module */
int m_Num; /* Numero d'ordre pour affichage sur la liste */ int m_Num; /* Numero d'ordre pour affichage sur la liste */
wxString m_Doc; /* Doc associee */ wxString m_Doc; /* Doc associee */
wxString m_KeyWord; /* Mots cles associes */ wxString m_KeyWord; /* Mots cles associes */
STOREMOD(); FOOTPRINT();
}; };
WX_DECLARE_LIST( FOOTPRINT, FOOTPRINT_LIST );
/* FOOTPRINT object list sort function. */
extern int compare( const FOOTPRINT** item1, const FOOTPRINT** item2 );
/* Gestion des noms des librairies */ /* Gestion des noms des librairies */
extern const wxString EquivFileExtension; extern const wxString FootprintAliasFileExtension;
extern const wxString RetroFileExtension; extern const wxString RetroFileExtension;
extern const wxString ComponentFileExtension; extern const wxString ComponentFileExtension;
extern const wxString RetroFileWildcard; extern const wxString RetroFileWildcard;
extern const wxString EquivFileWildcard; extern const wxString FootprintAliasFileWildcard;
extern const wxString titleLibLoadError; extern const wxString titleLibLoadError;
// Wildcard for footprint libraries filesnames
extern const wxString g_FootprintLibFileWildcard;
// Wildcard for schematic retroannotation (import footprint names in schematic):
extern const wxString g_FootprintEquFileWildcard;
/* Name of the document footprint list
* usually located in share/modules/footprints_doc
* this is of the responsability to users to create this file
* if they want to have a list of footprints
*/
extern wxString g_DocModulesFileName;
/* CvPcb global variable definition references. */
extern STOREMOD* g_BaseListePkg;
extern STORECMP* g_BaseListeCmp;
extern wxString g_NetlistFileExtension;
extern wxString g_UserNetDirBuffer;
extern wxArrayString g_ListName_Equ; // list of .equ files to load
extern int g_FlagEESchema;
extern int Rjustify; /* flag pout troncature des noms de Net:
* = 0: debut de chaine conservee (->ORCADPCB2)
* = 1: fin de chaine conservee (->VIEWLOGIC) */
extern int modified; /* Flag != 0 si modif attribution des module. */
extern int nbcomp; /* nombre de composants trouves */
extern int nblib; /* nombre d'empreintes trouvees */
extern int composants_non_affectes; /* nbre de composants non affectes */
extern bool g_KeepCvpcbOpen; // Option to keep cvpcb open after saving netlist files
void Plume( int state ); void Plume( int state );
#endif /* __CVPCB_H__ */ #endif /* __CVPCB_H__ */
/***********************************************************/ /***********************************************************/
/* wxstruct.h: */ /* cvstruct.h : */
/* descriptions des principales classes derivees utilisees */ /* descriptions des principales classes derivees utilisees */
/***********************************************************/ /***********************************************************/
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
#include "wx/listctrl.h" #include "wx/listctrl.h"
#include <wx/filename.h> #include <wx/filename.h>
#include "param_config.h"
#include "cvpcb.h"
/* Forward declarations of all top-level window classes. */ /* Forward declarations of all top-level window classes. */
class FootprintListBox; class FootprintListBox;
class ListBoxCmp; class ListBoxCmp;
class WinEDA_DisplayFrame; class WinEDA_DisplayFrame;
class STORECMP;
#define LIST_BOX_TYPE wxListView #define LIST_BOX_TYPE wxListView
...@@ -25,11 +26,26 @@ class WinEDA_CvpcbFrame : public WinEDA_BasicFrame ...@@ -25,11 +26,26 @@ class WinEDA_CvpcbFrame : public WinEDA_BasicFrame
{ {
public: public:
bool m_KeepCvpcbOpen;
FootprintListBox* m_FootprintList; FootprintListBox* m_FootprintList;
ListBoxCmp* m_ListCmp; ListBoxCmp* m_ListCmp;
WinEDA_DisplayFrame* DrawFrame; WinEDA_DisplayFrame* DrawFrame;
WinEDA_Toolbar* m_HToolBar; // Toolbar horizontal haut d'ecran WinEDA_Toolbar* m_HToolBar; // Toolbar horizontal haut d'ecran
wxFileName m_NetlistFileName; wxFileName m_NetlistFileName;
wxArrayString m_ModuleLibNames;
wxArrayString m_AliasLibNames;
wxString m_UserLibraryPath;
wxString m_NetlistFileExtension;
wxString m_DocModulesFileName;
FOOTPRINT_LIST m_footprints;
COMPONENT_LIST m_components;
protected:
int m_undefinedComponentCnt;
bool m_modified;
bool m_rightJustify;
bool m_isEESchemaNetlist;
PARAM_CFG_ARRAY m_projectFileParams;
// Constructor and destructor // Constructor and destructor
public: public:
...@@ -49,8 +65,6 @@ public: ...@@ -49,8 +65,6 @@ public:
void ReCreateHToolbar(); void ReCreateHToolbar();
virtual void ReCreateMenuBar(); virtual void ReCreateMenuBar();
void SetLanguage( wxCommandEvent& event ); void SetLanguage( wxCommandEvent& event );
void AddFontSelectionMenu( wxMenu* main_menu );
void ProcessFontPreferences( wxCommandEvent& event );
void ToFirstNA( wxCommandEvent& event ); void ToFirstNA( wxCommandEvent& event );
void ToPreviousNA( wxCommandEvent& event ); void ToPreviousNA( wxCommandEvent& event );
...@@ -58,11 +72,15 @@ public: ...@@ -58,11 +72,15 @@ public:
void SaveQuitCvpcb( wxCommandEvent& event ); void SaveQuitCvpcb( wxCommandEvent& event );
void LoadNetList( wxCommandEvent& event ); void LoadNetList( wxCommandEvent& event );
void ConfigCvpcb( wxCommandEvent& event ); void ConfigCvpcb( wxCommandEvent& event );
void OnKeepOpenOnSave( wxCommandEvent& event );
void DisplayModule( wxCommandEvent& event ); void DisplayModule( wxCommandEvent& event );
void AssocieModule( wxCommandEvent& event ); void AssocieModule( wxCommandEvent& event );
void WriteStuffList( wxCommandEvent& event ); void WriteStuffList( wxCommandEvent& event );
void DisplayDocFile( wxCommandEvent& event ); void DisplayDocFile( wxCommandEvent& event );
void OnSelectFilteringFootprint( wxCommandEvent& event ); void OnSelectFilteringFootprint( wxCommandEvent& event );
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
void SetNewPkg( const wxString& package ); void SetNewPkg( const wxString& package );
void BuildCmpListBox(); void BuildCmpListBox();
void BuildFootprintListBox(); void BuildFootprintListBox();
...@@ -75,6 +93,12 @@ public: ...@@ -75,6 +93,12 @@ public:
int ReadFootprintFilterList( FILE* f ); int ReadFootprintFilterList( FILE* f );
int ReadViewlogicWirList(); int ReadViewlogicWirList();
int ReadViewlogicNetList(); int ReadViewlogicNetList();
void LoadProjectFile( const wxString& FileName );
void SaveProjectFile( const wxString& fileName );
virtual void LoadSettings();
virtual void SaveSettings();
const PARAM_CFG_ARRAY& GetProjectFileParameters( void );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
...@@ -113,8 +137,8 @@ public: ...@@ -113,8 +137,8 @@ public:
bool m_UseFootprintFullList; bool m_UseFootprintFullList;
public: public:
FootprintListBox( WinEDA_CvpcbFrame * parent, FootprintListBox( WinEDA_CvpcbFrame * parent, wxWindowID id,
wxWindowID id, const wxPoint &loc, const wxSize &size, const wxPoint &loc, const wxSize &size,
int nbitems, wxString choice[] ); int nbitems, wxString choice[] );
~FootprintListBox(); ~FootprintListBox();
...@@ -122,8 +146,9 @@ public: ...@@ -122,8 +146,9 @@ public:
void SetSelection( unsigned index, bool State = TRUE ); void SetSelection( unsigned index, bool State = TRUE );
void SetString( unsigned linecount, const wxString& text ); void SetString( unsigned linecount, const wxString& text );
void AppendLine( const wxString& text ); void AppendLine( const wxString& text );
void SetFootprintFullList(); void SetFootprintFullList( FOOTPRINT_LIST& list );
void SetFootprintFilteredList( STORECMP* Component ); void SetFootprintFilteredList( COMPONENT* Component,
FOOTPRINT_LIST& list );
void SetActiveFootprintList( bool FullList, bool Redraw = FALSE ); void SetActiveFootprintList( bool FullList, bool Redraw = FALSE );
wxString GetSelectedFootprint(); wxString GetSelectedFootprint();
......
...@@ -24,12 +24,14 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( WinEDA_CvpcbFrame* parent ) : ...@@ -24,12 +24,14 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( WinEDA_CvpcbFrame* parent ) :
DIALOG_CVPCB_CONFIG_FBP( parent ) DIALOG_CVPCB_CONFIG_FBP( parent )
{ {
wxString title; wxString title;
wxFileName fn = parent->m_NetlistFileName;
fn.SetExt( ProjectFileExtension );
m_Parent = parent; m_Parent = parent;
m_Config = wxGetApp().m_EDA_CommonConfig; m_Config = wxGetApp().m_EDA_CommonConfig;
Init( ); Init( );
title = _( "from " ) + wxGetApp().m_CurrentOptionFile; title = _( "Project file: " ) + fn.GetFullPath();
SetTitle( title ); SetTitle( title );
if( GetSizer() ) if( GetSizer() )
{ {
...@@ -44,35 +46,16 @@ void DIALOG_CVPCB_CONFIG::Init() ...@@ -44,35 +46,16 @@ void DIALOG_CVPCB_CONFIG::Init()
{ {
wxString msg; wxString msg;
SetFont( *g_DialogFont );
SetFocus(); SetFocus();
m_LibListChanged = false; m_LibListChanged = false;
m_LibPathChanged = false; m_LibPathChanged = false;
m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath;
// Display current files extension (info) m_ListLibr->InsertItems( m_Parent->m_ModuleLibNames, 0 );
msg = m_InfoCmpFileExt->GetLabel() + ComponentFileExtension; m_ListEquiv->InsertItems( m_Parent->m_AliasLibNames, 0 );
m_InfoCmpFileExt->SetLabel( msg );
msg = m_InfoLibFileExt->GetLabel() + ModuleFileExtension; m_TextHelpModulesFileName->SetValue( m_Parent->m_DocModulesFileName );
m_InfoLibFileExt->SetLabel( msg );
msg = m_InfoNetlistFileExt->GetLabel() + g_NetlistFileExtension;
m_InfoNetlistFileExt->SetLabel( msg );
msg = m_InfoEquivFileExt->GetLabel() + EquivFileExtension;
m_InfoEquivFileExt->SetLabel( msg );
msg = m_InfoRetroannotFileExt->GetLabel() + RetroFileExtension;
m_InfoRetroannotFileExt->SetLabel( msg );
m_ListLibr->InsertItems( g_LibName_List, 0 );
m_ListEquiv->InsertItems( g_ListName_Equ, 0 );
// Display current modules doc file:
m_Config->Read( DOC_FOOTPRINTS_LIST_KEY, g_DocModulesFileName );
m_TextHelpModulesFileName->SetValue( g_DocModulesFileName );
// Load user libs paths: // Load user libs paths:
wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) ); wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) );
...@@ -93,8 +76,6 @@ void DIALOG_CVPCB_CONFIG::Init() ...@@ -93,8 +76,6 @@ void DIALOG_CVPCB_CONFIG::Init()
// select the first path afer the current path project // select the first path afer the current path project
if( libpaths.GetCount() > 1 ) if( libpaths.GetCount() > 1 )
m_DefaultLibraryPathslistBox->Select( 1 ); m_DefaultLibraryPathslistBox->Select( 1 );
m_radioBoxCloseOpt->SetSelection ( g_KeepCvpcbOpen ? 1 : 0 );
} }
...@@ -108,9 +89,10 @@ void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event ) ...@@ -108,9 +89,10 @@ void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event )
for( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ )
wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString( ii ) ); wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString( ii ) );
wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1 ); wxGetApp().InsertLibraryPath( m_Parent->m_UserLibraryPath, 1 );
} }
EndModal( -1 );
EndModal( wxID_CANCEL );
} }
...@@ -118,21 +100,17 @@ void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event ) ...@@ -118,21 +100,17 @@ void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event )
void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event ) void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
/**************************************************************/ /**************************************************************/
{ {
g_KeepCvpcbOpen = m_radioBoxCloseOpt->GetSelection( ) ? true : false; m_Parent->m_DocModulesFileName = m_TextHelpModulesFileName->GetValue();
m_Config->Write( CLOSE_OPTION_KEY, (long) g_KeepCvpcbOpen );
m_Config->Write( DOC_FOOTPRINTS_LIST_KEY,
m_TextHelpModulesFileName->GetValue() );
// Recreate the user lib path // Recreate the user lib path
if( m_LibPathChanged ) if( m_LibPathChanged )
{ {
g_UserLibDirBuffer.Empty(); m_Parent->m_UserLibraryPath.Empty();
for( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii++ )
{ {
if( ii > 0 ) if( ii > 0 )
g_UserLibDirBuffer << wxT( ";" ); m_Parent->m_UserLibraryPath << wxT( ";" );
g_UserLibDirBuffer << m_listUserPaths->GetString( ii ); m_Parent->m_UserLibraryPath << m_listUserPaths->GetString( ii );
} }
} }
...@@ -141,20 +119,22 @@ void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event ) ...@@ -141,20 +119,22 @@ void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
if( m_LibListChanged || m_LibPathChanged ) if( m_LibListChanged || m_LibPathChanged )
{ {
// Recreate lib list // Recreate lib list
g_LibName_List.Clear(); m_Parent->m_ModuleLibNames.Clear();
for( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ )
g_LibName_List.Add( m_ListLibr->GetString( ii ) ); m_Parent->m_ModuleLibNames.Add( m_ListLibr->GetString( ii ) );
// Recreate equ list // Recreate equ list
g_ListName_Equ.Clear(); m_Parent->m_AliasLibNames.Clear();
for( unsigned ii = 0; ii < m_ListEquiv->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_ListEquiv->GetCount(); ii++ )
g_ListName_Equ.Add( m_ListEquiv->GetString( ii ) ); m_Parent->m_AliasLibNames.Add( m_ListEquiv->GetString( ii ) );
listlib(); LoadFootprintFiles( m_Parent->m_ModuleLibNames,
m_Parent->m_footprints );
m_Parent->BuildFootprintListBox(); m_Parent->BuildFootprintListBox();
} }
if( event.GetId() != ID_SAVE_CFG )
EndModal( 0 ); m_Parent->SaveProjectFile( m_Parent->m_NetlistFileName.GetFullPath() );
EndModal( wxID_OK );
} }
...@@ -209,12 +189,12 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -209,12 +189,12 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
if( (event.GetId() == ID_INSERT_EQU) || (event.GetId() == ID_INSERT_LIB) ) if( (event.GetId() == ID_INSERT_EQU) || (event.GetId() == ID_INSERT_LIB) )
insert = true; insert = true;
wildcard = EquivFileWildcard; wildcard = FootprintAliasFileWildcard;
wxListBox * list = m_ListEquiv; wxListBox * list = m_ListEquiv;
if( (event.GetId() == ID_ADD_LIB) || (event.GetId() == ID_INSERT_LIB) ) if( (event.GetId() == ID_ADD_LIB) || (event.GetId() == ID_INSERT_LIB) )
{ {
list = m_ListLibr; list = m_ListLibr;
wildcard = g_FootprintLibFileWildcard; wildcard = ModuleFileWildcard;
} }
ii = list->GetSelection(); ii = list->GetSelection();
...@@ -246,8 +226,8 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -246,8 +226,8 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
* list, just add the library name to the list. Otherwise, add * list, just add the library name to the list. Otherwise, add
* the library name with the full or relative path. * the library name with the full or relative path.
* the relative path, when possible is preferable, * the relative path, when possible is preferable,
* because it preserve use of default libraries paths, when the path is a sub path of these default paths * because it preserve use of default libraries paths, when the path
* * is a sub path of these default paths
*/ */
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
libfilename = fn.GetName(); libfilename = fn.GetName();
...@@ -283,15 +263,6 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -283,15 +263,6 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
} }
/*******************************************************************/
void DIALOG_CVPCB_CONFIG::OnSaveCfgClick( wxCommandEvent& event )
/*******************************************************************/
{
OnOkClick( event );
Save_Config( this, m_Parent->m_NetlistFileName.GetFullPath() );
}
/***********************************************************************/ /***********************************************************************/
void DIALOG_CVPCB_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) void DIALOG_CVPCB_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
/***********************************************************************/ /***********************************************************************/
...@@ -370,16 +341,14 @@ void DIALOG_CVPCB_CONFIG::OnRemoveUserPath( wxCommandEvent& event ) ...@@ -370,16 +341,14 @@ void DIALOG_CVPCB_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
void DIALOG_CVPCB_CONFIG::OnBrowseModDocFile( wxCommandEvent& event ) void DIALOG_CVPCB_CONFIG::OnBrowseModDocFile( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
wxString FullFileName, mask; wxString FullFileName;
wxString docpath, filename; wxString docpath, filename;
docpath = wxGetApp().ReturnLastVisitedLibraryPath( wxT( "doc" ) ); docpath = wxGetApp().ReturnLastVisitedLibraryPath( wxT( "doc" ) );
mask = wxT( "*.pdf" );
wxFileDialog FilesDialog( this, _( "Footprint document file:" ), docpath, wxFileDialog FilesDialog( this, _( "Footprint document file:" ), docpath,
wxEmptyString, mask, wxEmptyString, PdfFileWildcard,
wxFD_DEFAULT_STYLE ); wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
if( FilesDialog.ShowModal() != wxID_OK ) if( FilesDialog.ShowModal() != wxID_OK )
return; return;
...@@ -390,7 +359,8 @@ void DIALOG_CVPCB_CONFIG::OnBrowseModDocFile( wxCommandEvent& event ) ...@@ -390,7 +359,8 @@ void DIALOG_CVPCB_CONFIG::OnBrowseModDocFile( wxCommandEvent& event )
* list, just add the library name to the list. Otherwise, add * list, just add the library name to the list. Otherwise, add
* the library name with the full or relative path. * the library name with the full or relative path.
* the relative path, when possible is preferable, * the relative path, when possible is preferable,
* because it preserve use of default libraries paths, when the path is a sub path of these default paths * because it preserve use of default libraries paths, when the path is
* a sub path of these default paths
*/ */
wxFileName fn = FullFileName; wxFileName fn = FullFileName;
wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() );
......
...@@ -26,7 +26,6 @@ private: ...@@ -26,7 +26,6 @@ private:
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void OnSaveCfgClick( wxCommandEvent& event );
void OnAddOrInsertLibClick( wxCommandEvent& event ); void OnAddOrInsertLibClick( wxCommandEvent& event );
void OnRemoveLibClick( wxCommandEvent& event ); void OnRemoveLibClick( wxCommandEvent& event );
void OnBrowseModDocFile( wxCommandEvent& event ); void OnBrowseModDocFile( wxCommandEvent& event );
......
...@@ -16,175 +16,92 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i ...@@ -16,175 +16,92 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_buttonCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_buttonSave = new wxButton( this, ID_SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonSave->SetToolTip( _("Accept and save current configuration setting in the local .pro file") );
bLeftSizer->Add( m_buttonSave, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
bLeftSizer->Add( 0, 20, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sFileExtBox;
sFileExtBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Files ext:") ), wxVERTICAL );
m_InfoCmpFileExt = new wxStaticText( this, wxID_ANY, _("Cmp file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoCmpFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoCmpFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoLibFileExt = new wxStaticText( this, wxID_ANY, _("Library file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoLibFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoLibFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoNetlistFileExt = new wxStaticText( this, wxID_ANY, _("Netlist file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoNetlistFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoNetlistFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoEquivFileExt = new wxStaticText( this, wxID_ANY, _("Equiv file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoEquivFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoEquivFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoRetroannotFileExt = new wxStaticText( this, wxID_ANY, _("Retro file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoRetroannotFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoRetroannotFileExt, 0, wxALL, 5 );
bLeftSizer->Add( sFileExtBox, 0, wxEXPAND, 5 );
wxString m_radioBoxCloseOptChoices[] = { _("Close after Save"), _("Keep Open") };
int m_radioBoxCloseOptNChoices = sizeof( m_radioBoxCloseOptChoices ) / sizeof( wxString );
m_radioBoxCloseOpt = new wxRadioBox( this, wxID_ANY, _("Cvpcb Close Option:"), wxDefaultPosition, wxDefaultSize, m_radioBoxCloseOptNChoices, m_radioBoxCloseOptChoices, 1, wxRA_SPECIFY_COLS );
m_radioBoxCloseOpt->SetSelection( 0 );
m_radioBoxCloseOpt->SetToolTip( _("After saving the nelist and the components files, Cvpcb can be kept open, or automatically closed") );
bLeftSizer->Add( m_radioBoxCloseOpt, 0, wxALL, 5 );
bUpperSizer->Add( bLeftSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxStaticBoxSizer* sbLibsChoiceSizer; wxStaticBoxSizer* sbLibsChoiceSizer;
sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Libraries") ), wxVERTICAL ); sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint library files") ), wxHORIZONTAL );
wxBoxSizer* bLibsButtonsSizer; m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
bLibsButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") );
m_ListLibr->SetMinSize( wxSize( 450,-1 ) );
sbLibsChoiceSizer->Add( bLibsButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextlibList = new wxStaticText( this, wxID_ANY, _("Active Libraries:"), wxDefaultPosition, wxDefaultSize, 0 ); sbLibsChoiceSizer->Add( m_ListLibr, 1, wxALL|wxEXPAND, 5 );
m_staticTextlibList->Wrap( -1 );
sbLibsChoiceSizer->Add( m_staticTextlibList, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerLibButtons; wxBoxSizer* bSizerLibButtons;
bSizerLibButtons = new wxBoxSizer( wxHORIZONTAL ); bSizerLibButtons = new wxBoxSizer( wxVERTICAL );
m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") );
bSizerLibButtons->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); bSizerLibButtons->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 );
m_buttonInsLib = new wxButton( this, ID_INSERT_LIB, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonInsLib = new wxButton( this, ID_INSERT_LIB, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonInsLib->SetToolTip( _("Add a new library before the selected library, and load it") ); m_buttonInsLib->SetToolTip( _("Add a new library before the selected library, and load it") );
bSizerLibButtons->Add( m_buttonInsLib, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); bSizerLibButtons->Add( m_buttonInsLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 );
m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); m_buttonRemoveLib->SetToolTip( _("Unload the selected library") );
bSizerLibButtons->Add( m_buttonRemoveLib, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); bSizerLibButtons->Add( m_buttonRemoveLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 );
sbLibsChoiceSizer->Add( bSizerLibButtons, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") );
m_ListLibr->SetMinSize( wxSize( 200,-1 ) );
sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbLibsChoiceSizer->Add( bSizerLibButtons, 0, wxALIGN_CENTER_VERTICAL, 5 );
bUpperSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( sbLibsChoiceSizer, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbEquivChoiceSizer; wxStaticBoxSizer* sbEquivChoiceSizer;
sbEquivChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Libraries") ), wxVERTICAL ); sbEquivChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint alias files") ), wxHORIZONTAL );
wxBoxSizer* bEquivButtonsSizer; m_ListEquiv = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
bEquivButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); m_ListEquiv->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") );
m_ListEquiv->SetMinSize( wxSize( 400,-1 ) );
sbEquivChoiceSizer->Add( bEquivButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextEquList = new wxStaticText( this, wxID_ANY, _("Active Equivalente Files:"), wxDefaultPosition, wxDefaultSize, 0 ); sbEquivChoiceSizer->Add( m_ListEquiv, 1, wxALL|wxEXPAND, 5 );
m_staticTextEquList->Wrap( -1 );
sbEquivChoiceSizer->Add( m_staticTextEquList, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerEquButtons; wxBoxSizer* bSizerEquButtons;
bSizerEquButtons = new wxBoxSizer( wxHORIZONTAL ); bSizerEquButtons = new wxBoxSizer( wxVERTICAL );
m_buttonAddEqu = new wxButton( this, ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAddEqu = new wxButton( this, ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonAddEqu->SetToolTip( _("Add a new library after the selected library, and load it") ); m_buttonAddEqu->SetToolTip( _("Add a new library after the selected library, and load it") );
bSizerEquButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); bSizerEquButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5 );
m_buttonInsEqu = new wxButton( this, ID_INSERT_EQU, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonInsEqu = new wxButton( this, ID_INSERT_EQU, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonInsEqu->SetToolTip( _("Add a new library before the selected library, and load it") ); m_buttonInsEqu->SetToolTip( _("Add a new library before the selected library, and load it") );
bSizerEquButtons->Add( m_buttonInsEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); bSizerEquButtons->Add( m_buttonInsEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 );
m_buttonRemoveEqu = new wxButton( this, ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemoveEqu = new wxButton( this, ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRemoveEqu->SetToolTip( _("Unload the selected library") ); m_buttonRemoveEqu->SetToolTip( _("Unload the selected library") );
bSizerEquButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); bSizerEquButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 );
sbEquivChoiceSizer->Add( bSizerEquButtons, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
m_ListEquiv = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
m_ListEquiv->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") );
m_ListEquiv->SetMinSize( wxSize( 200,-1 ) );
sbEquivChoiceSizer->Add( m_ListEquiv, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bUpperSizer->Add( sbEquivChoiceSizer, 1, wxEXPAND, 5 ); sbEquivChoiceSizer->Add( bSizerEquButtons, 0, wxALIGN_CENTER_VERTICAL, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); bMainSizer->Add( sbEquivChoiceSizer, 1, wxALL|wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
wxStaticBoxSizer* sbModulesDocSizer; wxStaticBoxSizer* sbModulesDocSizer;
sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Module Doc File:") ), wxHORIZONTAL ); sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint documentation file") ), wxHORIZONTAL );
m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALL, 5 ); sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_buttonModDoc = new wxButton( this, ID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonModDoc = new wxButton( this, ID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
sbModulesDocSizer->Add( m_buttonModDoc, 0, wxALL, 5 ); sbModulesDocSizer->Add( m_buttonModDoc, 0, wxALL, 5 );
bMainSizer->Add( sbModulesDocSizer, 0, wxEXPAND, 5 ); bMainSizer->Add( sbModulesDocSizer, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbLibPathSizer;
sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Path for Libraries Files:") ), wxVERTICAL );
wxBoxSizer* bUserLibPathSizer;
bUserLibPathSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizer4; wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Path:") ), wxHORIZONTAL ); sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search paths") ), wxHORIZONTAL );
wxBoxSizer* bUserListSizer; wxBoxSizer* bUserListSizer;
bUserListSizer = new wxBoxSizer( wxVERTICAL ); bUserListSizer = new wxBoxSizer( wxVERTICAL );
m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB );
m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") );
m_listUserPaths->SetMinSize( wxSize( 300,-1 ) );
bUserListSizer->Add( m_listUserPaths, 1, wxEXPAND, 5 ); bUserListSizer->Add( m_listUserPaths, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
wxBoxSizer* bUserPathsButtonsSizer; wxBoxSizer* bUserPathsButtonsSizer;
bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL );
...@@ -198,32 +115,40 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i ...@@ -198,32 +115,40 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i
m_buttonRemovePath = new wxButton( this, ID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemovePath = new wxButton( this, ID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
bUserLibPathSizer->Add( sbSizer4, 1, wxEXPAND, 5 );
sbLibPathSizer->Add( bUserLibPathSizer, 1, wxEXPAND, 5 ); bMainSizer->Add( sbSizer4, 1, wxALL|wxEXPAND, 5 );
m_staticTextcurrenpaths = new wxStaticText( this, wxID_ANY, _("Current Full Paths for Libraries Files in Use:"), wxDefaultPosition, wxDefaultSize, 0 ); wxStaticBoxSizer* sbSizer6;
m_staticTextcurrenpaths->Wrap( -1 ); sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxHORIZONTAL );
sbLibPathSizer->Add( m_staticTextcurrenpaths, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB );
m_DefaultLibraryPathslistBox->SetToolTip( _("Paths (system paths and user paths) used to search and load libraries files and component doc files.\nSorted by decreasing priority order.") ); m_DefaultLibraryPathslistBox->SetToolTip( _("Paths (system paths and user paths) used to search and load libraries files and component doc files.\nSorted by decreasing priority order.") );
m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) ); m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) );
sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizer6->Add( m_DefaultLibraryPathslistBox, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbSizer6, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbLibPathSizer, 0, wxEXPAND, 5 ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer2 = new wxStdDialogButtonSizer();
m_sdbSizer2OK = new wxButton( this, wxID_OK );
m_sdbSizer2->AddButton( m_sdbSizer2OK );
m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer2->AddButton( m_sdbSizer2Cancel );
m_sdbSizer2->Realize();
bMainSizer->Add( m_sdbSizer2, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
bMainSizer->Fit( this );
this->Centre( wxBOTH );
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) );
m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this );
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this );
m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnSaveCfgClick ), NULL, this );
m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonInsLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonInsLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this );
...@@ -234,15 +159,14 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i ...@@ -234,15 +159,14 @@ DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID i
m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this );
m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this );
m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this );
m_sdbSizer2Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this );
m_sdbSizer2OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this );
} }
DIALOG_CVPCB_CONFIG_FBP::~DIALOG_CVPCB_CONFIG_FBP() DIALOG_CVPCB_CONFIG_FBP::~DIALOG_CVPCB_CONFIG_FBP()
{ {
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) ); this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) );
m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this );
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this );
m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnSaveCfgClick ), NULL, this );
m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonInsLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonInsLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this );
...@@ -253,4 +177,6 @@ DIALOG_CVPCB_CONFIG_FBP::~DIALOG_CVPCB_CONFIG_FBP() ...@@ -253,4 +177,6 @@ DIALOG_CVPCB_CONFIG_FBP::~DIALOG_CVPCB_CONFIG_FBP()
m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this );
m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this );
m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this );
m_sdbSizer2Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this );
m_sdbSizer2OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this );
} }
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="center"></property> <property name="center">wxBOTH</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="extra_style"></property> <property name="extra_style"></property>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">DIALOG_CVPCB_CONFIG_FBP</property> <property name="name">DIALOG_CVPCB_CONFIG_FBP</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">641,612</property> <property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="title"></property> <property name="title"></property>
...@@ -77,562 +77,41 @@ ...@@ -77,562 +77,41 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bUpperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bLeftSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_OK</property>
<property name="label">Ok</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_buttonOk</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOkClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_CANCEL</property>
<property name="label">Cancel</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_buttonCancel</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnCancelClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">ID_SAVE_CFG</property>
<property name="label">Save Cfg</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_buttonSave</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Accept and save current configuration setting in the local .pro file</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnSaveCfgClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">20</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Files ext:</property>
<property name="minimum_size"></property>
<property name="name">sFileExtBox</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Cmp file Ext: </property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_InfoCmpFileExt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Library file Ext: </property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_InfoLibFileExt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Netlist file Ext: </property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_InfoNetlistFileExt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticBoxSizer" expanded="0">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Equiv file Ext: </property> <property name="label">Footprint library files</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_InfoEquivFileExt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Retro file Ext: </property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_InfoRetroannotFileExt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;Close after Save&quot; &quot;Keep Open&quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Cvpcb Close Option:</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_radioBoxCloseOpt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">0</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip">After saving the nelist and the components files, Cvpcb can be left open, or automatically closed</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Libraries</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">sbLibsChoiceSizer</property> <property name="name">sbLibsChoiceSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bLibsButtonsSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
</object> <event name="OnUpdateUI"></event>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxStaticText" expanded="1"> <object class="wxListBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Active Libraries:</property> <property name="maximum_size">-1,-1</property>
<property name="maximum_size"></property> <property name="minimum_size">450,-1</property>
<property name="minimum_size"></property> <property name="name">m_ListLibr</property>
<property name="name">m_staticTextlibList</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style">wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip">List of active library files.&#x0A;Only library files in this list are loaded by Pcbnew.&#x0A;The order of this list is important:&#x0A;Pcbnew searchs for a given footprint using this list order priority.</property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
...@@ -643,6 +122,8 @@ ...@@ -643,6 +122,8 @@
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
...@@ -660,16 +141,16 @@ ...@@ -660,16 +141,16 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerLibButtons</property> <property name="name">bSizerLibButtons</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxLEFT</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -721,7 +202,7 @@ ...@@ -721,7 +202,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -773,7 +254,7 @@ ...@@ -773,7 +254,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxRIGHT</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -825,109 +306,45 @@ ...@@ -825,109 +306,45 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxListBox" expanded="1">
<property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">200,-1</property>
<property name="name">m_ListLibr</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE</property>
<property name="subclass"></property>
<property name="tooltip">List of active library files.&#x0A;Only library files in this list are loaded by Pcbnew.&#x0A;The order of this list is important:&#x0A;Pcbnew searchs for a given footprint using this list order priority.</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Libraries</property> <property name="label">Footprint alias files</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">sbEquivChoiceSizer</property> <property name="name">sbEquivChoiceSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bEquivButtonsSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
</object> <event name="OnUpdateUI"></event>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxStaticText" expanded="1"> <object class="wxListBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Active Equivalente Files:</property> <property name="maximum_size">-1,-1</property>
<property name="maximum_size"></property> <property name="minimum_size">400,-1</property>
<property name="minimum_size"></property> <property name="name">m_ListEquiv</property>
<property name="name">m_staticTextEquList</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style">wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip">List of active library files.&#x0A;Only library files in this list are loaded by Pcbnew.&#x0A;The order of this list is important:&#x0A;Pcbnew searchs for a given footprint using this list order priority.</property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
...@@ -938,6 +355,8 @@ ...@@ -938,6 +355,8 @@
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
...@@ -955,16 +374,16 @@ ...@@ -955,16 +374,16 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerEquButtons</property> <property name="name">bSizerEquButtons</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxLEFT</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -1016,7 +435,7 @@ ...@@ -1016,7 +435,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -1068,7 +487,7 @@ ...@@ -1068,7 +487,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxRIGHT</property> <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -1120,118 +539,15 @@ ...@@ -1120,118 +539,15 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxListBox" expanded="1">
<property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">200,-1</property>
<property name="name">m_ListEquiv</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE</property>
<property name="subclass"></property>
<property name="tooltip">List of active library files.&#x0A;Only library files in this list are loaded by Pcbnew.&#x0A;The order of this list is important:&#x0A;Pcbnew searchs for a given footprint using this list order priority.</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticline1</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Module Doc File:</property> <property name="label">Footprint documentation file</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">sbModulesDocSizer</property> <property name="name">sbModulesDocSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
...@@ -1239,7 +555,7 @@ ...@@ -1239,7 +555,7 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -1348,32 +664,11 @@ ...@@ -1348,32 +664,11 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Path for Libraries Files:</property>
<property name="minimum_size"></property>
<property name="name">sbLibPathSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bUserLibPathSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">User Path:</property> <property name="label">User defined search paths</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">sbSizer4</property> <property name="name">sbSizer4</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
...@@ -1381,7 +676,7 @@ ...@@ -1381,7 +676,7 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -1390,7 +685,7 @@ ...@@ -1390,7 +685,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxListBox" expanded="1"> <object class="wxListBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -1401,13 +696,13 @@ ...@@ -1401,13 +696,13 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size">-1,-1</property>
<property name="minimum_size"></property> <property name="minimum_size">300,-1</property>
<property name="name">m_listUserPaths</property> <property name="name">m_listUserPaths</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style">wxLB_NEEDED_SB</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Additional paths used in this project. The priority is highter than default Kicad paths.</property> <property name="tooltip">Additional paths used in this project. The priority is highter than default Kicad paths.</property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
...@@ -1444,7 +739,7 @@ ...@@ -1444,7 +739,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -1611,34 +906,43 @@ ...@@ -1611,34 +906,43 @@
</object> </object>
</object> </object>
</object> </object>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Current search path list</property>
<property name="minimum_size"></property>
<property name="name">sbSizer6</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxListBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Current Full Paths for Libraries Files in Use:</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size">-1,70</property>
<property name="name">m_staticTextcurrenpaths</property> <property name="name">m_DefaultLibraryPathslistBox</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style">wxLB_NEEDED_SB</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip">Paths (system paths and user paths) used to search and load libraries files and component doc files.&#x0A;Sorted by decreasing priority order.</property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
...@@ -1649,6 +953,8 @@ ...@@ -1649,6 +953,8 @@
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
...@@ -1664,13 +970,14 @@ ...@@ -1664,13 +970,14 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxListBox" expanded="1"> <object class="wxStaticLine" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
...@@ -1678,14 +985,14 @@ ...@@ -1678,14 +985,14 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size">-1,70</property> <property name="minimum_size"></property>
<property name="name">m_DefaultLibraryPathslistBox</property> <property name="name">m_staticline2</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxLB_NEEDED_SB</property> <property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Paths (system paths and user paths) used to search and load libraries files and component doc files.&#x0A;Sorted by decreasing priority order.</property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
...@@ -1699,8 +1006,6 @@ ...@@ -1699,8 +1006,6 @@
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
...@@ -1716,6 +1021,30 @@ ...@@ -1716,6 +1021,30 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer2</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick">OnCancelClick</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick">OnOkClick</event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object> </object>
</object> </object>
</object> </object>
......
...@@ -11,18 +11,16 @@ ...@@ -11,18 +11,16 @@
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/button.h> #include <wx/listbox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/stattext.h> #include <wx/button.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/listbox.h>
#include <wx/statline.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/statline.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -37,8 +35,7 @@ class DIALOG_CVPCB_CONFIG_FBP : public wxDialog ...@@ -37,8 +35,7 @@ class DIALOG_CVPCB_CONFIG_FBP : public wxDialog
protected: protected:
enum enum
{ {
ID_SAVE_CFG = 1000, ID_ADD_LIB = 1000,
ID_ADD_LIB,
ID_INSERT_LIB, ID_INSERT_LIB,
ID_REMOVE_LIB, ID_REMOVE_LIB,
ID_ADD_EQU, ID_ADD_EQU,
...@@ -50,50 +47,39 @@ class DIALOG_CVPCB_CONFIG_FBP : public wxDialog ...@@ -50,50 +47,39 @@ class DIALOG_CVPCB_CONFIG_FBP : public wxDialog
ID_REMOVE_PATH, ID_REMOVE_PATH,
}; };
wxButton* m_buttonOk; wxListBox* m_ListLibr;
wxButton* m_buttonCancel;
wxButton* m_buttonSave;
wxStaticText* m_InfoCmpFileExt;
wxStaticText* m_InfoLibFileExt;
wxStaticText* m_InfoNetlistFileExt;
wxStaticText* m_InfoEquivFileExt;
wxStaticText* m_InfoRetroannotFileExt;
wxRadioBox* m_radioBoxCloseOpt;
wxStaticText* m_staticTextlibList;
wxButton* m_buttonAddLib; wxButton* m_buttonAddLib;
wxButton* m_buttonInsLib; wxButton* m_buttonInsLib;
wxButton* m_buttonRemoveLib; wxButton* m_buttonRemoveLib;
wxListBox* m_ListLibr; wxListBox* m_ListEquiv;
wxStaticText* m_staticTextEquList;
wxButton* m_buttonAddEqu; wxButton* m_buttonAddEqu;
wxButton* m_buttonInsEqu; wxButton* m_buttonInsEqu;
wxButton* m_buttonRemoveEqu; wxButton* m_buttonRemoveEqu;
wxListBox* m_ListEquiv;
wxStaticLine* m_staticline1;
wxTextCtrl* m_TextHelpModulesFileName; wxTextCtrl* m_TextHelpModulesFileName;
wxButton* m_buttonModDoc; wxButton* m_buttonModDoc;
wxListBox* m_listUserPaths; wxListBox* m_listUserPaths;
wxButton* m_buttonAddPath; wxButton* m_buttonAddPath;
wxButton* m_buttonInsPath; wxButton* m_buttonInsPath;
wxButton* m_buttonRemovePath; wxButton* m_buttonRemovePath;
wxStaticText* m_staticTextcurrenpaths;
wxListBox* m_DefaultLibraryPathslistBox; wxListBox* m_DefaultLibraryPathslistBox;
wxStaticLine* m_staticline2;
wxStdDialogButtonSizer* m_sdbSizer2;
wxButton* m_sdbSizer2OK;
wxButton* m_sdbSizer2Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnSaveCfgClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); } virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); }
virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
public: public:
DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 641,612 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_CVPCB_CONFIG_FBP(); ~DIALOG_CVPCB_CONFIG_FBP();
}; };
......
...@@ -57,8 +57,6 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_FootprintDisplayOptionsFrame, wxDialog ) ...@@ -57,8 +57,6 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_FootprintDisplayOptionsFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_FootprintDisplayOptionsFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_FootprintDisplayOptionsFrame, wxDialog )
////@begin WinEDA_FootprintDisplayOptionsFrame event table entries ////@begin WinEDA_FootprintDisplayOptionsFrame event table entries
EVT_BUTTON( ID_SAVE_CONFIG, WinEDA_FootprintDisplayOptionsFrame::OnSaveConfigClick )
EVT_BUTTON( wxID_OK, WinEDA_FootprintDisplayOptionsFrame::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_FootprintDisplayOptionsFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_FootprintDisplayOptionsFrame::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_FootprintDisplayOptionsFrame::OnCancelClick )
...@@ -98,7 +96,6 @@ bool WinEDA_FootprintDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID i ...@@ -98,7 +96,6 @@ bool WinEDA_FootprintDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID i
ColumnBoxSizer = NULL; ColumnBoxSizer = NULL;
m_IsShowPadFill = NULL; m_IsShowPadFill = NULL;
m_IsShowPadNum = NULL; m_IsShowPadNum = NULL;
BottomBoxSizer = NULL;
m_CancelButton = NULL; m_CancelButton = NULL;
////@end WinEDA_FootprintDisplayOptionsFrame member initialisation ////@end WinEDA_FootprintDisplayOptionsFrame member initialisation
...@@ -122,10 +119,8 @@ bool WinEDA_FootprintDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID i ...@@ -122,10 +119,8 @@ bool WinEDA_FootprintDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID i
void WinEDA_FootprintDisplayOptionsFrame::CreateControls() void WinEDA_FootprintDisplayOptionsFrame::CreateControls()
{ {
SetFont(*g_DialogFont);
////@begin WinEDA_FootprintDisplayOptionsFrame content construction ////@begin WinEDA_FootprintDisplayOptionsFrame content construction
// Generated by DialogBlocks, 21/07/2008 15:12:47 (unregistered) // Generated by DialogBlocks, 16/04/2009 14:23:49 (unregistered)
WinEDA_FootprintDisplayOptionsFrame* itemDialog1 = this; WinEDA_FootprintDisplayOptionsFrame* itemDialog1 = this;
...@@ -152,40 +147,34 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls() ...@@ -152,40 +147,34 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls()
MainBoxSizer->Add(m_TextDisplayOption, 0, wxALIGN_TOP|wxALL, 5); MainBoxSizer->Add(m_TextDisplayOption, 0, wxALIGN_TOP|wxALL, 5);
ColumnBoxSizer = new wxBoxSizer(wxVERTICAL); ColumnBoxSizer = new wxBoxSizer(wxVERTICAL);
MainBoxSizer->Add(ColumnBoxSizer, 1, wxALIGN_TOP|wxLEFT|wxRIGHT|wxTOP, 5); MainBoxSizer->Add(ColumnBoxSizer, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_IsShowPadFill = new wxCheckBox( itemDialog1, PADFILL_OPT, _("&Pad Filled"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); m_IsShowPadFill = new wxCheckBox( itemDialog1, PADFILL_OPT, _("Fill &pad"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_IsShowPadFill->SetValue(false); m_IsShowPadFill->SetValue(false);
ColumnBoxSizer->Add(m_IsShowPadFill, 1, wxGROW|wxALL, 5); ColumnBoxSizer->Add(m_IsShowPadFill, 1, wxGROW|wxALL, 5);
m_IsShowPadNum = new wxCheckBox( itemDialog1, PADNUM_OPT, _("Display Pad &Num"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); m_IsShowPadNum = new wxCheckBox( itemDialog1, PADNUM_OPT, _("Show pad &number"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_IsShowPadNum->SetValue(false); m_IsShowPadNum->SetValue(false);
if (WinEDA_FootprintDisplayOptionsFrame::ShowToolTips()) if (WinEDA_FootprintDisplayOptionsFrame::ShowToolTips())
m_IsShowPadNum->SetToolTip(_("Display pad number")); m_IsShowPadNum->SetToolTip(_("Display pad number"));
ColumnBoxSizer->Add(m_IsShowPadNum, 1, wxGROW|wxALL, 5); ColumnBoxSizer->Add(m_IsShowPadNum, 1, wxGROW|wxALL, 5);
ColumnBoxSizer->Add(5, 5, 0, wxGROW|wxTOP, 5); wxStaticLine* itemStaticLine9 = new wxStaticLine( itemDialog1, ID_STATICLINE1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
OuterBoxSizer->Add(itemStaticLine9, 0, wxGROW|wxALL, 5);
wxButton* itemButton10 = new wxButton( itemDialog1, ID_SAVE_CONFIG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 );
ColumnBoxSizer->Add(itemButton10, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticLine* itemStaticLine11 = new wxStaticLine( itemDialog1, ID_STATICLINE1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
OuterBoxSizer->Add(itemStaticLine11, 0, wxGROW|wxALL, 5);
BottomBoxSizer = new wxBoxSizer(wxHORIZONTAL); wxStdDialogButtonSizer* itemStdDialogButtonSizer10 = new wxStdDialogButtonSizer;
OuterBoxSizer->Add(BottomBoxSizer, 0, wxALIGN_RIGHT|wxALL, 5);
wxButton* itemButton13 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); OuterBoxSizer->Add(itemStdDialogButtonSizer10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemButton13->SetDefault(); wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton13->SetForegroundColour(wxColour(255, 0, 0)); itemStdDialogButtonSizer10->AddButton(itemButton11);
BottomBoxSizer->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_CancelButton = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_CancelButton = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_CancelButton->SetForegroundColour(wxColour(0, 0, 255)); itemStdDialogButtonSizer10->AddButton(m_CancelButton);
BottomBoxSizer->Add(m_CancelButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton15 = new wxButton( itemDialog1, wxID_APPLY, _("&Apply"), wxDefaultPosition, wxDefaultSize, 0 ); wxButton* itemButton13 = new wxButton( itemDialog1, wxID_APPLY, _("&Apply"), wxDefaultPosition, wxDefaultSize, 0 );
BottomBoxSizer->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemStdDialogButtonSizer10->AddButton(itemButton13);
itemStdDialogButtonSizer10->Realize();
// Set validators // Set validators
m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) ); m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) );
...@@ -240,33 +229,14 @@ void WinEDA_FootprintDisplayOptionsFrame::UpdateObjectSettings(void) ...@@ -240,33 +229,14 @@ void WinEDA_FootprintDisplayOptionsFrame::UpdateObjectSettings(void)
{ {
// Update settings // Update settings
////@begin WinEDA_FootprintDisplayOptionsFrame update settings ////@begin WinEDA_FootprintDisplayOptionsFrame update settings
DisplayOpt.DisplayModEdge = m_Parent->m_DisplayModEdge = m_Parent->m_DisplayModEdge = m_EdgesDisplayOption->GetSelection();
m_EdgesDisplayOption->GetSelection(); m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection();
m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue();
DisplayOpt.DisplayModText = m_Parent->m_DisplayModText = m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue();
m_TextDisplayOption->GetSelection();
DisplayOpt.DisplayPadNum = m_Parent->m_DisplayPadNum =
m_IsShowPadNum->GetValue();
DisplayOpt.DisplayPadFill = m_Parent->m_DisplayPadFill =
m_IsShowPadFill->GetValue();
m_Parent->DrawPanel->Refresh(); m_Parent->DrawPanel->Refresh();
////@end WinEDA_FootprintDisplayOptionsFrame update settings ////@end WinEDA_FootprintDisplayOptionsFrame update settings
} }
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_CONFIG
*/
void WinEDA_FootprintDisplayOptionsFrame::OnSaveConfigClick( wxCommandEvent& event )
{
WinEDA_CvpcbFrame* parent = ( WinEDA_CvpcbFrame* )GetParent();
wxASSERT( parent && parent->IsKindOf( CLASSINFO( WinEDA_CvpcbFrame ) ) );
Save_Config( this, parent->m_NetlistFileName.GetFullPath() );
}
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/ */
......
...@@ -45,7 +45,6 @@ class wxBoxSizer; ...@@ -45,7 +45,6 @@ class wxBoxSizer;
#define TEXT_SELECT 10002 #define TEXT_SELECT 10002
#define PADFILL_OPT 10003 #define PADFILL_OPT 10003
#define PADNUM_OPT 10004 #define PADNUM_OPT 10004
#define ID_SAVE_CONFIG 10005
#define ID_STATICLINE1 10006 #define ID_STATICLINE1 10006
#define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER #define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_TITLE _("Display Options") #define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_TITLE _("Display Options")
...@@ -84,9 +83,6 @@ public: ...@@ -84,9 +83,6 @@ public:
////@begin WinEDA_FootprintDisplayOptionsFrame event handler declarations ////@begin WinEDA_FootprintDisplayOptionsFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_CONFIG
void OnSaveConfigClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
...@@ -120,7 +116,6 @@ public: ...@@ -120,7 +116,6 @@ public:
wxBoxSizer* ColumnBoxSizer; wxBoxSizer* ColumnBoxSizer;
wxCheckBox* m_IsShowPadFill; wxCheckBox* m_IsShowPadFill;
wxCheckBox* m_IsShowPadNum; wxCheckBox* m_IsShowPadNum;
wxBoxSizer* BottomBoxSizer;
wxButton* m_CancelButton; wxButton* m_CancelButton;
////@end WinEDA_FootprintDisplayOptionsFrame member variables ////@end WinEDA_FootprintDisplayOptionsFrame member variables
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<string name="resource_prefix">""</string> <string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool> <bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool> <bool name="use_enums">0</bool>
<bool name="generate_for_xrced">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string> <string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"&lt;Any&gt;"</string> <string name="target_wx_version">"&lt;Any&gt;"</string>
<string name="cpp_header_comment">"///////////////////////////////////////////////////////////////////////////// <string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
...@@ -114,6 +115,7 @@ ...@@ -114,6 +115,7 @@
<bool name="archive_all_image_files">0</bool> <bool name="archive_all_image_files">0</bool>
<bool name="xrc_retain_relative_paths">1</bool> <bool name="xrc_retain_relative_paths">1</bool>
<bool name="xrc_generate_id_tags">0</bool> <bool name="xrc_generate_id_tags">0</bool>
<bool name="xrc_use_name_property">0</bool>
</header> </header>
<data> <data>
<document> <document>
...@@ -136,7 +138,7 @@ ...@@ -136,7 +138,7 @@
<long name="locked">0</long> <long name="locked">0</long>
<string name="template-name">""</string> <string name="template-name">""</string>
<bool name="dirty">1</bool> <bool name="dirty">1</bool>
<long name="makefile-last-written">0</long> <long name="makefile-last-written">-8519680</long>
<string name="Compiler name">""</string> <string name="Compiler name">""</string>
<string name="Build mode">"Debug"</string> <string name="Build mode">"Debug"</string>
<string name="Unicode mode">"ANSI"</string> <string name="Unicode mode">"ANSI"</string>
...@@ -157,6 +159,7 @@ ...@@ -157,6 +159,7 @@
<string name="Compiler location">"%AUTO%"</string> <string name="Compiler location">"%AUTO%"</string>
<string name="wxWidgets location">"%AUTO%"</string> <string name="wxWidgets location">"%AUTO%"</string>
<string name="C++ command">"%AUTO%"</string> <string name="C++ command">"%AUTO%"</string>
<string name="C command">"%AUTO%"</string>
<string name="Resource compiler">"%AUTO%"</string> <string name="Resource compiler">"%AUTO%"</string>
<string name="Make command">"%AUTO%"</string> <string name="Make command">"%AUTO%"</string>
<string name="Project makefile">"%AUTO%"</string> <string name="Project makefile">"%AUTO%"</string>
...@@ -168,6 +171,7 @@ ...@@ -168,6 +171,7 @@
<string name="Optimizations">"%AUTO%"</string> <string name="Optimizations">"%AUTO%"</string>
<string name="Warnings">"%AUTO%"</string> <string name="Warnings">"%AUTO%"</string>
<string name="Debug flags">"%AUTO%"</string> <string name="Debug flags">"%AUTO%"</string>
<string name="Extra compile flags">"%AUTO%"</string>
<string name="Libraries">"%AUTO%"</string> <string name="Libraries">"%AUTO%"</string>
<string name="Library path">"%AUTO%"</string> <string name="Library path">"%AUTO%"</string>
<string name="Linker flags">"%AUTO%"</string> <string name="Linker flags">"%AUTO%"</string>
...@@ -180,6 +184,7 @@ ...@@ -180,6 +184,7 @@
<string name="PATH variable">"%AUTO%"</string> <string name="PATH variable">"%AUTO%"</string>
<bool name="Suppress source rules">0</bool> <bool name="Suppress source rules">0</bool>
<bool name="Enable makefile generation">1</bool> <bool name="Enable makefile generation">1</bool>
<string name="CFG">""</string>
</document> </document>
</document> </document>
</data> </data>
...@@ -465,13 +470,13 @@ ...@@ -465,13 +470,13 @@
<string name="proxy-Orientation">"Vertical"</string> <string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">"ColumnBoxSizer"</string> <string name="proxy-Member variable name">"ColumnBoxSizer"</string>
<string name="proxy-AlignH">"Centre"</string> <string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Top"</string> <string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">1</long> <long name="proxy-Stretch factor">1</long>
<long name="proxy-Border">5</long> <long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool> <bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool> <bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool> <bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">0</bool> <bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool> <bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool> <bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool> <bool name="proxy-wxFIXED_MINSIZE">0</bool>
...@@ -497,7 +502,7 @@ ...@@ -497,7 +502,7 @@
<string name="proxy-Implementation filename">""</string> <string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string> <string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_IsShowPadFill"</string> <string name="proxy-Member variable name">"m_IsShowPadFill"</string>
<string name="proxy-Label">"&amp;Pad Filled"</string> <string name="proxy-Label">"Fill &amp;pad"</string>
<bool name="proxy-Initial value">0</bool> <bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string> <string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string> <string name="proxy-Tooltip text">""</string>
...@@ -561,7 +566,7 @@ ...@@ -561,7 +566,7 @@
<string name="proxy-Implementation filename">""</string> <string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string> <string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_IsShowPadNum"</string> <string name="proxy-Member variable name">"m_IsShowPadNum"</string>
<string name="proxy-Label">"Display Pad &amp;Num"</string> <string name="proxy-Label">"Show pad &amp;number"</string>
<bool name="proxy-Initial value">0</bool> <bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string> <string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">"Display pad number"</string> <string name="proxy-Tooltip text">"Display pad number"</string>
...@@ -604,99 +609,6 @@ ...@@ -604,99 +609,6 @@
<string name="proxy-Custom arguments">""</string> <string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string> <string name="proxy-Custom ctor arguments">""</string>
</document> </document>
<document>
<string name="title">"Spacer"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"spacer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"24/10/2007"</string>
<string name="proxy-type">"wbSpacerProxy"</string>
<long name="proxy-Width">5</long>
<long name="proxy-Height">5</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">0</bool>
<bool name="proxy-wxRIGHT">0</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">0</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxButton: ID_SAVE_CONFIG"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"24/10/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnSaveConfigClick|||"</string>
<string name="proxy-Id name">"ID_SAVE_CONFIG"</string>
<long name="proxy-Id value">10005</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Save Cfg"</string>
<bool name="proxy-Default">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxBU_LEFT">0</bool>
<bool name="proxy-wxBU_RIGHT">0</bool>
<bool name="proxy-wxBU_TOP">0</bool>
<bool name="proxy-wxBU_BOTTOM">0</bool>
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document> </document>
</document> </document>
<document> <document>
...@@ -755,7 +667,7 @@ ...@@ -755,7 +667,7 @@
<bool name="proxy-wxFIXED_MINSIZE">0</bool> <bool name="proxy-wxFIXED_MINSIZE">0</bool>
</document> </document>
<document> <document>
<string name="title">"wxBoxSizer H"</string> <string name="title">"wxStdDialogButtonSizer"</string>
<string name="type">"dialog-control-document"</string> <string name="type">"dialog-control-document"</string>
<string name="filename">""</string> <string name="filename">""</string>
<string name="icon-name">"sizer"</string> <string name="icon-name">"sizer"</string>
...@@ -763,11 +675,17 @@ ...@@ -763,11 +675,17 @@
<long name="owns-file">1</long> <long name="owns-file">1</long>
<long name="title-mode">0</long> <long name="title-mode">0</long>
<long name="locked">0</long> <long name="locked">0</long>
<string name="created">"24/10/2007"</string> <string name="proxy-type">"wbStdDialogButtonSizerProxy"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string> <bool name="proxy-wxID_OK">1</bool>
<string name="proxy-Orientation">"Horizontal"</string> <bool name="proxy-wxID_CANCEL">1</bool>
<string name="proxy-Member variable name">"BottomBoxSizer"</string> <bool name="proxy-wxID_YES">0</bool>
<string name="proxy-AlignH">"Right"</string> <bool name="proxy-wxID_NO">0</bool>
<bool name="proxy-wxID_HELP">0</bool>
<bool name="proxy-wxID_APPLY">1</bool>
<bool name="proxy-wxID_SAVE">0</bool>
<bool name="proxy-wxID_CONTEXT_HELP">0</bool>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string> <string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long> <long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long> <long name="proxy-Border">5</long>
...@@ -787,10 +705,9 @@ ...@@ -787,10 +705,9 @@
<long name="is-transient">0</long> <long name="is-transient">0</long>
<long name="owns-file">1</long> <long name="owns-file">1</long>
<long name="title-mode">0</long> <long name="title-mode">0</long>
<long name="locked">0</long> <long name="locked">1</long>
<string name="created">"24/10/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string> <string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||"</string> <string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||WinEDA_FootprintDisplayOptionsFrame"</string>
<string name="proxy-Id name">"wxID_OK"</string> <string name="proxy-Id name">"wxID_OK"</string>
<long name="proxy-Id value">5100</long> <long name="proxy-Id value">5100</long>
<string name="proxy-Name">""</string> <string name="proxy-Name">""</string>
...@@ -802,7 +719,7 @@ ...@@ -802,7 +719,7 @@
<string name="proxy-Header filename">""</string> <string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string> <string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"&amp;OK"</string> <string name="proxy-Label">"&amp;OK"</string>
<bool name="proxy-Default">1</bool> <bool name="proxy-Default">0</bool>
<string name="proxy-Help text">""</string> <string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string> <string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string> <string name="proxy-Data variable">""</string>
...@@ -813,7 +730,7 @@ ...@@ -813,7 +730,7 @@
<string name="proxy-Data class header filename">""</string> <string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string> <string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string> <string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">"FF0000"</string> <string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string> <string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool> <bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool> <bool name="proxy-Enabled">1</bool>
...@@ -854,8 +771,7 @@ ...@@ -854,8 +771,7 @@
<long name="is-transient">0</long> <long name="is-transient">0</long>
<long name="owns-file">1</long> <long name="owns-file">1</long>
<long name="title-mode">0</long> <long name="title-mode">0</long>
<long name="locked">0</long> <long name="locked">1</long>
<string name="created">"24/10/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string> <string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||WinEDA_FootprintDisplayOptionsFrame"</string> <string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||WinEDA_FootprintDisplayOptionsFrame"</string>
<string name="proxy-Id name">"wxID_CANCEL"</string> <string name="proxy-Id name">"wxID_CANCEL"</string>
...@@ -880,7 +796,7 @@ ...@@ -880,7 +796,7 @@
<string name="proxy-Data class header filename">""</string> <string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string> <string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string> <string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">"0000FF"</string> <string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string> <string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool> <bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool> <bool name="proxy-Enabled">1</bool>
...@@ -921,10 +837,9 @@ ...@@ -921,10 +837,9 @@
<long name="is-transient">0</long> <long name="is-transient">0</long>
<long name="owns-file">1</long> <long name="owns-file">1</long>
<long name="title-mode">0</long> <long name="title-mode">0</long>
<long name="locked">0</long> <long name="locked">1</long>
<string name="created">"24/10/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string> <string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnApplyClick|NONE||"</string> <string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnApplyClick|NONE||WinEDA_FootprintDisplayOptionsFrame"</string>
<string name="proxy-Id name">"wxID_APPLY"</string> <string name="proxy-Id name">"wxID_APPLY"</string>
<long name="proxy-Id value">5102</long> <long name="proxy-Id value">5102</long>
<string name="proxy-Name">""</string> <string name="proxy-Name">""</string>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/* Construction de la table des evenements pour WinEDA_DrawFrame */ /* Construction de la table des evenements pour WinEDA_DrawFrame */
/*****************************************************************/ /*****************************************************************/
BEGIN_EVENT_TABLE( WinEDA_DisplayFrame, WinEDA_DrawFrame ) BEGIN_EVENT_TABLE( WinEDA_DisplayFrame, WinEDA_BasePcbFrame )
EVT_CLOSE( WinEDA_DisplayFrame::OnCloseWindow ) EVT_CLOSE( WinEDA_DisplayFrame::OnCloseWindow )
EVT_SIZE( WinEDA_DrawFrame::OnSize ) EVT_SIZE( WinEDA_DrawFrame::OnSize )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_DisplayFrame::OnZoom ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_DisplayFrame::OnZoom )
......
...@@ -17,12 +17,13 @@ ...@@ -17,12 +17,13 @@
void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event ) void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event )
{ {
COMPONENT_LIST::iterator i;
FILE* FileEquiv; FILE* FileEquiv;
STORECMP* Cmp; COMPONENT* Cmp;
wxString Line; wxString Line;
wxFileName fn = m_NetlistFileName; wxFileName fn = m_NetlistFileName;
if( nbcomp <= 0 ) if( m_components.GetCount() <= 0 )
return; return;
/* calcul du nom du fichier */ /* calcul du nom du fichier */
...@@ -45,8 +46,10 @@ void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event ) ...@@ -45,8 +46,10 @@ void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event )
} }
/* Generation de la liste */ /* Generation de la liste */
for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) for( i = m_components.begin(); i != m_components.end(); ++i )
{ {
Cmp = *i;
/* gnration du composant si son empreinte est dfinie */ /* gnration du composant si son empreinte est dfinie */
if( Cmp->m_Module.IsEmpty() ) if( Cmp->m_Module.IsEmpty() )
continue; continue;
......
/***************/ /***************/
/* genorcad() */ /* genorcad() */
/***************/ /***************/
/* /*
Complte la netliste (*.NET) en y placant les ref *.lib FORMAT ORCADPCB * Complte la netliste (*.NET) en y placant les ref *.lib FORMAT ORCADPCB
La valeur (Part Value) est tronquee a 16 lettres * La valeur (Part Value) est tronquee a 16 lettres
*/ */
#include "fctsys.h" #include "fctsys.h"
...@@ -17,43 +17,43 @@ La valeur (Part Value) est tronquee a 16 lettres ...@@ -17,43 +17,43 @@ La valeur (Part Value) est tronquee a 16 lettres
#define MAX_LEN_NETNAME 16 #define MAX_LEN_NETNAME 16
/* Routines locales */ /* Routines locales */
static void TriPinsModule( STORECMP * CurrentCmp ); static void TriPinsModule( COMPONENT* CurrentCmp );
static int PinCompare(const void *cmp1, const void *cmp2); static void ChangePinNet( wxString& PinNet, bool rightJustify );
static void ChangePinNet( wxString & PinNet );
/* Variables Locales */ /* Variables Locales */
int NetNumCode; /* Nombre utilise pour cree des NetNames lors de int NetNumCode; /* Nombre utilise pour cree des NetNames lors de
reaffectation de NetNames */ * reaffectation de NetNames */
int genorcad() int genorcad( bool rightJustify )
{ {
char Line[1024]; char Line[1024];
STOREPIN * Pin; PIN* Pin;
STORECMP * CurrentCmp; COMPONENT* CurrentCmp;
wxString Title = wxGetApp().GetAppName() + wxT(" ") + GetBuildVersion(); wxString Title = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion();
NetNumCode = 1; DateAndTime(Line); NetNumCode = 1; DateAndTime( Line );
fprintf(dest,"( { Netlist by %s, date = %s }\n", fprintf( dest, "( { Netlist by %s, date = %s }\n",
CONV_TO_UTF8(Title), Line ) ; CONV_TO_UTF8( Title ), Line );
/***********************/ /***********************/
/* Lecture de la liste */ /* Lecture de la liste */
/***********************/ /***********************/
CurrentCmp = BaseListeCmp; CurrentCmp = BaseListeCmp;
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext) for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
{ {
fprintf(dest," ( %s ", CONV_TO_UTF8(CurrentCmp->m_TimeStamp)); fprintf( dest, " ( %s ", CONV_TO_UTF8( CurrentCmp->m_TimeStamp ) );
if( ! CurrentCmp->m_Module.IsEmpty() ) if( !CurrentCmp->m_Module.IsEmpty() )
fprintf(dest, CONV_TO_UTF8(CurrentCmp->m_Module)); fprintf( dest, CONV_TO_UTF8( CurrentCmp->m_Module ) );
else fprintf(dest,"$noname$") ; else
fprintf( dest, "$noname$" );
fprintf(dest," %s ",CONV_TO_UTF8(CurrentCmp->m_Reference)) ; fprintf( dest, " %s ", CONV_TO_UTF8( CurrentCmp->m_Reference ) );
/* placement de la valeur */ /* placement de la valeur */
fprintf(dest,"%s\n",CONV_TO_UTF8(CurrentCmp->m_Valeur)) ; fprintf( dest, "%s\n", CONV_TO_UTF8( CurrentCmp->m_Valeur ) );
/* Tri des pins */ /* Tri des pins */
TriPinsModule( CurrentCmp ); TriPinsModule( CurrentCmp );
...@@ -62,67 +62,74 @@ int genorcad() ...@@ -62,67 +62,74 @@ int genorcad()
Pin = CurrentCmp->m_Pins; Pin = CurrentCmp->m_Pins;
for( ; Pin != NULL; Pin = Pin->Pnext ) for( ; Pin != NULL; Pin = Pin->Pnext )
{ {
if( Pin->m_PinNet.Len() > MAX_LEN_NETNAME) if( Pin->m_PinNet.Len() > MAX_LEN_NETNAME )
ChangePinNet( Pin->m_PinNet ); ChangePinNet( Pin->m_PinNet, rightJustify );
if( ! Pin->m_PinNet.IsEmpty() ) if( !Pin->m_PinNet.IsEmpty() )
fprintf(dest," ( %s %s )\n", fprintf( dest, " ( %s %s )\n",
CONV_TO_UTF8(Pin->m_PinNum), CONV_TO_UTF8( Pin->m_PinNum ),
CONV_TO_UTF8(Pin->m_PinNet)); CONV_TO_UTF8( Pin->m_PinNet ) );
else else
fprintf(dest," ( %s ? )\n", CONV_TO_UTF8(Pin->m_PinNum)); fprintf( dest, " ( %s ? )\n", CONV_TO_UTF8( Pin->m_PinNum ) );
} }
fprintf(dest," )\n");
fprintf( dest, " )\n" );
} }
fprintf(dest,")\n*\n");
fclose(dest);
return(0);
}
fprintf( dest, ")\n*\n" );
fclose( dest );
return 0;
}
/***********************************************/ /***********************************************/
static void TriPinsModule( STORECMP * CurrentCmp ) static void TriPinsModule( COMPONENT* CurrentCmp )
/***********************************************/ /***********************************************/
/* Tri et controle des pins du module CurrentCmp /* Tri et controle des pins du module CurrentCmp
*/ */
{ {
STOREPIN * Pin, * NextPin, ** BasePin; PIN* Pin, * NextPin, ** BasePin;
int nbpins = 0, ii; int nbpins = 0, ii;
Pin = CurrentCmp->m_Pins; Pin = CurrentCmp->m_Pins;
if( Pin == NULL ) return; if( Pin == NULL )
return;
/* comptage des pins */ /* comptage des pins */
for( ; Pin != NULL ; Pin = Pin->Pnext ) nbpins++; for( ; Pin != NULL; Pin = Pin->Pnext )
nbpins++;
/* Tri des pins: etablissement de la liste des pointeurs */ /* Tri des pins: etablissement de la liste des pointeurs */
BasePin = (STOREPIN ** )MyZMalloc( nbpins * sizeof(STOREPIN*) ); BasePin = (PIN**) MyZMalloc( nbpins * sizeof(PIN*) );
Pin = CurrentCmp->m_Pins; Pin = CurrentCmp->m_Pins;
for( ii = 0 ; ii < nbpins ; ii++, Pin = Pin->Pnext ) for( ii = 0; ii < nbpins; ii++, Pin = Pin->Pnext )
{ {
BasePin[ii] = Pin; BasePin[ii] = Pin;
} }
/* Tri des Pins */ /* Tri des Pins */
qsort( BasePin, nbpins, sizeof( STORECMP*), PinCompare) ; qsort( BasePin, nbpins, sizeof( COMPONENT*), PinCompare );
/* Remise a jour des pointeurs chaines */ /* Remise a jour des pointeurs chaines */
for( ii = 0 ; ii < nbpins-1 ; ii++ ) for( ii = 0; ii < nbpins - 1; ii++ )
{ {
BasePin[ii]->Pnext = BasePin[ii+1]; BasePin[ii]->Pnext = BasePin[ii + 1];
} }
BasePin[ii]->Pnext = NULL; BasePin[ii]->Pnext = NULL;
CurrentCmp->m_Pins = BasePin[0]; CurrentCmp->m_Pins = BasePin[0];
MyFree(BasePin); MyFree( BasePin );
/* Elimination des redondances */ /* Elimination des redondances */
Pin = CurrentCmp->m_Pins; Pin = CurrentCmp->m_Pins;
while( Pin != NULL) while( Pin != NULL )
{ {
NextPin = Pin->Pnext; NextPin = Pin->Pnext;
if ( NextPin == NULL ) break; if( NextPin == NULL )
break;
if( Pin->m_PinNum != NextPin->m_PinNum ) if( Pin->m_PinNum != NextPin->m_PinNum )
{ {
Pin = Pin->Pnext; continue; Pin = Pin->Pnext; continue;
...@@ -131,10 +138,11 @@ int nbpins = 0, ii; ...@@ -131,10 +138,11 @@ int nbpins = 0, ii;
if( Pin->m_PinNet != NextPin->m_PinNet ) if( Pin->m_PinNet != NextPin->m_PinNet )
{ {
wxString msg; wxString msg;
msg.Printf( _("%s %s pin %s : Different Nets"), msg.Printf( _( "%s %s pin %s : Different Nets" ),
CurrentCmp->m_Reference.GetData(),CurrentCmp->m_Valeur.GetData(), CurrentCmp->m_Reference.GetData(),
Pin->m_PinNum.GetData()); CurrentCmp->m_Valeur.GetData(),
DisplayError(NULL, msg, 60 ); Pin->m_PinNum.GetData() );
DisplayError( NULL, msg, 60 );
} }
Pin->Pnext = NextPin->Pnext; Pin->Pnext = NextPin->Pnext;
delete NextPin; delete NextPin;
...@@ -142,60 +150,41 @@ int nbpins = 0, ii; ...@@ -142,60 +150,41 @@ int nbpins = 0, ii;
} }
/*******************************************************/
static int PinCompare(const void *cmp1,const void *cmp2)
/*******************************************************/
/*
routine PinCompare() pour qsort() pour classement alphabetique
pour tri de la liste des Pins
*/
{
STOREPIN **pt1 , **pt2 ;
int ii;
pt1 = (STOREPIN**)cmp1;
pt2 = (STOREPIN**)cmp2;
ii = StrLenNumICmp( (*pt1)->m_PinNum.GetData(), (*pt2)->m_PinNum.GetData(), 4);
return(ii);
}
/*******************************************/ /*******************************************/
static void ChangePinNet( wxString & PinNet ) static void ChangePinNet( wxString& PinNet, bool rightJustify )
/*******************************************/ /*******************************************/
/* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet /* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999 * suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
*/ */
{ {
STOREPIN * Pin; PIN* Pin;
STORECMP * CurrentCmp; COMPONENT* CurrentCmp;
int ii; int ii;
wxString OldName; wxString OldName;
wxString NewName; wxString NewName;
OldName = PinNet; OldName = PinNet;
ii = PinNet.Len(); ii = PinNet.Len();
if( Rjustify ) /* On conserve les 8 dernieres lettres du nom */ if( rightJustify ) /* On conserve les 8 dernieres lettres du nom */
{ {
NewName= OldName.Right(8); NewName << NetNumCode; NewName = OldName.Right( 8 ); NewName << NetNumCode;
} }
else /* On conserve les 8 premieres lettres du nom */ else /* On conserve les 8 premieres lettres du nom */
{ {
NewName = OldName.Left(8); NewName << NetNumCode; NewName = OldName.Left( 8 ); NewName << NetNumCode;
} }
NetNumCode ++; NetNumCode++;
CurrentCmp = BaseListeCmp; CurrentCmp = BaseListeCmp;
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext) for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
{ {
Pin = CurrentCmp->m_Pins; Pin = CurrentCmp->m_Pins;
for( ; Pin != NULL; Pin = Pin->Pnext ) for( ; Pin != NULL; Pin = Pin->Pnext )
{ {
if( Pin->m_PinNet != OldName ) continue; if( Pin->m_PinNet != OldName )
continue;
Pin->m_PinNet = NewName; Pin->m_PinNet = NewName;
} }
} }
} }
...@@ -19,20 +19,19 @@ ...@@ -19,20 +19,19 @@
/* routines locales : */ /* routines locales : */
/**********************************************************/
void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
/*********************************************************/
/* /*
* - Affecte un module au composant selectionne * - Affecte un module au composant selectionne
* - Selectionne le composant suivant * - Selectionne le composant suivant
*/ */
void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
{ {
STORECMP* Composant; COMPONENT_LIST::iterator i;
int ii, NumCmp, IsNew = 1; COMPONENT* Component;
bool isUndefined = false;
int NumCmp;
wxString Line; wxString Line;
if( g_BaseListeCmp == NULL ) if( m_components.empty() )
return; return;
NumCmp = m_ListCmp->GetSelection(); NumCmp = m_ListCmp->GetSelection();
...@@ -42,26 +41,22 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package ) ...@@ -42,26 +41,22 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
m_ListCmp->SetSelection( NumCmp, TRUE ); m_ListCmp->SetSelection( NumCmp, TRUE );
} }
Composant = g_BaseListeCmp; Component = m_components[ NumCmp ];
for( ii = 0; Composant != NULL; Composant = Composant->Pnext, ii++ )
{
if( NumCmp == ii )
break;
}
if( Composant == NULL ) if( Component == NULL )
return; return;
if( !Composant->m_Module.IsEmpty() )
IsNew = 0;
Composant->m_Module = package; isUndefined = Component->m_Module.IsEmpty();
Component->m_Module = package;
Line.Printf( CMP_FORMAT, ii + 1, Line.Printf( CMP_FORMAT, NumCmp + 1,
Composant->m_Reference.GetData(), Composant->m_Valeur.GetData(), Component->m_Reference.GetData(), Component->m_Valeur.GetData(),
Composant->m_Module.GetData() ); Component->m_Module.GetData() );
modified = 1; m_modified = true;
if( IsNew )
composants_non_affectes -= 1; if( isUndefined )
m_undefinedComponentCnt -= 1;
m_ListCmp->SetString( NumCmp, Line ); m_ListCmp->SetString( NumCmp, Line );
m_ListCmp->SetSelection( NumCmp, FALSE ); m_ListCmp->SetSelection( NumCmp, FALSE );
...@@ -72,21 +67,20 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package ) ...@@ -72,21 +67,20 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
m_ListCmp->SetSelection( NumCmp, TRUE ); m_ListCmp->SetSelection( NumCmp, TRUE );
Line.Printf( _( "Components: %d (free: %d)" ), Line.Printf( _( "Components: %d (free: %d)" ),
nbcomp, composants_non_affectes ); m_components.GetCount(), m_undefinedComponentCnt );
SetStatusText( Line, 1 ); SetStatusText( Line, 1 );
} }
/********************************************/
bool WinEDA_CvpcbFrame::ReadNetList()
/*******************************************/
/* Lecture de la netliste selon format, ainsi que du fichier des composants /*
* Lecture de la netliste selon format, ainsi que du fichier des composants
*/ */
bool WinEDA_CvpcbFrame::ReadNetList()
{ {
STORECMP* Composant; COMPONENT_LIST::iterator i;
COMPONENT* Component;
wxString msg; wxString msg;
int ii;
int error_level; int error_level;
error_level = ReadSchematicNetlist(); error_level = ReadSchematicNetlist();
...@@ -101,36 +95,35 @@ bool WinEDA_CvpcbFrame::ReadNetList() ...@@ -101,36 +95,35 @@ bool WinEDA_CvpcbFrame::ReadNetList()
} }
/* lecture des correspondances */ /* lecture des correspondances */
loadcmp( m_NetlistFileName.GetFullPath() ); LoadComponentFile( m_NetlistFileName.GetFullPath(), m_components );
if( m_ListCmp == NULL ) if( m_ListCmp == NULL )
return false; return false;
Read_Config( m_NetlistFileName.GetFullPath() ); LoadProjectFile( m_NetlistFileName.GetFullPath() );
LoadFootprintFiles( m_ModuleLibNames, m_footprints );
listlib();
BuildFootprintListBox(); BuildFootprintListBox();
m_ListCmp->Clear(); m_ListCmp->Clear();
Composant = g_BaseListeCmp;
composants_non_affectes = 0; m_undefinedComponentCnt = 0;
for( ii = 1; Composant != NULL; Composant = Composant->Pnext, ii++ ) for( i = m_components.begin(); i != m_components.end(); ++i )
{ {
msg.Printf( CMP_FORMAT, ii, Component = *i;
Composant->m_Reference.GetData(), msg.Printf( CMP_FORMAT, m_ListCmp->GetCount() + 1,
Composant->m_Valeur.GetData(), Component->m_Reference.GetData(),
Composant->m_Module.GetData() ); Component->m_Valeur.GetData(),
Component->m_Module.GetData() );
m_ListCmp->AppendLine( msg ); m_ListCmp->AppendLine( msg );
if( Composant->m_Module.IsEmpty() ) if( Component->m_Module.IsEmpty() )
composants_non_affectes += 1; m_undefinedComponentCnt += 1;
} }
if( g_BaseListeCmp ) if( !m_components.empty() )
m_ListCmp->SetSelection( 0, TRUE ); m_ListCmp->SetSelection( 0, TRUE );
msg.Printf( _( "Components: %d (free: %d)" ), nbcomp, msg.Printf( _( "Components: %d (free: %d)" ), m_components.GetCount(),
composants_non_affectes ); m_undefinedComponentCnt );
SetStatusText( msg, 1 ); SetStatusText( msg, 1 );
/* Mise a jour du titre de la fenetre principale */ /* Mise a jour du titre de la fenetre principale */
...@@ -140,14 +133,12 @@ bool WinEDA_CvpcbFrame::ReadNetList() ...@@ -140,14 +133,12 @@ bool WinEDA_CvpcbFrame::ReadNetList()
} }
/*****************************************************************/ /*
int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName ) * Sauvegarde des fichiers netliste et cmp
/*****************************************************************/
/* Sauvegarde des fichiers netliste et cmp
* Le nom complet du fichier Netliste doit etre dans FFileName. * Le nom complet du fichier Netliste doit etre dans FFileName.
* Le nom du fichier cmp en est deduit * Le nom du fichier cmp en est deduit
*/ */
int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName )
{ {
wxFileName fn; wxFileName fn;
...@@ -177,7 +168,8 @@ int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName ) ...@@ -177,7 +168,8 @@ int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName )
return 0; return 0;
} }
GenNetlistPcbnew( netlist ); GenNetlistPcbnew( netlist, m_components, m_isEESchemaNetlist,
m_rightJustify );
return 1; return 1;
} }
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
/* Not directly used: the 2 list boxes actually used are derived from it */ /* Not directly used: the 2 list boxes actually used are derived from it */
/******************************************************************************/ /******************************************************************************/
ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, wxWindowID id,
wxWindowID id, const wxPoint& loc, const wxSize& size ) : const wxPoint& loc, const wxSize& size ) :
LIST_BOX_TYPE( parent, id, loc, size, LIST_BOX_TYPE( parent, id, loc, size,
wxSUNKEN_BORDER | wxLC_NO_HEADER | wxSUNKEN_BORDER | wxLC_NO_HEADER |
wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL ) wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL )
...@@ -38,7 +38,7 @@ ListBoxBase::~ListBoxBase() ...@@ -38,7 +38,7 @@ ListBoxBase::~ListBoxBase()
void ListBoxBase::OnSize( wxSizeEvent& event ) void ListBoxBase::OnSize( wxSizeEvent& event )
/************************************************/ /************************************************/
// Ajust the column width to the entire available window width // Adjust the column width to the entire available window width
{ {
wxSize size = GetClientSize(); wxSize size = GetClientSize();
int width = 0; int width = 0;
...@@ -66,7 +66,8 @@ int ListBoxBase::GetSelection() ...@@ -66,7 +66,8 @@ int ListBoxBase::GetSelection()
/***************************************/ /***************************************/
FootprintListBox::FootprintListBox( WinEDA_CvpcbFrame* parent, FootprintListBox::FootprintListBox( WinEDA_CvpcbFrame* parent,
wxWindowID id, const wxPoint& loc, const wxSize& size, wxWindowID id, const wxPoint& loc,
const wxSize& size,
int nbitems, wxString choice[] ) : int nbitems, wxString choice[] ) :
ListBoxBase( parent, id, loc, size ) ListBoxBase( parent, id, loc, size )
{ {
...@@ -138,7 +139,7 @@ void FootprintListBox::AppendLine( const wxString& text ) ...@@ -138,7 +139,7 @@ void FootprintListBox::AppendLine( const wxString& text )
wxString FootprintListBox::OnGetItemText( long item, long column ) const wxString FootprintListBox::OnGetItemText( long item, long column ) const
/*********************************************************************/ /*********************************************************************/
/* Overlayed function: MUST be provided in wxLC_VIRTUAL mode /* Overlaid function: MUST be provided in wxLC_VIRTUAL mode
* because real data is not handled by ListBoxBase * because real data is not handled by ListBoxBase
*/ */
{ {
...@@ -197,7 +198,7 @@ END_EVENT_TABLE() ...@@ -197,7 +198,7 @@ END_EVENT_TABLE()
void ListBoxCmp::Clear() void ListBoxCmp::Clear()
/****************************/ /****************************/
// Reset ALL datas // Reset ALL data
{ {
m_ComponentList.Clear(); m_ComponentList.Clear();
SetItemCount( 0 ); SetItemCount( 0 );
...@@ -242,8 +243,8 @@ void ListBoxCmp::AppendLine( const wxString& text ) ...@@ -242,8 +243,8 @@ void ListBoxCmp::AppendLine( const wxString& text )
wxString ListBoxCmp::OnGetItemText( long item, long column ) const wxString ListBoxCmp::OnGetItemText( long item, long column ) const
/****************************************************************/ /****************************************************************/
/* Overlayed function: MUST be provided in wxLC_VIRTUAL mode /* Overlaid function: MUST be provided in wxLC_VIRTUAL mode
* because real datas are not handled by ListBoxBase * because real data are not handled by ListBoxBase
*/ */
{ {
return m_ComponentList.Item( item ); return m_ComponentList.Item( item );
...@@ -279,10 +280,11 @@ void WinEDA_CvpcbFrame::BuildCmpListBox() ...@@ -279,10 +280,11 @@ void WinEDA_CvpcbFrame::BuildCmpListBox()
/* Create or update the schematic components list. /* Create or update the schematic components list.
*/ */
{ {
int ii; COMPONENT_LIST::iterator i;
STORECMP* Composant; COMPONENT* Component;
wxString msg; wxString msg;
wxSize size( 10, 10 ); wxSize size( 10, 10 );
wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
if( m_ListCmp == NULL ) if( m_ListCmp == NULL )
{ {
...@@ -291,21 +293,25 @@ void WinEDA_CvpcbFrame::BuildCmpListBox() ...@@ -291,21 +293,25 @@ void WinEDA_CvpcbFrame::BuildCmpListBox()
0, NULL ); 0, NULL );
m_ListCmp->SetBackgroundColour( wxColour( 225, 255, 255 ) ); m_ListCmp->SetBackgroundColour( wxColour( 225, 255, 255 ) );
m_ListCmp->SetForegroundColour( wxColour( 0, 0, 0 ) ); m_ListCmp->SetForegroundColour( wxColour( 0, 0, 0 ) );
m_ListCmp->SetFont( *g_FixedFont ); m_ListCmp->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
} }
m_ListCmp->m_ComponentList.Clear(); m_ListCmp->m_ComponentList.Clear();
Composant = g_BaseListeCmp;
for( ii = 1; Composant != NULL; Composant = Composant->Pnext, ii++ ) for( i = m_components.begin(); i != m_components.end(); ++i )
{ {
msg.Printf( CMP_FORMAT, ii, Component = *i;
Composant->m_Reference.GetData(), Composant->m_Valeur.GetData(), msg.Printf( CMP_FORMAT, m_ListCmp->GetCount() + 1,
Composant->m_Module.GetData() ); Component->m_Reference.GetData(),
Component->m_Valeur.GetData(),
Component->m_Module.GetData() );
m_ListCmp->m_ComponentList.Add( msg ); m_ListCmp->m_ComponentList.Add( msg );
} }
m_ListCmp->SetItemCount( m_ListCmp->m_ComponentList.Count() ); m_ListCmp->SetItemCount( m_ListCmp->m_ComponentList.Count() );
m_ListCmp->SetSelection( 0, TRUE ); m_ListCmp->SetSelection( 0, TRUE );
} }
...@@ -319,6 +325,7 @@ void WinEDA_CvpcbFrame::BuildFootprintListBox() ...@@ -319,6 +325,7 @@ void WinEDA_CvpcbFrame::BuildFootprintListBox()
{ {
wxString msg; wxString msg;
wxSize size( 10, 10 ); wxSize size( 10, 10 );
wxFont guiFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
if( m_FootprintList == NULL ) if( m_FootprintList == NULL )
{ {
...@@ -327,10 +334,13 @@ void WinEDA_CvpcbFrame::BuildFootprintListBox() ...@@ -327,10 +334,13 @@ void WinEDA_CvpcbFrame::BuildFootprintListBox()
0, NULL ); 0, NULL );
m_FootprintList->SetBackgroundColour( wxColour( 225, 255, 225 ) ); m_FootprintList->SetBackgroundColour( wxColour( 225, 255, 225 ) );
m_FootprintList->SetForegroundColour( wxColour( 0, 0, 0 ) ); m_FootprintList->SetForegroundColour( wxColour( 0, 0, 0 ) );
m_FootprintList->SetFont( *g_FixedFont ); m_FootprintList->SetFont( wxFont( guiFont.GetPointSize(),
wxFONTFAMILY_MODERN,
wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL ) );
} }
m_FootprintList->SetFootprintFullList(); m_FootprintList->SetFootprintFullList( m_footprints );
msg.Printf( _( "Footprints: %d" ), m_FootprintList->GetCount() ); msg.Printf( _( "Footprints: %d" ), m_FootprintList->GetCount() );
SetStatusText( msg, 2 ); SetStatusText( msg, 2 );
...@@ -338,51 +348,57 @@ void WinEDA_CvpcbFrame::BuildFootprintListBox() ...@@ -338,51 +348,57 @@ void WinEDA_CvpcbFrame::BuildFootprintListBox()
/************************************************/ /************************************************/
void FootprintListBox::SetFootprintFullList() void FootprintListBox::SetFootprintFullList( FOOTPRINT_LIST& list )
/************************************************/
{ {
STOREMOD* FootprintItem; FOOTPRINT_LIST::iterator i;
FOOTPRINT* footprint;
wxString msg; wxString msg;
int OldSelection = GetSelection(); int OldSelection = GetSelection();
m_FullFootprintList.Clear(); m_FullFootprintList.Clear();
FootprintItem = g_BaseListePkg;
for( int ii = 1; FootprintItem != NULL; FootprintItem = FootprintItem->Pnext, ii++ ) for( i = list.begin(); i != list.end(); ++i )
{ {
msg.Printf( wxT( "%3d %s" ), ii, FootprintItem->m_Module.GetData() ); footprint = *i;
msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1,
footprint->m_Module.GetData() );
m_FullFootprintList.Add( msg ); m_FullFootprintList.Add( msg );
} }
SetActiveFootprintList( TRUE ); SetActiveFootprintList( TRUE );
if( (GetCount() == 0) || (OldSelection < 0) || ( OldSelection >= GetCount() ) ) if( ( GetCount() == 0 )
|| ( OldSelection < 0 ) || ( OldSelection >= GetCount() ) )
SetSelection( 0, TRUE ); SetSelection( 0, TRUE );
Refresh(); Refresh();
} }
/**********************************************************************/ /**********************************************************************/
void FootprintListBox::SetFootprintFilteredList( STORECMP* Component ) void FootprintListBox::SetFootprintFilteredList( COMPONENT* Component,
FOOTPRINT_LIST& list )
/*********************************************************************/ /*********************************************************************/
{ {
STOREMOD* FootprintItem; FOOTPRINT_LIST::iterator i;
FOOTPRINT* footprint;
wxString msg; wxString msg;
unsigned jj;
int OldSelection = GetSelection(); int OldSelection = GetSelection();
bool HasItem = FALSE; bool HasItem = FALSE;
m_FilteredFootprintList.Clear(); m_FilteredFootprintList.Clear();
FootprintItem = g_BaseListePkg;
int cmpnum = 1; for( i = list.begin(); i != list.end(); ++i )
for( int ii = 0; FootprintItem != NULL; FootprintItem = FootprintItem->Pnext, ii++ )
{ {
footprint = *i;
/* Search for matching footprints */ /* Search for matching footprints */
for( unsigned jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ ) for( jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ )
{ {
if( !FootprintItem->m_Module.Matches( Component->m_FootprintFilter[jj] ) ) if( !footprint->m_Module.Matches( Component->m_FootprintFilter[jj] ) )
continue; continue;
msg.Printf( wxT( "%3d %s" ), cmpnum++, FootprintItem->m_Module.GetData() ); msg.Printf( wxT( "%3d %s" ), m_FilteredFootprintList.GetCount() + 1,
footprint->m_Module.GetData() );
m_FilteredFootprintList.Add( msg ); m_FilteredFootprintList.Add( msg );
HasItem = TRUE; HasItem = TRUE;
} }
...@@ -393,7 +409,7 @@ void FootprintListBox::SetFootprintFilteredList( STORECMP* Component ) ...@@ -393,7 +409,7 @@ void FootprintListBox::SetFootprintFilteredList( STORECMP* Component )
else else
SetActiveFootprintList( TRUE ); SetActiveFootprintList( TRUE );
if( (GetCount() == 0) || ( OldSelection >= GetCount() ) ) if( ( GetCount() == 0 ) || ( OldSelection >= GetCount() ) )
SetSelection( 0, TRUE ); SetSelection( 0, TRUE );
Refresh(); Refresh();
...@@ -422,8 +438,10 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) ...@@ -422,8 +438,10 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
if ( m_ActiveFootprintList ) if ( m_ActiveFootprintList )
{ {
bool new_selection; bool new_selection;
if( FullList ) new_selection = TRUE; if( FullList )
else new_selection = FALSE; new_selection = TRUE;
else
new_selection = FALSE;
if( new_selection != old_selection ) if( new_selection != old_selection )
SetSelection( 0, TRUE ); SetSelection( 0, TRUE );
} }
...@@ -443,13 +461,14 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) ...@@ -443,13 +461,14 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
if( Redraw ) if( Redraw )
{ {
if( !m_UseFootprintFullList || (m_UseFootprintFullList != old_selection) ) if( !m_UseFootprintFullList
|| ( m_UseFootprintFullList != old_selection ) )
{ {
Refresh(); Refresh();
} }
} }
if( !m_UseFootprintFullList || (m_UseFootprintFullList != old_selection) ) if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) )
{ {
m_Parent->SetStatusText( wxEmptyString, 0 ); m_Parent->SetStatusText( wxEmptyString, 0 );
m_Parent->SetStatusText( wxEmptyString, 1 ); m_Parent->SetStatusText( wxEmptyString, 1 );
...@@ -457,9 +476,11 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) ...@@ -457,9 +476,11 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
wxString msg; wxString msg;
if( FullList ) if( FullList )
msg.Printf( _( "Footprints (All): %d" ), m_ActiveFootprintList->GetCount() ); msg.Printf( _( "Footprints (All): %d" ),
m_ActiveFootprintList->GetCount() );
else else
msg.Printf( _( "Footprints (filtered): %d" ), m_ActiveFootprintList->GetCount() ); msg.Printf( _( "Footprints (filtered): %d" ),
m_ActiveFootprintList->GetCount() );
m_Parent->SetStatusText( msg, 2 ); m_Parent->SetStatusText( msg, 2 );
} }
...@@ -469,8 +490,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) ...@@ -469,8 +490,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
/**************************************/ /**************************************/
BEGIN_EVENT_TABLE( FootprintListBox, LIST_BOX_TYPE ) BEGIN_EVENT_TABLE( FootprintListBox, LIST_BOX_TYPE )
EVT_SIZE( ListBoxBase::OnSize ) EVT_SIZE( ListBoxBase::OnSize )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -478,10 +498,10 @@ END_EVENT_TABLE() ...@@ -478,10 +498,10 @@ END_EVENT_TABLE()
void FootprintListBox::OnLeftClick( wxListEvent& event ) void FootprintListBox::OnLeftClick( wxListEvent& event )
/********************************************************/ /********************************************************/
{ {
STOREMOD* Module; FOOTPRINT* Module;
wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint();
Module = GetModuleDescrByName( FootprintName ); Module = GetModuleDescrByName( FootprintName, m_Parent->m_footprints );
if( m_Parent->DrawFrame ) if( m_Parent->DrawFrame )
{ {
m_Parent->CreateScreenCmp(); /* refresh general */ m_Parent->CreateScreenCmp(); /* refresh general */
...@@ -510,17 +530,19 @@ void FootprintListBox::OnLeftDClick( wxListEvent& event ) ...@@ -510,17 +530,19 @@ void FootprintListBox::OnLeftDClick( wxListEvent& event )
} }
/**************************************************************/ FOOTPRINT* GetModuleDescrByName( const wxString& FootprintName,
STOREMOD* GetModuleDescrByName( const wxString& FootprintName ) FOOTPRINT_LIST& list )
/**************************************************************/
{ {
STOREMOD* FootprintItem = g_BaseListePkg; FOOTPRINT_LIST::iterator i;
FOOTPRINT* footprint;
for( ; FootprintItem != NULL; FootprintItem = FootprintItem->Pnext ) for( i = list.begin() ; i != list.end(); ++i )
{ {
if( FootprintItem->m_Module == FootprintName ) footprint = *i;
break; // found !
if( *footprint->m_Module == FootprintName )
return footprint;
} }
return FootprintItem; return NULL;
} }
...@@ -20,16 +20,11 @@ ...@@ -20,16 +20,11 @@
#include "protos.h" #include "protos.h"
/* routines locales : */ /* routines locales : */
static void ReadDocLib( const wxString& ModLibName ); static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
static int LibCompare( void* mod1, void* mod2 );
static STOREMOD* TriListeModules( STOREMOD* BaseListe, int nbitems );
/*********************/ /**
bool listlib() * Routine lisant la liste des librairies, et generant la liste chainee
/*********************/
/* Routine lisant la liste des librairies, et generant la liste chainee
* des modules disponibles * des modules disponibles
* *
* Module descr format: * Module descr format:
...@@ -40,22 +35,25 @@ bool listlib() ...@@ -40,22 +35,25 @@ bool listlib()
* $EndMODULE * $EndMODULE
* *
*/ */
bool LoadFootprintFiles( const wxArrayString& libNames,
FOOTPRINT_LIST& list )
{ {
FILE* file; /* pour lecture librairie */ FILE* file; /* pour lecture librairie */
char buffer[1024]; char buffer[1024];
wxFileName fn; wxFileName fn;
int end; int end;
STOREMOD* ItemLib; FOOTPRINT* ItemLib;
unsigned ii; unsigned ii;
wxString tmp, msg; wxString tmp, msg;
if( g_BaseListePkg ) /* Liste Deja existante, a supprimer */ if( !list.empty() )
{ {
FreeMemoryModules(); list.DeleteContents( true );
g_BaseListePkg = NULL; list.Clear();
list.DeleteContents( false );
} }
if( g_LibName_List.GetCount() == 0 ) if( libNames.GetCount() == 0 )
{ {
wxMessageBox( _( "No PCB foot print libraries are listed in the " \ wxMessageBox( _( "No PCB foot print libraries are listed in the " \
"current project file." ), _( "Project File Error" ), "current project file." ), _( "Project File Error" ),
...@@ -63,13 +61,11 @@ bool listlib() ...@@ -63,13 +61,11 @@ bool listlib()
return false; return false;
} }
nblib = 0;
/* Lecture des Librairies */ /* Lecture des Librairies */
for( ii = 0; ii < g_LibName_List.GetCount(); ii++ ) for( ii = 0; ii < libNames.GetCount(); ii++ )
{ {
/* Calcul du nom complet de la librairie */ /* Calcul du nom complet de la librairie */
fn = g_LibName_List[ii]; fn = libNames[ii];
fn.SetExt( ModuleFileExtension ); fn.SetExt( ModuleFileExtension );
tmp = wxGetApp().FindLibraryPath( fn ); tmp = wxGetApp().FindLibraryPath( fn );
...@@ -122,12 +118,10 @@ bool listlib() ...@@ -122,12 +118,10 @@ bool listlib()
break; break;
} }
ItemLib = new STOREMOD(); ItemLib = new FOOTPRINT();
ItemLib->Pnext = g_BaseListePkg;
g_BaseListePkg = ItemLib;
ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( buffer ) ); ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( buffer ) );
ItemLib->m_LibName = tmp; ItemLib->m_LibName = tmp;
nblib++; list.push_back( ItemLib );
} }
if( !end ) if( !end )
...@@ -141,104 +135,29 @@ bool listlib() ...@@ -141,104 +135,29 @@ bool listlib()
} }
fclose( file ); fclose( file );
ReadDocLib( tmp ); ReadDocLib( tmp, list );
} }
/* classement alphabetique: */ list.Sort( compare );
if( g_BaseListePkg )
g_BaseListePkg = TriListeModules( g_BaseListePkg, nblib );
return true; return true;
} }
/************************************************/
static int LibCompare( void* mod1, void* mod2 )
/************************************************/
/*
* routine compare() pour qsort() en classement alphabtique des modules
*/
{
int ii;
STOREMOD* pt1, * pt2;
pt1 = *( (STOREMOD**) mod1 );
pt2 = *( (STOREMOD**) mod2 );
ii = StrNumICmp( pt1->m_Module.GetData(), pt2->m_Module.GetData() );
return ii;
}
/********************************************************************/
static STOREMOD* TriListeModules( STOREMOD* BaseListe, int nbitems )
/********************************************************************/
/* Tri la liste des Modules par ordre alphabetique et met a jour
* le nouveau chainage avant/arriere
* retourne un pointeur sur le 1er element de la liste
*/
{
STOREMOD** bufferptr, * Item;
int ii, nb;
if( nbitems <= 0 )
return NULL;
if( BaseListe == NULL )
return NULL;
if( nbitems == 1 )
return BaseListe; // Tri inutile et impossible
bufferptr = (STOREMOD**) MyZMalloc( (nbitems + 3) * sizeof(STOREMOD*) );
for( ii = 1, nb = 0, Item = BaseListe;
Item != NULL;
Item = Item->Pnext, ii++ )
{
nb++;
bufferptr[ii] = Item;
}
/* ici bufferptr[0] = NULL et bufferptr[nbitem+1] = NULL et ces 2 valeurs
* representent le chainage arriere du 1er element ( = NULL),
* et le chainage avant du dernier element ( = NULL ) */
qsort( bufferptr + 1, nb, sizeof(STOREMOD*),
( int( * ) ( const void*, const void* ) )LibCompare );
/* Mise a jour du chainage */
for( ii = 1; ii <= nb; ii++ )
{
Item = bufferptr[ii];
Item->m_Num = ii;
Item->Pnext = bufferptr[ii + 1];
Item->Pback = bufferptr[ii - 1];
}
Item = bufferptr[1];
MyFree( bufferptr );
return Item;
}
/***************************************************/
static void ReadDocLib( const wxString& ModLibName )
/***************************************************/
/* Routine de lecture du fichier Doc associe a la librairie ModLibName. /* Routine de lecture du fichier Doc associe a la librairie ModLibName.
* Cree en memoire la chaine liste des docs pointee par MList * Cree en memoire la chaine liste des docs pointee par MList
* ModLibName = full file Name de la librairie Modules * ModLibName = full file Name de la librairie Modules
*/ */
static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list )
{ {
STOREMOD* NewMod; FOOTPRINT* NewMod;
FOOTPRINT* tmp;
char Line[1024]; char Line[1024];
wxString ModuleName; wxString ModuleName;
wxString msg; wxString msg;
FILE* LibDoc; FILE* LibDoc;
wxFileName fn = ModLibName; wxFileName fn = ModLibName;
FOOTPRINT_LIST::iterator i;
fn.SetExt( wxT( "mdc" ) ); fn.SetExt( wxT( "mdc" ) );
...@@ -277,12 +196,15 @@ static void ReadDocLib( const wxString& ModLibName ) ...@@ -277,12 +196,15 @@ static void ReadDocLib( const wxString& ModLibName )
{ {
case 'L': /* LibName */ case 'L': /* LibName */
ModuleName = CONV_FROM_UTF8( StrPurge( Line + 3 ) ); ModuleName = CONV_FROM_UTF8( StrPurge( Line + 3 ) );
NewMod = g_BaseListePkg; for( i = list.begin(); i != list.end(); ++i )
while( NewMod ) {
tmp = *i;
if( ModuleName == tmp->m_Module )
{ {
if( ModuleName == NewMod->m_Module ) NewMod = tmp;
break; break;
NewMod = NewMod->Pnext; }
} }
break; break;
...@@ -293,7 +215,7 @@ static void ReadDocLib( const wxString& ModLibName ) ...@@ -293,7 +215,7 @@ static void ReadDocLib( const wxString& ModLibName )
break; break;
case 'C': /* Doc */ case 'C': /* Doc */
if( NewMod && (!NewMod->m_Doc ) ) if( NewMod && ( !NewMod->m_Doc ) )
NewMod->m_Doc = CONV_FROM_UTF8( StrPurge( Line + 3 ) ); NewMod->m_Doc = CONV_FROM_UTF8( StrPurge( Line + 3 ) );
break; break;
} }
......
...@@ -35,11 +35,12 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName ) ...@@ -35,11 +35,12 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
wxString tmp, msg; wxString tmp, msg;
wxFileName fn; wxFileName fn;
MODULE* Module = NULL; MODULE* Module = NULL;
WinEDA_CvpcbFrame* parent = ( WinEDA_CvpcbFrame* ) GetParent();
for( ii = 0; ii < g_LibName_List.GetCount(); ii++ ) for( ii = 0; ii < parent->m_ModuleLibNames.GetCount(); ii++ )
{ {
/* Calcul du nom complet de la librairie */ /* Calcul du nom complet de la librairie */
fn = g_LibName_List[ii]; fn = parent->m_ModuleLibNames[ii];
fn.SetExt( ModuleFileExtension ); fn.SetExt( ModuleFileExtension );
tmp = wxGetApp().FindLibraryPath( fn ); tmp = wxGetApp().FindLibraryPath( fn );
......
/**********************************************/
/* Routines de gestion de la memoire */
/**********************************************/
/* Fichier memoire.cpp */
#include "fctsys.h"
#include "wxstruct.h"
#include "common.h"
#include "cvpcb.h"
/********************************/
void FreeMemoryModules()
/********************************/
/* Routine de liberation memoire de la liste des modules
- remet a NULL g_BaseListePkg
- remet a 0 nblib;
*/
{
STOREMOD * Module, * NextMod;
if( g_BaseListePkg == NULL) return;
for ( Module = g_BaseListePkg; Module != NULL; Module = NextMod)
{
NextMod = Module->Pnext;
delete Module;
}
nblib = 0;
g_BaseListePkg = NULL;
}
/***********************************/
void FreeMemoryComponents()
/***********************************/
/* Routine de liberation memoire de la liste des composants
- remet a NULL BaseListeMod
- remet a 0 nbcomp
*/
{
STORECMP * Cmp, * NextCmp;
if( g_BaseListeCmp == NULL ) return;
for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = NextCmp )
{
NextCmp = Cmp->Pnext;
delete Cmp;
}
nbcomp = 0;
g_BaseListeCmp = NULL;
}
...@@ -62,15 +62,18 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar() ...@@ -62,15 +62,18 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
item->SetBitmap( config_xpm ); item->SetBitmap( config_xpm );
configmenu->Append( item ); configmenu->Append( item );
// Font selection and setup
AddFontSelectionMenu( configmenu );
wxGetApp().AddMenuLanguageList( configmenu ); wxGetApp().AddMenuLanguageList( configmenu );
item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
_( "Keep Open On Save" ),
_( "Prevent CVPcb from exiting after saving " \
"netlist file" ),
wxITEM_CHECK );
configmenu->Append( item );
configmenu->AppendSeparator(); configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,
_( "&Save config" ), _( "&Save Project File" ),
_( "Save configuration in current dir" ) ); _( "Save changes to the project file" ) );
item->SetBitmap( save_setup_xpm ); item->SetBitmap( save_setup_xpm );
configmenu->Append( item ); configmenu->Append( item );
......
...@@ -5,32 +5,16 @@ ...@@ -5,32 +5,16 @@
#ifndef PROTOS_H #ifndef PROTOS_H
#define PROTOS_H #define PROTOS_H
int GenNetlistPcbnew( FILE* f ) ; extern int GenNetlistPcbnew( FILE* f, COMPONENT_LIST& list,
bool loadcmp( const wxString& fileName ) ; bool isEESchemaNetlist = true,
bool listlib() ; bool rightJustify = false );
extern bool LoadComponentFile( const wxString& fileName,
STOREMOD * GetModuleDescrByName(const wxString & FootprintName); COMPONENT_LIST& list );
extern bool LoadFootprintFiles( const wxArrayString& libNames,
FOOTPRINT_LIST& list );
/***********/
/* CFG.CPP */ FOOTPRINT* GetModuleDescrByName( const wxString& FootprintName,
/***********/ FOOTPRINT_LIST& list );
void Save_Config( wxWindow* parent, const wxString& fileName );
void Read_Config( const wxString & FullFileName ); /* lit la configuration */
/***************/
/* MEMOIRE.CPP */
/***************/
void FreeMemoryComponents();
/* Routine de liberation memoire de la liste des composants
- remet a NULL BaseListeMod
- remet a 0 NbComp */
void FreeMemoryModules();
/* Routine de liberation memoire de la liste des modules
- remet a NULL g_BaseListePkg
- rement a 0 NbLib; */
#endif // PROTOS_H #endif // PROTOS_H
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* readschematicnetlist.cpp */ /* readschematicnetlist.cpp */
/****************************/ /****************************/
/* Read a nelist type Eeschema or OrcadPCB2 and buid the component list /* Read a nelist type Eeschema or OrcadPCB2 and build the component list
* Manages the lines like : * Manages the lines like :
* ( XXXXXX VALEUR|(pin1,pin2,...=newalim) ID VALEUR * ( XXXXXX VALEUR|(pin1,pin2,...=newalim) ID VALEUR
*/ */
...@@ -23,20 +23,16 @@ ...@@ -23,20 +23,16 @@
/* routines locales : */ /* routines locales : */
static int ReadPinConnection( FILE* f, STORECMP* CurrentCmp ); static int ReadPinConnection( FILE* f, COMPONENT* CurrentCmp );
static int CmpCompare( void* cmp1, void* cmp2 ); /* routine pour qsort() de tri de liste des composants */
static STORECMP* TriListeComposants( STORECMP* BaseListe, int nbitems );
/* Tri la liste des composants par ordre alphabetique et met a jour le nouveau chainage avant/arriere /* Tri la liste des composants par ordre alphabetique et met a jour le nouveau
* retourne un pointeur sur le 1er element de la liste */ * chainage avant/arriere retourne un pointeur sur le 1er element de la liste */
#define BUFFER_CHAR_SIZE 1024 // Size of buffers used to store netlist datas #define BUFFER_CHAR_SIZE 1024 // Size of buffers used to store netlist data
/************************************************/
int WinEDA_CvpcbFrame::ReadSchematicNetlist()
/************************************************/
/** Function ReadSchematicNetlist /**
* Function ReadSchematicNetlist
* Read a Eeschema (or OrcadPCB) netlist * Read a Eeschema (or OrcadPCB) netlist
* like: * like:
* # EESchema Netlist Version 1.1 created 15/5/2008-12:09:21 * # EESchema Netlist Version 1.1 created 15/5/2008-12:09:21
...@@ -87,6 +83,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() ...@@ -87,6 +83,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
* $endfootprintlist * $endfootprintlist
* } * }
*/ */
int WinEDA_CvpcbFrame::ReadSchematicNetlist()
{ {
char alim[1024]; char alim[1024];
int i, k, l; int i, k, l;
...@@ -97,16 +94,19 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() ...@@ -97,16 +94,19 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
wxString footprint_name; /* buffer for component footprint field */ wxString footprint_name; /* buffer for component footprint field */
wxString component_value; /* buffer for component values (470K, 22nF ...) */ wxString component_value; /* buffer for component values (470K, 22nF ...) */
char* ptchar; char* ptchar;
STORECMP* Cmp; COMPONENT* Cmp;
FILE* source; FILE* source;
modified = 0; m_modified = false;
Rjustify = 0; m_isEESchemaNetlist = false;
g_FlagEESchema = FALSE;
/* Clear components buffer */ /* Clear components buffer */
if( g_BaseListeCmp ) if( !m_components.empty() )
FreeMemoryComponents(); {
m_components.DeleteContents( true );
m_components.Clear();
m_components.DeleteContents( false );
}
source = wxFopen( m_NetlistFileName.GetFullPath(), wxT( "rt" ) ); source = wxFopen( m_NetlistFileName.GetFullPath(), wxT( "rt" ) );
...@@ -129,7 +129,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() ...@@ -129,7 +129,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
{ {
i = strnicmp( Line, "# EESchema", 7 ); /* net type EESchema */ i = strnicmp( Line, "# EESchema", 7 ); /* net type EESchema */
if( i == 0 ) if( i == 0 )
g_FlagEESchema = TRUE; m_isEESchemaNetlist = TRUE;
} }
if( i != 0 ) if( i != 0 )
...@@ -143,7 +143,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() ...@@ -143,7 +143,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
SetStatusText( _( "Netlist Format: EESchema" ), 0 ); SetStatusText( _( "Netlist Format: EESchema" ), 0 );
/* Read the netlit */ /* Read the netlist */
for( ; ; ) for( ; ; )
{ {
/* Search the beginning of a component description */ /* Search the beginning of a component description */
...@@ -255,13 +255,12 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() ...@@ -255,13 +255,12 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
} }
/* Store info for this component */ /* Store info for this component */
Cmp = new STORECMP(); Cmp = new COMPONENT();
Cmp->Pnext = g_BaseListeCmp;
g_BaseListeCmp = Cmp;
Cmp->m_Reference = component_reference; Cmp->m_Reference = component_reference;
Cmp->m_Valeur = component_value; Cmp->m_Valeur = component_value;
m_components.push_back( Cmp );
if( g_FlagEESchema ) /* copy footprint name: */ if( m_isEESchemaNetlist ) /* copy footprint name: */
{ {
if( strnicmp( LibName, "$noname", 7 ) != 0 ) if( strnicmp( LibName, "$noname", 7 ) != 0 )
{ {
...@@ -275,26 +274,22 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() ...@@ -275,26 +274,22 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
Cmp->m_TimeStamp = schematic_timestamp; Cmp->m_TimeStamp = schematic_timestamp;
ReadPinConnection( source, Cmp ); ReadPinConnection( source, Cmp );
nbcomp++;
} }
fclose( source ); fclose( source );
/* Alpabetic sorting : */ m_components.Sort( compare );
g_BaseListeCmp = TriListeComposants( g_BaseListeCmp, nbcomp );
return 0; return 0;
} }
/********************************************************/
int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f ) int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f )
/********************************************************/
{ {
COMPONENT_LIST::iterator i;
char Line[BUFFER_CHAR_SIZE + 1]; char Line[BUFFER_CHAR_SIZE + 1];
wxString CmpRef; wxString CmpRef;
STORECMP* Cmp = NULL; COMPONENT* Cmp = NULL;
for( ; ; ) for( ; ; )
{ {
...@@ -313,9 +308,12 @@ int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f ) ...@@ -313,9 +308,12 @@ int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f )
CmpRef = CONV_FROM_UTF8( Line + 11 ); CmpRef = CONV_FROM_UTF8( Line + 11 );
CmpRef.Trim( TRUE ); CmpRef.Trim( TRUE );
CmpRef.Trim( FALSE ); CmpRef.Trim( FALSE );
/* Search the new component in list */ /* Search the new component in list */
for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) for( i = m_components.begin(); i != m_components.end(); ++i )
{ {
Cmp = *i;
if( Cmp->m_Reference == CmpRef ) if( Cmp->m_Reference == CmpRef )
break; break;
} }
...@@ -333,16 +331,13 @@ int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f ) ...@@ -333,16 +331,13 @@ int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f )
} }
/***********************************/ int ReadPinConnection( FILE* f, COMPONENT* Cmp )
int ReadPinConnection( FILE* f, STORECMP* Cmp )
/***********************************/
{ {
int i, jj; int i, jj;
wxString numpin; wxString numpin;
wxString net; wxString net;
char Line[BUFFER_CHAR_SIZE + 1]; char Line[BUFFER_CHAR_SIZE + 1];
STOREPIN* Pin = NULL; PIN* Pin = NULL;
STOREPIN** LastPin = &Cmp->m_Pins;
for( ; ; ) for( ; ; )
{ {
...@@ -392,69 +387,10 @@ int ReadPinConnection( FILE* f, STORECMP* Cmp ) ...@@ -392,69 +387,10 @@ int ReadPinConnection( FILE* f, STORECMP* Cmp )
net.Append( Line[i] ); net.Append( Line[i] );
} }
Pin = new STOREPIN(); Pin = new PIN();
*LastPin = Pin;
LastPin = &Pin->Pnext;
Pin->m_PinNum = numpin; Pin->m_PinNum = numpin;
Pin->m_PinNet = net; Pin->m_PinNet = net;
Cmp->m_Pins.push_back( Pin );
} }
} }
} }
/****************************************************************/
STORECMP* TriListeComposants( STORECMP* BaseListe, int nbitems )
/****************************************************************/
/* Sort the component list( this is a linked list)
* retourn the beginning of the list
*/
{
STORECMP** bufferptr, * Item;
int ii;
if( nbitems <= 0 )
return NULL;
bufferptr = (STORECMP**) MyZMalloc( (nbitems + 2) * sizeof(STORECMP*) );
for( ii = 1, Item = BaseListe; Item != NULL; Item = Item->Pnext, ii++ )
{
bufferptr[ii] = Item;
}
/* Here: bufferptr[0] = NULL and bufferptr[nbitem+1] = NULL.
* These 2 values are the first item back link, and the last item forward link
*/
qsort( bufferptr + 1, nbitems, sizeof(STORECMP*),
( int( * ) ( const void*, const void* ) )CmpCompare );
/* Update linked list */
for( ii = 1; ii <= nbitems; ii++ )
{
Item = bufferptr[ii];
Item->m_Num = ii;
Item->Pnext = bufferptr[ii + 1];
Item->Pback = bufferptr[ii - 1];
}
return bufferptr[1];
}
/****************************************/
int CmpCompare( void* mod1, void* mod2 )
/****************************************/
/*
* Compare function for qsort() : alphabetic sorting, with numbering order
*/
{
int ii;
STORECMP* pt1, * pt2;
pt1 = *( (STORECMP**) mod1 );
pt2 = *( (STORECMP**) mod2 );
ii = StrNumICmp( pt1->m_Reference.GetData(), pt2->m_Reference.GetData() );
return ii;
}
...@@ -24,19 +24,19 @@ char EnteteCmpMod[] = { "Cmp-Mod V01" }; ...@@ -24,19 +24,19 @@ char EnteteCmpMod[] = { "Cmp-Mod V01" };
const wxString titleComponentLibErr( _( "Component Library Error" ) ); const wxString titleComponentLibErr( _( "Component Library Error" ) );
/*****************************************************************************/ /*
/* Routine de sauvegarde du fichier des modules * Routine de sauvegarde du fichier des modules
* Retourne 1 si OK * Retourne 1 si OK
* 0 si ecriture non faite * 0 si ecriture non faite
*/ */
/****************************************************************************/
int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName ) int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName )
{ {
STORECMP* Cmp; COMPONENT_LIST::iterator i;
COMPONENT* Cmp;
FILE* dest; FILE* dest;
wxFileName fn( NetlistFullFileName ); wxFileName fn( NetlistFullFileName );
char Line[1024]; char Line[1024];
wxString Title = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion(); wxString Title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion();
/* calcul du nom du fichier */ /* calcul du nom du fichier */
fn.SetExt( ComponentFileExtension ); fn.SetExt( ComponentFileExtension );
...@@ -49,8 +49,9 @@ int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName ) ...@@ -49,8 +49,9 @@ int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName )
fprintf( dest, " Created by %s", CONV_TO_UTF8( Title ) ); fprintf( dest, " Created by %s", CONV_TO_UTF8( Title ) );
fprintf( dest, " date = %s\n", DateAndTime( Line ) ); fprintf( dest, " date = %s\n", DateAndTime( Line ) );
for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) for( i = m_components.begin(); i != m_components.end(); ++i )
{ {
Cmp = *i;
fprintf( dest, "\nBeginCmp\n" ); fprintf( dest, "\nBeginCmp\n" );
fprintf( dest, "TimeStamp = %s;\n", CONV_TO_UTF8( Cmp->m_TimeStamp ) ); fprintf( dest, "TimeStamp = %s;\n", CONV_TO_UTF8( Cmp->m_TimeStamp ) );
fprintf( dest, "Reference = %s;\n", CONV_TO_UTF8( Cmp->m_Reference ) ); fprintf( dest, "Reference = %s;\n", CONV_TO_UTF8( Cmp->m_Reference ) );
...@@ -61,20 +62,19 @@ int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName ) ...@@ -61,20 +62,19 @@ int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName )
fprintf( dest, "\nEndListe\n" ); fprintf( dest, "\nEndListe\n" );
fclose( dest ); fclose( dest );
return 1; return 1;
} }
/***************/ /*
/* recupere la liste des associations composants/empreintes * recupere la liste des associations composants/empreintes
*/ */
/****************/ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
bool loadcmp( const wxString& fileName )
{ {
COMPONENT_LIST::iterator i;
wxString timestamp, valeur, ilib, namecmp, msg; wxString timestamp, valeur, ilib, namecmp, msg;
bool read_cmp_data = FALSE, eof = FALSE; bool read_cmp_data = FALSE, eof = FALSE;
STORECMP* Cmp; COMPONENT* Cmp;
char Line[1024], * ident, * data; char Line[1024], * ident, * data;
FILE* source; FILE* source;
wxFileName fn = fileName; wxFileName fn = fileName;
...@@ -176,8 +176,10 @@ bool loadcmp( const wxString& fileName ) ...@@ -176,8 +176,10 @@ bool loadcmp( const wxString& fileName )
/* Recherche du composant correspondant en netliste et /* Recherche du composant correspondant en netliste et
* mise a jour de ses parametres */ * mise a jour de ses parametres */
for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) for( i = list.begin(); i != list.end(); ++i )
{ {
Cmp = *i;
if( namecmp != Cmp->m_Reference ) if( namecmp != Cmp->m_Reference )
continue; continue;
......
...@@ -43,7 +43,7 @@ void WinEDA_CvpcbFrame::CreateScreenCmp() ...@@ -43,7 +43,7 @@ void WinEDA_CvpcbFrame::CreateScreenCmp()
{ {
msg = _( "Footprint: " ) + FootprintName; msg = _( "Footprint: " ) + FootprintName;
DrawFrame->SetTitle( msg ); DrawFrame->SetTitle( msg );
STOREMOD* Module = GetModuleDescrByName( FootprintName ); FOOTPRINT* Module = GetModuleDescrByName( FootprintName, m_footprints );
msg = _( "Lib: " ); msg = _( "Lib: " );
if( Module ) if( Module )
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
/***************************/ /***************************/
/* /*
* Complete la netliste (*.NET) en y placant les ref *.lib FORMAT PCBNEW ou ORCADPCB * Complete la netliste (*.NET) en y placant les ref *.lib FORMAT PCBNEW ou
* ORCADPCB
*/ */
#include "fctsys.h" #include "fctsys.h"
...@@ -19,27 +20,72 @@ ...@@ -19,27 +20,72 @@
#define MAX_LEN_NETNAME 16 #define MAX_LEN_NETNAME 16
/* Routines locales */ /* Routines locales */
static void TriPinsModule( STORECMP* CurrentCmp ); static void ChangePinNet( COMPONENT_LIST& list, wxString& PinNet,
static int PinCompare( const void* cmp1, const void* cmp2 ); int* netNumber, bool rightJustify );
static void ChangePinNet( wxString& PinNet ); static void WriteFootprintFilterInfos( FILE* dest, COMPONENT_LIST& list );
static void WriteFootprintFilterInfos( FILE* dest );
/* Variables Locales */
int NetNumCode; /* Nombre utilise pour cree des NetNames lors de
* reaffectation de NetNames */
static void RemoveDuplicatePins( COMPONENT* component )
{
wxASSERT( component != NULL );
PIN_LIST::iterator i;
PIN *pin1, *pin2;
wxString msg;
if( component->m_Pins.size() <= 1 )
return;
i = component->m_Pins.begin();
pin1 = *i;
++i;
while( i != component->m_Pins.end() )
{
pin2 = *i;
wxASSERT( pin2 != NULL );
if( !same_pin_number( pin1, pin2 ) )
{
pin1 = pin2;
++i;
continue;
}
if( !same_pin_net( pin1, pin2 ) )
{
msg.Printf( _( "Component %s %s pin %s : Different Nets" ),
component->m_Reference.GetData(),
component->m_Valeur.GetData(),
pin1->m_PinNum.GetData() );
DisplayError( NULL, msg, 60 );
}
/*************************/ wxLogDebug( wxT( "Removing duplicate pin %s from component %s: %s" ),
int GenNetlistPcbnew( FILE* file ) pin1->m_PinNum.c_str(), component->m_Reference.c_str(),
component->m_Valeur.c_str() );
pin1 = pin2;
i = component->m_Pins.erase( i );
delete pin2;
}
}
int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
bool rightJustify )
{ {
#define NETLIST_HEAD_STRING "EESchema Netlist Version 1.1" #define NETLIST_HEAD_STRING "EESchema Netlist Version 1.1"
COMPONENT_LIST::iterator iCmp;
PIN_LIST::iterator iPin;
char Line[1024]; char Line[1024];
STOREPIN* Pin; PIN* Pin;
STORECMP* CurrentCmp; COMPONENT* Component;
wxString Title = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion(); int netNumber = 1;
DateAndTime( Line );
NetNumCode = 1; DateAndTime( Line ); if( isEESchemaNetlist )
if( g_FlagEESchema )
fprintf( file, "# %s created %s\n(\n", NETLIST_HEAD_STRING, Line ); fprintf( file, "# %s created %s\n(\n", NETLIST_HEAD_STRING, Line );
else else
fprintf( file, "( { netlist created %s }\n", Line ); fprintf( file, "( { netlist created %s }\n", Line );
...@@ -48,31 +94,33 @@ int GenNetlistPcbnew( FILE* file ) ...@@ -48,31 +94,33 @@ int GenNetlistPcbnew( FILE* file )
/* Lecture de la liste */ /* Lecture de la liste */
/***********************/ /***********************/
CurrentCmp = g_BaseListeCmp; for( iCmp = list.begin(); iCmp != list.end(); ++iCmp )
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
{ {
fprintf( file, " ( %s ", CONV_TO_UTF8( CurrentCmp->m_TimeStamp ) ); Component = *iCmp;
if( !CurrentCmp->m_Module.IsEmpty() ) fprintf( file, " ( %s ", CONV_TO_UTF8( Component->m_TimeStamp ) );
fprintf( file, CONV_TO_UTF8( CurrentCmp->m_Module ) );
if( !Component->m_Module.IsEmpty() )
fprintf( file, CONV_TO_UTF8( Component->m_Module ) );
else else
fprintf( file, "$noname$" ); fprintf( file, "$noname$" );
fprintf( file, " %s ", CONV_TO_UTF8( CurrentCmp->m_Reference ) ); fprintf( file, " %s ", CONV_TO_UTF8( Component->m_Reference ) );
/* placement de la valeur */ /* placement de la valeur */
fprintf( file, "%s\n", CONV_TO_UTF8( CurrentCmp->m_Valeur ) ); fprintf( file, "%s\n", CONV_TO_UTF8( Component->m_Valeur ) );
/* Tri des pins */ Component->m_Pins.Sort( compare );
TriPinsModule( CurrentCmp ); RemoveDuplicatePins( Component );
/* Placement de la liste des pins */ /* Placement de la liste des pins */
Pin = CurrentCmp->m_Pins; for( iPin = Component->m_Pins.begin(); iPin != Component->m_Pins.end();
for( ; Pin != NULL; Pin = Pin->Pnext ) ++iPin )
{ {
Pin = *iPin;
if( Pin->m_PinNet.Len() > MAX_LEN_NETNAME ) if( Pin->m_PinNet.Len() > MAX_LEN_NETNAME )
ChangePinNet( Pin->m_PinNet ); ChangePinNet( list, Pin->m_PinNet, &netNumber, rightJustify );
if( !Pin->m_PinNet.IsEmpty() ) if( !Pin->m_PinNet.IsEmpty() )
fprintf( file, " ( %s %s )\n", fprintf( file, " ( %s %s )\n",
...@@ -87,24 +135,26 @@ int GenNetlistPcbnew( FILE* file ) ...@@ -87,24 +135,26 @@ int GenNetlistPcbnew( FILE* file )
fprintf( file, ")\n*\n" ); fprintf( file, ")\n*\n" );
if( g_FlagEESchema ) if( isEESchemaNetlist )
WriteFootprintFilterInfos( file ); WriteFootprintFilterInfos( file, list );
fclose( file ); fclose( file );
return 0; return 0;
} }
/******************************************/ /*
void WriteFootprintFilterInfos( FILE* file ) * Write the allowed footprint list for each component
/******************************************/ */
/* Write the allowed footprint list for each component */ void WriteFootprintFilterInfos( FILE* file, COMPONENT_LIST& list )
{ {
STORECMP* component = g_BaseListeCmp; COMPONENT_LIST::iterator i;
COMPONENT* component;
bool WriteHeader = FALSE; bool WriteHeader = FALSE;
for( ; component != NULL; component = component->Pnext ) for( i = list.begin(); i != list.end(); ++i )
{ {
component = *i;
unsigned int FilterCount; unsigned int FilterCount;
FilterCount = component->m_FootprintFilter.GetCount(); FilterCount = component->m_FootprintFilter.GetCount();
if( FilterCount == 0 ) if( FilterCount == 0 )
...@@ -131,131 +181,48 @@ void WriteFootprintFilterInfos( FILE* file ) ...@@ -131,131 +181,48 @@ void WriteFootprintFilterInfos( FILE* file )
} }
/***********************************************/
static void TriPinsModule( STORECMP* CurrentCmp )
/***********************************************/
/* Tri et controle des pins du module CurrentCmp
*/
{
STOREPIN* Pin, * NextPin, ** BasePin;
int nbpins = 0, ii;
Pin = CurrentCmp->m_Pins;
if( Pin == NULL )
return;
/* comptage des pins */
for( ; Pin != NULL; Pin = Pin->Pnext )
nbpins++;
/* Tri des pins: etablissement de la liste des pointeurs */
BasePin = (STOREPIN**) MyZMalloc( nbpins * sizeof(STOREPIN*) );
Pin = CurrentCmp->m_Pins;
for( ii = 0; ii < nbpins; ii++, Pin = Pin->Pnext )
{
BasePin[ii] = Pin;
}
/* Tri des Pins */
qsort( BasePin, nbpins, sizeof( STORECMP*), PinCompare );
/* Remise a jour des pointeurs chaines */
for( ii = 0; ii < nbpins - 1; ii++ )
{
BasePin[ii]->Pnext = BasePin[ii + 1];
}
BasePin[ii]->Pnext = NULL;
CurrentCmp->m_Pins = BasePin[0];
MyFree( BasePin );
/* Elimination des redondances */
Pin = CurrentCmp->m_Pins;
while( Pin != NULL )
{
NextPin = Pin->Pnext;
if( NextPin == NULL )
break;
if( Pin->m_PinNum != NextPin->m_PinNum )
{
Pin = Pin->Pnext; continue;
}
/* 2 pins successives ont le meme numero */
if( Pin->m_PinNet != NextPin->m_PinNet )
{
wxString msg;
msg.Printf( _( "%s %s pin %s : Different Nets" ),
CurrentCmp->m_Reference.GetData(),
CurrentCmp->m_Valeur.GetData(),
Pin->m_PinNum.GetData() );
DisplayError( NULL, msg, 60 );
}
Pin->Pnext = NextPin->Pnext;
delete NextPin;
}
}
/*******************************************************/
static int PinCompare( const void* cmp1, const void* cmp2 )
/*******************************************************/
/* /*
* routine PinCompare() pour qsort() pour classement alphabetique * Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
* pour tri de la liste des Pins
*/
{
STOREPIN** pt1, ** pt2;
int ii;
pt1 = (STOREPIN**) cmp1;
pt2 = (STOREPIN**) cmp2;
ii = StrLenNumICmp( (*pt1)->m_PinNum.GetData(),
(*pt2)->m_PinNum.GetData(), 4 );
return ii;
}
/*******************************************/
static void ChangePinNet( wxString& PinNet )
/*******************************************/
/* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999 * suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
*/ */
static void ChangePinNet( COMPONENT_LIST& list, wxString& PinNet,
int* netNumber, bool rightJustify )
{ {
STOREPIN* Pin; wxASSERT( netNumber != NULL );
STORECMP* CurrentCmp;
int ii; COMPONENT_LIST::iterator iCmp;
PIN_LIST::iterator iPin;
PIN* Pin;
COMPONENT* Cmp;
wxString OldName; wxString OldName;
wxString NewName; wxString NewName;
OldName = PinNet; OldName = PinNet;
ii = PinNet.Len();
if( Rjustify ) /* On conserve les 8 dernieres lettres du nom */ if( rightJustify ) /* On conserve les 8 dernieres lettres du nom */
{ {
NewName = OldName.Right( 8 ); NewName = OldName.Right( 8 );
NewName << NetNumCode; NewName << *netNumber;
} }
else /* On conserve les 8 premieres lettres du nom */ else /* On conserve les 8 premieres lettres du nom */
{ {
NewName = OldName.Left( 8 ); NewName = OldName.Left( 8 );
NewName << NetNumCode; NewName << *netNumber;
} }
NetNumCode++;
CurrentCmp = g_BaseListeCmp; *netNumber = *netNumber + 1;
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
for( iCmp = list.begin(); iCmp != list.end(); ++iCmp )
{ {
Pin = CurrentCmp->m_Pins; Cmp = *iCmp;
for( ; Pin != NULL; Pin = Pin->Pnext )
for( iPin = Cmp->m_Pins.begin(); iPin != Cmp->m_Pins.end(); ++iPin )
{ {
Pin = *iPin;
if( Pin->m_PinNet != OldName ) if( Pin->m_PinNet != OldName )
continue; continue;
Pin->m_PinNet = NewName; Pin->m_PinNet = NewName;
} }
} }
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include <wx/docview.h> #include <wx/docview.h>
#include <wx/config.h> #include <wx/config.h>
#include <wx/filename.h> #include <wx/filename.h>
#include "param_config.h"
enum id_app_type { enum id_app_type {
APP_TYPE_UNKOWN, APP_TYPE_UNKOWN,
...@@ -26,7 +28,6 @@ enum id_app_type { ...@@ -26,7 +28,6 @@ enum id_app_type {
class wxConfigBase; class wxConfigBase;
class wxFileConfig; class wxFileConfig;
class PARAM_CFG_BASE;
class wxSingleInstanceChecker; class wxSingleInstanceChecker;
class wxHtmlHelpController; class wxHtmlHelpController;
...@@ -120,6 +121,9 @@ public: ...@@ -120,6 +121,9 @@ public:
void WriteProjectConfig( const wxString& local_config_filename, void WriteProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
PARAM_CFG_BASE** List ); PARAM_CFG_BASE** List );
void WriteProjectConfig( const wxString& fileName,
const wxString& GroupName,
const PARAM_CFG_ARRAY& params );
/** Function SaveCurrentSetupValues() /** Function SaveCurrentSetupValues()
* Save the current setup values in m_EDA_Config * Save the current setup values in m_EDA_Config
...@@ -136,7 +140,12 @@ public: ...@@ -136,7 +140,12 @@ public:
void ReadCurrentSetupValues( PARAM_CFG_BASE** aList ); void ReadCurrentSetupValues( PARAM_CFG_BASE** aList );
bool ReadProjectConfig( const wxString& local_config_filename, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, PARAM_CFG_BASE** List, const wxString& GroupName,
PARAM_CFG_BASE** List,
bool Load_Only_if_New );
bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName,
const PARAM_CFG_ARRAY& List,
bool Load_Only_if_New ); bool Load_Only_if_New );
bool ReCreatePrjConfig( const wxString& local_config_filename, bool ReCreatePrjConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
......
...@@ -171,12 +171,14 @@ extern const wxString SchematicFileExtension; ...@@ -171,12 +171,14 @@ extern const wxString SchematicFileExtension;
extern const wxString BoardFileExtension; extern const wxString BoardFileExtension;
extern const wxString NetlistFileExtension; extern const wxString NetlistFileExtension;
extern const wxString GerberFileExtension; extern const wxString GerberFileExtension;
extern const wxString PdfFileExtension;
extern const wxString ProjectFileWildcard; extern const wxString ProjectFileWildcard;
extern const wxString SchematicFileWildcard; extern const wxString SchematicFileWildcard;
extern const wxString BoardFileWildcard; extern const wxString BoardFileWildcard;
extern const wxString NetlistFileWildcard; extern const wxString NetlistFileWildcard;
extern const wxString GerberFileWildcard; extern const wxString GerberFileWildcard;
extern const wxString PdfFileWildcard;
extern const wxString AllFilesWildcard; extern const wxString AllFilesWildcard;
......
...@@ -461,6 +461,7 @@ enum main_id { ...@@ -461,6 +461,7 @@ enum main_id {
ID_CVPCB_SHOW3D_FRAME, ID_CVPCB_SHOW3D_FRAME,
ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
ID_CVPCB_UNUSED0, ID_CVPCB_UNUSED0,
ID_CVPCB_UNUSED1, ID_CVPCB_UNUSED1,
ID_CVPCB_UNUSED2, ID_CVPCB_UNUSED2,
......
...@@ -59,12 +59,10 @@ const wxChar* s_AllowedExtensionsToList[] = ...@@ -59,12 +59,10 @@ const wxChar* s_AllowedExtensionsToList[] =
/* File extension definitions. */ /* File extension definitions. */
const wxString PythonFileExtension( wxT( "py" ) ); const wxString PythonFileExtension( wxT( "py" ) );
const wxString PdfFileExtension( wxT( "pdf" ) );
const wxString TextFileExtension( wxT( "txt" ) ); const wxString TextFileExtension( wxT( "txt" ) );
/* File wildcard definitions. */ /* File wildcard definitions. */
const wxString PythonFileWildcard( wxT( "Python files (*.py)|*.py" ) ); const wxString PythonFileWildcard( wxT( "Python files (*.py)|*.py" ) );
const wxString PdfFileWildcard( wxT( "Portable document files (*.pdf)|*.pdf" ) );
const wxString TextFileWildcard( wxT( "Text files (*.txt)|*.txt" ) ); const wxString TextFileWildcard( wxT( "Text files (*.txt)|*.txt" ) );
......
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
static const wxString UserGridSizeXEntry( wxT( "PcbUserGrid_X" ) ); static const wxString UserGridSizeXEntry( wxT( "PcbUserGrid_X" ) );
static const wxString UserGridSizeYEntry( wxT( "PcbUserGrid_Y" ) ); static const wxString UserGridSizeYEntry( wxT( "PcbUserGrid_Y" ) );
static const wxString UserGridUnitsEntry( wxT( "PcbUserGrid_Unit" ) ); static const wxString UserGridUnitsEntry( wxT( "PcbUserGrid_Unit" ) );
static const wxString DisplayPadFillEntry( wxT( "DiPadFi" ) );
static const wxString DisplayPadNumberEntry( wxT( "DiPadNu" ) );
static const wxString DisplayModuleEdgeEntry( wxT( "DiModEd" ) );
static const wxString DisplayModuleTextEntry( wxT( "DiModTx" ) );
/*******************************/ /*******************************/
/* class WinEDA_BasePcbFrame */ /* class WinEDA_BasePcbFrame */
...@@ -392,6 +397,16 @@ void WinEDA_BasePcbFrame::LoadSettings() ...@@ -392,6 +397,16 @@ void WinEDA_BasePcbFrame::LoadSettings()
cfg->Read( m_FrameName + UserGridSizeYEntry, &m_UserGridSize.y, 0.01 ); cfg->Read( m_FrameName + UserGridSizeYEntry, &m_UserGridSize.y, 0.01 );
cfg->Read( m_FrameName + UserGridUnitsEntry, &m_UserGridUnits, cfg->Read( m_FrameName + UserGridUnitsEntry, &m_UserGridUnits,
( long )INCHES ); ( long )INCHES );
cfg->Read( m_FrameName + DisplayPadFillEntry, &m_DisplayPadFill, true );
cfg->Read( m_FrameName + DisplayPadNumberEntry, &m_DisplayPadNum, true );
cfg->Read( m_FrameName + DisplayModuleEdgeEntry, &m_DisplayModEdge,
( long )FILLED );
if( m_DisplayModEdge < FILAIRE || m_DisplayModEdge > SKETCH )
m_DisplayModEdge = FILLED;
cfg->Read( m_FrameName + DisplayModuleTextEntry, &m_DisplayModText,
( long )FILLED );
if( m_DisplayModText < FILAIRE || m_DisplayModText > SKETCH )
m_DisplayModText = FILLED;
} }
...@@ -411,4 +426,8 @@ void WinEDA_BasePcbFrame::SaveSettings() ...@@ -411,4 +426,8 @@ void WinEDA_BasePcbFrame::SaveSettings()
cfg->Write( m_FrameName + UserGridSizeXEntry, m_UserGridSize.x ); cfg->Write( m_FrameName + UserGridSizeXEntry, m_UserGridSize.x );
cfg->Write( m_FrameName + UserGridSizeYEntry, m_UserGridSize.y ); cfg->Write( m_FrameName + UserGridSizeYEntry, m_UserGridSize.y );
cfg->Write( m_FrameName + UserGridUnitsEntry, ( long )m_UserGridUnits ); cfg->Write( m_FrameName + UserGridUnitsEntry, ( long )m_UserGridUnits );
cfg->Write( m_FrameName + DisplayPadFillEntry, m_DisplayPadFill );
cfg->Write( m_FrameName + DisplayPadNumberEntry, m_DisplayPadNum );
cfg->Write( m_FrameName + DisplayModuleEdgeEntry, ( long )m_DisplayModEdge );
cfg->Write( m_FrameName + DisplayModuleTextEntry, ( long )m_DisplayModText );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment