2012-02-16 20:03:33 +00:00
|
|
|
/**
|
|
|
|
* @file dialog_cvpcb_config.cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
|
|
|
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
2009-04-21 17:56:27 +00:00
|
|
|
#include <wx/tokenzr.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <pgm_base.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <confirm.h>
|
|
|
|
#include <gestfich.h>
|
|
|
|
#include <id.h>
|
|
|
|
#include <macros.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <cvpcb.h>
|
|
|
|
#include <cvpcb_mainframe.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_cvpcb_config.h>
|
2012-02-16 20:03:33 +00:00
|
|
|
#include <wildcards_and_files_ext.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* aParent ) :
|
|
|
|
DIALOG_CVPCB_CONFIG_FBP( aParent )
|
2009-04-21 17:56:27 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxString title;
|
|
|
|
wxFileName fn = aParent->m_NetlistFileName;
|
|
|
|
|
2009-04-23 15:02:18 +00:00
|
|
|
fn.SetExt( ProjectFileExtension );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
m_Parent = aParent;
|
|
|
|
m_Config = Pgm().CommonSettings();
|
2009-04-23 15:02:18 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
Init( );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
title.Format( _( "Project file: '%s'" ), GetChars( fn.GetFullPath() ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
SetTitle( title );
|
2011-03-14 15:17:18 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( GetSizer() )
|
|
|
|
{
|
|
|
|
GetSizer()->SetSizeHints( this );
|
|
|
|
}
|
2011-03-14 15:17:18 +00:00
|
|
|
|
|
|
|
m_sdbSizer2OK->SetDefault();
|
2009-04-21 17:56:27 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::Init()
|
|
|
|
{
|
|
|
|
wxString msg;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
SetFocus();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
m_LibListChanged = false;
|
|
|
|
m_LibPathChanged = false;
|
2009-04-23 15:02:18 +00:00
|
|
|
m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-23 15:02:18 +00:00
|
|
|
m_ListLibr->InsertItems( m_Parent->m_ModuleLibNames, 0 );
|
|
|
|
m_ListEquiv->InsertItems( m_Parent->m_AliasLibNames, 0 );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-23 15:02:18 +00:00
|
|
|
m_TextHelpModulesFileName->SetValue( m_Parent->m_DocModulesFileName );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
// Load user libs paths:
|
|
|
|
wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
while( Token.HasMoreTokens() )
|
|
|
|
{
|
|
|
|
wxString path = Token.GetNextToken();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( wxFileName::DirExists( path ) )
|
|
|
|
m_listUserPaths->Append( path );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
// Display actual libraries paths:
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxPathList libpaths = Pgm().GetLibraryPathList();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
|
|
|
|
{
|
|
|
|
m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
// select the first path after the current path project
|
2009-04-21 17:56:27 +00:00
|
|
|
if( libpaths.GetCount() > 1 )
|
|
|
|
m_DefaultLibraryPathslistBox->Select( 1 );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-21 17:56:27 +00:00
|
|
|
// Recreate the user lib path
|
|
|
|
if( m_LibPathChanged )
|
2007-10-27 12:24:09 +00:00
|
|
|
{
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ )
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().RemoveLibraryPath( m_listUserPaths->GetString( ii ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().InsertLibraryPath( m_Parent->m_UserLibraryPath, 1 );
|
2007-10-27 12:24:09 +00:00
|
|
|
}
|
2009-04-23 15:02:18 +00:00
|
|
|
|
|
|
|
EndModal( wxID_CANCEL );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
|
2008-08-01 17:41:51 +00:00
|
|
|
{
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_DocModulesFileName = m_TextHelpModulesFileName->GetValue();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
// Recreate the user lib path
|
|
|
|
if( m_LibPathChanged )
|
|
|
|
{
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_UserLibraryPath.Empty();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii++ )
|
|
|
|
{
|
|
|
|
if( ii > 0 )
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_UserLibraryPath << wxT( ";" );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_UserLibraryPath << m_listUserPaths->GetString( ii );
|
2009-04-21 17:56:27 +00:00
|
|
|
}
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
// Set new active library list if the lib list of if default path list was modified
|
2009-04-21 17:56:27 +00:00
|
|
|
if( m_LibListChanged || m_LibPathChanged )
|
|
|
|
{
|
|
|
|
// Recreate lib list
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_ModuleLibNames.Clear();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ )
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_ModuleLibNames.Add( m_ListLibr->GetString( ii ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
|
|
|
// Recreate equ list
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_AliasLibNames.Clear();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned ii = 0; ii < m_ListEquiv->GetCount(); ii++ )
|
2009-04-23 15:02:18 +00:00
|
|
|
m_Parent->m_AliasLibNames.Add( m_ListEquiv->GetString( ii ) );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
m_Parent->LoadFootprintFiles();
|
2009-08-20 11:44:06 +00:00
|
|
|
m_Parent->BuildFOOTPRINTS_LISTBOX();
|
2013-05-31 17:33:46 +00:00
|
|
|
m_Parent->BuildLIBRARY_LISTBOX();
|
2009-04-21 17:56:27 +00:00
|
|
|
}
|
2009-04-23 15:02:18 +00:00
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
wxCommandEvent evt( ID_SAVE_PROJECT );
|
|
|
|
m_Parent->SaveProjectFile( evt );
|
2009-04-23 15:02:18 +00:00
|
|
|
EndModal( wxID_OK );
|
2009-04-21 17:56:27 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnCloseWindow( wxCloseEvent& event )
|
|
|
|
{
|
|
|
|
EndModal( 0 );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
/********************************************************************/
|
|
|
|
void DIALOG_CVPCB_CONFIG::OnButtonUpClick( wxCommandEvent& event )
|
|
|
|
/********************************************************************/
|
|
|
|
{
|
|
|
|
wxListBox * list = m_ListLibr;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
if( (event.GetId() == ID_EQU_UP) || (event.GetId() == ID_EQU_DOWN) )
|
|
|
|
{
|
|
|
|
list = m_ListEquiv;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxArrayInt selections;
|
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
list->GetSelections( selections );
|
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
if ( selections.GetCount() <= 0 ) // No selection.
|
|
|
|
return;
|
|
|
|
|
|
|
|
if( selections[0] == 0 ) // The first lib is selected. cannot move up it
|
|
|
|
return;
|
|
|
|
|
|
|
|
wxArrayString libnames = list->GetStrings();
|
|
|
|
|
|
|
|
for( size_t ii = 0; ii < selections.GetCount(); ii++ )
|
|
|
|
{
|
|
|
|
int jj = selections[ii];
|
2011-08-24 19:44:05 +00:00
|
|
|
EXCHG( libnames[jj], libnames[jj-1] );
|
2010-04-02 15:18:46 +00:00
|
|
|
}
|
2011-08-24 19:44:05 +00:00
|
|
|
|
|
|
|
list->Set( libnames );
|
2010-04-02 15:18:46 +00:00
|
|
|
|
|
|
|
// Reselect previously selected names
|
|
|
|
for( size_t ii = 0; ii < selections.GetCount(); ii++ )
|
|
|
|
{
|
|
|
|
int jj = selections[ii];
|
2011-08-24 19:44:05 +00:00
|
|
|
list->SetSelection( jj-1 );
|
2010-04-02 15:18:46 +00:00
|
|
|
}
|
|
|
|
|
2012-01-22 17:20:22 +00:00
|
|
|
m_LibListChanged = true;
|
2010-04-02 15:18:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************/
|
|
|
|
void DIALOG_CVPCB_CONFIG::OnButtonDownClick( wxCommandEvent& event )
|
|
|
|
/*********************************************************************/
|
|
|
|
{
|
|
|
|
wxListBox * list = m_ListLibr;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
if( (event.GetId() == ID_EQU_UP) || (event.GetId() == ID_EQU_DOWN) )
|
|
|
|
{
|
|
|
|
list = m_ListEquiv;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxArrayInt selections;
|
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
list->GetSelections( selections );
|
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
if ( selections.GetCount() <= 0 ) // No selection.
|
|
|
|
return;
|
|
|
|
|
|
|
|
// The last lib is selected. cannot move down it
|
|
|
|
if( selections.Last() == (int)(list->GetCount()-1) )
|
|
|
|
return;
|
|
|
|
|
|
|
|
wxArrayString libnames = list->GetStrings();
|
|
|
|
|
|
|
|
for( int ii = selections.GetCount()-1; ii >= 0; ii-- )
|
|
|
|
{
|
|
|
|
int jj = selections[ii];
|
|
|
|
EXCHG( libnames[jj], libnames[jj+1]);
|
|
|
|
}
|
2011-08-24 19:44:05 +00:00
|
|
|
|
|
|
|
list->Set( libnames );
|
2010-04-02 15:18:46 +00:00
|
|
|
|
|
|
|
// Reselect previously selected names
|
|
|
|
for( size_t ii = 0; ii < selections.GetCount(); ii++ )
|
|
|
|
{
|
|
|
|
int jj = selections[ii];
|
|
|
|
list->SetSelection(jj+1);
|
|
|
|
}
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2012-01-22 17:20:22 +00:00
|
|
|
m_LibListChanged = true;
|
2010-04-02 15:18:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
/* Remove a library to the library list.
|
2009-11-05 19:26:52 +00:00
|
|
|
* The real list (g_LibName_List) is not changed, so the change can be canceled
|
2009-04-21 17:56:27 +00:00
|
|
|
*/
|
2009-11-05 19:26:52 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
|
2009-04-21 17:56:27 +00:00
|
|
|
{
|
|
|
|
wxListBox * list = m_ListEquiv;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( event.GetId() == ID_REMOVE_LIB )
|
|
|
|
list = m_ListLibr;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
wxArrayInt selections;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
list->GetSelections( selections );
|
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
for( int ii = selections.GetCount()-1; ii >= 0; ii-- )
|
|
|
|
{
|
|
|
|
list->Delete(selections[ii] );
|
2012-01-22 17:20:22 +00:00
|
|
|
m_LibListChanged = true;
|
2010-04-02 15:18:46 +00:00
|
|
|
}
|
2009-04-21 17:56:27 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
/* 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
|
2009-11-05 19:26:52 +00:00
|
|
|
* The real list (g_LibName_List) is not changed, so the change can be canceled
|
2009-04-21 17:56:27 +00:00
|
|
|
*/
|
2009-11-05 19:26:52 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
2009-04-21 17:56:27 +00:00
|
|
|
{
|
|
|
|
int ii;
|
|
|
|
wxString libfilename, wildcard;
|
|
|
|
wxFileName fn;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
bool insert = false;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( (event.GetId() == ID_INSERT_EQU) || (event.GetId() == ID_INSERT_LIB) )
|
|
|
|
insert = true;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-23 15:02:18 +00:00
|
|
|
wildcard = FootprintAliasFileWildcard;
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
|
|
|
wxListBox* list = m_ListEquiv;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( (event.GetId() == ID_ADD_LIB) || (event.GetId() == ID_INSERT_LIB) )
|
|
|
|
{
|
|
|
|
list = m_ListLibr;
|
2012-11-19 16:19:38 +00:00
|
|
|
wildcard = LegacyFootprintLibPathWildcard;
|
2009-04-21 17:56:27 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
wxArrayInt selections;
|
|
|
|
list->GetSelections(selections);
|
|
|
|
|
|
|
|
ii = selections.GetCount();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2010-04-02 15:18:46 +00:00
|
|
|
if( ii > 0 )
|
|
|
|
ii = selections[0];
|
|
|
|
else
|
2009-04-21 17:56:27 +00:00
|
|
|
ii = 0;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
wxString libpath;
|
|
|
|
libpath = m_DefaultLibraryPathslistBox->GetStringSelection();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( libpath.IsEmpty() )
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
libpath = Pgm().LastVisitedLibraryPath();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
wxFileDialog FilesDialog( this, _( "Footprint library files:" ), libpath,
|
|
|
|
wxEmptyString, wildcard,
|
|
|
|
wxFD_DEFAULT_STYLE | wxFD_MULTIPLE );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( FilesDialog.ShowModal() != wxID_OK )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
wxArrayString Filenames;
|
|
|
|
FilesDialog.GetPaths( Filenames );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ )
|
|
|
|
{
|
|
|
|
fn = Filenames[jj];
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( jj == 0 )
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().SaveLastVisitedLibraryPath( fn.GetPath() );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
|
|
|
/* 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,
|
2009-04-23 15:02:18 +00:00
|
|
|
* because it preserve use of default libraries paths, when the path
|
|
|
|
* is a sub path of these default paths
|
2009-04-21 17:56:27 +00:00
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
libfilename = Pgm().FilenameWithRelativePathInSearchList( fn.GetFullPath() );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-10-23 14:35:24 +00:00
|
|
|
// Remove extension:
|
|
|
|
fn = libfilename;
|
2011-08-24 19:44:05 +00:00
|
|
|
fn.SetExt( wxEmptyString );
|
2009-10-23 14:35:24 +00:00
|
|
|
libfilename = fn.GetFullPath();
|
2009-04-21 17:56:27 +00:00
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
// Add or insert new library name, if not already in list
|
2009-04-21 17:56:27 +00:00
|
|
|
if( list->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
|
|
|
|
{
|
2012-01-22 17:20:22 +00:00
|
|
|
m_LibListChanged = true;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( ! insert )
|
|
|
|
list->Append( libfilename );
|
|
|
|
else
|
|
|
|
list->Insert( libfilename, ii++ );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wxString msg = wxT( "<" ) + libfilename + wxT( "> : " ) +
|
|
|
|
_( "Library already in use" );
|
|
|
|
DisplayError( this, msg );
|
|
|
|
}
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxString path = Pgm().LastVisitedLibraryPath();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ),
|
|
|
|
path,
|
2009-04-21 17:56:27 +00:00
|
|
|
wxDD_DEFAULT_STYLE,
|
2009-11-05 19:26:52 +00:00
|
|
|
this,
|
2009-04-21 17:56:27 +00:00
|
|
|
wxDefaultPosition );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( !select )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( !wxFileName::DirExists( path ) ) // Should not occurs
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
// Add or insert path if not already in list
|
|
|
|
if( m_listUserPaths->FindString( path ) == wxNOT_FOUND )
|
|
|
|
{
|
|
|
|
int ipos = m_listUserPaths->GetCount();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( event.GetId() == ID_INSERT_PATH )
|
|
|
|
{
|
|
|
|
if( ipos )
|
|
|
|
ipos--;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
int jj = m_listUserPaths->GetSelection();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( jj >= 0 )
|
|
|
|
ipos = jj;
|
|
|
|
}
|
2010-02-05 15:59:33 +00:00
|
|
|
|
|
|
|
// Ask the user if this is a relative path
|
2011-08-24 19:44:05 +00:00
|
|
|
int diag = wxMessageBox( _( "Use a relative path?" ),
|
|
|
|
_( "Path type" ),
|
|
|
|
wxYES_NO | wxICON_QUESTION, this );
|
2010-02-05 15:59:33 +00:00
|
|
|
|
|
|
|
if( diag == wxYES )
|
|
|
|
{ // Make it relative
|
|
|
|
wxFileName fn = path;
|
2011-08-24 19:44:05 +00:00
|
|
|
fn.MakeRelativeTo( wxT( "." ) );
|
2010-02-05 15:59:33 +00:00
|
|
|
path = fn.GetPathWithSep() + fn.GetFullName();
|
|
|
|
}
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
m_listUserPaths->Insert( path, ipos );
|
|
|
|
m_LibPathChanged = true;
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().InsertLibraryPath( path, ipos + 1 );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
|
|
|
// Display actual libraries paths:
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxPathList libpaths = Pgm().GetLibraryPathList();
|
2009-04-21 17:56:27 +00:00
|
|
|
m_DefaultLibraryPathslistBox->Clear();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
|
|
|
|
{
|
|
|
|
m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2011-08-24 19:44:05 +00:00
|
|
|
{
|
2009-04-21 17:56:27 +00:00
|
|
|
DisplayError( this, _( "Path already in use" ) );
|
2011-08-24 19:44:05 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().SaveLastVisitedLibraryPath( path );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-21 17:56:27 +00:00
|
|
|
int ii = m_listUserPaths->GetSelection();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( ii < 0 )
|
|
|
|
ii = m_listUserPaths->GetCount() - 1;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( ii >= 0 )
|
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().RemoveLibraryPath( m_listUserPaths->GetStringSelection() );
|
2009-04-21 17:56:27 +00:00
|
|
|
m_listUserPaths->Delete( ii );
|
|
|
|
m_LibPathChanged = true;
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
// Display actual libraries paths:
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxPathList libpaths = Pgm().GetLibraryPathList();
|
2009-04-21 17:56:27 +00:00
|
|
|
m_DefaultLibraryPathslistBox->Clear();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
|
|
|
|
{
|
|
|
|
m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
void DIALOG_CVPCB_CONFIG::OnBrowseModDocFile( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-23 15:02:18 +00:00
|
|
|
wxString FullFileName;
|
2009-04-21 17:56:27 +00:00
|
|
|
wxString docpath, filename;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
docpath = Pgm().LastVisitedLibraryPath( wxT( "doc" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
wxFileDialog FilesDialog( this, _( "Footprint document file:" ), docpath,
|
2009-04-23 15:02:18 +00:00
|
|
|
wxEmptyString, PdfFileWildcard,
|
|
|
|
wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
if( FilesDialog.ShowModal() != wxID_OK )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
FullFileName = FilesDialog.GetPath();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-21 17:56:27 +00:00
|
|
|
/* 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,
|
2009-04-23 15:02:18 +00:00
|
|
|
* because it preserve use of default libraries paths, when the path is
|
|
|
|
* a sub path of these default paths
|
2009-04-21 17:56:27 +00:00
|
|
|
*/
|
|
|
|
wxFileName fn = FullFileName;
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().SaveLastVisitedLibraryPath( fn.GetPath() );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
filename = Pgm().FilenameWithRelativePathInSearchList( FullFileName );
|
2009-04-21 17:56:27 +00:00
|
|
|
m_TextHelpModulesFileName->SetValue( filename );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|