Commit b4b57a96 authored by charras's avatar charras

Added: handling multiple user paths in library path list in Cvpcb. Other minor changes

parent 6039a5f7
...@@ -25,7 +25,7 @@ int S3D_MASTER:: ReadData() ...@@ -25,7 +25,7 @@ int S3D_MASTER:: ReadData()
{ {
char line[1024], * text; char line[1024], * text;
wxFileName fn; wxFileName fn;
wxString tmp; wxString FullFilename;
FILE* file; FILE* file;
int LineNum = 0; int LineNum = 0;
...@@ -34,23 +34,23 @@ int S3D_MASTER:: ReadData() ...@@ -34,23 +34,23 @@ int S3D_MASTER:: ReadData()
return 1; return 1;
} }
fn = m_Shape3DName;
if( !fn.FileExists() ) if( wxFileName::FileExists(m_Shape3DName) )
FullFilename = m_Shape3DName;
else
{ {
tmp = wxGetApp().FindLibraryPath( fn ); fn = m_Shape3DName;
FullFilename = wxGetApp().FindLibraryPath( fn );
if( !tmp ) if( FullFilename.IsEmpty() )
{ {
wxLogDebug( _( "3D part library <%s> could not be found." ), wxLogDebug( _( "3D part library <%s> could not be found." ),
fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
return -1; return -1;
} }
fn = tmp;
} }
file = wxFopen( fn.GetFullPath(), wxT( "rt" ) ); file = wxFopen( FullFilename, wxT( "rt" ) );
if( file == NULL ) if( file == NULL )
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* under GNU General Public License (see copyright.txt) * under GNU General Public License (see copyright.txt)
== Main Author == Main Author
Jean-Pierre Charras <jean-pierre.charras@inpg.fr> Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
Maitre de Conferences Maitre de Conferences
IUT1 GEII2 IUT1 GEII2
Universite Joseph Fourier (U.J.F.) Universite Joseph Fourier (U.J.F.)
...@@ -24,7 +24,7 @@ Wayne Stambaugh <stambaughw@verizon.net> ...@@ -24,7 +24,7 @@ Wayne Stambaugh <stambaughw@verizon.net>
See also CHANGELOG.txt for contributors. See also CHANGELOG.txt for contributors.
== Document Writers == Document Writers
Jean-Pierre Charras <jean-pierre.charras@inpg.fr> Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
Igor Plyatov <plyatov@gmail.com> Igor Plyatov <plyatov@gmail.com>
== Translators == Translators
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#define BUILD_VERSION wxT("(20090414-unstable)") #define BUILD_VERSION wxT("(20090421-unstable)")
wxString g_BuildVersion wxString g_BuildVersion
...@@ -138,7 +138,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info ) ...@@ -138,7 +138,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info )
info.AddDeveloper( SetMsg( wxT( "Wayne Stambaugh <stambaughw@verizon.net>" ) ) ); info.AddDeveloper( SetMsg( wxT( "Wayne Stambaugh <stambaughw@verizon.net>" ) ) );
/* Add document writers*/ /* Add document writers*/
info.AddDocWriter( wxT( "Jean-Pierre Charras <jean-pierre.charras@inpg.fr>" ) ); info.AddDocWriter( wxT( "Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>" ) );
info.AddDocWriter( SetMsg( wxT( "Igor Plyatov <plyatov@gmail.com>" ) ) ); info.AddDocWriter( SetMsg( wxT( "Igor Plyatov <plyatov@gmail.com>" ) ) );
/* Add translators */ /* Add translators */
......
...@@ -112,6 +112,11 @@ bool GetAssociatedDocument( wxFrame* aFrame, ...@@ -112,6 +112,11 @@ bool GetAssociatedDocument( wxFrame* aFrame,
/* Compute the full file name */ /* Compute the full file name */
if( wxIsAbsolutePath( aDocName ) || aPaths == NULL) if( wxIsAbsolutePath( aDocName ) || aPaths == NULL)
fullfilename = aDocName; fullfilename = aDocName;
/* If the file exists, this is a trivial case: return the filename "as this"
* the name can be an absolute path, or a relative path like ./filename or ../<filename>
*/
else if( wxFileName::FileExists( aDocName ) )
fullfilename = aDocName;
else else
{ {
fullfilename = aPaths->FindValidPath( aDocName ); fullfilename = aPaths->FindValidPath( aDocName );
......
...@@ -12,7 +12,8 @@ set(CVPCB_SRCS ...@@ -12,7 +12,8 @@ set(CVPCB_SRCS
class_cvpcb.cpp class_cvpcb.cpp
cvframe.cpp cvframe.cpp
cvpcb.cpp cvpcb.cpp
# dialog_cvpcb_config.cpp dialog_cvpcb_config.cpp
dialog_cvpcb_config_fbp.cpp
dialog_display_options.cpp dialog_display_options.cpp
displayframe.cpp displayframe.cpp
genequiv.cpp genequiv.cpp
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "kicad_string.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
...@@ -23,7 +24,6 @@ public: ...@@ -23,7 +24,6 @@ public:
AUTOMODULE* Pnext; AUTOMODULE* Pnext;
wxString m_Name; wxString m_Name;
wxString m_LibName; wxString m_LibName;
wxString m_Library;
AUTOMODULE() { m_Type = 0; Pnext = NULL; } AUTOMODULE() { m_Type = 0; Pnext = NULL; }
}; };
...@@ -33,27 +33,20 @@ public: ...@@ -33,27 +33,20 @@ public:
static int auto_select( WinEDA_CvpcbFrame* frame, static int auto_select( WinEDA_CvpcbFrame* frame,
STORECMP* Cmp, STORECMP* Cmp,
AUTOMODULE* BaseListeMod ); AUTOMODULE* BaseListeMod );
static void auto_associe( WinEDA_CvpcbFrame* frame ); static char * ReadQuotedText(wxString & aTarget, char * aText);
/*************************************************************/ /*************************************************************/
void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event ) void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
/*************************************************************/ /*************************************************************/
/* Fonction liee au boutton "Auto" /* Called by the automatic association button
* Lance l'association automatique modules/composants * Read *.equ files to try to find acorresponding footprint
* for each component that is not already linked to a footprint ( a "free" component )
* format of a line:
* 'cmp_ref' 'footprint_name'
*/ */
{
auto_associe( this );
}
/**************************************************/
static void auto_associe( WinEDA_CvpcbFrame* frame )
/**************************************************/
{ {
wxFileName fn; wxFileName fn;
unsigned ii, j, k;
wxString msg, tmp; wxString msg, tmp;
char Line[1024]; char Line[1024];
FILE* file; FILE* file;
...@@ -66,7 +59,7 @@ static void auto_associe( WinEDA_CvpcbFrame* frame ) ...@@ -66,7 +59,7 @@ static void auto_associe( WinEDA_CvpcbFrame* frame )
return; return;
/* recherche des equivalences a travers les fichiers possibles */ /* recherche des equivalences a travers les fichiers possibles */
for( ii = 0; ii < g_ListName_Equ.GetCount(); ii++ ) for( unsigned ii = 0; ii < g_ListName_Equ.GetCount(); ii++ )
{ {
fn = g_ListName_Equ[ii]; fn = g_ListName_Equ[ii];
fn.SetExt( EquivFileExtension ); fn.SetExt( EquivFileExtension );
...@@ -92,16 +85,13 @@ static void auto_associe( WinEDA_CvpcbFrame* frame ) ...@@ -92,16 +85,13 @@ static void auto_associe( WinEDA_CvpcbFrame* frame )
} }
/* lecture fichier n */ /* lecture fichier n */
while( fgets( Line, 79, file ) != 0 ) while( GetLine( file, Line, NULL, sizeof(Line) ) != NULL )
{ {
/* elimination des lignes vides */ char * text = Line;
for( j = 0; j < 40; j++ ) text = ReadQuotedText(tmp, text);
{
if( Line[j] == 0 ) if ( text == NULL || (*text == 0 ) )
goto fin_de_while; continue;
if( Line[j] == QUOTE )
break;
}
ItemModule = new AUTOMODULE(); ItemModule = new AUTOMODULE();
ItemModule->Pnext = BaseListeMod; ItemModule->Pnext = BaseListeMod;
...@@ -109,56 +99,73 @@ static void auto_associe( WinEDA_CvpcbFrame* frame ) ...@@ -109,56 +99,73 @@ static void auto_associe( WinEDA_CvpcbFrame* frame )
/* stockage du composant ( 'namecmp' 'namelib') /* stockage du composant ( 'namecmp' 'namelib')
* name et namelib */ * name et namelib */
for( j++; j < 40; j++, k++ ) ItemModule->m_Name = tmp;
{
if( Line[j] == QUOTE )
break;
ItemModule->m_Name.Append( Line[j] );
}
j++; text++;
for( ; j < 80; ) ReadQuotedText(ItemModule->m_LibName, text);
if( Line[j++] == QUOTE )
break;
for( ; ; j++ )
{
if( Line[j] == QUOTE )
break;
ItemModule->m_LibName.Append( Line[j] );
}
nb_correspondances++; nb_correspondances++;
fin_de_while:;
} }
fclose( file ); fclose( file );
/* Affichage Statistiques */
msg.Printf( _( "%d equivalences" ), nb_correspondances );
frame->SetStatusText( msg, 0 );
} }
/* display some info */
msg.Printf( _( "%d equivalences" ), nb_correspondances );
SetStatusText( msg, 0 );
wxMessageBox(msg);
Component = g_BaseListeCmp; Component = g_BaseListeCmp;
for( ii = 0; Component != NULL; Component = Component->Pnext, ii++ ) for( unsigned ii = 0; Component != NULL; Component = Component->Pnext, ii++ )
{ {
frame->m_ListCmp->SetSelection( ii, TRUE ); m_ListCmp->SetSelection( ii, TRUE );
if( Component->m_Module.IsEmpty() ) if( Component->m_Module.IsEmpty() )
auto_select( frame, Component, BaseListeMod ); auto_select( this, Component, BaseListeMod );
} }
/* Liberation memoire */ /* free memory: */
for( ItemModule = BaseListeMod; ItemModule != NULL; ItemModule = NextMod ) for( ItemModule = BaseListeMod; ItemModule != NULL; ItemModule = NextMod )
{ {
NextMod = ItemModule->Pnext; delete ItemModule; NextMod = ItemModule->Pnext;
delete ItemModule;
} }
BaseListeMod = NULL; 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 )
break;
}
if ( *aText == 0 )
return NULL;
aText++;
for(; *aText != 0; aText++ )
{
if( *aText == QUOTE )
break;
aTarget.Append(*aText);
}
return aText;
}
/****************************************************************/ /****************************************************************/
static int auto_select( WinEDA_CvpcbFrame* frame, STORECMP* Cmp, int auto_select( WinEDA_CvpcbFrame* frame, STORECMP* Cmp,
AUTOMODULE* BaseListeMod ) AUTOMODULE* BaseListeMod )
/****************************************************************/ /****************************************************************/
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h" #include "protos.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "dialog_cvpcb_config.h"
#define FRAME_MIN_SIZE_X 450 #define FRAME_MIN_SIZE_X 450
...@@ -342,7 +343,8 @@ void WinEDA_CvpcbFrame::SaveQuitCvpcb( wxCommandEvent& event ) ...@@ -342,7 +343,8 @@ void WinEDA_CvpcbFrame::SaveQuitCvpcb( wxCommandEvent& event )
if( SaveNetList( wxEmptyString ) > 0 ) if( SaveNetList( wxEmptyString ) > 0 )
{ {
modified = 0; modified = 0;
Close( TRUE ); if ( ! g_KeepCvpcbOpen )
Close( TRUE );
} }
} }
...@@ -437,12 +439,9 @@ void WinEDA_CvpcbFrame::LoadNetList( wxCommandEvent& event ) ...@@ -437,12 +439,9 @@ void WinEDA_CvpcbFrame::LoadNetList( wxCommandEvent& event )
/***********************************************************/ /***********************************************************/
void WinEDA_CvpcbFrame::ConfigCvpcb( wxCommandEvent& event ) void WinEDA_CvpcbFrame::ConfigCvpcb( wxCommandEvent& event )
/***********************************************************/ /***********************************************************/
/* Fonction liee au boutton "Config"
* Affiche le panneau de configuration
*/
{ {
CreateConfigWindow(); DIALOG_CVPCB_CONFIG ConfigFrame( this );
ConfigFrame.ShowModal();
} }
...@@ -500,18 +499,10 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event ) ...@@ -500,18 +499,10 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event ) void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
/*************************************************************/ /*************************************************************/
{ {
wxASSERT( wxGetApp().m_EDA_CommonConfig != NULL );
wxString DocModuleFileName, fullfilename;
wxConfig* cfg = wxGetApp().m_EDA_CommonConfig; wxConfig* cfg = wxGetApp().m_EDA_CommonConfig;
DocModuleFileName = cfg->Read( DOC_FOOTPRINTS_LIST_KEY, cfg->Read( DOC_FOOTPRINTS_LIST_KEY, g_DocModulesFileName );
DEFAULT_FOOTPRINTS_LIST_FILENAME );
if( wxIsAbsolutePath( DocModuleFileName ) ) GetAssociatedDocument( this, g_DocModulesFileName, &wxGetApp().GetLibraryPathList() );
fullfilename = DocModuleFileName;
else
fullfilename = FindKicadHelpPath() + wxT( "../" ) + DocModuleFileName;
GetAssociatedDocument( this, fullfilename );
} }
......
...@@ -24,9 +24,13 @@ const wxString ComponentFileExtension( wxT( "cmp" ) ); ...@@ -24,9 +24,13 @@ const wxString ComponentFileExtension( wxT( "cmp" ) );
const wxString RetroFileExtension( wxT( "stf" ) ); const wxString RetroFileExtension( wxT( "stf" ) );
const wxString EquivFileExtension( wxT( "equ" ) ); const wxString EquivFileExtension( wxT( "equ" ) );
/* TODO: What is a stuff file??? Please fix this wild card in English if // Wildcard for footprint libraries filesnames
* you know. */ const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file " \
"(*.mod)|*.mod" ) );
// 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 EquivFileWildcard( _( "Kicad footprint alias files (*.equ)|*.equ" ) ); const wxString EquivFileWildcard( _( "Kicad footprint alias files (*.equ)|*.equ" ) );
const wxString titleLibLoadError( _( "Library Load Error" ) ); const wxString titleLibLoadError( _( "Library Load Error" ) );
...@@ -40,6 +44,10 @@ int nbcomp; ...@@ -40,6 +44,10 @@ int nbcomp;
int nblib; int nblib;
int composants_non_affectes; int composants_non_affectes;
// Option to keep cvpcb open after saving netlist files
bool g_KeepCvpcbOpen = false;
STOREMOD* g_BaseListePkg = NULL; STOREMOD* g_BaseListePkg = NULL;
STORECMP* g_BaseListeCmp = NULL; STORECMP* g_BaseListeCmp = NULL;
...@@ -48,6 +56,14 @@ wxString g_NetlistFileExtension; ...@@ -48,6 +56,14 @@ wxString g_NetlistFileExtension;
wxArrayString g_ListName_Equ; // list of .equ files to load 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 )
...@@ -65,7 +81,7 @@ bool WinEDA_App::OnInit() ...@@ -65,7 +81,7 @@ bool WinEDA_App::OnInit()
wxString currCWD = wxGetCwd(); wxString currCWD = wxGetCwd();
WinEDA_CvpcbFrame* frame = NULL; WinEDA_CvpcbFrame* frame = NULL;
InitEDA_Appl( wxT( "CVpcb" ), APP_TYPE_CVPCB ); InitEDA_Appl( wxT( "Cvpcb" ), APP_TYPE_CVPCB );
if( m_Checker && m_Checker->IsAnotherRunning() ) if( m_Checker && m_Checker->IsAnotherRunning() )
{ {
...@@ -96,6 +112,9 @@ bool WinEDA_App::OnInit() ...@@ -96,6 +112,9 @@ bool WinEDA_App::OnInit()
SetTopWindow( frame ); SetTopWindow( frame );
Read_Config( fn.GetFullPath() ); Read_Config( 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();
......
...@@ -8,8 +8,11 @@ ...@@ -8,8 +8,11 @@
#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 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" )
...@@ -62,7 +65,7 @@ public: ...@@ -62,7 +65,7 @@ public:
wxString m_Module; /* Nom du module (Package) corresp */ wxString m_Module; /* Nom du module (Package) corresp */
wxString m_Repere; /* utilise selon formats de netliste */ wxString m_Repere; /* utilise selon formats de netliste */
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(); STORECMP();
~STORECMP(); ~STORECMP();
...@@ -94,25 +97,40 @@ extern const wxString EquivFileWildcard; ...@@ -94,25 +97,40 @@ extern const wxString EquivFileWildcard;
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. */ /* CvPcb global variable definition references. */
extern STOREMOD* g_BaseListePkg; extern STOREMOD* g_BaseListePkg;
extern STORECMP* g_BaseListeCmp; extern STORECMP* g_BaseListeCmp;
extern wxString g_NetlistFileExtension; extern wxString g_NetlistFileExtension;
extern wxString g_UserNetDirBuffer; extern wxString g_UserNetDirBuffer;
extern wxArrayString g_ListName_Equ; // list of .equ files to load extern wxArrayString g_ListName_Equ; // list of .equ files to load
extern int g_FlagEESchema; extern int g_FlagEESchema;
extern int Rjustify; /* flag pout troncature des noms de Net: extern int Rjustify; /* flag pout troncature des noms de Net:
* = 0: debut de chaine conservee (->ORCADPCB2) * = 0: debut de chaine conservee (->ORCADPCB2)
* = 1: fin de chaine conservee (->VIEWLOGIC) */ * = 1: fin de chaine conservee (->VIEWLOGIC) */
extern int modified; /* Flag != 0 si modif attribution des module. */ 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 int nbcomp; /* nombre de composants trouves */ extern bool g_KeepCvpcbOpen; // Option to keep cvpcb open after saving netlist files
extern int nblib; /* nombre d'empreintes trouvees */
extern int composants_non_affectes; /* nbre de composants non affectes */
void Plume( int state ); void Plume( int state );
......
...@@ -67,7 +67,6 @@ public: ...@@ -67,7 +67,6 @@ public:
void BuildCmpListBox(); void BuildCmpListBox();
void BuildFootprintListBox(); void BuildFootprintListBox();
void CreateScreenCmp(); void CreateScreenCmp();
void CreateConfigWindow();
int SaveNetList( const wxString& FullFileName ); int SaveNetList( const wxString& FullFileName );
int SaveComponentList( const wxString& FullFileName ); int SaveComponentList( const wxString& FullFileName );
bool ReadNetList(); bool ReadNetList();
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_cvpcb_config.h
// Purpose: // Name: dialog_display_options.h
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Licence: GPL
// Created: 17/02/2006 18:43:13
// RCS-ID:
// Copyright: License GNU
// Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 17/02/2006 18:43:13
#ifndef _DIALOG_CVPCB_CONFIG_H_ #ifndef _DIALOG_CVPCB_CONFIG_H_
#define _DIALOG_CVPCB_CONFIG_H_ #define _DIALOG_CVPCB_CONFIG_H_
/*! #include "dialog_cvpcb_config_fbp.h"
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxBoxSizer;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define SAVE_CFG 10001
#define ID_READ_OLDCFG 10002
#define DEL_LIB 10004
#define ADD_LIB 10005
#define INSERT_LIB 10006
#define ID_LISTBOX 10010
#define DEL_EQU 10007
#define ADD_EQU 10008
#define INSERT_EQU 10009
#define ID_LISTBOX1 10011
#define SYMBOL_KICONFIGCVPCBFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_KICONFIGCVPCBFRAME_TITLE _("Cvpcb Configuration")
#define SYMBOL_KICONFIGCVPCBFRAME_IDNAME ID_DIALOG
#define SYMBOL_KICONFIGCVPCBFRAME_SIZE wxSize(400, 300)
#define SYMBOL_KICONFIGCVPCBFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*! class DIALOG_CVPCB_CONFIG : public DIALOG_CVPCB_CONFIG_FBP
* KiConfigCvpcbFrame class declaration
*/
class KiConfigCvpcbFrame: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS( KiConfigCvpcbFrame ) private:
DECLARE_EVENT_TABLE() WinEDA_CvpcbFrame* m_Parent;
wxConfig * m_Config;
public: wxString m_UserLibDirBufferImg;
/// Constructors bool m_LibListChanged;
KiConfigCvpcbFrame( ); bool m_LibPathChanged;
KiConfigCvpcbFrame( WinEDA_CvpcbFrame* parent, wxWindowID id = SYMBOL_KICONFIGCVPCBFRAME_IDNAME, const wxString& caption = SYMBOL_KICONFIGCVPCBFRAME_TITLE, const wxPoint& pos = SYMBOL_KICONFIGCVPCBFRAME_POSITION, const wxSize& size = SYMBOL_KICONFIGCVPCBFRAME_SIZE, long style = SYMBOL_KICONFIGCVPCBFRAME_STYLE );
private:
/// Creation void Init();
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_KICONFIGCVPCBFRAME_IDNAME, const wxString& caption = SYMBOL_KICONFIGCVPCBFRAME_TITLE, const wxPoint& pos = SYMBOL_KICONFIGCVPCBFRAME_POSITION, const wxSize& size = SYMBOL_KICONFIGCVPCBFRAME_SIZE, long style = SYMBOL_KICONFIGCVPCBFRAME_STYLE );
// Virtual event handlers
/// Creates the controls and sizers void OnCloseWindow( wxCloseEvent& event );
void CreateControls();
////@begin KiConfigCvpcbFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for SAVE_CFG
void OnSaveCfgClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_READ_OLDCFG
void OnReadOldcfgClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnSaveCfgClick( wxCommandEvent& event );
void OnAddOrInsertLibClick( wxCommandEvent& event );
void OnRemoveLibClick( wxCommandEvent& event );
void OnBrowseModDocFile( wxCommandEvent& event );
void OnAddOrInsertPath( wxCommandEvent& event );
void OnRemoveUserPath( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for DEL_LIB
void OnDelLibClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ADD_LIB
void OnAddLibClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for INSERT_LIB
void OnInsertLibClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for DEL_EQU
void OnDelEquClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ADD_EQU
void OnAddEquClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for INSERT_EQU
void OnInsertEquClick( wxCommandEvent& event );
////@end KiConfigCvpcbFrame event handler declarations
////@begin KiConfigCvpcbFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end KiConfigCvpcbFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void Update();
void AcceptCfg(wxCommandEvent& event);
void SaveCfg(wxCommandEvent& event);
void ReadOldCfg(wxCommandEvent& event);
void LibDelFct(wxCommandEvent& event);
void LibAddFct(wxCommandEvent& event);
void EquDelFct(wxCommandEvent& event);
void EquAddFct(wxCommandEvent& event);
void SetDialogDatas();
////@begin KiConfigCvpcbFrame member variables
wxButton* m_OkButton;
wxStaticBoxSizer* m_FileExtList;
wxBoxSizer* m_RightBoxSizer;
wxListBox* m_ListLibr;
wxListBox* m_ListEquiv;
wxBoxSizer* m_FileExtBoxSizerH;
wxBoxSizer* m_NetExtBoxSizer;
////@end KiConfigCvpcbFrame member variables
WinEDA_CvpcbFrame * m_Parent;
bool m_DoUpdate;
WinEDA_EnterText * m_LibDirCtrl; public:
WinEDA_EnterText * m_NetInputExtCtrl; DIALOG_CVPCB_CONFIG( WinEDA_CvpcbFrame* parent );
WinEDA_EnterText * m_PkgExtCtrl; ~DIALOG_CVPCB_CONFIG() {};
WinEDA_EnterText * m_TextHelpModulesFileName;
}; };
#endif #endif
// _DIALOG_CVPCB_CONFIG_H_
// _DIALOG_CVPCB_CONFIG_H_
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_cvpcb_config_fbp__
#define __dialog_cvpcb_config_fbp__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/button.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/stattext.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/listbox.h>
#include <wx/statline.h>
#include <wx/textctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_CVPCB_CONFIG_FBP
///////////////////////////////////////////////////////////////////////////////
class DIALOG_CVPCB_CONFIG_FBP : public wxDialog
{
private:
protected:
enum
{
ID_SAVE_CFG = 1000,
ID_ADD_LIB,
ID_INSERT_LIB,
ID_REMOVE_LIB,
ID_ADD_EQU,
ID_INSERT_EQU,
ID_REMOVE_EQU,
ID_BROWSE_MOD_DOC,
ID_LIB_PATH_SEL,
ID_INSERT_PATH,
ID_REMOVE_PATH,
};
wxButton* m_buttonOk;
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_buttonInsLib;
wxButton* m_buttonRemoveLib;
wxListBox* m_ListLibr;
wxStaticText* m_staticTextEquList;
wxButton* m_buttonAddEqu;
wxButton* m_buttonInsEqu;
wxButton* m_buttonRemoveEqu;
wxListBox* m_ListEquiv;
wxStaticLine* m_staticline1;
wxTextCtrl* m_TextHelpModulesFileName;
wxButton* m_buttonModDoc;
wxListBox* m_listUserPaths;
wxButton* m_buttonAddPath;
wxButton* m_buttonInsPath;
wxButton* m_buttonRemovePath;
wxStaticText* m_staticTextcurrenpaths;
wxListBox* m_DefaultLibraryPathslistBox;
// Virtual event handlers, overide them in your derived class
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 OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); }
virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); }
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();
};
#endif //__dialog_cvpcb_config_fbp__
...@@ -16,6 +16,8 @@ OBJECTS = $(TARGET).o \ ...@@ -16,6 +16,8 @@ OBJECTS = $(TARGET).o \
class_board_item.o\ class_board_item.o\
memoire.o \ memoire.o \
cvframe.o\ cvframe.o\
dialog_cvpcb_config.o\
dialog_cvpcb_config_fbp.o\
listboxes.o\ listboxes.o\
displayframe.o\ displayframe.o\
init.o\ init.o\
......
This diff is collapsed.
...@@ -58,11 +58,11 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() ...@@ -58,11 +58,11 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE,
wxBitmap( save_cmpstuff_xpm ), wxBitmap( save_cmpstuff_xpm ),
_( "Create stuff file (component/footprint list)" ) ); _( "Create export file (component/footprint list, used by eeschema to fill the footprint field of components)" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC,
wxBitmap( file_footprint_xpm ), wxBitmap( datasheet_xpm ),
_( "Display footprints list documentation" ) ); _( "Display footprints list documentation" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
...@@ -90,81 +90,3 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() ...@@ -90,81 +90,3 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar->Realize(); m_HToolBar->Realize();
} }
/*******************************************/
void WinEDA_CvpcbFrame::ReCreateMenuBar()
/*******************************************/
/* Creation des menus de la fenetre principale
*/
{
wxMenuItem* item;
wxMenuBar* menuBar = GetMenuBar();
/* Destroy the existing menu bar so it can be rebuilt. This allows
* language changes of the menu text on the fly. */
if( menuBar )
SetMenuBar( NULL );
menuBar = new wxMenuBar();
wxMenu* filesMenu = new wxMenu;
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT,
_( "&Open" ),
_( "Open a NetList file" ) );
item->SetBitmap( open_xpm );
filesMenu->Append( item );
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
_( "&Save As..." ),
_( "Save New NetList and Footprints List files" ) );
item->SetBitmap( save_xpm );
filesMenu->Append( item );
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_CVPCB_QUIT, _( "E&xit" ),
_( "Quit Cvpcb" ) );
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
// Creation des selections des anciens fichiers
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
// Menu Configuration:
wxMenu* configmenu = new wxMenu;
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Configuration" ),
_( "Setting Libraries, Directories and others..." ) );
item->SetBitmap( config_xpm );
configmenu->Append( item );
// Font selection and setup
AddFontSelectionMenu( configmenu );
wxGetApp().AddMenuLanguageList( configmenu );
configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE,
_( "&Save config" ),
_( "Save configuration in current dir" ) );
item->SetBitmap( save_setup_xpm );
configmenu->Append( item );
// Menu Help:
wxMenu* helpMenu = new wxMenu;
item = new wxMenuItem( helpMenu, ID_CVPCB_DISPLAY_HELP, _( "&Contents" ),
_( "Open the cvpcb manual" ) );
item->SetBitmap( help_xpm );
helpMenu->Append( item );
item = new wxMenuItem( helpMenu, ID_CVPCB_DISPLAY_LICENCE,
_( "&About cvpcb" ),
_( "About cvpcb schematic to pcb converter" ) );
item->SetBitmap( info_xpm );
helpMenu->Append( item );
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( configmenu, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
// Associate the menu bar with the frame
SetMenuBar( menuBar );
}
...@@ -185,7 +185,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -185,7 +185,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event )
wxFileName fn; wxFileName fn;
ii = m_ListLibr->GetSelection(); ii = m_ListLibr->GetSelection();
if( ii == wxNOT_FOUND && event.GetId() != ID_ADD_LIB ) if( ii == wxNOT_FOUND )
ii = 0; ii = 0;
wxString libpath; wxString libpath;
......
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