2009-11-03 13:26:31 +00:00
|
|
|
/******************/
|
|
|
|
/** eeconfig.cpp **/
|
|
|
|
/******************/
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "fctsys.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2009-01-29 14:26:20 +00:00
|
|
|
#include "gr_basic.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "common.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "eeschema_id.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "class_drawpanel.h"
|
|
|
|
#include "confirm.h"
|
|
|
|
#include "gestfich.h"
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "program.h"
|
|
|
|
#include "general.h"
|
|
|
|
#include "protos.h"
|
2009-10-27 19:30:32 +00:00
|
|
|
#include "eeschema_config.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "worksheet.h"
|
2007-09-06 11:52:26 +00:00
|
|
|
#include "hotkeys.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2008-02-26 19:19:54 +00:00
|
|
|
#define HOTKEY_FILENAME wxT( "eeschema" )
|
2007-09-10 04:51:01 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2008-02-26 19:19:54 +00:00
|
|
|
void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
int id = event.GetId();
|
|
|
|
wxPoint pos;
|
|
|
|
wxFileName fn;
|
2008-02-26 19:19:54 +00:00
|
|
|
|
|
|
|
wxGetMousePosition( &pos.x, &pos.y );
|
|
|
|
|
|
|
|
pos.y += 5;
|
|
|
|
|
|
|
|
switch( id )
|
|
|
|
{
|
|
|
|
case ID_COLORS_SETUP:
|
|
|
|
DisplayColorSetupFrame( this, pos );
|
|
|
|
break;
|
|
|
|
|
2009-11-03 13:26:31 +00:00
|
|
|
case ID_CONFIG_REQ: // Display the configuration window.
|
2008-02-26 19:19:54 +00:00
|
|
|
InstallConfigFrame( pos );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_OPTIONS_SETUP:
|
|
|
|
DisplayOptionFrame( this, pos );
|
2009-11-03 13:26:31 +00:00
|
|
|
// Redraw, because grid settings may have changed.
|
|
|
|
DrawPanel->Refresh( TRUE );
|
2008-02-26 19:19:54 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_CONFIG_SAVE:
|
2009-04-29 17:09:00 +00:00
|
|
|
SaveProjectFile( this );
|
2008-02-26 19:19:54 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_CONFIG_READ:
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
fn = g_RootSheet->m_AssociatedScreen->m_FileName;
|
|
|
|
fn.SetExt( ProjectFileExtension );
|
|
|
|
|
|
|
|
wxFileDialog dlg( this, _( "Read Project File" ), fn.GetPath(),
|
|
|
|
fn.GetFullName(), ProjectFileWildcard,
|
|
|
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
|
|
|
|
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
2008-02-26 19:19:54 +00:00
|
|
|
break;
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
LoadProjectFile( fn.GetFullPath(), TRUE );
|
2008-02-26 19:19:54 +00:00
|
|
|
}
|
2008-12-08 15:27:13 +00:00
|
|
|
break;
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2009-10-27 13:48:24 +00:00
|
|
|
|
|
|
|
/* Hotkey IDs */
|
|
|
|
case ID_PREFERENCES_HOTKEY_CREATE_CONFIG:
|
2009-04-05 20:49:15 +00:00
|
|
|
fn = wxFileName( ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ),
|
|
|
|
HOTKEY_FILENAME,
|
|
|
|
DEFAULT_HOTKEY_FILENAME_EXT );
|
|
|
|
WriteHotkeyConfigFile( fn.GetFullPath(), s_Eeschema_Hokeys_Descr, true );
|
2008-02-26 19:19:54 +00:00
|
|
|
break;
|
|
|
|
|
2009-10-27 13:48:24 +00:00
|
|
|
case ID_PREFERENCES_HOTKEY_READ_CONFIG:
|
2008-02-26 19:19:54 +00:00
|
|
|
Read_Hotkey_Config( this, true );
|
|
|
|
break;
|
|
|
|
|
2009-10-27 13:48:24 +00:00
|
|
|
case ID_PREFERENCES_HOTKEY_EDIT_CONFIG:
|
2008-02-26 19:19:54 +00:00
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
fn = wxFileName( ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ),
|
|
|
|
HOTKEY_FILENAME, DEFAULT_HOTKEY_FILENAME_EXT );
|
|
|
|
wxString editorname = wxGetApp().GetEditorName();
|
2008-02-26 19:19:54 +00:00
|
|
|
if( !editorname.IsEmpty() )
|
2009-04-05 20:49:15 +00:00
|
|
|
ExecuteFile( this, editorname, QuoteFullPath( fn ) );
|
2008-02-26 19:19:54 +00:00
|
|
|
}
|
2008-12-08 15:27:13 +00:00
|
|
|
break;
|
2008-02-26 19:19:54 +00:00
|
|
|
|
|
|
|
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
|
|
|
|
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
|
|
|
|
HandleHotkeyConfigMenuSelection( this, id );
|
|
|
|
break;
|
|
|
|
|
2009-11-03 13:26:31 +00:00
|
|
|
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
|
|
|
|
// Display current hotkey list for eeschema.
|
2008-02-26 19:19:54 +00:00
|
|
|
DisplayHotkeyList( this, s_Schematic_Hokeys_Descr );
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2009-05-21 17:42:42 +00:00
|
|
|
DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config internal error" ) );
|
2008-02-26 19:19:54 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-21 19:37:31 +00:00
|
|
|
/*
|
|
|
|
* Read the hotkey files config for eeschema and libedit
|
2008-02-26 19:19:54 +00:00
|
|
|
*/
|
2009-04-29 17:09:00 +00:00
|
|
|
bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose )
|
2007-08-21 19:37:31 +00:00
|
|
|
{
|
2008-12-08 15:27:13 +00:00
|
|
|
wxString FullFileName = ReturnHotkeyConfigFilePath(
|
|
|
|
g_ConfigFileLocationChoice );
|
2007-08-23 01:40:50 +00:00
|
|
|
|
2008-02-26 19:19:54 +00:00
|
|
|
FullFileName += HOTKEY_FILENAME;
|
2009-06-19 20:13:22 +00:00
|
|
|
FullFileName += wxT(".");
|
2008-02-26 19:19:54 +00:00
|
|
|
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
|
2008-12-08 15:27:13 +00:00
|
|
|
frame->ReadHotkeyConfigFile( FullFileName,
|
|
|
|
s_Eeschema_Hokeys_Descr,
|
|
|
|
verbose );
|
2008-02-26 19:19:54 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2007-08-21 19:37:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
/**
|
|
|
|
* Return project file parameter list for EESchema.
|
2008-02-26 19:19:54 +00:00
|
|
|
*
|
2009-04-29 17:09:00 +00:00
|
|
|
* Populate the project file parameter array specific to EESchema if it hasn't
|
|
|
|
* already been populated and return a reference to the array to the caller.
|
|
|
|
* Creating the parameter list at run time has the advantage of being able
|
|
|
|
* to define local variables. The old method of statically building the array
|
|
|
|
* at compile time requiring global variable definitions.
|
|
|
|
*/
|
2009-05-21 17:42:42 +00:00
|
|
|
PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetProjectFileParameters( void )
|
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;
|
|
|
|
|
2009-05-21 17:42:42 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
|
|
|
|
&m_UserLibraryPath ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
|
|
|
|
&m_ComponentLibFiles,
|
|
|
|
GROUPLIB ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "NetFmt" ),
|
|
|
|
&m_NetlistFormat,
|
|
|
|
NET_TYPE_PCBNEW,
|
|
|
|
NET_TYPE_PCBNEW,
|
|
|
|
NET_TYPE_CUSTOM_MAX ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
|
|
|
/* NOTE: Left as global until supporting code can be fixed. */
|
2009-05-21 17:42:42 +00:00
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLSpd" ),
|
|
|
|
&g_HPGL_Pen_Descr.m_Pen_Speed,
|
|
|
|
20, 2, 45 ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLDm" ),
|
|
|
|
&g_HPGL_Pen_Descr.m_Pen_Diam,
|
|
|
|
15, 1, 150 ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLNum" ),
|
|
|
|
&g_HPGL_Pen_Descr.m_Pen_Num,
|
|
|
|
1, 1, 8 ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A4" ),
|
|
|
|
&g_Sheet_A4.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A4" ),
|
|
|
|
&g_Sheet_A4.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A3" ),
|
|
|
|
&g_Sheet_A3.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A3" ),
|
|
|
|
&g_Sheet_A3.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A2" ),
|
|
|
|
&g_Sheet_A2.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A2" ),
|
|
|
|
&g_Sheet_A2.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A1" ),
|
|
|
|
&g_Sheet_A1.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A1" ),
|
|
|
|
&g_Sheet_A1.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A0" ),
|
|
|
|
&g_Sheet_A0.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A0" ),
|
|
|
|
&g_Sheet_A0.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A" ),
|
|
|
|
&g_Sheet_A.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A" ),
|
|
|
|
&g_Sheet_A.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_B" ),
|
|
|
|
&g_Sheet_B.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_B" ),
|
|
|
|
&g_Sheet_B.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_C" ),
|
|
|
|
&g_Sheet_C.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_C" ),
|
|
|
|
&g_Sheet_C.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_D" ),
|
|
|
|
&g_Sheet_D.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_D" ),
|
|
|
|
&g_Sheet_D.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_E" ),
|
|
|
|
&g_Sheet_E.m_Offset.x ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_E" ),
|
|
|
|
&g_Sheet_E.m_Offset.y ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptD_X" ),
|
|
|
|
&g_RepeatStep.x,
|
|
|
|
0, -1000, +1000 ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptD_Y" ),
|
|
|
|
&g_RepeatStep.y,
|
|
|
|
100, -1000, +1000 ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptLab" ),
|
|
|
|
&g_RepeatDeltaLabel,
|
|
|
|
1, -10, +10 ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "SimCmd" ),
|
|
|
|
&g_SimulatorCommandLine ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "UseNetN" ),
|
|
|
|
&g_OptNetListUseNames,
|
|
|
|
0, 0, 1 ) );
|
|
|
|
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
|
|
|
|
&g_DefaultTextLabelSize,
|
|
|
|
DEFAULT_SIZE_TEXT, 0,
|
|
|
|
1000 ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
|
|
|
return m_projectFileParams;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Load the Kicad project file (*.pro) settings specific to EESchema.
|
2008-02-26 19:19:54 +00:00
|
|
|
*/
|
2009-04-29 17:09:00 +00:00
|
|
|
bool WinEDA_SchematicFrame::LoadProjectFile( const wxString& CfgFileName,
|
|
|
|
bool ForceRereadConfig )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
wxFileName fn;
|
2008-12-08 15:27:13 +00:00
|
|
|
bool IsRead = TRUE;
|
2009-04-29 17:09:00 +00:00
|
|
|
wxArrayString liblist_tmp = m_ComponentLibFiles;
|
2008-02-26 19:19:54 +00:00
|
|
|
|
|
|
|
if( CfgFileName.IsEmpty() )
|
2009-04-05 20:49:15 +00:00
|
|
|
fn = g_RootSheet->m_AssociatedScreen->m_FileName;
|
2008-02-26 19:19:54 +00:00
|
|
|
else
|
2009-04-05 20:49:15 +00:00
|
|
|
fn = CfgFileName;
|
2009-04-29 17:09:00 +00:00
|
|
|
m_ComponentLibFiles.Clear();
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
/* Change the schematic file extension (.sch) to the project file
|
|
|
|
* extension (.pro). */
|
|
|
|
fn.SetExt( ProjectFileExtension );
|
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
wxGetApp().RemoveLibraryPath( m_UserLibraryPath );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
if( !wxGetApp().ReadProjectConfig( fn.GetFullPath(), GROUP,
|
|
|
|
GetProjectFileParameters(),
|
2009-04-05 20:49:15 +00:00
|
|
|
ForceRereadConfig ? FALSE : TRUE ) )
|
2008-02-26 19:19:54 +00:00
|
|
|
{
|
2009-04-29 17:09:00 +00:00
|
|
|
m_ComponentLibFiles = liblist_tmp;
|
2008-02-26 19:19:54 +00:00
|
|
|
IsRead = FALSE;
|
|
|
|
}
|
|
|
|
|
2009-04-09 18:39:39 +00:00
|
|
|
/* User library path takes precedent over default library search paths. */
|
2009-04-29 17:09:00 +00:00
|
|
|
wxGetApp().InsertLibraryPath( m_UserLibraryPath, 1 );
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2009-11-03 13:26:31 +00:00
|
|
|
/* If the list is void, force loadind the library "power.lib" that is
|
|
|
|
* the "standard" library for power symbols.
|
|
|
|
*/
|
2009-04-29 17:09:00 +00:00
|
|
|
if( m_ComponentLibFiles.GetCount() == 0 )
|
|
|
|
m_ComponentLibFiles.Add( wxT( "power" ) );
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2009-09-18 14:56:05 +00:00
|
|
|
SetDrawBgColor( g_DrawBgColor );
|
|
|
|
LoadLibraries();
|
2009-10-14 19:43:31 +00:00
|
|
|
GetBaseScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
2008-02-26 19:19:54 +00:00
|
|
|
|
|
|
|
return IsRead;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
/*
|
|
|
|
* Save the Kicad project file (*.pro) settings specific to EESchema.
|
|
|
|
*/
|
|
|
|
void WinEDA_SchematicFrame::SaveProjectFile( wxWindow* displayframe )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
wxFileName fn;
|
|
|
|
|
|
|
|
fn = g_RootSheet->m_AssociatedScreen->m_FileName /*ConfigFileName*/;
|
|
|
|
fn.SetExt( ProjectFileExtension );
|
|
|
|
|
|
|
|
wxFileDialog dlg( this, _( "Save Project Settings" ), wxGetCwd(),
|
|
|
|
fn.GetFullName(), ProjectFileWildcard,
|
|
|
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
|
|
|
|
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
2008-02-26 19:19:54 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* ecriture de la configuration */
|
2009-04-29 17:09:00 +00:00
|
|
|
wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP,
|
|
|
|
GetProjectFileParameters() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-02 07:26:49 +00:00
|
|
|
static const wxString DefaultDrawLineWidthEntry( wxT( "DefaultDrawLineWidth" ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
static const wxString ShowHiddenPinsEntry( wxT( "ShowHiddenPins" ) );
|
2009-05-01 18:06:03 +00:00
|
|
|
static const wxString HorzVertLinesOnlyEntry( wxT( "HorizVertLinesOnly" ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the EESchema applications settings list.
|
|
|
|
*
|
|
|
|
* This replaces the old statically define list that had the project
|
|
|
|
* file settings and the application settings mixed together. This
|
|
|
|
* was confusing and caused some settings to get saved and loaded
|
|
|
|
* incorrectly. Currently, only the settings that are needed at start
|
|
|
|
* up by the main window are defined here. There are other locally used
|
|
|
|
* settings scattered thoughout the EESchema source code. If you need
|
|
|
|
* to define a configuration setting that need to be loaded at run time,
|
|
|
|
* this is the place to define it.
|
|
|
|
*
|
|
|
|
* TODO: Define the configuration variables as member variables instead of
|
|
|
|
* global variables or move them to the object class where they are
|
|
|
|
* used.
|
|
|
|
*/
|
2009-05-21 17:42:42 +00:00
|
|
|
PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetConfigurationSettings( void )
|
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;
|
|
|
|
|
2009-05-21 17:42:42 +00:00
|
|
|
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Unite" ),
|
|
|
|
&g_UnitMetric, 0, 0, 1 ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_WIRE],
|
|
|
|
GREEN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBus" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_BUS],
|
|
|
|
BLUE ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorConn" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_JUNCTION],
|
|
|
|
GREEN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorLlab" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_LOCLABEL],
|
|
|
|
BLACK ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorHlab" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_HIERLABEL],
|
|
|
|
BROWN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGbllab" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_GLOBLABEL],
|
|
|
|
RED ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPinF" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_PINFUN],
|
|
|
|
MAGENTA ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColPinN" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_PINNUM],
|
|
|
|
RED ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPNam" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_PINNAM],
|
|
|
|
CYAN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorField" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_FIELDS],
|
|
|
|
MAGENTA ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorRef" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_REFERENCEPART],
|
|
|
|
CYAN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorValue" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_VALUEPART],
|
|
|
|
CYAN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNote" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_NOTES],
|
|
|
|
LIGHTBLUE ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBody" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_DEVICE],
|
|
|
|
RED ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBodyBg" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_DEVICE_BACKGROUND],
|
|
|
|
LIGHTYELLOW ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNetN" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_NETNAM],
|
|
|
|
DARKGRAY ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPin" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_PIN],
|
|
|
|
RED ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheet" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_SHEET],
|
|
|
|
MAGENTA ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true,
|
|
|
|
wxT( "ColorSheetFileName" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_SHEETFILENAME],
|
|
|
|
BROWN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetName" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_SHEETNAME],
|
|
|
|
CYAN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetLab" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_SHEETLABEL],
|
|
|
|
BROWN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNoCo" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_NOCONNECT],
|
|
|
|
BLUE ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcW" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_ERC_WARN],
|
|
|
|
GREEN ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcE" ),
|
|
|
|
&g_LayerDescr.LayerColor[LAYER_ERC_ERR],
|
|
|
|
RED ) );
|
|
|
|
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGrid" ),
|
|
|
|
&g_GridColor,
|
|
|
|
DARKDARKGRAY ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
return m_configSettings;
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Load the EESchema configuration parameters.
|
|
|
|
*/
|
|
|
|
void WinEDA_SchematicFrame::LoadSettings()
|
|
|
|
{
|
2009-04-29 17:09:00 +00:00
|
|
|
wxASSERT( wxGetApp().m_EDA_Config != NULL );
|
|
|
|
|
|
|
|
wxConfig* cfg = wxGetApp().m_EDA_Config;
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_DrawFrame::LoadSettings();
|
2009-04-29 17:09:00 +00:00
|
|
|
|
|
|
|
wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() );
|
|
|
|
|
2009-06-02 07:26:49 +00:00
|
|
|
g_DrawDefaultLineThickness = cfg->Read( DefaultDrawLineWidthEntry, (long) 6 );
|
2009-04-29 17:09:00 +00:00
|
|
|
cfg->Read( ShowHiddenPinsEntry, &m_ShowAllPins, false );
|
2009-05-01 18:06:03 +00:00
|
|
|
cfg->Read( HorzVertLinesOnlyEntry, &g_HVLines, true );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Save the EESchema configuration parameters.
|
|
|
|
*/
|
|
|
|
void WinEDA_SchematicFrame::SaveSettings()
|
|
|
|
{
|
2009-04-29 17:09:00 +00:00
|
|
|
wxASSERT( wxGetApp().m_EDA_Config != NULL );
|
|
|
|
|
|
|
|
wxConfig* cfg = wxGetApp().m_EDA_Config;
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_DrawFrame::SaveSettings();
|
2009-04-29 17:09:00 +00:00
|
|
|
|
|
|
|
wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() );
|
|
|
|
|
2009-06-02 07:26:49 +00:00
|
|
|
cfg->Write( DefaultDrawLineWidthEntry, (long) g_DrawDefaultLineThickness );
|
2009-04-29 17:09:00 +00:00
|
|
|
cfg->Write( ShowHiddenPinsEntry, m_ShowAllPins );
|
2009-05-01 18:06:03 +00:00
|
|
|
cfg->Write( HorzVertLinesOnlyEntry, g_HVLines );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|