diff --git a/common/edaappl.cpp b/common/edaappl.cpp index bbc97ef41f..557da610cb 100644 --- a/common/edaappl.cpp +++ b/common/edaappl.cpp @@ -582,17 +582,6 @@ void WinEDA_App::SetDefaultSearchPaths( void ) fn.RemoveLastDir(); // point to } - /* Add kicad template file path to search path list. */ - fn.AppendDir( wxT( "template" ) ); - - if( fn.IsDirReadable() ) - { - wxLogDebug( wxT( "Adding <%s> to search path list" ), - fn.GetPath().c_str() ); - m_libSearchPaths.Add( fn.GetPath() ); - } - fn.RemoveLastDir(); - /* Add PCB library file path to search path list. */ if( ( m_Id == APP_TYPE_PCBNEW ) || ( m_Id == APP_TYPE_CVPCB ) ) { @@ -614,7 +603,19 @@ void WinEDA_App::SetDefaultSearchPaths( void ) fn.GetPath().c_str() ); m_libSearchPaths.Add( fn.GetPath() ); } + fn.RemoveLastDir(); + fn.RemoveLastDir(); // point to } + /* Add kicad template file path to search path list. */ + fn.AppendDir( wxT( "template" ) ); + + if( fn.IsDirReadable() ) + { + wxLogDebug( wxT( "Adding <%s> to search path list" ), + fn.GetPath().c_str() ); + m_libSearchPaths.Add( fn.GetPath() ); + } + fn.RemoveLastDir(); } } } diff --git a/eeschema/dialog_eeschema_config_fbp.cpp b/eeschema/dialog_eeschema_config_fbp.cpp index 0317377b0d..1f20b35d3e 100644 --- a/eeschema/dialog_eeschema_config_fbp.cpp +++ b/eeschema/dialog_eeschema_config_fbp.cpp @@ -82,11 +82,6 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind wxBoxSizer* bRightSizer; bRightSizer = new wxBoxSizer( wxVERTICAL ); - m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); - - bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - 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") ); @@ -95,7 +90,12 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); - bRightSizer->Add( m_buttonIns, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); + + bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 ); @@ -104,7 +104,7 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind bRightSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonCancel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + bRightSizer->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") ); @@ -131,21 +131,23 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind bUserListSizer = new wxBoxSizer( wxVERTICAL ); m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bUserListSizer->Add( m_listUserPaths, 1, wxALL|wxEXPAND, 5 ); + m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); + + bUserListSizer->Add( m_listUserPaths, 1, wxEXPAND, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxBoxSizer* bUserPathsButtonsSizer; bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); - m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxRIGHT|wxLEFT, 5 ); - m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxRIGHT|wxLEFT, 5 ); + + m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); @@ -170,28 +172,28 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); - m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); - m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); } DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); - m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); - m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); } diff --git a/eeschema/dialog_eeschema_config_fbp.fbp b/eeschema/dialog_eeschema_config_fbp.fbp index 9015d26758..b90217331f 100644 --- a/eeschema/dialog_eeschema_config_fbp.fbp +++ b/eeschema/dialog_eeschema_config_fbp.fbp @@ -614,58 +614,6 @@ bRightSizer wxVERTICAL none - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 0 - 1 - - - 0 - ID_REMOVE_LIB - Remove - - - m_buttonRemoveLib - protected - - - - - Unload the selected library - - - - OnRemoveLibClick - - - - - - - - - - - - - - - - - - - - - - - - - 5 wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL @@ -720,7 +668,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT 0 @@ -770,6 +718,58 @@ + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + + + 0 + 1 + + + 0 + ID_REMOVE_LIB + Remove + + + m_buttonRemoveLib + protected + + + + + Unload the selected library + + + + OnRemoveLibClick + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND @@ -834,7 +834,7 @@ 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT 0 @@ -1033,7 +1033,7 @@ none 5 - wxALL|wxEXPAND + wxEXPAND 1 @@ -1052,7 +1052,7 @@ - + Additional paths used in this project. The priority is highter than default Kicad paths. @@ -1096,59 +1096,7 @@ none 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_REMOVE_PATH - Remove - - - m_buttonRemovePath - protected - - - - - - - - - OnRemoveUserPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 @@ -1200,7 +1148,7 @@ 5 - wxBOTTOM|wxRIGHT|wxLEFT + wxRIGHT|wxLEFT 0 @@ -1250,6 +1198,58 @@ + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 0 + 1 + + + 0 + wxID_REMOVE_PATH + Remove + + + m_buttonRemovePath + protected + + + + + + + + + OnRemoveUserPath + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialog_eeschema_config_fbp.h b/eeschema/dialog_eeschema_config_fbp.h index 79e32a010e..28fda307b4 100644 --- a/eeschema/dialog_eeschema_config_fbp.h +++ b/eeschema/dialog_eeschema_config_fbp.h @@ -35,12 +35,12 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog protected: enum { - ID_REMOVE_LIB = 1000, - ID_ADD_LIB, + ID_ADD_LIB = 1000, + ID_REMOVE_LIB, ID_SAVE_CFG, - wxID_REMOVE_PATH, ID_LIB_PATH_SEL, wxID_INSERT_PATH, + wxID_REMOVE_PATH, }; wxStaticText* m_staticTextNetListFormats; @@ -53,30 +53,30 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog wxStaticText* m_InfoSchFileExt; wxStaticText* m_staticTextlibList; wxListBox* m_ListLibr; - wxButton* m_buttonRemoveLib; wxButton* m_buttonAddLib; wxButton* m_buttonIns; + wxButton* m_buttonRemoveLib; wxButton* m_buttonOk; wxButton* m_buttonCancel; wxButton* m_buttonSave; wxStaticLine* m_staticline1; wxListBox* m_listUserPaths; - wxButton* m_buttonRemovePath; 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 OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveLibClick( wxCommandEvent& 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 OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } public: diff --git a/eeschema/edit_component_in_lib.cpp b/eeschema/edit_component_in_lib.cpp index 0323e97053..2de9a87f66 100644 --- a/eeschema/edit_component_in_lib.cpp +++ b/eeschema/edit_component_in_lib.cpp @@ -769,7 +769,7 @@ void WinEDA_PartPropertiesFrame::BrowseAndSelectDocFile( wxCommandEvent& event ) if( FullFileName.IsEmpty() ) return; - /* If the library path is already in the library search paths + /* If the path is already in the library search paths * list, just add the library name to the list. Otherwise, add * the library name with the full or relative path. * the relative path, when possible is preferable, diff --git a/osx-package/__MACOSX/._osx-package.pmdoc b/osx-package/__MACOSX/._osx-package.pmdoc new file mode 100644 index 0000000000..0ddac7cfd4 Binary files /dev/null and b/osx-package/__MACOSX/._osx-package.pmdoc differ diff --git a/osx-package/osx-package.pmdoc/01cvpcb-contents.xml b/osx-package/osx-package.pmdoc/01cvpcb-contents.xml new file mode 100644 index 0000000000..bc1e5a791f --- /dev/null +++ b/osx-package/osx-package.pmdoc/01cvpcb-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/01cvpcb.xml b/osx-package/osx-package.pmdoc/01cvpcb.xml new file mode 100644 index 0000000000..c5472c36d9 --- /dev/null +++ b/osx-package/osx-package.pmdoc/01cvpcb.xml @@ -0,0 +1 @@ +net.sourceforge.kicad.cvpcb1cvpcb/cvpcb.app/Applications/KicadparentinstallFrom.pathinstallTo.isAbsoluteTyperelocatableinstallFrom.isRelativeTypeincludeRootinstallTo.pathinstallToidentifier/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/02eeschema-contents.xml b/osx-package/osx-package.pmdoc/02eeschema-contents.xml new file mode 100644 index 0000000000..bc1e5a791f --- /dev/null +++ b/osx-package/osx-package.pmdoc/02eeschema-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/02eeschema.xml b/osx-package/osx-package.pmdoc/02eeschema.xml new file mode 100644 index 0000000000..f0ae023f02 --- /dev/null +++ b/osx-package/osx-package.pmdoc/02eeschema.xml @@ -0,0 +1 @@ +net.sourceforge.kicad.eeschema1eeschema/eeschema.app/Applications/KicadparentinstallFrom.pathinstallTo.isAbsoluteTypeinstallFrom.isAbsoluteTyperelocatableinstallFrom.isRelativeTypeincludeRootinstallTo.pathinstallToidentifier/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/03pcbnew-contents.xml b/osx-package/osx-package.pmdoc/03pcbnew-contents.xml new file mode 100644 index 0000000000..bc1e5a791f --- /dev/null +++ b/osx-package/osx-package.pmdoc/03pcbnew-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/03pcbnew.xml b/osx-package/osx-package.pmdoc/03pcbnew.xml new file mode 100644 index 0000000000..52fff6d2b0 --- /dev/null +++ b/osx-package/osx-package.pmdoc/03pcbnew.xml @@ -0,0 +1 @@ +net.sourceforge.kicad.pcbnew1pcbnew/pcbnew.app/Applications/KicadparentidentifierinstallTo.isAbsoluteTypeincludeRootinstallFrom.pathinstallToinstallTo.path/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/04kicad-contents.xml b/osx-package/osx-package.pmdoc/04kicad-contents.xml new file mode 100644 index 0000000000..bc1e5a791f --- /dev/null +++ b/osx-package/osx-package.pmdoc/04kicad-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/04kicad.xml b/osx-package/osx-package.pmdoc/04kicad.xml new file mode 100644 index 0000000000..7207f722ef --- /dev/null +++ b/osx-package/osx-package.pmdoc/04kicad.xml @@ -0,0 +1 @@ +net.sourceforge.kicad.kicad1kicad/kicad.app/Applications/KicadparentidentifierinstallTo.isAbsoluteTypeincludeRootinstallFrom.pathinstallToinstallTo.path/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/05gerbview-contents.xml b/osx-package/osx-package.pmdoc/05gerbview-contents.xml new file mode 100644 index 0000000000..bc1e5a791f --- /dev/null +++ b/osx-package/osx-package.pmdoc/05gerbview-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/05gerbview.xml b/osx-package/osx-package.pmdoc/05gerbview.xml new file mode 100644 index 0000000000..9ddbfcdbf7 --- /dev/null +++ b/osx-package/osx-package.pmdoc/05gerbview.xml @@ -0,0 +1 @@ +net.sourceforge.kicad.gerbview1gerbview/gerbview.app/Applications/KicadparentinstallToinstallTo.isAbsoluteTypeversionincludeRootinstallTo.pathidentifierinstallFrom.path/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/06demos-contents.xml b/osx-package/osx-package.pmdoc/06demos-contents.xml new file mode 100644 index 0000000000..1d4dbf8390 --- /dev/null +++ b/osx-package/osx-package.pmdoc/06demos-contents.xml @@ -0,0 +1 @@ +modemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemodemode \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/06demos.xml b/osx-package/osx-package.pmdoc/06demos.xml new file mode 100644 index 0000000000..1a3386307c --- /dev/null +++ b/osx-package/osx-package.pmdoc/06demos.xml @@ -0,0 +1 @@ +net.sourceforge.kicad.demos1demos/Applications/KicadparentinstallTorequireAuthorizationinstallTo.isAbsoluteTypeinstallTo.isRelativeTypeincludeRootinstallTo.pathidentifierinstallFrom.path06demos-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$/CMake/cmake/Makefile \ No newline at end of file diff --git a/osx-package/osx-package.pmdoc/index.xml b/osx-package/osx-package.pmdoc/index.xml new file mode 100644 index 0000000000..5fbb7fa7b8 --- /dev/null +++ b/osx-package/osx-package.pmdoc/index.xml @@ -0,0 +1 @@ +Kicad/Users/marco/Development/kicad/kicad_d/Kicad.mpkgnet.sourceforge.kicadAUTHORS.txt01cvpcb.xml02eeschema.xml03pcbnew.xml04kicad.xml05gerbview.xml06demos.xmlproperties.anywhereDomainproperties.title \ No newline at end of file diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 65a08032e6..a9d44fc33a 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -52,8 +52,9 @@ set(PCBNEW_SRCS dialog_non_copper_zones_properties_base.cpp dialog_pad_properties.cpp dialog_pad_properties_base.cpp + dialog_pcbnew_config_libs_and_paths.cpp + dialog_pcbnew_config_libs_and_paths_fbp.cpp dialog_print_using_printer.cpp - dialog_setup_libs.cpp dialog_orient_footprints.cpp dialog_track_options.cpp dialog_track_options_base.cpp diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp b/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp new file mode 100644 index 0000000000..4d22d8f2b9 --- /dev/null +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp @@ -0,0 +1,366 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: dialog_pcbnew_config_libs_and_paths.cpp +// Author: jean-pierre Charras +// Created: 2009 apr 18 +// Licence: GPL +///////////////////////////////////////////////////////////////////////////// + +/* Handle the pcbnew library config (library list, and default lib path) + */ + +#include "fctsys.h" +#include +#include "appl_wxstruct.h" +#include "common.h" +#include "confirm.h" +#include "gestfich.h" +#include "pcbnew.h" + +#include "dialog_pcbnew_config_libs_and_paths.h" + + +/*****************************************************************/ +void WinEDA_PcbFrame::InstallConfigFrame( const wxPoint& pos ) +/*****************************************************************/ +{ + DIALOG_PCBNEW_CONFIG_LIBS dialog( this ); + dialog.ShowModal(); +} + + +DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( WinEDA_PcbFrame* parent ): + DIALOG_PCBNEW_CONFIG_LIBS_FBP(parent) +{ + m_Parent = parent; + m_Config = wxGetApp().m_EDA_CommonConfig; + + Init( ); + + wxString title = _( "from " ) + wxGetApp().m_CurrentOptionFile; + SetTitle( title ); + + if( GetSizer() ) + GetSizer()->SetSizeHints( this ); + +} + +/*************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::Init() +/*************************************/ +{ + SetFont( *g_DialogFont ); + SetFocus(); + + m_LibListChanged = false; + m_LibPathChanged = false; + m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path + + // Display current files extension (info) + wxString msg = m_InfoBoardFileExt->GetLabel() + PcbExtBuffer; + m_InfoBoardFileExt->SetLabel( msg ); + + msg = m_InfoCmpFileExt->GetLabel() + NetCmpExtBuffer; + m_InfoCmpFileExt->SetLabel( msg ); + + msg = m_InfoLibFileExt->GetLabel() + ModuleFileExtension; + m_InfoLibFileExt->SetLabel( msg ); + + msg = m_InfoNetlistFileExt->GetLabel() + NetExtBuffer; + m_InfoNetlistFileExt->SetLabel( msg ); + + m_ListLibr->InsertItems( g_LibName_List, 0 ); + + // Display current modules doc file: + m_Config->Read( wxT( "module_doc_file" ), g_DocModulesFileName ); + m_TextHelpModulesFileName->SetValue( g_DocModulesFileName ); + + // Load user libs paths: + wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) ); + while( Token.HasMoreTokens() ) + { + wxString path = Token.GetNextToken(); + if( wxFileName::DirExists( path ) ) + m_listUserPaths->Append(path); + } + + // Display actual libraries paths: + wxPathList libpaths = wxGetApp().GetLibraryPathList(); + for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) + { + m_DefaultLibraryPathslistBox->Append( libpaths[ii]); + } + + // select the first path afer the current path project + if ( libpaths.GetCount() > 1 ) + m_DefaultLibraryPathslistBox->Select( 1 ); +} + + +/******************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnCancelClick( wxCommandEvent& event ) +/******************************************************************/ +{ + // Recreate the user lib path + if ( m_LibPathChanged ) + { + for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) + wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii)) ; + wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1); + } + EndModal( -1 ); +} + + +/**************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnOkClick( wxCommandEvent& event ) +/**************************************************************/ +{ + m_Config->Write( wxT( "module_doc_file" ), + m_TextHelpModulesFileName->GetValue() ); + + // Recreate the user lib path + if ( m_LibPathChanged ) + { + g_UserLibDirBuffer.Empty(); + for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii ++ ) + { + if ( ii > 0 ) + g_UserLibDirBuffer << wxT(";"); + g_UserLibDirBuffer << m_listUserPaths->GetString(ii); + } + } + + + // Set new active library list if the lib list of if default path list was modified + if( m_LibListChanged || m_LibPathChanged ) + { + // Recreate lib list + g_LibName_List.Clear(); + for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) + g_LibName_List.Add(m_ListLibr->GetString(ii) ); + } + if ( event.GetId() != ID_SAVE_CFG ) + EndModal( 0 ); +} + +/**************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnCloseWindow( wxCloseEvent& event ) +/**************************************************************/ +{ + EndModal( 0 ); +} + + + +/*********************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnRemoveLibClick( wxCommandEvent& event ) +/*********************************************************************/ +/* Remove a library to the library list. + * The real list (g_LibName_List) is not changed, so the change can be cancelled + */ +{ + int ii; + + ii = m_ListLibr->GetSelection(); + if( ii < 0 ) + return; + + m_ListLibr->Delete(ii); + m_LibListChanged = TRUE; +} + + +/**************************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event ) +/**************************************************************************/ + +/* Insert or add a library to the library list: + * The new library is put in list before (insert button) the selection, + * or added (add button) to end of list + * The real list (g_LibName_List) is not changed, so the change can be cancelled + */ +{ + int ii; + wxString libfilename; + wxFileName fn; + + ii = m_ListLibr->GetSelection(); + if( ii == wxNOT_FOUND && event.GetId() != ID_ADD_LIB ) + ii = 0; + + wxString libpath; + libpath = m_DefaultLibraryPathslistBox->GetStringSelection(); + if ( libpath.IsEmpty() ) + libpath = wxGetApp().ReturnLastVisitedLibraryPath(); + + wxFileDialog FilesDialog( this, _( "Footprint library files:" ), libpath, + wxEmptyString, g_FootprintLibFileWildcard, + wxFD_DEFAULT_STYLE | wxFD_MULTIPLE ); + + if( FilesDialog.ShowModal() != wxID_OK ) + return; + + wxArrayString Filenames; + FilesDialog.GetPaths( Filenames ); + + for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ ) + { + fn = Filenames[jj]; + if ( jj == 0 ) + wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); + + /* If the library path is already in the library search paths + * list, just add the library name to the list. Otherwise, add + * the library name with the full or relative path. + * 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 + * + */ + if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case + libfilename = fn.GetName(); + else // not in the default, : see if this file is in a subpath: + { + libfilename = fn.GetPathWithSep() + fn.GetName(); + for ( unsigned kk = 0; kk < wxGetApp().GetLibraryPathList().GetCount(); kk ++ ) + { + if( fn.MakeRelativeTo(wxGetApp().GetLibraryPathList()[kk] ) ) + { + libfilename = fn.GetPathWithSep() + fn.GetName(); + break; + } + } + } + + //Add or insert new library name, if not already in list + if( m_ListLibr->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND ) + { + m_LibListChanged = TRUE; + if( event.GetId() == ID_ADD_LIB ) + m_ListLibr->Append( libfilename ); + else + m_ListLibr->Insert( libfilename, ii++ ); + } + else + { + wxString msg = wxT( "<" ) + libfilename + wxT( "> : " ) + + _( "Library already in use" ); + DisplayError( this, msg ); + } + } +} + + + +/*******************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnSaveCfgClick( wxCommandEvent& event ) +/*******************************************************************/ +{ + OnOkClick( event ); + m_Parent->Update_config( this ); +} + + +/***********************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertPath( wxCommandEvent& event ) +/***********************************************************************/ +{ + wxString path = wxGetApp().ReturnLastVisitedLibraryPath(); + + bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), /* Titre de la fenetre */ + path, /* Chemin par defaut */ + wxDD_DEFAULT_STYLE, + this, /* parent frame */ + wxDefaultPosition ); + + if( !select ) + return; + + if( ! wxFileName::DirExists( path ) ) // Should not occurs + return; + + // Add or insert path if not already in list + if( m_listUserPaths->FindString( path ) == wxNOT_FOUND ) + { + int ipos = m_listUserPaths->GetCount(); + if ( event.GetId() == wxID_INSERT_PATH ) + { + if ( ipos ) ipos--; + int jj = m_listUserPaths->GetSelection(); + if ( jj >= 0 ) + ipos = jj; + } + m_listUserPaths->Insert(path, ipos); + m_LibPathChanged = true; + wxGetApp().InsertLibraryPath( path, ipos+1 ); + + // Display actual libraries paths: + wxPathList libpaths = wxGetApp().GetLibraryPathList(); + m_DefaultLibraryPathslistBox->Clear(); + for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) + { + m_DefaultLibraryPathslistBox->Append( libpaths[ii]); + } + } + + else + DisplayError(this, _("Path already in use") ); + + wxGetApp().SaveLastVisitedLibraryPath( path ); + +} + + +/***********************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnRemoveUserPath( wxCommandEvent& event ) +/***********************************************************************/ +{ + int ii = m_listUserPaths->GetSelection(); + if ( ii < 0 ) + ii = m_listUserPaths->GetCount()-1; + if ( ii >= 0 ) + { + wxGetApp().RemoveLibraryPath( m_listUserPaths->GetStringSelection() ); + m_listUserPaths->Delete( ii ); + m_LibPathChanged = true; + } + + // Display actual libraries paths: + wxPathList libpaths = wxGetApp().GetLibraryPathList(); + m_DefaultLibraryPathslistBox->Clear(); + for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) + { + m_DefaultLibraryPathslistBox->Append( libpaths[ii]); + } +} + +/**************************************************************************/ +void DIALOG_PCBNEW_CONFIG_LIBS::OnBrowseModDocFile( wxCommandEvent& event ) +/**************************************************************************/ +{ + wxString FullFileName, mask; + wxString docpath, filename; + + docpath = wxGetApp().ReturnLastVisitedLibraryPath(wxT( "doc" )); + + mask = wxT( "*.pdf" ); + + wxFileDialog FilesDialog( this, _( "Footprint document file:" ), docpath, + wxEmptyString, mask, + wxFD_DEFAULT_STYLE ); + + if( FilesDialog.ShowModal() != wxID_OK ) + return; + + FullFileName = FilesDialog.GetPath( ); + /* If the path is already in the library search paths + * list, just add the library name to the list. Otherwise, add + * the library name with the full or relative path. + * 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 + */ + wxFileName fn = FullFileName; + wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); + + filename = wxGetApp().ReturnFilenameWithRelativePathInLibPath(FullFileName); + m_TextHelpModulesFileName->SetValue( filename ); +} diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths.h b/pcbnew/dialog_pcbnew_config_libs_and_paths.h new file mode 100644 index 0000000000..65e6194e56 --- /dev/null +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths.h @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: dialog_pcbnew_config_libs_and_paths.h +// Author: jean-pierre Charras +// Licence: GPL +///////////////////////////////////////////////////////////////////////////// + +#ifndef _DIALOG_PCBNEW_CONFIG_LIBS_H_ +#define _DIALOG_PCBNEW_CONFIG_LIBS_H_ + +#include "dialog_pcbnew_config_libs_and_paths_fbp.h" + +class DIALOG_PCBNEW_CONFIG_LIBS : public DIALOG_PCBNEW_CONFIG_LIBS_FBP +{ +private: + WinEDA_PcbFrame* m_Parent; + wxConfig * m_Config; + bool m_LibListChanged; + bool m_LibPathChanged; + wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer + +private: + + // event handlers, overiding the fbp handlers + void Init(); + void OnCloseWindow( wxCloseEvent& event ); + void OnSaveCfgClick( wxCommandEvent& event ); + void OnRemoveLibClick( wxCommandEvent& event ); + void OnAddOrInsertLibClick( wxCommandEvent& event ); + void OnAddOrInsertPath( wxCommandEvent& event ); + void OnOkClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); + void OnRemoveUserPath( wxCommandEvent& event ); + void OnBrowseModDocFile( wxCommandEvent& event ); + + +public: + DIALOG_PCBNEW_CONFIG_LIBS( WinEDA_PcbFrame * parent ); + ~DIALOG_PCBNEW_CONFIG_LIBS() {}; +}; + +#endif // _DIALOG_PCBNEW_CONFIG_LIBS_H_ diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp new file mode 100644 index 0000000000..118c5c790a --- /dev/null +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp @@ -0,0 +1,198 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_pcbnew_config_libs_and_paths_fbp.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_PCBNEW_CONFIG_LIBS_FBP::DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bUpperSizer; + bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sFileExtBox; + sFileExtBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Files ext:") ), wxVERTICAL ); + + m_InfoBoardFileExt = new wxStaticText( this, wxID_ANY, _("Board file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); + m_InfoBoardFileExt->Wrap( -1 ); + sFileExtBox->Add( m_InfoBoardFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + 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 ); + + bLeftSizer->Add( sFileExtBox, 0, wxEXPAND, 5 ); + + bUpperSizer->Add( bLeftSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + wxStaticBoxSizer* sbLibsChoiceSizer; + sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Libraries") ), wxVERTICAL ); + + wxBoxSizer* bLibsButtonsSizer; + bLibsButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + sbLibsChoiceSizer->Add( bLibsButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticTextlibList = new wxStaticText( this, wxID_ANY, _("Active Libraries:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextlibList->Wrap( -1 ); + sbLibsChoiceSizer->Add( m_staticTextlibList, 0, wxTOP|wxRIGHT|wxLEFT, 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( 300,-1 ) ); + + sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bUpperSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + 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") ); + + bRightSizer->Add( m_buttonAddLib, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); + + bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); + + bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 ); + + m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->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") ); + + bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + wxStaticBoxSizer* sbModulesDocSizer; + sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Module Doc File:") ), wxHORIZONTAL ); + + m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALL, 5 ); + + m_buttonModDoc = new wxButton( this, wxID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + sbModulesDocSizer->Add( m_buttonModDoc, 0, wxALL, 5 ); + + bMainSizer->Add( sbModulesDocSizer, 0, 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; + sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Path:") ), wxHORIZONTAL ); + + wxBoxSizer* bUserListSizer; + bUserListSizer = new wxBoxSizer( wxVERTICAL ); + + m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); + + bUserListSizer->Add( m_listUserPaths, 1, wxEXPAND, 5 ); + + sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxBoxSizer* bUserPathsButtonsSizer; + bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxRIGHT|wxLEFT, 5 ); + + m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); + + bUserLibPathSizer->Add( sbSizer4, 1, wxEXPAND, 5 ); + + sbLibPathSizer->Add( bUserLibPathSizer, 1, wxEXPAND, 5 ); + + m_staticTextcurrenpaths = new wxStaticText( this, wxID_ANY, _("Current Full Paths for Libraries Files in Use:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextcurrenpaths->Wrap( -1 ); + 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->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 ) ); + + sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bMainSizer->Add( sbLibPathSizer, 0, wxEXPAND, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCloseWindow ) ); + m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); + m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnSaveCfgClick ), NULL, this ); + m_buttonModDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); + m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); +} + +DIALOG_PCBNEW_CONFIG_LIBS_FBP::~DIALOG_PCBNEW_CONFIG_LIBS_FBP() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCloseWindow ) ); + m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); + m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); + m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnSaveCfgClick ), NULL, this ); + m_buttonModDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); + m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); +} diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.fbp b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.fbp new file mode 100644 index 0000000000..8a4a42d7b2 --- /dev/null +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.fbp @@ -0,0 +1,1324 @@ + + + + + + C++ + 1 + UTF-8 + connect + dialog_pcbnew_config_libs_and_paths_fbp + 1000 + none + 1 + dialog_pcbnew_config_libs_and_paths_fbp + + . + + 1 + 1 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + + DIALOG_PCBNEW_CONFIG_LIBS_FBP + + 593,612 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + + + + + + + + + OnCloseWindow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + + bUpperSizer + wxHORIZONTAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + wxID_ANY + Files ext: + + sFileExtBox + wxVERTICAL + none + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Board file Ext: + + + m_InfoBoardFileExt + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Cmp file Ext: + + + m_InfoCmpFileExt + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Library file Ext: + + + m_InfoLibFileExt + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Netlist file Ext: + + + m_InfoNetlistFileExt + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + wxID_ANY + Libraries + + sbLibsChoiceSizer + wxVERTICAL + none + + + 5 + wxALIGN_CENTER_HORIZONTAL + 0 + + + bLibsButtonsSizer + wxHORIZONTAL + none + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Active Libraries: + + + m_staticTextlibList + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + + + + 1 + + + 0 + wxID_ANY + + 300,-1 + m_ListLibr + protected + + + wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + + List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bRightSizer + wxVERTICAL + none + + 5 + wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL + 0 + + + + 0 + 1 + + + 0 + ID_ADD_LIB + Add + + + m_buttonAddLib + protected + + + + + Add a new library after the selected library, and load it + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT + 0 + + + + 0 + 1 + + + 0 + wxID_ANY + Insert + + + m_buttonIns + protected + + + + + Add a new library before the selected library, and load it + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + + + 0 + 1 + + + 0 + ID_REMOVE_LIB + Remove + + + m_buttonRemoveLib + protected + + + + + Unload the selected library + + + + OnRemoveLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 20 + protected + 0 + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + + + 0 + 1 + + + 0 + wxID_OK + Ok + + + m_buttonOk + protected + + + + + + + + + OnOkClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 0 + 1 + + + 0 + wxID_CANCEL + Cancel + + + m_buttonCancel + protected + + + + + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + + + 0 + 1 + + + 0 + ID_SAVE_CFG + Save Cfg + + + m_buttonSave + protected + + + + + Accept and save current configuration setting in the local .pro file + + + + OnSaveCfgClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + wxID_ANY + Module Doc File: + + sbModulesDocSizer + wxHORIZONTAL + none + + + 5 + wxALL + 1 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_TextHelpModulesFileName + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 0 + 1 + + + 0 + wxID_BROWSE_MOD_DOC + Browse + + + m_buttonModDoc + protected + + + + + + + + + OnBrowseModDocFile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + wxID_ANY + Path for Libraries Files: + + sbLibPathSizer + wxVERTICAL + none + + + 5 + wxEXPAND + 1 + + + bUserLibPathSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + wxID_ANY + User Path: + + sbSizer4 + wxHORIZONTAL + none + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 1 + + + bUserListSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + + + + 1 + + + 0 + wxID_ANY + + + m_listUserPaths + protected + + + + + Additional paths used in this project. The priority is highter than default Kicad paths. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bUserPathsButtonsSizer + wxVERTICAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + + + + 0 + 1 + + + 0 + ID_LIB_PATH_SEL + Add + + + m_buttonAddPath + protected + + + + + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 0 + 1 + + + 0 + wxID_INSERT_PATH + Insert + + + m_buttonInsPath + protected + + + + + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 0 + 1 + + + 0 + wxID_REMOVE_PATH + Remove + + + m_buttonRemovePath + protected + + + + + + + + + OnRemoveUserPath + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Current Full Paths for Libraries Files in Use: + + + m_staticTextcurrenpaths + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + + 1 + + + 0 + wxID_ANY + + -1,70 + m_DefaultLibraryPathslistBox + protected + + + wxLB_NEEDED_SB + + Paths (system paths and user paths) used to search and load libraries files and component doc files. Sorted by decreasing priority order. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.h b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.h new file mode 100644 index 0000000000..dd83032020 --- /dev/null +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.h @@ -0,0 +1,89 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_pcbnew_config_libs_and_paths_fbp__ +#define __dialog_pcbnew_config_libs_and_paths_fbp__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_PCBNEW_CONFIG_LIBS_FBP +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_PCBNEW_CONFIG_LIBS_FBP : public wxDialog +{ + private: + + protected: + enum + { + ID_ADD_LIB = 1000, + ID_REMOVE_LIB, + ID_SAVE_CFG, + wxID_BROWSE_MOD_DOC, + ID_LIB_PATH_SEL, + wxID_INSERT_PATH, + wxID_REMOVE_PATH, + }; + + wxStaticText* m_InfoBoardFileExt; + wxStaticText* m_InfoCmpFileExt; + wxStaticText* m_InfoLibFileExt; + wxStaticText* m_InfoNetlistFileExt; + wxStaticText* m_staticTextlibList; + wxListBox* m_ListLibr; + wxButton* m_buttonAddLib; + wxButton* m_buttonIns; + wxButton* m_buttonRemoveLib; + + wxButton* m_buttonOk; + wxButton* m_buttonCancel; + wxButton* m_buttonSave; + 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 OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveLibClick( wxCommandEvent& 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 OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } + + + public: + DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 593,612 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_PCBNEW_CONFIG_LIBS_FBP(); + +}; + +#endif //__dialog_pcbnew_config_libs_and_paths_fbp__ diff --git a/pcbnew/dialog_setup_libs.cpp b/pcbnew/dialog_setup_libs.cpp deleted file mode 100644 index b4315100e1..0000000000 --- a/pcbnew/dialog_setup_libs.cpp +++ /dev/null @@ -1,522 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// - -// Name: dialog_pcbnew_config.cpp -// Purpose: -// Author: jean-pierre Charras -// Modified by: -// Created: 18/02/2006 16:41:57 -// RCS-ID: -// Copyright: License GNU -// Licence: -///////////////////////////////////////////////////////////////////////////// - -/* Handle the pcbnew libary config (library list, and default lib path) - */ - -// Generated by DialogBlocks (unregistered), 18/02/2006 16:41:57 - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "dialog_pcbnew_config.h" -#endif - -#include "fctsys.h" -#include "appl_wxstruct.h" -#include "gr_basic.h" -#include "common.h" -#include "confirm.h" -#include "gestfich.h" -#include "pcbnew.h" - -////@begin includes -////@end includes - -#include "dialog_setup_libs.h" - -////@begin XPM images -////@end XPM images - -/*****************************************************************/ -void WinEDA_PcbFrame::InstallConfigFrame( const wxPoint& pos ) -/*****************************************************************/ -{ - KiConfigPcbnewFrame* CfgFrame = new KiConfigPcbnewFrame( this ); - - CfgFrame->ShowModal(); CfgFrame->Destroy(); -} - - -/*! - * KiConfigPcbnewFrame type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( KiConfigPcbnewFrame, wxDialog ) - -/*! - * KiConfigPcbnewFrame event table definition - */ - -BEGIN_EVENT_TABLE( KiConfigPcbnewFrame, wxDialog ) - -////@begin KiConfigPcbnewFrame event table entries - EVT_CLOSE( KiConfigPcbnewFrame::OnCloseWindow ) - - EVT_BUTTON( SAVE_CFG, KiConfigPcbnewFrame::OnSaveCfgClick ) - - EVT_BUTTON( DEL_LIB, KiConfigPcbnewFrame::OnDelLibClick ) - - EVT_BUTTON( ADD_LIB, KiConfigPcbnewFrame::OnAddLibClick ) - - EVT_BUTTON( INSERT_LIB, KiConfigPcbnewFrame::OnInsertLibClick ) - -////@end KiConfigPcbnewFrame event table entries - -END_EVENT_TABLE() - -/*! - * KiConfigPcbnewFrame constructors - */ - -KiConfigPcbnewFrame::KiConfigPcbnewFrame() -{ -} - - -KiConfigPcbnewFrame::KiConfigPcbnewFrame( WinEDA_PcbFrame* parent, - wxWindowID id, - const wxString& caption, - const wxPoint& pos, - const wxSize& size, - long style ) -{ - wxString title; - wxConfig* cfg = wxGetApp().m_EDA_CommonConfig; - - m_Parent = parent; - m_LibModified = FALSE; - - Create( parent, id, caption, pos, size, style ); - - title = _( "from " ) + wxGetApp().m_CurrentOptionFile; - SetTitle( title ); - m_ListLibr->InsertItems( g_LibName_List, 0 ); - wxString DocModuleFileName = cfg->Read( wxT( "module_doc_file" ), - wxT( "pcbnew/footprints.pdf" ) ); - m_TextHelpModulesFileName->SetValue( DocModuleFileName ); -} - - -/*! - * KiConfigPcbnewFrame creator - */ - -bool KiConfigPcbnewFrame::Create( wxWindow* parent, - wxWindowID id, - const wxString& caption, - const wxPoint& pos, - const wxSize& size, - long style ) -{ -////@begin KiConfigPcbnewFrame member initialisation - m_FileExtList = NULL; - m_ListLibr = NULL; - m_TextLibDir = NULL; - m_TextHelpModulesFileName = NULL; - -////@end KiConfigPcbnewFrame member initialisation - -////@begin KiConfigPcbnewFrame creation - SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS ); - wxDialog::Create( parent, id, caption, pos, size, style ); - - CreateControls(); - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); - Centre(); - -////@end KiConfigPcbnewFrame creation - return true; -} - - -/*! - * Control creation for KiConfigPcbnewFrame - */ - -void KiConfigPcbnewFrame::CreateControls() -{ - SetFont( *g_DialogFont ); - -////@begin KiConfigPcbnewFrame content construction - // Generated by DialogBlocks, 18/02/2006 17:19:54 (unregistered) - - KiConfigPcbnewFrame* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL ); - itemDialog1->SetSizer( itemBoxSizer2 ); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL ); - itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 ); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL ); - itemBoxSizer3->Add( itemBoxSizer4, 0, wxGROW | wxALL, 5 ); - - wxButton* itemButton5 = - new wxButton( itemDialog1, SAVE_CFG, _( - "Save Cfg" ), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton5->SetForegroundColour( wxColour( 204, 0, 0 ) ); - itemBoxSizer4->Add( itemButton5, 0, wxGROW | wxALL, 5 ); - - itemBoxSizer4->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 ); - - wxStaticBox* itemStaticBoxSizer7Static = - new wxStaticBox( itemDialog1, wxID_ANY, _( - "Files ext:" ) ); - m_FileExtList = new wxStaticBoxSizer( itemStaticBoxSizer7Static, - wxVERTICAL ); - itemBoxSizer4->Add( m_FileExtList, 0, wxGROW | wxALL, 5 ); - - wxBoxSizer* itemBoxSizer8 = new wxBoxSizer( wxVERTICAL ); - itemBoxSizer3->Add( itemBoxSizer8, - 0, - wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); - - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxHORIZONTAL ); - itemBoxSizer8->Add( itemBoxSizer9, - 0, - wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT | - wxBOTTOM, - 5 ); - - wxBoxSizer* itemBoxSizer10 = new wxBoxSizer( wxVERTICAL ); - itemBoxSizer9->Add( itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* itemBoxSizer11 = new wxBoxSizer( wxHORIZONTAL ); - itemBoxSizer10->Add( itemBoxSizer11, - 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, - 5 ); - - wxButton* itemButton12 = new wxButton( itemDialog1, DEL_LIB, _( - "Del" ), wxDefaultPosition, - wxDefaultSize, 0 ); - itemButton12->SetForegroundColour( wxColour( 204, 0, 0 ) ); - itemBoxSizer11->Add( itemButton12, 0, wxGROW | wxALL, 5 ); - - wxButton* itemButton13 = new wxButton( itemDialog1, ADD_LIB, _( - "Add" ), wxDefaultPosition, - wxDefaultSize, 0 ); - itemButton13->SetForegroundColour( wxColour( 0, 128, 0 ) ); - itemBoxSizer11->Add( itemButton13, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); - - wxButton* itemButton14 = new wxButton( itemDialog1, INSERT_LIB, _( - "Ins" ), wxDefaultPosition, - wxDefaultSize, 0 ); - itemButton14->SetDefault(); - itemButton14->SetForegroundColour( wxColour( 0, 0, 255 ) ); - itemBoxSizer11->Add( itemButton14, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); - - wxBoxSizer* itemBoxSizer15 = new wxBoxSizer( wxVERTICAL ); - itemBoxSizer10->Add( itemBoxSizer15, 0, wxGROW | wxALL, 5 ); - - wxStaticText* itemStaticText16 = new wxStaticText( itemDialog1, - wxID_STATIC, - _( "Libraries" ), - wxDefaultPosition, - wxDefaultSize, - 0 ); - itemStaticText16->SetForegroundColour( wxColour( 204, 0, 0 ) ); - itemBoxSizer15->Add( itemStaticText16, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, - 5 ); - - wxString* m_ListLibrStrings = NULL; - m_ListLibr = new wxListBox( itemDialog1, - ID_LIST_LIBS, - wxDefaultPosition, - wxSize( -1, 200 ), - 0, - m_ListLibrStrings, - wxLB_SINGLE | wxSUNKEN_BORDER ); - itemBoxSizer15->Add( m_ListLibr, - 0, - wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); - - wxStaticText* itemStaticText18 = new wxStaticText( itemDialog1, - wxID_STATIC, - _( "Lib Modules Dir:" ), - wxDefaultPosition, - wxDefaultSize, - wxALIGN_LEFT ); - itemStaticText18->SetForegroundColour( wxColour( 204, 0, 0 ) ); - itemBoxSizer2->Add( itemStaticText18, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, - 5 ); - - m_TextLibDir = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( - "" ), wxDefaultPosition, wxDefaultSize, - 0 ); - itemBoxSizer2->Add( m_TextLibDir, - 0, - wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); - - wxStaticText* itemStaticText20 = new wxStaticText( itemDialog1, - wxID_STATIC, - _( "Module Doc File:" ), - wxDefaultPosition, - wxDefaultSize, - wxALIGN_LEFT ); - itemStaticText20->SetForegroundColour( wxColour( 204, 0, 0 ) ); - itemBoxSizer2->Add( itemStaticText20, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, - 5 ); - - m_TextHelpModulesFileName = - new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T( - "" ), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer2->Add( m_TextHelpModulesFileName, - 0, - wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); - - // Set validators - m_TextLibDir->SetValidator( wxTextValidator( wxFILTER_NONE, - &g_UserLibDirBuffer ) ); - -////@end KiConfigPcbnewFrame content construction - wxString msg = _( "Board ext: " ) + PcbExtBuffer; - wxStaticText* text = new wxStaticText( itemDialog1, - -1, - msg, - wxDefaultPosition, - wxDefaultSize, - 0 ); - m_FileExtList->Add( text, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, - 5 ); - - msg = _( "Cmp ext: " ) + NetCmpExtBuffer; - text = new wxStaticText( itemDialog1, - -1, - msg, - wxDefaultPosition, - wxDefaultSize, - 0 ); - m_FileExtList->Add( text, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, - 5 ); - - msg = _( "Lib ext: " ) + ModuleFileExtension; - text = new wxStaticText( itemDialog1, - -1, - msg, - wxDefaultPosition, - wxDefaultSize, - 0 ); - m_FileExtList->Add( text, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, - 5 ); - - msg = _( "Net ext: " ) + NetExtBuffer; - text = new wxStaticText( itemDialog1, - -1, - msg, - wxDefaultPosition, - wxDefaultSize, - 0 ); - m_FileExtList->Add( text, - 0, - wxALIGN_LEFT | wxLEFT | wxRIGHT | wxADJUST_MINSIZE, - 5 ); -} - - -/*! - * wxEVT_CLOSE_WINDOW event handler for ID_DIALOG - */ - -void KiConfigPcbnewFrame::OnCloseWindow( wxCloseEvent& event ) -{ - SetNewOptions(); - EndModal( 0 ); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for SAVE_CFG - */ - -void KiConfigPcbnewFrame::OnSaveCfgClick( wxCommandEvent& event ) -{ - SetNewOptions(); - m_Parent->Update_config( this ); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for DEL_LIB - */ - -void KiConfigPcbnewFrame::OnDelLibClick( wxCommandEvent& event ) -{ - LibDelFct( event ); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ADD_LIB - */ - -void KiConfigPcbnewFrame::OnAddLibClick( wxCommandEvent& event ) -{ - LibInsertFct( event ); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for INSERT_LIB - */ - -void KiConfigPcbnewFrame::OnInsertLibClick( wxCommandEvent& event ) -{ - LibInsertFct( event ); -} - - -/*! - * Should we show tooltips? - */ - -bool KiConfigPcbnewFrame::ShowToolTips() -{ - return true; -} - - -/*! - * Get bitmap resources - */ - -wxBitmap KiConfigPcbnewFrame::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin KiConfigPcbnewFrame bitmap retrieval - wxUnusedVar( name ); - return wxNullBitmap; - -////@end KiConfigPcbnewFrame bitmap retrieval -} - - -/*! - * Get icon resources - */ - -wxIcon KiConfigPcbnewFrame::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin KiConfigPcbnewFrame icon retrieval - wxUnusedVar( name ); - return wxNullIcon; - -////@end KiConfigPcbnewFrame icon retrieval -} - - -/********************************************/ -void KiConfigPcbnewFrame::SetNewOptions() -/********************************************/ -{ - wxConfig* cfg = wxGetApp().m_EDA_CommonConfig; - - g_UserLibDirBuffer = m_TextLibDir->GetValue(); - cfg->Write( wxT( "module_doc_file" ), - m_TextHelpModulesFileName->GetValue() ); -} - - -/********************************************************/ -void KiConfigPcbnewFrame::LibDelFct( wxCommandEvent& event ) -/********************************************************/ -{ - int ii; - - ii = m_ListLibr->GetSelection(); - if( ii < 0 ) - return; - - g_LibName_List.RemoveAt( ii ); - - m_ListLibr->Clear(); - m_ListLibr->InsertItems( g_LibName_List, 0 ); - m_LibModified = TRUE; -} - - -/************************************************************* - * Insert or add a library to the existing library list: - * New library is put in list before (insert) or after (add) - * the selection. - * - *************************************************************/ -void KiConfigPcbnewFrame::LibInsertFct( wxCommandEvent& event ) -{ - int ii; - wxFileName fn; - wxString tmp; - - ii = m_ListLibr->GetSelection(); - if( ii == wxNOT_FOUND && event.GetId() == INSERT_LIB ) - ii = 0; - - SetNewOptions(); - - wxFileDialog FilesDialog( this, _( "Foot Print Library Files" ), - wxEmptyString, wxEmptyString, - ModuleFileWildcard, wxFD_OPEN | wxFD_MULTIPLE ); - - if( FilesDialog.ShowModal() != wxID_OK ) - return; - - wxArrayString Filenames; - FilesDialog.GetPaths( Filenames ); - - for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ ) - { - fn = Filenames[jj]; - - /* If the library path is already in the library search paths - * list, just add the library name to the list. Otherwise, add - * the library name with the full path. */ - if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) == wxNOT_FOUND ) - tmp = fn.GetPathWithSep() + fn.GetName(); - else - tmp = fn.GetName(); - - // Add or insert new library name. - if( g_LibName_List.Index( tmp, fn.IsCaseSensitive() ) == wxNOT_FOUND ) - { - m_LibModified = TRUE; - if( event.GetId() == ADD_LIB ) - g_LibName_List.Add( tmp ); - else - g_LibName_List.Insert( tmp, ii++ ); - m_ListLibr->Clear(); - m_ListLibr->InsertItems( g_LibName_List, 0 ); - } - else - { - wxString msg = wxT( "<" ) + tmp + wxT( "> : " ) + - _( "Library already in use" ); - DisplayError( this, msg ); - } - } -} diff --git a/pcbnew/dialog_setup_libs.h b/pcbnew/dialog_setup_libs.h deleted file mode 100644 index 32ad259921..0000000000 --- a/pcbnew/dialog_setup_libs.h +++ /dev/null @@ -1,133 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_pcbnew_config.h -// Purpose: -// Author: jean-pierre Charras -// Modified by: -// Created: 18/02/2006 16:41:57 -// RCS-ID: -// Copyright: License GNU -// Licence: -///////////////////////////////////////////////////////////////////////////// - -// Generated by DialogBlocks (unregistered), 18/02/2006 16:41:57 - -#ifndef _DIALOG_PCBNEW_CONFIG_H_ -#define _DIALOG_PCBNEW_CONFIG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "dialog_pcbnew_config.h" -#endif - -/*! - * Includes - */ - -////@begin includes -#include "wx/valtext.h" -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define ID_DIALOG 10000 -#define SYMBOL_KICONFIGPCBNEWFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER -#define SYMBOL_KICONFIGPCBNEWFRAME_TITLE _("Dialog") -#define SYMBOL_KICONFIGPCBNEWFRAME_IDNAME ID_DIALOG -#define SYMBOL_KICONFIGPCBNEWFRAME_SIZE wxSize(400, 300) -#define SYMBOL_KICONFIGPCBNEWFRAME_POSITION wxDefaultPosition -#define SAVE_CFG 10001 -#define DEL_LIB 10002 -#define ADD_LIB 10003 -#define INSERT_LIB 10004 -#define ID_LIST_LIBS 10005 -#define ID_TEXTCTRL 10007 -#define ID_TEXTCTRL1 10008 -////@end control identifiers - -/*! - * Compatibility - */ - -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif - -/*! - * KiConfigPcbnewFrame class declaration - */ - -class KiConfigPcbnewFrame: public wxDialog -{ - DECLARE_DYNAMIC_CLASS( KiConfigPcbnewFrame ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - KiConfigPcbnewFrame( ); - KiConfigPcbnewFrame( WinEDA_PcbFrame* parent, wxWindowID id = SYMBOL_KICONFIGPCBNEWFRAME_IDNAME, const wxString& caption = SYMBOL_KICONFIGPCBNEWFRAME_TITLE, const wxPoint& pos = SYMBOL_KICONFIGPCBNEWFRAME_POSITION, const wxSize& size = SYMBOL_KICONFIGPCBNEWFRAME_SIZE, long style = SYMBOL_KICONFIGPCBNEWFRAME_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = SYMBOL_KICONFIGPCBNEWFRAME_IDNAME, const wxString& caption = SYMBOL_KICONFIGPCBNEWFRAME_TITLE, const wxPoint& pos = SYMBOL_KICONFIGPCBNEWFRAME_POSITION, const wxSize& size = SYMBOL_KICONFIGPCBNEWFRAME_SIZE, long style = SYMBOL_KICONFIGPCBNEWFRAME_STYLE ); - - /// Creates the controls and sizers - void CreateControls(); - -////@begin KiConfigPcbnewFrame event handler declarations - - /// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG - void OnCloseWindow( wxCloseEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for SAVE_CFG - void OnSaveCfgClick( 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 ); - -////@end KiConfigPcbnewFrame event handler declarations - -////@begin KiConfigPcbnewFrame member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end KiConfigPcbnewFrame member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - - void SaveCfg(wxCommandEvent& event); - void LibDelFct(wxCommandEvent& event); - void LibInsertFct(wxCommandEvent& event); - void SetNewOptions(); - -////@begin KiConfigPcbnewFrame member variables - wxStaticBoxSizer* m_FileExtList; - wxListBox* m_ListLibr; - wxTextCtrl* m_TextLibDir; - wxTextCtrl* m_TextHelpModulesFileName; -////@end KiConfigPcbnewFrame member variables - - WinEDA_PcbFrame * m_Parent; - bool m_LibModified; - -}; - -#endif - // _DIALOG_PCBNEW_CONFIG_H_ diff --git a/pcbnew/dialog_setup_libs.pjd b/pcbnew/dialog_setup_libs.pjd deleted file mode 100644 index 185cd9031c..0000000000 --- a/pcbnew/dialog_setup_libs.pjd +++ /dev/null @@ -1,1123 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - 28 - "" - 0 - 0 - 0 - 1 - 1 - 0 - "jean-pierre Charras" - "License GNU" - "" - 0 - "<All platforms>" - "<Any>" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - " -/*! - * %BODY% - */ - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "<System>" - "<System>" - "" - 0 - 1 - 1 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 0 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "Untitled" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "17/2/2006" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "wxEVT_CLOSE_WINDOW|OnCloseWindow" - "ID_DIALOG" - 10000 - "KiConfigPcbnewFrame" - "wxDialog" - "wxDialog" - "dialog_setup_libs.cpp" - "dialog_setup_libs.h" - "" - "Dialog" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "MAYBE_RESIZE_BORDER" - 0 - 1 - -1 - -1 - 400 - 300 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: SAVE_CFG" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnSaveCfgClick" - "SAVE_CFG" - 10001 - "wxButton" - "" - "Save Cfg" - 0 - "" - "" - "" - "CC0000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/4/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Files ext:" - "m_FileExtList" - "" - "" - 0 - 1 - "Vertical" - "" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: DEL_LIB" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnDelLibClick" - "DEL_LIB" - 10002 - "wxButton" - "" - "Del" - 0 - "" - "" - "" - "CC0000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ADD_LIB" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnAddLibClick" - "ADD_LIB" - 10003 - "wxButton" - "" - "Add" - 0 - "" - "" - "" - "008000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: INSERT_LIB" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnInsertLibClick" - "INSERT_LIB" - 10004 - "wxButton" - "" - "Ins" - 1 - "" - "" - "" - "0000FF" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "wxStaticText" - "" - "Libraries" - "" - "" - "" - "CC0000" - "" - 0 - 1 - "<Any platform>" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 1 - 0 - "" - "" - - - "wxListBox: ID_LIST_LIBS" - "dialog-control-document" - "" - "listbox" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbListBoxProxy" - "ID_LIST_LIBS" - 10005 - "wxListBox" - "m_ListLibr" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - -1 - -1 - -1 - 200 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "wxStaticText" - "" - "Lib Modules Dir:" - "" - "" - "" - "CC0000" - "" - 0 - 1 - "<Any platform>" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Top" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRL" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL" - 10007 - "wxTextCtrl" - "m_TextLibDir" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "g_UserLibDirBuffer" - "wxTextValidator(wxFILTER_NONE, & %VARIABLE%)" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/3/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "wxStaticText" - "" - "Module Doc File:" - "" - "" - "" - "CC0000" - "" - 0 - 1 - "<Any platform>" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Top" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRL1" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/3/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL1" - 10008 - "wxTextCtrl" - "m_TextHelpModulesFileName" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - "dialog_setup_libs.rc" - "source-editor-document" - "dialog_setup_libs.rc" - "source-editor" - 0 - 0 - 1 - 0 - "17/2/2006" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index d28884df1d..5a98b3709c 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -1029,10 +1029,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC: { wxConfig* cfg = wxGetApp().m_EDA_CommonConfig; - wxString msg = FindKicadHelpPath(); - msg += cfg->Read( wxT( "module_doc_file" ), - wxT( "pcbnew/footprints.pdf" ) ); - GetAssociatedDocument( this, msg ); + cfg->Read( wxT( "module_doc_file" ), g_DocModulesFileName ); + GetAssociatedDocument( this, g_DocModulesFileName, &wxGetApp().GetLibraryPathList() ); } break; diff --git a/pcbnew/makefile.include b/pcbnew/makefile.include index 010b988a44..6387e966fc 100644 --- a/pcbnew/makefile.include +++ b/pcbnew/makefile.include @@ -64,7 +64,8 @@ OBJECTS= $(TARGET).o\ locate.o \ modules.o \ loadcmp.o \ - dialog_setup_libs.o \ + dialog_pcbnew_config_libs_and_paths.o\ + dialog_pcbnew_config_libs_and_paths_fbp.o\ dialog_general_options.o \ dialog_general_options_BoardEditor_base.o\ dialog_display_options_base.o\ @@ -181,7 +182,7 @@ affiche.o: affiche.cpp tr_modif.o: tr_modif.cpp -dialog_setup_libs.o: dialog_setup_libs.cpp +dialog_pcbnew_config_libs_and_paths.o: dialog_pcbnew_config_libs_and_paths.cpp dialog_pcbnew_config_libs_and_paths_fbp.h initpcb.o: initpcb.cpp dialog_initpcb.cpp dialog_initpcb.h diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 01b91d542a..d8b358bef3 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -87,6 +87,16 @@ bool Plot_Pads_All_Layers; /* Plot pads meme n'appartenant pas a la couche ( utile pour serigraphie) */ +// Wildcard for footprint libraries filesnames +const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file " \ + "(*.mod)|*.mod" ) ); +/* 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 = wxT("footprints_doc/footprints.pdf"); + IMPLEMENT_APP( WinEDA_App ) /****************************/ diff --git a/pcbnew/pcbnew.h b/pcbnew/pcbnew.h index 6036c1ffec..cf1a21158c 100644 --- a/pcbnew/pcbnew.h +++ b/pcbnew/pcbnew.h @@ -56,6 +56,8 @@ extern bool g_Show_Pads_Module_in_Move; extern bool g_Raccord_45_Auto; extern bool g_ShowIsolDuringCreateTrack; +extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint libraries filesnames + /** * Function IsModuleLayerVisible * expects either of the two layers on which a module can reside, and returns @@ -78,6 +80,7 @@ bool inline IsModuleLayerVisible( int layer ) { extern bool Track_45_Only; extern bool Segments_45_Only; extern wxString g_Shapes3DExtBuffer; +extern wxString g_DocModulesFileName; /* A buffer used in some computations (will be removed in next cleanup code, * do not use) */