Commit b65590f7 authored by charras's avatar charras

code cleanup in project_config.cpp and some enhancements

parent 2eaa28f0
...@@ -4,6 +4,17 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,17 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-mar-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++All
code cleanup in project_config.cpp.
Now parameters common to all projects are saved on exit.
(they are usally options like colors, draw options ...)
++pcbnew:
added option to show or not netnames on pads and tracks
2009-mar-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2009-mar-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
++pcbnew: ++pcbnew:
......
/** /**
* Functions to draw and plot text on screen * Functions to draw and plot text on screen
* @file drawtxt.cpp * @file drawtxt.cpp
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -53,7 +53,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -53,7 +53,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
void (* aCallback) (int x0, int y0, int xf, int yf)) void (* aCallback) (int x0, int y0, int xf, int yf))
/****************************************************************************************************/ /****************************************************************************************************/
{ {
int ii, kk, char_count, AsciiCode, endcar; int kk, char_count, AsciiCode;
int x0, y0; int x0, y0;
int size_h, size_v, pitch; int size_h, size_v, pitch;
SH_CODE f_cod, plume = 'U'; SH_CODE f_cod, plume = 'U';
...@@ -62,9 +62,10 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -62,9 +62,10 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
int ux0, uy0, dx, dy; // Draw coordinate for segments to draw. also used in some other calculation int ux0, uy0, dx, dy; // Draw coordinate for segments to draw. also used in some other calculation
int cX, cY; // Texte center int cX, cY; // Texte center
int ox, oy; // Draw coordinates for the current char int ox, oy; // Draw coordinates for the current char
int coord[100]; // Buffer coordinate used to draw polylines (char shapes) #define BUF_SIZE 100
wxPoint coord[BUF_SIZE+1]; // Buffer coordinate used to draw polylines (one char shape)
bool sketch_mode = false; bool sketch_mode = false;
bool italic_reverse = false; // true for mirrored texts with m_Size.x < 0 bool italic_reverse = false; // true for mirrored texts with m_Size.x < 0
size_h = aSize.x; size_h = aSize.x;
size_v = aSize.y; size_v = aSize.y;
...@@ -72,7 +73,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -72,7 +73,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
if( aWidth < 0 ) if( aWidth < 0 )
{ {
aWidth = -aWidth; aWidth = -aWidth;
sketch_mode = TRUE; sketch_mode = true;
} }
int thickness = aWidth; int thickness = aWidth;
if ( aSize.x < 0 ) // text is mirrored using size.x < 0 (mirror / Y axis) if ( aSize.x < 0 ) // text is mirrored using size.x < 0 (mirror / Y axis)
...@@ -234,7 +235,9 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -234,7 +235,9 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description
* du caractere a dessiner */ * du caractere a dessiner */
for( ii = 0, endcar = FALSE; !endcar; ptcar++ ) int point_count;
bool endcar;
for( point_count = 0, endcar = false; !endcar; ptcar++ )
{ {
f_cod = *ptcar; f_cod = *ptcar;
...@@ -242,36 +245,34 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -242,36 +245,34 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
switch( f_cod ) switch( f_cod )
{ {
case 'X': case 'X':
endcar = TRUE; /* fin du caractere */ endcar = true; /* fin du caractere */
break; break;
case 'U': case 'U':
if( ii && (plume == 'D' ) ) if( point_count && (plume == 'D' ) )
{ {
if( aWidth <= 1 ) if( aWidth <= 1 )
aWidth = 0; aWidth = 0;
if ( aCallback ) if ( aCallback )
{ {
int ik, * coordptr; for( int ik = 0; ik < (point_count - 1); ik ++ )
coordptr = coord; {
for( ik = 0; ik < (ii - 2); ik += 2, coordptr += 2 ) aCallback( coord[ik].x, coord[ik].y,
aCallback( *coordptr, *(coordptr + 1), coord[ik+1].x, coord[ik+1].y );
*(coordptr + 2), *(coordptr + 3) ); }
} }
else if( sketch_mode ) else if( sketch_mode )
{ {
int ik, * coordptr; for( int ik = 0; ik < (point_count - 1); ik ++ )
coordptr = coord; GRCSegm( &aPanel->m_ClipBox, aDC, coord[ik].x, coord[ik].y,
for( ik = 0; ik < (ii - 2); ik += 2, coordptr += 2 ) coord[ik+1].x, coord[ik+1].y, aWidth, aColor );
GRCSegm( &aPanel->m_ClipBox, aDC, *coordptr, *(coordptr + 1),
*(coordptr + 2), *(coordptr + 3), aWidth, aColor );
} }
else else
GRPoly( &aPanel->m_ClipBox, aDC, ii / 2, (wxPoint*)coord, 0, GRPoly( &aPanel->m_ClipBox, aDC, point_count, coord, 0,
aWidth, aColor, aColor ); aWidth, aColor, aColor );
} }
plume = f_cod; ii = 0; plume = f_cod; point_count = 0;
break; break;
case 'D': case 'D':
...@@ -295,8 +296,10 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -295,8 +296,10 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
dx = k2 + ox; dy = k1 + oy; dx = k2 + ox; dy = k1 + oy;
RotatePoint( &dx, &dy, cX, cY, aOrient ); RotatePoint( &dx, &dy, cX, cY, aOrient );
coord[ii++] = dx; coord[point_count].x = dx;
coord[ii++] = dy; coord[point_count].y = dy;
if ( point_count < BUF_SIZE-1 )
point_count++;
break; break;
} }
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "param_config.h"
#include "worksheet.h" #include "worksheet.h"
#include "id.h" #include "id.h"
#include "build_version.h" #include "build_version.h"
......
This diff is collapsed.
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#define eda_global extern #define eda_global extern
#endif #endif
#include "param_config.h"
#define INSETUP TRUE #define INSETUP TRUE
#define GROUP wxT("/cvpcb") #define GROUP wxT("/cvpcb")
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#define eda_global extern #define eda_global extern
#endif #endif
#include "param_config.h"
#define GROUP wxT( "/eeschema" ) #define GROUP wxT( "/eeschema" )
#define GROUPCOMMON wxT( "/common" ) #define GROUPCOMMON wxT( "/common" )
#define GROUPLIB wxT( "libraries" ) #define GROUPLIB wxT( "libraries" )
......
...@@ -63,6 +63,8 @@ bool WinEDA_App::OnInit() ...@@ -63,6 +63,8 @@ bool WinEDA_App::OnInit()
/* init EESCHEMA */ /* init EESCHEMA */
GetSettings(); // read current setup GetSettings(); // read current setup
SeedLayers(); SeedLayers();
extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().ReadCurrentSetupValues( ParamCfgList );
Read_Hotkey_Config( frame, false ); /* Must be called before creating Read_Hotkey_Config( frame, false ); /* Must be called before creating
* the main frame in order to * the main frame in order to
* display the real hotkeys in menus * display the real hotkeys in menus
......
...@@ -186,6 +186,9 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -186,6 +186,9 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
WinEDA_SchematicFrame::~WinEDA_SchematicFrame() WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
{ {
extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().SaveCurrentSetupValues( ParamCfgList );
SAFE_DELETE( g_RootSheet ); SAFE_DELETE( g_RootSheet );
SAFE_DELETE( m_CurrentSheet ); //a DrawSheetPath, on the heap. SAFE_DELETE( m_CurrentSheet ); //a DrawSheetPath, on the heap.
m_CurrentSheet = NULL; m_CurrentSheet = NULL;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#endif #endif
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
...@@ -163,6 +164,9 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -163,6 +164,9 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
WinEDA_GerberFrame::~WinEDA_GerberFrame() WinEDA_GerberFrame::~WinEDA_GerberFrame()
{ {
SetBaseScreen( ScreenPcb ); SetBaseScreen( ScreenPcb );
extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().SaveCurrentSetupValues( ParamCfgList );
} }
......
...@@ -37,6 +37,8 @@ bool WinEDA_App::OnInit() ...@@ -37,6 +37,8 @@ bool WinEDA_App::OnInit()
ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb;
GetSettings(); GetSettings();
extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().ReadCurrentSetupValues( ParamCfgList );
if( m_Checker && m_Checker->IsAnotherRunning() ) if( m_Checker && m_Checker->IsAnotherRunning() )
{ {
......
/**********************************************************/ /**********************************************************/
/** cfg.h : configuration: definition des structures **/ /* gerber_config.h : configuration: setup parameters list */
/**********************************************************/ /**********************************************************/
#include "param_config.h"
#define GROUP wxT("/gerbview") #define GROUP wxT("/gerbview")
#define GROUPLIB wxT("libraries") #define GROUPLIB wxT("libraries")
...@@ -444,7 +447,7 @@ static PARAM_CFG_INT CursorShapeCfg ...@@ -444,7 +447,7 @@ static PARAM_CFG_INT CursorShapeCfg
0, 1 /* Valeurs extremes */ 0, 1 /* Valeurs extremes */
); );
static PARAM_CFG_BASE * ParamCfgList[] = PARAM_CFG_BASE * ParamCfgList[] =
{ {
& PhotoExtBufCfg, & PhotoExtBufCfg,
& PenExtBufCfg, & PenExtBufCfg,
......
...@@ -82,6 +82,20 @@ public: ...@@ -82,6 +82,20 @@ public:
const wxString& GroupName, const wxString& GroupName,
PARAM_CFG_BASE** List ); PARAM_CFG_BASE** List );
/** Function SaveCurrentSetupValues()
* Save the current setup values in m_EDA_Config
* saved parameters are parameters that have the .m_Setup member set to true
* @param aList = array of PARAM_CFG_BASE pointers
*/
void SaveCurrentSetupValues( PARAM_CFG_BASE** aList );
/** Function ReadCurrentSetupValues()
* Raed the current setup values previously saved, from m_EDA_Config
* saved parameters are parameters that have the .m_Setup member set to true
* @param aList = array of PARAM_CFG_BASE pointers
*/
void ReadCurrentSetupValues( PARAM_CFG_BASE** aList );
bool ReadProjectConfig( const wxString& local_config_filename, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, PARAM_CFG_BASE** List, const wxString& GroupName, PARAM_CFG_BASE** List,
bool Load_Only_if_New ); bool Load_Only_if_New );
......
...@@ -86,117 +86,8 @@ enum pseudokeys { ...@@ -86,117 +86,8 @@ enum pseudokeys {
/* forward declarations: */ /* forward declarations: */
class LibNameList; class LibNameList;
/* definifition des types de parametre des files de configuration */
enum paramcfg_id /* type du parametre dans la structure ParamConfig */
{
PARAM_INT,
PARAM_SETCOLOR,
PARAM_DOUBLE,
PARAM_BOOL,
PARAM_LIBNAME_LIST,
PARAM_WXSTRING,
PARAM_COMMAND_ERASE
};
#define MAX_COLOR 0x8001F
#define INT_MINVAL 0x80000000
#define INT_MAXVAL 0x7FFFFFFF
class PARAM_CFG_BASE
{
public:
const wxChar* m_Ident; /* Abreviation de reperage des debuts de lignes */
paramcfg_id m_Type; /* flag type des parametres */
const wxChar* m_Group; /* Nom du groupe (rubrique) de classement */
bool m_Setup; /* TRUE -> inscription en setup (registration base)*/
public:
PARAM_CFG_BASE( const wxChar* ident, const paramcfg_id type, const wxChar* group = NULL );
~PARAM_CFG_BASE() { };
};
class PARAM_CFG_INT : public PARAM_CFG_BASE
{
public:
int* m_Pt_param; /* pointeur sur le parametre a configurer */
int m_Min, m_Max; /* valeurs extremes du parametre */
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_INT( const wxChar* ident, int* ptparam,
int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL,
const wxChar* group = NULL );
PARAM_CFG_INT( bool Insetup, const wxChar* ident, int* ptparam,
int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL,
const wxChar* group = NULL );
};
class PARAM_CFG_SETCOLOR : public PARAM_CFG_BASE
{
public:
int* m_Pt_param; /* pointeur sur le parametre a configurer */
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_SETCOLOR( const wxChar* ident, int* ptparam,
int default_val, const wxChar* group = NULL );
PARAM_CFG_SETCOLOR( bool Insetup, const wxChar* ident, int* ptparam,
int default_val, const wxChar* group = NULL );
};
class PARAM_CFG_DOUBLE : public PARAM_CFG_BASE
{
public:
double* m_Pt_param; /* pointeur sur le parametre a configurer */
double m_Default; /* valeur par defaut */
double m_Min, m_Max; /* valeurs extremes du parametre */
public:
PARAM_CFG_DOUBLE( const wxChar* ident, double* ptparam,
double default_val = 0.0, double min = 0.0, double max = 10000.0,
const wxChar* group = NULL );
PARAM_CFG_DOUBLE( bool Insetup, const wxChar* ident, double* ptparam,
double default_val = 0.0, double min = 0.0, double max = 10000.0,
const wxChar* group = NULL );
};
class PARAM_CFG_BOOL : public PARAM_CFG_BASE
{
public:
bool* m_Pt_param; /* pointeur sur le parametre a configurer */
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_BOOL( const wxChar* ident, bool* ptparam,
int default_val = FALSE, const wxChar* group = NULL );
PARAM_CFG_BOOL( bool Insetup, const wxChar* ident, bool* ptparam,
int default_val = FALSE, const wxChar* group = NULL );
};
//#define MAX_COLOR 0x8001F
class PARAM_CFG_WXSTRING : public PARAM_CFG_BASE
{
public:
wxString* m_Pt_param; /* pointeur sur le parametre a configurer */
public:
PARAM_CFG_WXSTRING( const wxChar* ident, wxString* ptparam, const wxChar* group = NULL );
PARAM_CFG_WXSTRING( bool Insetup,
const wxChar* ident,
wxString* ptparam,
const wxChar* group = NULL );
};
class PARAM_CFG_LIBNAME_LIST : public PARAM_CFG_BASE
{
public:
wxArrayString* m_Pt_param; /* pointeur sur le parametre a configurer */
public:
PARAM_CFG_LIBNAME_LIST( const wxChar* ident,
wxArrayString* ptparam,
const wxChar* group = NULL );
};
/***********************************/ /***********************************/
...@@ -220,7 +111,7 @@ private: ...@@ -220,7 +111,7 @@ private:
}; };
/* Gestion des feuilles de trac�: /* Clsass to handle pages sizes:
*/ */
class Ki_PageDescr class Ki_PageDescr
{ {
...@@ -311,6 +202,7 @@ COMMON_GLOBL bool g_ShowPageLimits // TRUE to display the page limits ...@@ -311,6 +202,7 @@ COMMON_GLOBL bool g_ShowPageLimits // TRUE to display the page limits
#endif #endif
; ;
/* Gloabl variables for project handling */ /* Gloabl variables for project handling */
COMMON_GLOBL wxString g_Prj_Config_Filename_ext COMMON_GLOBL wxString g_Prj_Config_Filename_ext
#ifdef EDA_BASE #ifdef EDA_BASE
......
/**
* The common library
* @file param_config.h
*/
#ifndef __PARAM_CONFIG_H__
#define __PARAM_CONFIG_H__ 1
#include "wx/confbase.h"
#include "wx/fileconf.h"
#ifndef COMMON_GLOBL
# define COMMON_GLOBL extern
#endif
/* definifition des types de parametre des files de configuration */
enum paramcfg_id /* type du parametre dans la structure ParamConfig */
{
PARAM_INT,
PARAM_SETCOLOR,
PARAM_DOUBLE,
PARAM_BOOL,
PARAM_LIBNAME_LIST,
PARAM_WXSTRING,
PARAM_COMMAND_ERASE
};
#define MAX_COLOR 0x8001F
#define INT_MINVAL 0x80000000
#define INT_MAXVAL 0x7FFFFFFF
class PARAM_CFG_BASE
{
public:
const wxChar* m_Ident; /* Keyword in config data */
paramcfg_id m_Type; /* Type of parameter */
const wxChar* m_Group; /* Group name (tjis is like a path in the config data) */
bool m_Setup; /* TRUE -> setup parameter (used for all projects), FALSE = parameter relative to a project */
public:
PARAM_CFG_BASE( const wxChar* ident, const paramcfg_id type, const wxChar* group = NULL );
~PARAM_CFG_BASE() { };
/** ReadParam
* read the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
virtual void ReadParam( wxConfigBase* aConfig ) {};
/** SaveParam
* the the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
virtual void SaveParam( wxConfigBase* aConfig ) {};
};
class PARAM_CFG_INT : public PARAM_CFG_BASE
{
public:
int* m_Pt_param; /* pointeur sur le parametre a configurer */
int m_Min, m_Max; /* valeurs extremes du parametre */
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_INT( const wxChar* ident, int* ptparam,
int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL,
const wxChar* group = NULL );
PARAM_CFG_INT( bool Insetup, const wxChar* ident, int* ptparam,
int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL,
const wxChar* group = NULL );
/** ReadParam
* read the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
virtual void ReadParam( wxConfigBase* aConfig );
/** SaveParam
* the the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
virtual void SaveParam( wxConfigBase* aConfig );
};
class PARAM_CFG_SETCOLOR : public PARAM_CFG_BASE
{
public:
int* m_Pt_param; /* pointeur sur le parametre a configurer */
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_SETCOLOR( const wxChar* ident, int* ptparam,
int default_val, const wxChar* group = NULL );
PARAM_CFG_SETCOLOR( bool Insetup, const wxChar* ident, int* ptparam,
int default_val, const wxChar* group = NULL );
/** ReadParam
* read the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
virtual void ReadParam( wxConfigBase* aConfig );
/** SaveParam
* the the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
virtual void SaveParam( wxConfigBase* aConfig );
};
class PARAM_CFG_DOUBLE : public PARAM_CFG_BASE
{
public:
double* m_Pt_param; /* pointeur sur le parametre a configurer */
double m_Default; /* valeur par defaut */
double m_Min, m_Max; /* valeurs extremes du parametre */
public:
PARAM_CFG_DOUBLE( const wxChar* ident, double* ptparam,
double default_val = 0.0, double min = 0.0, double max = 10000.0,
const wxChar* group = NULL );
PARAM_CFG_DOUBLE( bool Insetup, const wxChar* ident, double* ptparam,
double default_val = 0.0, double min = 0.0, double max = 10000.0,
const wxChar* group = NULL );
/** ReadParam
* read the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
virtual void ReadParam( wxConfigBase* aConfig );
/** SaveParam
* the the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
virtual void SaveParam( wxConfigBase* aConfig );
};
class PARAM_CFG_BOOL : public PARAM_CFG_BASE
{
public:
bool* m_Pt_param; /* pointeur sur le parametre a configurer */
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_BOOL( const wxChar* ident, bool* ptparam,
int default_val = FALSE, const wxChar* group = NULL );
PARAM_CFG_BOOL( bool Insetup, const wxChar* ident, bool* ptparam,
int default_val = FALSE, const wxChar* group = NULL );
/** ReadParam
* read the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
virtual void ReadParam( wxConfigBase* aConfig );
/** SaveParam
* the the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
virtual void SaveParam( wxConfigBase* aConfig );
};
class PARAM_CFG_WXSTRING : public PARAM_CFG_BASE
{
public:
wxString* m_Pt_param; /* pointeur sur le parametre a configurer */
public:
PARAM_CFG_WXSTRING( const wxChar* ident, wxString* ptparam, const wxChar* group = NULL );
PARAM_CFG_WXSTRING( bool Insetup,
const wxChar* ident,
wxString* ptparam,
const wxChar* group = NULL );
/** ReadParam
* read the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
virtual void ReadParam( wxConfigBase* aConfig );
/** SaveParam
* the the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
virtual void SaveParam( wxConfigBase* aConfig );
};
class PARAM_CFG_LIBNAME_LIST : public PARAM_CFG_BASE
{
public:
wxArrayString* m_Pt_param; /* pointeur sur le parametre a configurer */
public:
PARAM_CFG_LIBNAME_LIST( const wxChar* ident,
wxArrayString* ptparam,
const wxChar* group = NULL );
/** ReadParam
* read the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
virtual void ReadParam( wxConfigBase* aConfig );
/** SaveParam
* the the value of parameter thi stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
virtual void SaveParam( wxConfigBase* aConfig );
};
#endif /* __PARAM_CONFIG_H__ */
No preview for this file type
This diff is collapsed.
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/* prjconfig.h : configuration: definition des structures */ /* prjconfig.h : configuration: definition des structures */
/**********************************************************/ /**********************************************************/
#include "param_config.h"
/* Liste des parametres */ /* Liste des parametres */
......
...@@ -35,7 +35,7 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow ...@@ -35,7 +35,7 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow
sLeftBoxSizer->Add( m_OptDisplayTracksClearance, 0, wxALL|wxEXPAND, 5 ); sLeftBoxSizer->Add( m_OptDisplayTracksClearance, 0, wxALL|wxEXPAND, 5 );
wxString m_OptDisplayViaHoleChoices[] = { _("Never"), _("Defined Holes"), _("Always") }; wxString m_OptDisplayViaHoleChoices[] = { _("Never"), _("Defined holes"), _("Always") };
int m_OptDisplayViaHoleNChoices = sizeof( m_OptDisplayViaHoleChoices ) / sizeof( wxString ); int m_OptDisplayViaHoleNChoices = sizeof( m_OptDisplayViaHoleChoices ) / sizeof( wxString );
m_OptDisplayViaHole = new wxRadioBox( this, ID_VIAS_HOLES, _("Show Via Holes:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayViaHoleNChoices, m_OptDisplayViaHoleChoices, 1, wxRA_SPECIFY_COLS ); m_OptDisplayViaHole = new wxRadioBox( this, ID_VIAS_HOLES, _("Show Via Holes:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayViaHoleNChoices, m_OptDisplayViaHoleChoices, 1, wxRA_SPECIFY_COLS );
m_OptDisplayViaHole->SetSelection( 1 ); m_OptDisplayViaHole->SetSelection( 1 );
...@@ -48,7 +48,7 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow ...@@ -48,7 +48,7 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow
wxStaticBoxSizer* sbMiddleLeftSizer; wxStaticBoxSizer* sbMiddleLeftSizer;
sbMiddleLeftSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Names:") ), wxVERTICAL ); sbMiddleLeftSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Names:") ), wxVERTICAL );
wxString m_ShowNetNamesOptionChoices[] = { _("Do Not Show"), _("On Pads"), _("OnTracks"), _("On Pads and Tracks") }; wxString m_ShowNetNamesOptionChoices[] = { _("Do not show"), _("On pads"), _("On tracks"), _("On pads and tracks") };
int m_ShowNetNamesOptionNChoices = sizeof( m_ShowNetNamesOptionChoices ) / sizeof( wxString ); int m_ShowNetNamesOptionNChoices = sizeof( m_ShowNetNamesOptionChoices ) / sizeof( wxString );
m_ShowNetNamesOption = new wxRadioBox( this, wxID_ANY, _("Show Net Names:"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS ); m_ShowNetNamesOption = new wxRadioBox( this, wxID_ANY, _("Show Net Names:"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS );
m_ShowNetNamesOption->SetSelection( 3 ); m_ShowNetNamesOption->SetSelection( 3 );
...@@ -87,16 +87,16 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow ...@@ -87,16 +87,16 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow
m_OptDisplayPads->SetSelection( 1 ); m_OptDisplayPads->SetSelection( 1 );
bRModuleSizer->Add( m_OptDisplayPads, 0, wxALL|wxEXPAND, 5 ); bRModuleSizer->Add( m_OptDisplayPads, 0, wxALL|wxEXPAND, 5 );
m_OptDisplayPadClearence = new wxCheckBox( this, wxID_ANY, _("Show Pad Clearance"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayPadClearence = new wxCheckBox( this, wxID_ANY, _("Show pad clearance"), wxDefaultPosition, wxDefaultSize, 0 );
bRModuleSizer->Add( m_OptDisplayPadClearence, 0, wxALL, 5 ); bRModuleSizer->Add( m_OptDisplayPadClearence, 0, wxALL, 5 );
m_OptDisplayPadNumber = new wxCheckBox( this, wxID_ANY, _("Show Pad Number"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayPadNumber = new wxCheckBox( this, wxID_ANY, _("Show pad number"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptDisplayPadNumber->SetValue(true); m_OptDisplayPadNumber->SetValue(true);
bRModuleSizer->Add( m_OptDisplayPadNumber, 0, wxALL, 5 ); bRModuleSizer->Add( m_OptDisplayPadNumber, 0, wxALL, 5 );
m_OptDisplayPadNoConn = new wxCheckBox( this, wxID_ANY, _("Show Pad NoConnect"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayPadNoConn = new wxCheckBox( this, wxID_ANY, _("Show pad NoConnect"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptDisplayPadNoConn->SetValue(true); m_OptDisplayPadNoConn->SetValue(true);
bRModuleSizer->Add( m_OptDisplayPadNoConn, 0, wxALL, 5 ); bRModuleSizer->Add( m_OptDisplayPadNoConn, 0, wxALL, 5 );
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxRadioBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices">&quot;Never&quot; &quot;Defined Holes&quot; &quot;Always&quot;</property> <property name="choices">&quot;Never&quot; &quot;Defined holes&quot; &quot;Always&quot;</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxRadioBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices">&quot;Do Not Show&quot; &quot;On Pads&quot; &quot;OnTracks&quot; &quot;On Pads and Tracks&quot;</property> <property name="choices">&quot;Do not show&quot; &quot;On pads&quot; &quot;On tracks&quot; &quot;On pads and tracks&quot;</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
...@@ -529,7 +529,7 @@ ...@@ -529,7 +529,7 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Show Pad Clearance</property> <property name="label">Show pad clearance</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_OptDisplayPadClearence</property> <property name="name">m_OptDisplayPadClearence</property>
...@@ -581,7 +581,7 @@ ...@@ -581,7 +581,7 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Show Pad Number</property> <property name="label">Show pad number</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_OptDisplayPadNumber</property> <property name="name">m_OptDisplayPadNumber</property>
...@@ -633,7 +633,7 @@ ...@@ -633,7 +633,7 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Show Pad NoConnect</property> <property name="label">Show pad NoConnect</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_OptDisplayPadNoConn</property> <property name="name">m_OptDisplayPadNoConn</property>
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
/** pcbcfg.h : configuration: definition des structures **/ /** pcbcfg.h : configuration: definition des structures **/
/**********************************************************/ /**********************************************************/
#include "param_config.h"
#define GROUP wxT( "/pcbnew" ) #define GROUP wxT( "/pcbnew" )
#define GROUPLIB wxT( "/pcbnew/libraries" ) #define GROUPLIB wxT( "/pcbnew/libraries" )
#define GROUPCOMMON wxT( "/common" ) #define GROUPCOMMON wxT( "/common" )
......
...@@ -211,7 +211,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, ...@@ -211,7 +211,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
wxConfig* config = wxGetApp().m_EDA_Config; wxConfig* config = wxGetApp().m_EDA_Config;
m_FrameName = wxT( "PcbFrame" ); m_FrameName = wxT( "PcbFrame" );
//m_AboutTitle = g_PcbnewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee
m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine
...@@ -291,6 +290,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, ...@@ -291,6 +290,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
WinEDA_PcbFrame::~WinEDA_PcbFrame() WinEDA_PcbFrame::~WinEDA_PcbFrame()
/************************************/ /************************************/
{ {
extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().SaveCurrentSetupValues( ParamCfgList );
SetBaseScreen( ScreenPcb ); SetBaseScreen( ScreenPcb );
delete m_drc; delete m_drc;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "eda_dde.h" #include "eda_dde.h"
wxString g_Main_Title( wxT( "PCBnew" ) ); wxString g_Main_Title( wxT( "PCBnew" ) );
extern PARAM_CFG_BASE* ParamCfgList[];
IMPLEMENT_APP( WinEDA_App ) IMPLEMENT_APP( WinEDA_App )
...@@ -57,6 +58,7 @@ bool WinEDA_App::OnInit() ...@@ -57,6 +58,7 @@ bool WinEDA_App::OnInit()
} }
Read_Config( FFileName ); Read_Config( FFileName );
wxGetApp().ReadCurrentSetupValues( ParamCfgList );
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
Read_Hotkey_Config( frame, false ); /* Must be called before creating the Read_Hotkey_Config( frame, false ); /* Must be called before creating the
* main frame in order to display the * main frame in order to display the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment