2012-02-16 20:03:33 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2019-06-10 22:27:34 +00:00
|
|
|
* Copyright (C) 2014-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2012-02-16 20:03:33 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.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>
|
|
|
|
#include <kiface_i.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <confirm.h>
|
|
|
|
#include <gestfich.h>
|
2018-01-30 10:49:51 +00:00
|
|
|
#include <sch_edit_frame.h>
|
2019-03-11 21:32:05 +00:00
|
|
|
#include <sch_sheet.h>
|
2018-01-30 10:49:51 +00:00
|
|
|
#include <lib_edit_frame.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <eeschema_config.h>
|
2019-05-25 11:05:39 +00:00
|
|
|
#include <ws_data_model.h>
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
#include <class_library.h>
|
2017-03-05 22:31:31 +00:00
|
|
|
#include <symbol_lib_table.h>
|
2012-02-16 20:03:33 +00:00
|
|
|
#include <wildcards_and_files_ext.h>
|
2018-05-14 17:34:18 +00:00
|
|
|
#include <widgets/paged_dialog.h>
|
|
|
|
#include <dialogs/panel_eeschema_template_fieldnames.h>
|
|
|
|
#include <dialogs/panel_eeschema_settings.h>
|
|
|
|
#include <dialogs/panel_eeschema_display_options.h>
|
2019-08-18 21:48:52 +00:00
|
|
|
#include <panel_display_options.h>
|
2019-06-09 21:57:23 +00:00
|
|
|
#include <panel_hotkeys_editor.h>
|
2018-05-14 17:34:18 +00:00
|
|
|
#include <widgets/widget_eeschema_color_config.h>
|
2019-02-05 15:06:36 +00:00
|
|
|
#include <widgets/symbol_tree_pane.h>
|
2018-05-14 17:34:18 +00:00
|
|
|
#include <dialogs/panel_libedit_settings.h>
|
2018-08-03 12:18:26 +00:00
|
|
|
#include <sch_painter.h>
|
2018-09-09 23:04:42 +00:00
|
|
|
#include "sch_junction.h"
|
2019-05-25 19:39:42 +00:00
|
|
|
#include "eeschema_id.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2015-04-22 11:39:00 +00:00
|
|
|
static int s_defaultBusThickness = DEFAULTBUSTHICKNESS;
|
2019-07-26 23:52:17 +00:00
|
|
|
static int s_defaultWireThickness = DEFAULTDRAWLINETHICKNESS;
|
|
|
|
static int s_defaultTextSize = DEFAULT_SIZE_TEXT;
|
|
|
|
static int s_drawDefaultLineThickness = -1;
|
2019-10-21 18:03:54 +00:00
|
|
|
static int s_textMarkupFlags = 0;
|
2019-11-21 15:48:44 +00:00
|
|
|
static bool s_selectTextAsBox = false;
|
|
|
|
static bool s_selectDrawChildren = true;
|
|
|
|
static bool s_selectFillShapes = false;
|
2019-12-03 19:47:36 +00:00
|
|
|
static int s_selectThickness = DEFAULTSELECTIONTHICKNESS;
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
int GetDefaultBusThickness()
|
|
|
|
{
|
|
|
|
return s_defaultBusThickness;
|
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
void SetDefaultBusThickness( int aThickness)
|
|
|
|
{
|
2019-07-26 23:52:17 +00:00
|
|
|
s_defaultBusThickness = std::max( 1, aThickness );
|
2012-09-28 17:47:41 +00:00
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2019-06-30 10:12:18 +00:00
|
|
|
int GetDefaultWireThickness()
|
|
|
|
{
|
|
|
|
return s_defaultWireThickness;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SetDefaultWireThickness( int aThickness )
|
|
|
|
{
|
2019-07-26 23:52:17 +00:00
|
|
|
s_defaultWireThickness = std::max( 1, aThickness );
|
2019-06-30 10:12:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-20 11:13:04 +00:00
|
|
|
int GetDefaultTextSize()
|
|
|
|
{
|
2014-05-16 13:57:53 +00:00
|
|
|
return s_defaultTextSize;
|
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2014-06-20 11:13:04 +00:00
|
|
|
void SetDefaultTextSize( int aTextSize )
|
|
|
|
{
|
|
|
|
s_defaultTextSize = aTextSize;
|
2014-05-16 13:57:53 +00:00
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
int GetDefaultLineThickness()
|
|
|
|
{
|
|
|
|
return s_drawDefaultLineThickness;
|
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2019-10-21 18:03:54 +00:00
|
|
|
void SetTextMarkupFlags( int aMarkupFlags )
|
|
|
|
{
|
|
|
|
s_textMarkupFlags = aMarkupFlags;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int GetTextMarkupFlags()
|
|
|
|
{
|
|
|
|
return s_textMarkupFlags;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-12 16:57:46 +00:00
|
|
|
void SetDefaultLineThickness( int aThickness )
|
2012-09-28 17:47:41 +00:00
|
|
|
{
|
2019-07-26 23:52:17 +00:00
|
|
|
s_drawDefaultLineThickness = std::max( 1, aThickness );
|
2012-09-28 17:47:41 +00:00
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2019-11-21 15:48:44 +00:00
|
|
|
bool GetSelectionTextAsBox()
|
|
|
|
{
|
|
|
|
return s_selectTextAsBox;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SetSelectionTextAsBox( bool aBool )
|
|
|
|
{
|
|
|
|
s_selectTextAsBox = aBool;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool GetSelectionDrawChildItems()
|
|
|
|
{
|
|
|
|
return s_selectDrawChildren;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SetSelectionDrawChildItems( bool aBool )
|
|
|
|
{
|
|
|
|
s_selectDrawChildren = aBool;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool GetSelectionFillShapes()
|
|
|
|
{
|
|
|
|
return s_selectFillShapes;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SetSelectionFillShapes( bool aBool )
|
|
|
|
{
|
|
|
|
s_selectFillShapes = aBool;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-12-03 19:47:36 +00:00
|
|
|
int GetSelectionThickness()
|
2019-11-20 19:54:33 +00:00
|
|
|
{
|
|
|
|
return s_selectThickness;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-12-03 19:47:36 +00:00
|
|
|
void SetSelectionThickness( int aThickness )
|
2019-11-20 19:54:33 +00:00
|
|
|
{
|
2019-12-03 19:47:36 +00:00
|
|
|
s_selectThickness = aThickness;
|
2019-11-20 19:54:33 +00:00
|
|
|
}
|
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
// Color to draw selected items
|
2017-02-20 16:57:41 +00:00
|
|
|
COLOR4D GetItemSelectedColor()
|
2012-09-28 17:47:41 +00:00
|
|
|
{
|
2017-02-20 16:57:41 +00:00
|
|
|
return COLOR4D( BROWN );
|
2012-09-28 17:47:41 +00:00
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2019-06-10 22:27:34 +00:00
|
|
|
// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema)
|
2017-02-20 16:57:41 +00:00
|
|
|
COLOR4D GetInvisibleItemColor()
|
2012-09-28 17:47:41 +00:00
|
|
|
{
|
2017-02-20 16:57:41 +00:00
|
|
|
return COLOR4D( DARKGRAY );
|
2012-09-28 17:47:41 +00:00
|
|
|
}
|
|
|
|
|
2010-11-19 16:28:46 +00:00
|
|
|
|
2019-08-01 17:26:21 +00:00
|
|
|
void SCH_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent,
|
2019-06-09 21:57:23 +00:00
|
|
|
PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
|
2018-05-14 17:34:18 +00:00
|
|
|
{
|
2018-07-15 23:15:48 +00:00
|
|
|
wxTreebook* book = aParent->GetTreebook();
|
|
|
|
|
2019-08-27 20:50:13 +00:00
|
|
|
book->AddPage( new wxPanel( book ), _( "Eeschema" ) );
|
2018-07-15 23:15:48 +00:00
|
|
|
book->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
|
2019-08-19 16:46:25 +00:00
|
|
|
book->AddSubPage( new PANEL_EESCHEMA_SETTINGS( this, book ), _( "Editing Options" ) );
|
2018-07-15 23:15:48 +00:00
|
|
|
book->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, book ), _( "Colors" ) );
|
2019-08-01 17:26:21 +00:00
|
|
|
book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ),
|
|
|
|
_( "Field Name Templates" ) );
|
|
|
|
|
2019-06-09 21:57:23 +00:00
|
|
|
aHotkeysPanel->AddHotKeys( GetToolManager() );
|
2009-12-01 15:14:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-03-07 04:55:14 +00:00
|
|
|
PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
{
|
2009-05-21 17:42:42 +00:00
|
|
|
if( !m_projectFileParams.empty() )
|
2009-04-29 17:09:00 +00:00
|
|
|
return m_projectFileParams;
|
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
|
|
|
|
&BASE_SCREEN::m_PageLayoutDescrFileName ) );
|
|
|
|
|
2014-10-26 13:59:01 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
|
|
|
|
&m_plotDirectoryName ) );
|
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
|
2019-07-26 23:52:17 +00:00
|
|
|
LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) );
|
2013-07-19 18:27:22 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
|
2019-07-26 23:52:17 +00:00
|
|
|
LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) );
|
2014-06-26 19:20:05 +00:00
|
|
|
|
2012-03-12 10:04:40 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
|
2015-12-20 12:40:17 +00:00
|
|
|
&m_netListFormat) );
|
2016-09-16 18:36:19 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
|
|
|
|
&m_spiceAjustPassiveValues, false ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2009-05-21 17:42:42 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
|
2019-07-26 23:52:17 +00:00
|
|
|
&s_defaultTextSize, DEFAULT_SIZE_TEXT, 5, 1000 ) );
|
2015-12-20 12:40:17 +00:00
|
|
|
|
2019-03-11 21:32:05 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_WriteFile" ),
|
|
|
|
&m_ercSettings.write_erc_file, false ) );
|
|
|
|
|
2015-12-20 12:40:17 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
|
2019-03-11 21:32:05 +00:00
|
|
|
&m_ercSettings.check_similar_labels, true ) );
|
|
|
|
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckUniqueGlobalLabels" ),
|
|
|
|
&m_ercSettings.check_unique_global_labels, true ) );
|
|
|
|
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusDriverConflicts" ),
|
|
|
|
&m_ercSettings.check_bus_driver_conflicts, true ) );
|
|
|
|
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusEntryConflicts" ),
|
|
|
|
&m_ercSettings.check_bus_entry_conflicts, true ) );
|
|
|
|
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToBusConflicts" ),
|
|
|
|
&m_ercSettings.check_bus_to_bus_conflicts, true ) );
|
|
|
|
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToNetConflicts" ),
|
|
|
|
&m_ercSettings.check_bus_to_net_conflicts, true ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
|
|
|
return m_projectFileParams;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
bool SCH_EDIT_FRAME::LoadProjectFile()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2014-08-25 07:30:17 +00:00
|
|
|
// Read library list and library path list
|
2019-03-07 04:55:14 +00:00
|
|
|
bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() );
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2014-08-25 07:30:17 +00:00
|
|
|
// Read schematic editor setup
|
2019-03-07 04:55:14 +00:00
|
|
|
ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
|
2014-08-25 07:30:17 +00:00
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
// Verify some values, because the config file can be edited by hand,
|
|
|
|
// and have bad values:
|
2019-05-25 11:05:39 +00:00
|
|
|
LIB_PART::SetSubpartIdNotation( LIB_PART::GetSubpartIdSeparator(),
|
|
|
|
LIB_PART::GetSubpartFirstId() );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
// Load the page layout decr file, from the filename stored in
|
|
|
|
// BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
|
2014-12-31 12:31:19 +00:00
|
|
|
// If empty, or not existing, the default descr is loaded
|
2019-05-25 11:05:39 +00:00
|
|
|
WS_DATA_MODEL& pglayout = WS_DATA_MODEL::GetTheInstance();
|
|
|
|
wxString filename = WS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_PageLayoutDescrFileName,
|
|
|
|
Prj().GetProjectPath() );
|
2014-12-23 13:01:59 +00:00
|
|
|
|
2019-05-25 11:05:39 +00:00
|
|
|
pglayout.SetPageLayout( filename );
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2019-03-07 04:55:14 +00:00
|
|
|
return ret;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
|
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
|
|
|
PROJECT& prj = Prj();
|
|
|
|
wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
|
2009-04-05 20:49:15 +00:00
|
|
|
|
|
|
|
fn.SetExt( ProjectFileExtension );
|
|
|
|
|
2011-08-18 19:25:12 +00:00
|
|
|
if( !IsWritable( fn ) )
|
2008-02-26 19:19:54 +00:00
|
|
|
return;
|
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
if( aAskForSave )
|
|
|
|
{
|
2019-03-07 04:55:14 +00:00
|
|
|
wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(), fn.GetFullName(),
|
2017-11-12 00:31:38 +00:00
|
|
|
ProjectFileWildcard(), wxFD_SAVE );
|
2013-07-19 18:27:22 +00:00
|
|
|
|
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
|
|
|
return;
|
|
|
|
|
* 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
|
|
|
fn = dlg.GetPath();
|
2013-07-19 18:27:22 +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
|
|
|
|
2019-03-07 04:55:14 +00:00
|
|
|
wxString path = fn.GetFullPath();
|
|
|
|
|
|
|
|
prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters(), path );
|
2009-04-29 17:09:00 +00:00
|
|
|
}
|
|
|
|
|
2016-05-12 19:45:47 +00:00
|
|
|
///@{
|
|
|
|
/// \ingroup config
|
* 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
|
|
|
|
2016-05-12 19:45:47 +00:00
|
|
|
const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
|
|
|
|
const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
|
|
|
|
const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
|
|
|
|
const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
|
2019-05-20 18:51:24 +00:00
|
|
|
static const wxChar DragActionIsMoveEntry[] = wxT( "DragActionIsMove" );
|
2018-01-03 02:52:35 +00:00
|
|
|
static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" );
|
* 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
|
|
|
static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
|
2019-06-30 10:12:18 +00:00
|
|
|
static const wxChar DefaultWireWidthEntry[] = wxT( "DefaultWireWidth" );
|
* 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
|
|
|
static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
|
2018-09-09 23:04:42 +00:00
|
|
|
static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" );
|
* 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
|
|
|
static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
|
|
|
|
static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
|
|
|
|
static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
|
2019-10-21 18:03:54 +00:00
|
|
|
static const wxString TextMarkupFlagsEntry = "TextMarkupFlags";
|
2016-05-12 19:45:47 +00:00
|
|
|
static const wxString ShowPageLimitsEntry = "ShowPageLimits";
|
|
|
|
static const wxString UnitsEntry = "Units";
|
|
|
|
static const wxString PrintMonochromeEntry = "PrintMonochrome";
|
|
|
|
static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
|
|
|
|
static const wxString RepeatStepXEntry = "RepeatStepX";
|
|
|
|
static const wxString RepeatStepYEntry = "RepeatStepY";
|
|
|
|
static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
|
2019-08-01 17:26:21 +00:00
|
|
|
static const wxString ShowIllegalSymboLibDialog = "ShowIllegalSymbolLibDialog";
|
2019-11-17 16:43:05 +00:00
|
|
|
static const wxString showSheetFileNameCaseSensitivityDlg = "ShowSheetFileNameCaseSensitivityDlg";
|
2019-12-19 11:41:51 +00:00
|
|
|
static const wxString SelectPinSelectSymbolEntry = "SelectPinSelectSymbolOpt";
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2014-08-25 16:31:32 +00:00
|
|
|
// Library editor wxConfig entry names.
|
2019-02-05 15:06:36 +00:00
|
|
|
static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" );
|
2014-08-25 16:31:32 +00:00
|
|
|
static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
|
|
|
|
static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
|
|
|
|
static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
|
2015-04-22 11:39:00 +00:00
|
|
|
static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
|
|
|
|
static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
|
|
|
|
static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
|
|
|
|
static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
|
2016-11-04 11:13:22 +00:00
|
|
|
static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
|
2014-08-25 16:31:32 +00:00
|
|
|
|
2019-11-21 15:48:44 +00:00
|
|
|
static const wxChar boxedSelectedText[] = wxT( "SelectionTextAsBox" );
|
|
|
|
static const wxChar drawSelectedChildren[] = wxT( "SelectionDrawChildItems" );
|
|
|
|
static const wxChar selectionFillShapes[] = wxT( "SelectionFillShapes" );
|
2019-11-20 19:54:33 +00:00
|
|
|
static const wxChar selectionThickness[] = wxT( "SelectionThickness" );
|
2019-11-21 15:48:44 +00:00
|
|
|
|
2016-05-12 19:45:47 +00:00
|
|
|
///@}
|
2011-08-18 19:25:12 +00:00
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings()
|
2009-04-29 17:09:00 +00:00
|
|
|
{
|
2009-05-21 17:42:42 +00:00
|
|
|
if( !m_configSettings.empty() )
|
2009-04-29 17:09:00 +00:00
|
|
|
return m_configSettings;
|
|
|
|
|
2016-05-12 19:45:47 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowPageLimitsEntry,
|
2014-06-20 11:13:04 +00:00
|
|
|
&m_showPageLimits, true ) );
|
2016-05-12 19:45:47 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
|
2019-06-09 22:21:53 +00:00
|
|
|
(int*)&m_userUnits, MILLIMETRES ) );
|
2014-06-20 11:13:04 +00:00
|
|
|
|
2016-05-12 19:45:47 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintMonochromeEntry,
|
2010-12-20 16:42:34 +00:00
|
|
|
&m_printMonochrome, true ) );
|
2016-05-12 19:45:47 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
|
2010-12-20 16:42:34 +00:00
|
|
|
&m_printSheetReference, true ) );
|
2010-02-02 15:01:09 +00:00
|
|
|
|
2016-05-12 19:45:47 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry,
|
2019-07-26 23:52:17 +00:00
|
|
|
&m_repeatStep.x, DEFAULT_REPEAT_OFFSET_X,
|
|
|
|
-REPEAT_OFFSET_MAX, REPEAT_OFFSET_MAX ) );
|
2016-05-12 19:45:47 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry,
|
2019-07-26 23:52:17 +00:00
|
|
|
&m_repeatStep.y, DEFAULT_REPEAT_OFFSET_Y,
|
|
|
|
-REPEAT_OFFSET_MAX, REPEAT_OFFSET_MAX ) );
|
2016-05-12 19:45:47 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatLabelIncrementEntry,
|
2019-07-26 23:52:17 +00:00
|
|
|
&m_repeatDeltaLabel, DEFAULT_REPEAT_LABEL_INC,
|
|
|
|
-10, +10 ) );
|
2019-08-01 17:26:21 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowIllegalSymboLibDialog,
|
|
|
|
&m_showIllegalSymbolLibDialog, true ) );
|
2019-11-17 16:43:05 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_BOOL( true, showSheetFileNameCaseSensitivityDlg,
|
|
|
|
&m_showSheetFileNameCaseSensitivityDlg,
|
|
|
|
true ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
return m_configSettings;
|
2009-04-05 20:49:15 +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
|
|
|
void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
2009-04-05 20:49:15 +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
|
|
|
EDA_DRAW_FRAME::LoadSettings( aCfg );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2010-02-02 15:01:09 +00:00
|
|
|
long tmp;
|
|
|
|
|
* 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
|
|
|
wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2019-07-02 18:58:42 +00:00
|
|
|
// LibEdit owns this one, but we must read it in if LibEdit hasn't set it yet
|
|
|
|
if( GetDefaultLineThickness() < 0 )
|
|
|
|
{
|
|
|
|
SetDefaultLineThickness( (int) aCfg->Read( DefaultDrawLineWidthEntry,
|
|
|
|
DEFAULTDRAWLINETHICKNESS ) );
|
|
|
|
}
|
|
|
|
|
2018-09-16 13:07:20 +00:00
|
|
|
SetDefaultBusThickness( (int) aCfg->Read( DefaultBusWidthEntry, DEFAULTBUSTHICKNESS ) );
|
2019-06-30 10:12:18 +00:00
|
|
|
|
2019-07-02 18:58:42 +00:00
|
|
|
// Property introduced in 6.0; use DefaultLineWidth for earlier projects
|
2019-06-30 10:12:18 +00:00
|
|
|
if( !aCfg->Read( DefaultWireWidthEntry, &tmp ) )
|
|
|
|
aCfg->Read( DefaultDrawLineWidthEntry, &tmp, DEFAULTDRAWLINETHICKNESS );
|
|
|
|
|
2019-07-02 18:58:42 +00:00
|
|
|
SetDefaultWireThickness( (int) tmp );
|
|
|
|
|
2019-11-21 15:48:44 +00:00
|
|
|
SetSelectionTextAsBox( aCfg->ReadBool( boxedSelectedText, false ) );
|
|
|
|
SetSelectionDrawChildItems( aCfg->ReadBool( drawSelectedChildren, true ) );
|
|
|
|
SetSelectionFillShapes( aCfg->ReadBool( selectionFillShapes, false ) );
|
2019-11-20 19:54:33 +00:00
|
|
|
SetSelectionThickness(
|
2019-12-03 19:47:36 +00:00
|
|
|
static_cast<int>( aCfg->Read( selectionThickness, DEFAULTSELECTIONTHICKNESS ) ) );
|
2019-11-21 15:48:44 +00:00
|
|
|
|
2019-10-21 18:03:54 +00:00
|
|
|
SetTextMarkupFlags( (int) aCfg->Read( TextMarkupFlagsEntry, 0L ) );
|
|
|
|
|
2019-07-02 18:58:42 +00:00
|
|
|
if( aCfg->Read( DefaultJctSizeEntry, &tmp ) )
|
|
|
|
SCH_JUNCTION::SetSymbolSize( (int) tmp );
|
2019-06-30 10:12:18 +00:00
|
|
|
|
2019-05-20 18:51:24 +00:00
|
|
|
aCfg->Read( DragActionIsMoveEntry, &m_dragActionIsMove, 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
|
|
|
aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
|
2019-12-19 11:41:51 +00:00
|
|
|
aCfg->Read( SelectPinSelectSymbolEntry, &m_selectPinSelectSymbol, 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
|
|
|
aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
|
2015-12-13 16:56:47 +00:00
|
|
|
aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
|
|
|
|
aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
|
|
|
|
aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
|
2018-01-03 02:52:35 +00:00
|
|
|
aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
|
2010-03-16 18:22:59 +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 templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
|
2010-06-17 16:30:10 +00:00
|
|
|
|
|
|
|
if( !templateFieldNames.IsEmpty() )
|
|
|
|
{
|
2011-02-28 18:36:19 +00:00
|
|
|
TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2010-06-17 16:30:10 +00:00
|
|
|
try
|
|
|
|
{
|
2018-08-08 20:57:53 +00:00
|
|
|
m_templateFieldNames.Parse( &lexer );
|
2010-06-17 16:30:10 +00:00
|
|
|
}
|
2016-10-10 15:04:48 +00:00
|
|
|
catch( const IO_ERROR& DBG( e ) )
|
2010-06-17 16:30:10 +00:00
|
|
|
{
|
|
|
|
// @todo show error msg
|
2018-08-08 20:57:53 +00:00
|
|
|
DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
|
2010-06-17 16:30:10 +00:00
|
|
|
}
|
|
|
|
}
|
2018-08-29 18:31:43 +00:00
|
|
|
|
2019-11-21 15:48:44 +00:00
|
|
|
KIGFX::SCH_RENDER_SETTINGS* settings = GetRenderSettings();
|
2018-09-04 18:22:26 +00:00
|
|
|
settings->m_ShowPinsElectricalType = false;
|
|
|
|
settings->m_ShowHiddenText = false;
|
2018-09-02 20:19:22 +00:00
|
|
|
settings->m_ShowHiddenPins = m_showAllPins;
|
2018-11-08 08:57:16 +00:00
|
|
|
settings->SetShowPageLimits( m_showPageLimits );
|
2018-11-14 21:54:53 +00:00
|
|
|
settings->m_ShowUmbilicals = true;
|
2009-04-05 20:49:15 +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
|
|
|
void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
|
2009-04-05 20:49:15 +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
|
|
|
EDA_DRAW_FRAME::SaveSettings( aCfg );
|
2009-04-29 17:09:00 +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
|
|
|
wxConfigSaveSetups( aCfg, GetConfigurationSettings() );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2019-05-20 18:51:24 +00:00
|
|
|
aCfg->Write( DragActionIsMoveEntry, m_dragActionIsMove );
|
* 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
|
|
|
aCfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
|
2019-06-30 10:12:18 +00:00
|
|
|
aCfg->Write( DefaultWireWidthEntry, (long) GetDefaultWireThickness() );
|
2018-09-09 23:04:42 +00:00
|
|
|
aCfg->Write( DefaultJctSizeEntry, (long) SCH_JUNCTION::GetSymbolSize() );
|
* 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
|
|
|
aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
|
2019-12-19 11:41:51 +00:00
|
|
|
aCfg->Write( SelectPinSelectSymbolEntry, GetSelectPinSelectSymbol() );
|
* 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
|
|
|
aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
|
2015-12-13 16:56:47 +00:00
|
|
|
aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
|
|
|
|
aCfg->Write( AutoplaceJustifyEntry, m_autoplaceJustify );
|
|
|
|
aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
|
2018-01-03 02:52:35 +00:00
|
|
|
aCfg->Write( FootprintPreviewEntry, m_footprintPreview );
|
2019-11-21 15:48:44 +00:00
|
|
|
aCfg->Write( boxedSelectedText, GetSelectionTextAsBox() );
|
|
|
|
aCfg->Write( drawSelectedChildren, GetSelectionDrawChildItems() );
|
|
|
|
aCfg->Write( selectionFillShapes, GetSelectionFillShapes() );
|
2019-11-20 19:54:33 +00:00
|
|
|
aCfg->Write( selectionThickness, GetSelectionThickness() );
|
2010-02-02 15:01:09 +00:00
|
|
|
|
2010-06-17 16:30:10 +00:00
|
|
|
// Save template fieldnames
|
2010-08-09 02:03:16 +00:00
|
|
|
STRING_FORMATTER sf;
|
2018-08-08 20:57:53 +00:00
|
|
|
m_templateFieldNames.Format( &sf, 0 );
|
2010-06-17 16:30:10 +00:00
|
|
|
|
2011-02-28 18:36:19 +00:00
|
|
|
wxString record = FROM_UTF8( sf.GetString().c_str() );
|
2010-06-17 16:30:10 +00:00
|
|
|
record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
|
|
|
|
record.Replace( wxT(" "), wxT(" "), true ); // double space to single
|
|
|
|
|
* 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
|
|
|
aCfg->Write( FieldNamesEntry, record );
|
2019-10-21 18:03:54 +00:00
|
|
|
|
|
|
|
aCfg->Write( TextMarkupFlagsEntry, GetTextMarkupFlags() );
|
2019-11-17 16:43:05 +00:00
|
|
|
aCfg->Write( showSheetFileNameCaseSensitivityDlg, m_showSheetFileNameCaseSensitivityDlg );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
2014-08-25 16:31:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|
|
|
{
|
|
|
|
EDA_DRAW_FRAME::LoadSettings( aCfg );
|
|
|
|
|
2019-08-01 17:26:21 +00:00
|
|
|
SetDefaultLineThickness( (int) aCfg->Read( DefaultDrawLineWidthEntry,
|
|
|
|
DEFAULTDRAWLINETHICKNESS ) );
|
2018-09-16 13:07:20 +00:00
|
|
|
SetDefaultPinLength( (int) aCfg->Read( DefaultPinLengthEntry, DEFAULTPINLENGTH ) );
|
|
|
|
m_textPinNumDefaultSize = (int) aCfg->Read( defaultPinNumSizeEntry, DEFAULTPINNUMSIZE );
|
|
|
|
m_textPinNameDefaultSize = (int) aCfg->Read( defaultPinNameSizeEntry, DEFAULTPINNAMESIZE );
|
|
|
|
SetRepeatDeltaLabel( (int) aCfg->Read( repeatLibLabelIncEntry, DEFAULT_REPEAT_LABEL_INC ) );
|
|
|
|
SetRepeatPinStep( (int) aCfg->Read( pinRepeatStepEntry, DEFAULT_REPEAT_OFFSET_PIN ) );
|
2019-02-05 15:06:36 +00:00
|
|
|
|
2015-04-22 11:39:00 +00:00
|
|
|
wxPoint step;
|
2019-02-05 15:06:36 +00:00
|
|
|
aCfg->Read( repeatLibStepXEntry, &step.x, DEFAULT_REPEAT_OFFSET_X );
|
|
|
|
aCfg->Read( repeatLibStepYEntry, &step.y, DEFAULT_REPEAT_OFFSET_Y );
|
2015-04-22 11:39:00 +00:00
|
|
|
SetRepeatStep( step );
|
2018-09-16 13:07:20 +00:00
|
|
|
m_showPinElectricalTypeName = aCfg->ReadBool( showPinElectricalType, true );
|
2019-02-05 15:06:36 +00:00
|
|
|
aCfg->Read( defaultLibWidthEntry, &m_defaultLibWidth, DEFAULTLIBWIDTH );
|
2018-08-08 20:57:53 +00:00
|
|
|
|
|
|
|
wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
|
|
|
|
|
|
|
|
if( !templateFieldNames.IsEmpty() )
|
|
|
|
{
|
|
|
|
TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
m_templateFieldNames.Parse( &lexer );
|
|
|
|
}
|
|
|
|
catch( const IO_ERROR& DBG( e ) )
|
|
|
|
{
|
|
|
|
// @todo show error msg
|
|
|
|
DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
|
|
|
|
}
|
|
|
|
}
|
2018-08-29 18:31:43 +00:00
|
|
|
|
2018-10-11 12:12:22 +00:00
|
|
|
auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
|
2018-08-29 18:31:43 +00:00
|
|
|
KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
|
2018-09-02 20:19:22 +00:00
|
|
|
settings->m_ShowPinsElectricalType = m_showPinElectricalTypeName;
|
2018-08-31 17:19:09 +00:00
|
|
|
|
|
|
|
// Hidden elements must be editable
|
2018-09-02 20:19:22 +00:00
|
|
|
settings->m_ShowHiddenText = true;
|
|
|
|
settings->m_ShowHiddenPins = true;
|
2018-11-14 21:54:53 +00:00
|
|
|
settings->m_ShowUmbilicals = false;
|
2014-08-25 16:31:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
|
|
|
|
{
|
|
|
|
EDA_DRAW_FRAME::SaveSettings( aCfg );
|
|
|
|
|
2019-07-02 18:58:42 +00:00
|
|
|
aCfg->Write( DefaultDrawLineWidthEntry, GetDefaultLineThickness() );
|
2019-02-05 15:06:36 +00:00
|
|
|
aCfg->Write( DefaultPinLengthEntry, GetDefaultPinLength() );
|
|
|
|
aCfg->Write( defaultPinNumSizeEntry, GetPinNumDefaultSize() );
|
|
|
|
aCfg->Write( defaultPinNameSizeEntry, GetPinNameDefaultSize() );
|
|
|
|
aCfg->Write( repeatLibLabelIncEntry, GetRepeatDeltaLabel() );
|
|
|
|
aCfg->Write( pinRepeatStepEntry, GetRepeatPinStep() );
|
|
|
|
aCfg->Write( repeatLibStepXEntry, GetRepeatStep().x );
|
|
|
|
aCfg->Write( repeatLibStepYEntry, GetRepeatStep().y );
|
2016-11-04 11:13:22 +00:00
|
|
|
aCfg->Write( showPinElectricalType, GetShowElectricalType() );
|
2019-02-05 15:06:36 +00:00
|
|
|
aCfg->Write( defaultLibWidthEntry, m_treePane->GetSize().x );
|
2014-08-25 16:31:32 +00:00
|
|
|
}
|
|
|
|
|
2015-04-22 11:39:00 +00:00
|
|
|
|
2019-06-09 21:57:23 +00:00
|
|
|
void LIB_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent,
|
|
|
|
PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
|
2018-05-14 17:34:18 +00:00
|
|
|
{
|
2018-07-15 23:15:48 +00:00
|
|
|
wxTreebook* book = aParent->GetTreebook();
|
|
|
|
|
2019-08-27 20:50:13 +00:00
|
|
|
book->AddPage( new wxPanel( book ), _( "Symbol Editor" ) );
|
2019-08-18 21:48:52 +00:00
|
|
|
book->AddSubPage( new PANEL_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
|
2019-08-19 16:46:25 +00:00
|
|
|
book->AddSubPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Defaults" ) );
|
2019-06-09 21:57:23 +00:00
|
|
|
|
|
|
|
aHotkeysPanel->AddHotKeys( GetToolManager() );
|
2014-08-25 16:31:32 +00:00
|
|
|
}
|
|
|
|
|
2017-03-05 22:31:31 +00:00
|
|
|
|
|
|
|
SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
|
|
|
|
{
|
|
|
|
// This is a lazy loading function, it loads the project specific table when
|
|
|
|
// that table is asked for, not before.
|
|
|
|
SYMBOL_LIB_TABLE* tbl = (SYMBOL_LIB_TABLE*) GetElem( ELEM_SYMBOL_LIB_TABLE );
|
|
|
|
|
|
|
|
// its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
|
2018-09-15 11:05:54 +00:00
|
|
|
wxASSERT( !tbl || tbl->Type() == SYMBOL_LIB_TABLE_T );
|
2017-03-05 22:31:31 +00:00
|
|
|
|
|
|
|
if( !tbl )
|
|
|
|
{
|
|
|
|
// Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
|
|
|
|
// ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
|
|
|
|
// stack this way, all using the same global fallback table.
|
|
|
|
tbl = new SYMBOL_LIB_TABLE( &SYMBOL_LIB_TABLE::GetGlobalLibTable() );
|
|
|
|
|
|
|
|
SetElem( ELEM_SYMBOL_LIB_TABLE, tbl );
|
|
|
|
|
|
|
|
wxString prjPath;
|
|
|
|
|
2017-11-10 22:55:37 +00:00
|
|
|
wxGetEnv( PROJECT_VAR_NAME, &prjPath );
|
|
|
|
|
2018-05-31 07:08:58 +00:00
|
|
|
if( !prjPath.IsEmpty() )
|
2017-03-05 22:31:31 +00:00
|
|
|
{
|
2018-05-31 07:08:58 +00:00
|
|
|
wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
tbl->Load( fn.GetFullPath() );
|
|
|
|
}
|
|
|
|
catch( const IO_ERROR& ioe )
|
|
|
|
{
|
|
|
|
wxString msg;
|
|
|
|
msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
|
|
|
|
fn.GetFullPath() );
|
|
|
|
DisplayErrorMessage( NULL, msg, ioe.What() );
|
|
|
|
}
|
2017-03-05 22:31:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return tbl;
|
|
|
|
}
|