Commit 2611a547 authored by stambaughw's avatar stambaughw

Convert global and embedded application pointers to wxGetApp()

parent 0745188d
...@@ -27,19 +27,21 @@ ...@@ -27,19 +27,21 @@
BEGIN_EVENT_TABLE( WinEDA3D_DrawFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA3D_DrawFrame, wxFrame )
EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT, EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT,
WinEDA3D_DrawFrame::Process_Zoom ) WinEDA3D_DrawFrame::Process_Zoom )
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D, EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D,
WinEDA3D_DrawFrame::Process_Special_Functions ) WinEDA3D_DrawFrame::Process_Special_Functions )
EVT_MENU( wxID_EXIT, WinEDA3D_DrawFrame::Exit3DFrame ) EVT_MENU( wxID_EXIT, WinEDA3D_DrawFrame::Exit3DFrame )
EVT_MENU( ID_MENU_SCREENCOPY_PNG, WinEDA3D_DrawFrame::Process_Special_Functions ) EVT_MENU( ID_MENU_SCREENCOPY_PNG,
EVT_MENU( ID_MENU_SCREENCOPY_JPEG, WinEDA3D_DrawFrame::Process_Special_Functions ) WinEDA3D_DrawFrame::Process_Special_Functions )
EVT_CLOSE( WinEDA3D_DrawFrame::OnCloseWindow ) EVT_MENU( ID_MENU_SCREENCOPY_JPEG,
WinEDA3D_DrawFrame::Process_Special_Functions )
EVT_CLOSE( WinEDA3D_DrawFrame::OnCloseWindow )
END_EVENT_TABLE() END_EVENT_TABLE()
/*******************************************************************/ /*******************************************************************/
WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
WinEDA_App* app_parent, const wxString& title, const wxString& title,
long style ) : long style ) :
wxFrame( parent, DISPLAY3D_FRAME, title, wxFrame( parent, DISPLAY3D_FRAME, title,
wxPoint( -1, -1 ), wxSize( -1, -1 ), style ) wxPoint( -1, -1 ), wxSize( -1, -1 ), style )
...@@ -48,7 +50,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, ...@@ -48,7 +50,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
m_FrameName = wxT( "Frame3D" ); m_FrameName = wxT( "Frame3D" );
m_Canvas = NULL; m_Canvas = NULL;
m_Parent = parent; m_Parent = parent;
m_ParentAppl = app_parent;
m_HToolBar = NULL; m_HToolBar = NULL;
m_VToolBar = NULL; m_VToolBar = NULL;
m_InternalUnits = 10000; // Unites internes = 1/10000 inch m_InternalUnits = 10000; // Unites internes = 1/10000 inch
...@@ -104,21 +105,24 @@ void WinEDA3D_DrawFrame::GetSettings() ...@@ -104,21 +105,24 @@ void WinEDA3D_DrawFrame::GetSettings()
/******************************************/ /******************************************/
{ {
wxString text; wxString text;
wxConfig* Config = m_ParentAppl->m_EDA_Config; // Current config used by application wxConfig* config = wxGetApp().m_EDA_Config; // Current config used by application
if( m_ParentAppl->m_EDA_Config ) if( config )
{ {
text = m_FrameName + wxT( "Pos_x" ); text = m_FrameName + wxT( "Pos_x" );
Config->Read( text, &m_FramePos.x ); config->Read( text, &m_FramePos.x );
text = m_FrameName + wxT( "Pos_y" ); text = m_FrameName + wxT( "Pos_y" );
Config->Read( text, &m_FramePos.y ); config->Read( text, &m_FramePos.y );
text = m_FrameName + wxT( "Size_x" ); text = m_FrameName + wxT( "Size_x" );
Config->Read( text, &m_FrameSize.x, 600 ); config->Read( text, &m_FrameSize.x, 600 );
text = m_FrameName + wxT( "Size_y" ); text = m_FrameName + wxT( "Size_y" );
Config->Read( text, &m_FrameSize.y, 400 ); config->Read( text, &m_FrameSize.y, 400 );
Config->Read( wxT( "BgColor_Red" ), &g_Parm_3D_Visu.m_BgColor.m_Red, 0.0 ); config->Read( wxT( "BgColor_Red" ),
Config->Read( wxT( "BgColor_Green" ), &g_Parm_3D_Visu.m_BgColor.m_Green, 0.0 ); &g_Parm_3D_Visu.m_BgColor.m_Red, 0.0 );
Config->Read( wxT( "BgColor_Blue" ), &g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 ); config->Read( wxT( "BgColor_Green" ),
&g_Parm_3D_Visu.m_BgColor.m_Green, 0.0 );
config->Read( wxT( "BgColor_Blue" ),
&g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 );
} }
#ifdef __WXMAC__ #ifdef __WXMAC__
...@@ -134,7 +138,7 @@ void WinEDA3D_DrawFrame::SaveSettings() ...@@ -134,7 +138,7 @@ void WinEDA3D_DrawFrame::SaveSettings()
/*******************************************/ /*******************************************/
{ {
wxString text; wxString text;
wxConfig* Config = m_ParentAppl->m_EDA_Config; // Current config used by application wxConfig* Config = wxGetApp().m_EDA_Config; // Current config used by application
if( !Config ) if( !Config )
return; return;
......
...@@ -87,7 +87,7 @@ private: ...@@ -87,7 +87,7 @@ private:
public: public:
Pcb3D_GLCanvas(WinEDA3D_DrawFrame *parent, const wxWindowID id = -1, Pcb3D_GLCanvas(WinEDA3D_DrawFrame *parent, const wxWindowID id = -1,
int* gl_attrib = NULL); int* gl_attrib = NULL);
~Pcb3D_GLCanvas(); ~Pcb3D_GLCanvas();
void ClearLists(); void ClearLists();
...@@ -125,7 +125,6 @@ class WinEDA3D_DrawFrame: public wxFrame ...@@ -125,7 +125,6 @@ class WinEDA3D_DrawFrame: public wxFrame
{ {
public: public:
WinEDA_BasePcbFrame * m_Parent; WinEDA_BasePcbFrame * m_Parent;
WinEDA_App * m_ParentAppl;
Pcb3D_GLCanvas * m_Canvas; Pcb3D_GLCanvas * m_Canvas;
wxToolBar * m_HToolBar; wxToolBar * m_HToolBar;
wxToolBar * m_VToolBar; wxToolBar * m_VToolBar;
...@@ -138,8 +137,9 @@ private: ...@@ -138,8 +137,9 @@ private:
// It is "Frame3D" // It is "Frame3D"
public: public:
WinEDA3D_DrawFrame(WinEDA_BasePcbFrame * parent, WinEDA_App *app_parent, WinEDA3D_DrawFrame(WinEDA_BasePcbFrame * parent,
const wxString& title, long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE ); const wxString& title,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
void Exit3DFrame(wxCommandEvent& event); void Exit3DFrame(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent & Event); void OnCloseWindow(wxCloseEvent & Event);
...@@ -169,7 +169,7 @@ public: ...@@ -169,7 +169,7 @@ public:
void Set3DEco1OnOff(); void Set3DEco1OnOff();
void Set3DEco2OnOff(); void Set3DEco2OnOff();
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
void SetGLColor(int color); void SetGLColor(int color);
......
...@@ -5,6 +5,14 @@ Started 2007-June-11 ...@@ -5,6 +5,14 @@ Started 2007-June-11
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.
2008-Dec-08 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++all
* Remove all instances of application pointers both global and embedded
member variables. Use wxGetApp() for improved readability and type
safety.
2008-Dec-6 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Dec-6 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
++pcbnew & gerbview ++pcbnew & gerbview
......
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
/*******************************************************/ /*******************************************************/
WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype,
WinEDA_App* parent, const wxString& title, const wxString& title,
const wxPoint& pos, const wxSize& size, long style ) : const wxPoint& pos, const wxSize& size,
long style ) :
wxFrame( father, -1, title, pos, size, style ) wxFrame( father, -1, title, pos, size, style )
{ {
wxSize minsize; wxSize minsize;
m_Ident = idtype; m_Ident = idtype;
m_Parent = parent;
SetFont( *g_StdFont ); SetFont( *g_StdFont );
m_MenuBar = NULL; // menu du haut d'ecran m_MenuBar = NULL; // menu du haut d'ecran
m_HToolBar = NULL; m_HToolBar = NULL;
...@@ -57,9 +57,9 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype, ...@@ -57,9 +57,9 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype,
WinEDA_BasicFrame::~WinEDA_BasicFrame() WinEDA_BasicFrame::~WinEDA_BasicFrame()
/******************************************/ /******************************************/
{ {
if( m_Parent->m_HtmlCtrl ) if( wxGetApp().m_HtmlCtrl )
delete m_Parent->m_HtmlCtrl; delete wxGetApp().m_HtmlCtrl;
m_Parent->m_HtmlCtrl = NULL; wxGetApp().m_HtmlCtrl = NULL;
} }
...@@ -76,19 +76,22 @@ void WinEDA_BasicFrame::ReCreateMenuBar() ...@@ -76,19 +76,22 @@ void WinEDA_BasicFrame::ReCreateMenuBar()
void WinEDA_BasicFrame::GetSettings() void WinEDA_BasicFrame::GetSettings()
/*********************************************/ /*********************************************/
{ {
wxString text; wxString text;
int Ypos_min; int Ypos_min;
wxConfig* config;
config = wxGetApp().m_EDA_Config;
if( m_Parent->m_EDA_Config ) if( config )
{ {
text = m_FrameName + wxT( "Pos_x" ); text = m_FrameName + wxT( "Pos_x" );
m_Parent->m_EDA_Config->Read( text, &m_FramePos.x ); config->Read( text, &m_FramePos.x );
text = m_FrameName + wxT( "Pos_y" ); text = m_FrameName + wxT( "Pos_y" );
m_Parent->m_EDA_Config->Read( text, &m_FramePos.y ); config->Read( text, &m_FramePos.y );
text = m_FrameName + wxT( "Size_x" ); text = m_FrameName + wxT( "Size_x" );
m_Parent->m_EDA_Config->Read( text, &m_FrameSize.x, 600 ); config->Read( text, &m_FrameSize.x, 600 );
text = m_FrameName + wxT( "Size_y" ); text = m_FrameName + wxT( "Size_y" );
m_Parent->m_EDA_Config->Read( text, &m_FrameSize.y, 400 ); config->Read( text, &m_FrameSize.y, 400 );
} }
// Ensure Window title bar is visible // Ensure Window title bar is visible
...@@ -109,24 +112,24 @@ void WinEDA_BasicFrame::SaveSettings() ...@@ -109,24 +112,24 @@ void WinEDA_BasicFrame::SaveSettings()
/*****************************************/ /*****************************************/
{ {
wxString text; wxString text;
wxConfig* config;
if( !m_Parent || !m_Parent->m_EDA_Config ) config = wxGetApp().m_EDA_Config;
return;
if( !m_Parent->m_EDA_Config || IsIconized() ) if( ( config == NULL ) || IsIconized() )
return; return;
m_FrameSize = GetSize(); m_FrameSize = GetSize();
m_FramePos = GetPosition(); m_FramePos = GetPosition();
text = m_FrameName + wxT( "Pos_x" ); text = m_FrameName + wxT( "Pos_x" );
m_Parent->m_EDA_Config->Write( text, (long) m_FramePos.x ); config->Write( text, (long) m_FramePos.x );
text = m_FrameName + wxT( "Pos_y" ); text = m_FrameName + wxT( "Pos_y" );
m_Parent->m_EDA_Config->Write( text, (long) m_FramePos.y ); config->Write( text, (long) m_FramePos.y );
text = m_FrameName + wxT( "Size_x" ); text = m_FrameName + wxT( "Size_x" );
m_Parent->m_EDA_Config->Write( text, (long) m_FrameSize.x ); config->Write( text, (long) m_FrameSize.x );
text = m_FrameName + wxT( "Size_y" ); text = m_FrameName + wxT( "Size_y" );
m_Parent->m_EDA_Config->Write( text, (long) m_FrameSize.y ); config->Write( text, (long) m_FrameSize.y );
} }
...@@ -175,36 +178,28 @@ void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName ) ...@@ -175,36 +178,28 @@ void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName )
return; return;
//suppression d'une ancienne trace eventuelle du meme fichier //suppression d'une ancienne trace eventuelle du meme fichier
for( ii = 0; ii < m_Parent->m_LastProject.GetCount(); ) for( ii = 0; ii < wxGetApp().m_LastProject.GetCount(); )
{ {
if( m_Parent->m_LastProject[ii].IsEmpty() ) if( wxGetApp().m_LastProject[ii].IsEmpty() )
break; break;
#ifdef __WINDOWS__ #ifdef __WINDOWS__
if( m_Parent->m_LastProject[ii].CmpNoCase( FullFileName ) == 0 ) if( wxGetApp().m_LastProject[ii].CmpNoCase( FullFileName ) == 0 )
#else #else
if( m_Parent->m_LastProject[ii] == FullFileName ) if( wxGetApp().m_LastProject[ii] == FullFileName )
#endif #endif
{ {
#if ( ( wxMAJOR_VERSION < 2) || ( ( wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION <= 4 ) ) ) wxGetApp().m_LastProject.RemoveAt( ii );
m_Parent->m_LastProject.Remove( ii );
#else
m_Parent->m_LastProject.RemoveAt( ii );
#endif
} }
else else
ii++; ii++;
} }
while( m_Parent->m_LastProject.GetCount() >= m_Parent->m_LastProjectMaxCount ) while( wxGetApp().m_LastProject.GetCount() >= wxGetApp().m_LastProjectMaxCount )
{ {
#if ( ( wxMAJOR_VERSION < 2) || ( ( wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION <= 4 ) ) ) wxGetApp().m_LastProject.RemoveAt( wxGetApp().m_LastProject.GetCount() - 1 );
files.Remove( files.GetCount() - 1 );
#else
m_Parent->m_LastProject.RemoveAt( m_Parent->m_LastProject.GetCount() - 1 );
#endif
} }
m_Parent->m_LastProject.Insert( FullFileName, 0 ); wxGetApp().m_LastProject.Insert( FullFileName, 0 );
ReCreateMenuBar(); ReCreateMenuBar();
} }
...@@ -216,9 +211,9 @@ wxString WinEDA_BasicFrame::GetLastProject( int rang ) ...@@ -216,9 +211,9 @@ wxString WinEDA_BasicFrame::GetLastProject( int rang )
{ {
if( rang < 0 ) if( rang < 0 )
rang = 0; rang = 0;
if( (unsigned) rang >= m_Parent->m_LastProject.GetCount() ) if( (unsigned) rang >= wxGetApp().m_LastProject.GetCount() )
return wxEmptyString; return wxEmptyString;
return m_Parent->m_LastProject[rang]; return wxGetApp().m_LastProject[rang];
} }
...@@ -227,30 +222,30 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) ...@@ -227,30 +222,30 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
/**************************************************************/ /**************************************************************/
{ {
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
if( m_Parent->m_HtmlCtrl == NULL ) if( wxGetApp().m_HtmlCtrl == NULL )
{ {
m_Parent->InitOnLineHelp(); wxGetApp().InitOnLineHelp();
} }
if( m_Parent->m_HtmlCtrl ) if( wxGetApp().m_HtmlCtrl )
{ {
m_Parent->m_HtmlCtrl->DisplayContents(); wxGetApp().m_HtmlCtrl->DisplayContents();
m_Parent->m_HtmlCtrl->Display( m_Parent->m_HelpFileName ); wxGetApp().m_HtmlCtrl->Display( wxGetApp().m_HelpFileName );
} }
else else
{ {
wxString msg; wxString msg;
msg.Printf( _( "Help file %s not found" ), m_Parent->m_HelpFileName.GetData() ); msg.Printf( _( "Help file %s not found" ), wxGetApp().m_HelpFileName.GetData() );
DisplayError( this, msg ); DisplayError( this, msg );
} }
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
wxString fullfilename = FindKicadHelpPath() + m_Parent->m_HelpFileName; wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName;
if ( wxFileExists(fullfilename) ) if ( wxFileExists(fullfilename) )
GetAssociatedDocument( this, wxEmptyString, fullfilename ); GetAssociatedDocument( this, wxEmptyString, fullfilename );
else // Try to find file in English format: else // Try to find file in English format:
{ {
fullfilename = FindKicadHelpPath() + wxT("../en/") + m_Parent->m_HelpFileName;; fullfilename = FindKicadHelpPath() + wxT("../en/") + wxGetApp().m_HelpFileName;;
GetAssociatedDocument( this, wxEmptyString, fullfilename ); GetAssociatedDocument( this, wxEmptyString, fullfilename );
} }
......
...@@ -14,14 +14,9 @@ ...@@ -14,14 +14,9 @@
#endif #endif
#include "fctsys.h" #include "fctsys.h"
#include <wx/image.h>
#include "wx/html/htmlwin.h" #include "wx/html/htmlwin.h"
#include "wx/fs_zip.h" #include "wx/fs_zip.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "worksheet.h" #include "worksheet.h"
#include "id.h" #include "id.h"
...@@ -53,8 +48,7 @@ struct LANGUAGE_DESCR ...@@ -53,8 +48,7 @@ struct LANGUAGE_DESCR
bool m_DoNotTranslate; // set to true if the m_Lang_Label must not be translated bool m_DoNotTranslate; // set to true if the m_Lang_Label must not be translated
}; };
#define LANGUAGE_DESCR_COUNT 16 static struct LANGUAGE_DESCR s_Language_List[] =
static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] =
{ {
{ {
wxLANGUAGE_DEFAULT, wxLANGUAGE_DEFAULT,
...@@ -155,30 +149,26 @@ static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] = ...@@ -155,30 +149,26 @@ static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] =
} }
}; };
/* Just add new languages to the list. This macro will properly recalculate
* the size of the array. */
#define LANGUAGE_DESCR_COUNT ( sizeof( s_Language_List ) / \
sizeof( struct LANGUAGE_DESCR ) )
/**************************/ /**************************/
/* WinEDA_App Constructor */ /* WinEDA_App Constructor */
/**************************/ /**************************/
WinEDA_App::WinEDA_App() WinEDA_App::WinEDA_App()
{ {
m_Checker = NULL; m_Checker = NULL;
m_MainFrame = NULL;
m_PcbFrame = NULL;
m_ModuleEditFrame = NULL; // Frame for footprint edition
m_SchematicFrame = NULL; // Frame for schematic edition
m_LibeditFrame = NULL; // Frame for component edition
m_ViewlibFrame = NULL; // Frame for browsing component libraries
m_CvpcbFrame = NULL;
m_GerberFrame = NULL; // Frame for the gerber viewer GERBVIEW
m_LastProjectMaxCount = 10; m_LastProjectMaxCount = 10;
m_HtmlCtrl = NULL; m_HtmlCtrl = NULL;
m_EDA_CommonConfig = NULL; m_EDA_CommonConfig = NULL;
m_EDA_Config = NULL; m_EDA_Config = NULL;
m_Env_Defined = FALSE; m_Env_Defined = FALSE;
m_LanguageId = wxLANGUAGE_DEFAULT; m_LanguageId = wxLANGUAGE_DEFAULT;
m_Language_Menu = NULL; m_Language_Menu = NULL;
m_Locale = NULL; m_Locale = NULL;
m_PdfBrowserIsDefault = TRUE; m_PdfBrowserIsDefault = TRUE;
} }
...@@ -230,7 +220,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& name ) ...@@ -230,7 +220,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
} }
/* Prepare On Line Help. Use only lower case for help filenames, /* Prepare On Line Help. Use only lower case for help filenames,
* in order to avoid problems with upper/lower case filenames under windows and unix */ * in order to avoid problems with upper/lower case filenames under windows and unix */
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
m_HelpFileName = name.Lower() + wxT( ".html" ); m_HelpFileName = name.Lower() + wxT( ".html" );
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
...@@ -250,14 +240,18 @@ void WinEDA_App::InitEDA_Appl( const wxString& name ) ...@@ -250,14 +240,18 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
g_MsgFontPointSize = FONT_DEFAULT_SIZE; g_MsgFontPointSize = FONT_DEFAULT_SIZE;
g_DialogFontPointSize = FONT_DEFAULT_SIZE; g_DialogFontPointSize = FONT_DEFAULT_SIZE;
g_FixedFontPointSize = FONT_DEFAULT_SIZE; g_FixedFontPointSize = FONT_DEFAULT_SIZE;
g_StdFont = new wxFont( g_StdFontPointSize, wxFONTFAMILY_ROMAN, wxNORMAL, wxNORMAL ); g_StdFont = new wxFont( g_StdFontPointSize, wxFONTFAMILY_ROMAN,
g_MsgFont = new wxFont( g_StdFontPointSize, wxFONTFAMILY_ROMAN, wxNORMAL, wxNORMAL ); wxNORMAL, wxNORMAL );
g_DialogFont = new wxFont( g_DialogFontPointSize, wxFONTFAMILY_ROMAN, wxNORMAL, wxNORMAL ); g_MsgFont = new wxFont( g_StdFontPointSize, wxFONTFAMILY_ROMAN,
wxNORMAL, wxNORMAL );
g_DialogFont = new wxFont( g_DialogFontPointSize, wxFONTFAMILY_ROMAN,
wxNORMAL, wxNORMAL );
g_ItalicFont = new wxFont( g_DialogFontPointSize, g_ItalicFont = new wxFont( g_DialogFontPointSize,
wxFONTFAMILY_ROMAN, wxFONTFAMILY_ROMAN,
wxFONTSTYLE_ITALIC, wxFONTSTYLE_ITALIC,
wxNORMAL ); wxNORMAL );
g_FixedFont = new wxFont( g_FixedFontPointSize, wxFONTFAMILY_MODERN, wxNORMAL, wxNORMAL ); g_FixedFont = new wxFont( g_FixedFontPointSize, wxFONTFAMILY_MODERN,
wxNORMAL, wxNORMAL );
/* installation des gestionnaires de visu d'images (pour help) */ /* installation des gestionnaires de visu d'images (pour help) */
wxImage::AddHandler( new wxPNGHandler ); wxImage::AddHandler( new wxPNGHandler );
...@@ -271,14 +265,15 @@ void WinEDA_App::InitEDA_Appl( const wxString& name ) ...@@ -271,14 +265,15 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
ReadPdfBrowserInfos(); ReadPdfBrowserInfos();
// Internationalisation: loading the kicad suitable Dictionnary // Internationalisation: loading the kicad suitable Dictionnary
m_EDA_CommonConfig->Read( wxT( "Language" ), &m_LanguageId, wxLANGUAGE_DEFAULT ); m_EDA_CommonConfig->Read( wxT( "Language" ), &m_LanguageId,
wxLANGUAGE_DEFAULT );
bool succes = SetLanguage( TRUE ); bool succes = SetLanguage( TRUE );
if( !succes ) if( !succes )
{ {
} }
SetLocaleTo_Default( ); // Set locale option for separator used in float numbers SetLocaleTo_Default(); // Set locale option for separator used in float numbers
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
PyHandler::GetInstance()->SetAppName( name ); PyHandler::GetInstance()->SetAppName( name );
...@@ -297,12 +292,12 @@ void WinEDA_App::InitOnLineHelp() ...@@ -297,12 +292,12 @@ void WinEDA_App::InitOnLineHelp()
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML #if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
m_HelpFileName = fullfilename + wxT( ".html" ); m_HelpFileName = fullfilename + wxT( ".html" );
fullfilename += wxT( "kicad.hhp" ); fullfilename += wxT( "kicad.hhp" );
if( wxFileExists( fullfilename ) ) if( wxFileExists( fullfilename ) )
{ {
m_HtmlCtrl = new wxHtmlHelpController( wxHF_TOOLBAR | m_HtmlCtrl = new wxHtmlHelpController( wxHF_TOOLBAR | wxHF_CONTENTS |
wxHF_CONTENTS | wxHF_PRINT | wxHF_OPEN_FILES wxHF_PRINT | wxHF_OPEN_FILES
/*| wxHF_SEARCH */ ); /*| wxHF_SEARCH */ );
m_HtmlCtrl->UseConfig( m_EDA_CommonConfig ); m_HtmlCtrl->UseConfig( m_EDA_CommonConfig );
m_HtmlCtrl->SetTitleFormat( wxT( "Kicad Help" ) ); m_HtmlCtrl->SetTitleFormat( wxT( "Kicad Help" ) );
m_HtmlCtrl->AddBook( fullfilename ); m_HtmlCtrl->AddBook( fullfilename );
...@@ -335,7 +330,7 @@ bool WinEDA_App::SetBinDir() ...@@ -335,7 +330,7 @@ bool WinEDA_App::SetBinDir()
return false; return false;
char* native_str = NULL; char* native_str = NULL;
int len = CFStringGetMaximumSizeForEncoding( CFStringGetLength( str ), int len = CFStringGetMaximumSizeForEncoding( CFStringGetLength( str ),
kCFStringEncodingUTF8 ) + 1; kCFStringEncodingUTF8 ) + 1;
native_str = new char[len]; native_str = new char[len];
CFStringGetCString( str, native_str, len, kCFStringEncodingUTF8 ); CFStringGetCString( str, native_str, len, kCFStringEncodingUTF8 );
m_BinDir = CONV_FROM_UTF8( native_str ); m_BinDir = CONV_FROM_UTF8( native_str );
...@@ -396,7 +391,8 @@ void WinEDA_App::GetSettings() ...@@ -396,7 +391,8 @@ void WinEDA_App::GetSettings()
if( m_EDA_CommonConfig ) if( m_EDA_CommonConfig )
{ {
m_LanguageId = m_EDA_CommonConfig->Read( wxT( "Language" ), wxLANGUAGE_DEFAULT ); m_LanguageId = m_EDA_CommonConfig->Read( wxT( "Language" ),
wxLANGUAGE_DEFAULT );
g_EditorName = m_EDA_CommonConfig->Read( wxT( "Editor" ) ); g_EditorName = m_EDA_CommonConfig->Read( wxT( "Editor" ) );
g_ConfigFileLocationChoice = m_EDA_CommonConfig->Read( HOTKEY_CFG_PATH_OPT, 0L ); g_ConfigFileLocationChoice = m_EDA_CommonConfig->Read( HOTKEY_CFG_PATH_OPT, 0L );
} }
...@@ -416,10 +412,14 @@ void WinEDA_App::GetSettings() ...@@ -416,10 +412,14 @@ void WinEDA_App::GetSettings()
m_LastProject.Add( Line ); m_LastProject.Add( Line );
} }
g_StdFontPointSize = m_EDA_Config->Read( wxT( "SdtFontSize" ), FONT_DEFAULT_SIZE ); g_StdFontPointSize = m_EDA_Config->Read( wxT( "SdtFontSize" ),
g_MsgFontPointSize = m_EDA_Config->Read( wxT( "MsgFontSize" ), FONT_DEFAULT_SIZE ); FONT_DEFAULT_SIZE );
g_DialogFontPointSize = m_EDA_Config->Read( wxT( "DialogFontSize" ), FONT_DEFAULT_SIZE ); g_MsgFontPointSize = m_EDA_Config->Read( wxT( "MsgFontSize" ),
g_FixedFontPointSize = m_EDA_Config->Read( wxT( "FixedFontSize" ), FONT_DEFAULT_SIZE ); FONT_DEFAULT_SIZE );
g_DialogFontPointSize = m_EDA_Config->Read( wxT( "DialogFontSize" ),
FONT_DEFAULT_SIZE );
g_FixedFontPointSize = m_EDA_Config->Read( wxT( "FixedFontSize" ),
FONT_DEFAULT_SIZE );
Line = m_EDA_Config->Read( wxT( "SdtFontType" ), wxEmptyString ); Line = m_EDA_Config->Read( wxT( "SdtFontType" ), wxEmptyString );
if( !Line.IsEmpty() ) if( !Line.IsEmpty() )
...@@ -584,7 +584,7 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu ) ...@@ -584,7 +584,7 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
s_Language_List[ii].m_Lang_Label : s_Language_List[ii].m_Lang_Label :
wxGetTranslation( s_Language_List[ii].m_Lang_Label ); wxGetTranslation( s_Language_List[ii].m_Lang_Label );
item = new wxMenuItem( m_Language_Menu, s_Language_List[ii].m_KI_Lang_Identifier, item = new wxMenuItem( m_Language_Menu, s_Language_List[ii].m_KI_Lang_Identifier,
MenuLabel, wxEmptyString, wxITEM_CHECK ); MenuLabel, wxEmptyString, wxITEM_CHECK );
SETBITMAPS( s_Language_List[ii].m_Lang_Icon ); SETBITMAPS( s_Language_List[ii].m_Lang_Icon );
m_Language_Menu->Append( item ); m_Language_Menu->Append( item );
} }
...@@ -593,17 +593,19 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu ) ...@@ -593,17 +593,19 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ ) for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{ {
if( m_LanguageId == s_Language_List[ii].m_WX_Lang_Identifier ) if( m_LanguageId == s_Language_List[ii].m_WX_Lang_Identifier )
m_Language_Menu->Check( s_Language_List[ii].m_KI_Lang_Identifier, true ); m_Language_Menu->Check( s_Language_List[ii].m_KI_Lang_Identifier,
true );
else else
m_Language_Menu->Check( s_Language_List[ii].m_KI_Lang_Identifier, false ); m_Language_Menu->Check( s_Language_List[ii].m_KI_Lang_Identifier,
false );
} }
if( MasterMenu ) if( MasterMenu )
{ {
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, m_Language_Menu, ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, m_Language_Menu,
ID_LANGUAGE_CHOICE, _( "Language" ), ID_LANGUAGE_CHOICE, _( "Language" ),
_( "Select application language (only for testing!)" ), _( "Select application language (only for testing!)" ),
language_xpm ); language_xpm );
} }
return m_Language_Menu; return m_Language_Menu;
} }
......
This diff is collapsed.
...@@ -674,6 +674,8 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id ) ...@@ -674,6 +674,8 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id )
*/ */
{ {
wxMenuBar* menu = frame->GetMenuBar(); wxMenuBar* menu = frame->GetMenuBar();
wxConfig * config = wxGetApp().m_EDA_CommonConfig;
wxASSERT( config != NULL );
switch( id ) switch( id )
{ {
...@@ -683,8 +685,7 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id ) ...@@ -683,8 +685,7 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id )
g_ConfigFileLocationChoice = 0; g_ConfigFileLocationChoice = 0;
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, true ); menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, true );
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, false ); menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, false );
frame->m_Parent->m_EDA_CommonConfig->Write( HOTKEY_CFG_PATH_OPT, config->Write( HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice );
g_ConfigFileLocationChoice );
} }
break; break;
...@@ -694,8 +695,7 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id ) ...@@ -694,8 +695,7 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id )
g_ConfigFileLocationChoice = 1; g_ConfigFileLocationChoice = 1;
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, false ); menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, false );
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, true ); menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, true );
frame->m_Parent->m_EDA_CommonConfig->Write( HOTKEY_CFG_PATH_OPT, config->Write( HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice );
g_ConfigFileLocationChoice );
} }
break; break;
......
This diff is collapsed.
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h"
#include "common.h" #include "common.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
...@@ -22,12 +21,12 @@ void Read_Config( const wxString& FileName ) ...@@ -22,12 +21,12 @@ void Read_Config( const wxString& FileName )
/**************************************************/ /**************************************************/
/* lit la configuration /* lit la configuration
* 1 - lit cvpcb.cnf * 1 - lit cvpcb.cnf
* 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf * 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut * 3 - si non trouve: init des variables aux valeurs par defaut
* *
* Remarque: * Remarque:
* le chemin de l'executable cvpcb.exe doit etre dans BinDir * le chemin de l'executable cvpcb.exe doit etre dans BinDir
*/ */
{ {
wxString FullFileName = FileName; wxString FullFileName = FileName;
...@@ -36,8 +35,8 @@ void Read_Config( const wxString& FileName ) ...@@ -36,8 +35,8 @@ void Read_Config( const wxString& FileName )
g_LibName_List.Clear(); g_LibName_List.Clear();
g_ListName_Equ.Clear(); g_ListName_Equ.Clear();
g_EDA_Appl->ReadProjectConfig( FullFileName, wxGetApp().ReadProjectConfig( FullFileName,
GROUP, ParamCfgList, FALSE ); GROUP, ParamCfgList, FALSE );
if( NetInExtBuffer.IsEmpty() ) if( NetInExtBuffer.IsEmpty() )
NetInExtBuffer = wxT( ".net" ); NetInExtBuffer = wxT( ".net" );
...@@ -52,7 +51,7 @@ void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event ) ...@@ -52,7 +51,7 @@ void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event )
/************************************************************/ /************************************************************/
/* fonction relai d'appel a Save_Config, /* fonction relai d'appel a Save_Config,
* la vraie fonction de sauvegarde de la config * la vraie fonction de sauvegarde de la config
*/ */
{ {
Save_Config( this ); Save_Config( this );
...@@ -73,18 +72,18 @@ void Save_Config( wxWindow* parent ) ...@@ -73,18 +72,18 @@ void Save_Config( wxWindow* parent )
path = wxGetCwd(); path = wxGetCwd();
FullFileName = EDA_FileSelector( _( "Save preferences" ), FullFileName = EDA_FileSelector( _( "Save preferences" ),
path, /* Chemin par defaut */ path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */ FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */ g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */ mask, /* Masque d'affichage */
parent, parent,
wxFD_SAVE, wxFD_SAVE,
TRUE TRUE
); );
if( FullFileName.IsEmpty() ) if( FullFileName.IsEmpty() )
return; return;
/* ecriture de la configuration */ /* ecriture de la configuration */
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList ); wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
} }
This diff is collapsed.
/*******************/ /*******************/
/* File: cvpcb.cpp */ /* File: cvpcb.cpp */
/*******************/ /*******************/
#define MAIN #define MAIN
#define eda_global #define eda_global
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "trigo.h" #include "trigo.h"
#include "gr_basic.h"
#include "zones.h" #include "zones.h"
#include "bitmaps.h" #include "bitmaps.h"
...@@ -18,77 +17,76 @@ ...@@ -18,77 +17,76 @@
#include "id.h" #include "id.h"
wxString g_Main_Title = wxT("CVpcb"); wxString g_Main_Title = wxT( "CVpcb" );
// Create a new application object // Create a new application object
IMPLEMENT_APP(WinEDA_App) IMPLEMENT_APP( WinEDA_App )
/* fonctions locales */ /* fonctions locales */
/************************************/ /************************************/
/* Called to initialize the program */ /* Called to initialize the program */
/************************************/ /************************************/
bool WinEDA_App::OnInit() bool WinEDA_App::OnInit()
{ {
wxString msg; wxString msg;
wxString currCWD = wxGetCwd(); wxString currCWD = wxGetCwd();
WinEDA_CvpcbFrame* frame = NULL;
g_EDA_Appl = this; InitEDA_Appl( wxT( "cvpcb" ) );
InitEDA_Appl( wxT("cvpcb") );
if ( m_Checker && m_Checker->IsAnotherRunning() ) if( m_Checker && m_Checker->IsAnotherRunning() )
{ {
if ( ! IsOK(NULL, _("Cvpcb is already running, Continue?") ) ) if( !IsOK( NULL, _( "Cvpcb is already running, Continue?" ) ) )
return false; return false;
} }
GetSettings(); // read current setup
wxSetWorkingDirectory(currCWD); // mofifie par GetSetting GetSettings(); // read current setup
SetRealLibraryPath( wxT("modules") );
if(argc > 1 ) wxSetWorkingDirectory( currCWD ); // mofifie par GetSetting
{ SetRealLibraryPath( wxT( "modules" ) );
NetInNameBuffer = argv[1];
NetNameBuffer = argv[1];
}
if ( ! NetInNameBuffer.IsEmpty() ) if( argc > 1 )
wxSetWorkingDirectory( wxPathOnly(NetInNameBuffer) ); {
g_DrawBgColor = BLACK; NetInNameBuffer = argv[1];
NetNameBuffer = argv[1];
}
Read_Config(NetInNameBuffer); if( !NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly( NetInNameBuffer ) );
g_DrawBgColor = BLACK;
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion(); Read_Config( NetInNameBuffer );
m_CvpcbFrame = new WinEDA_CvpcbFrame(this, Title);
msg.Printf( wxT("Modules: %d"), nblib); wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
m_CvpcbFrame->SetStatusText(msg,2); frame = new WinEDA_CvpcbFrame( Title );
// Show the frame msg.Printf( wxT( "Modules: %d" ), nblib );
SetTopWindow(m_CvpcbFrame); frame->SetStatusText( msg, 2 );
m_CvpcbFrame->Show(TRUE); // Show the frame
SetTopWindow( frame );
listlib(); frame->Show( TRUE );
m_CvpcbFrame->BuildFootprintListBox();
if( ! NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */ listlib();
{ frame->BuildFootprintListBox();
FFileName = MakeFileName(NetDirBuffer,
NetInNameBuffer, NetInExtBuffer);
m_CvpcbFrame->ReadNetListe(); if( !NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */
} {
else /* Mise a jour du titre de la fenetre principale */ FFileName = MakeFileName( NetDirBuffer,
{ NetInNameBuffer, NetInExtBuffer );
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion();
msg.Printf( wxT("%s {%s%c} [no file]"),
Title.GetData(), wxGetCwd().GetData(), DIR_SEP);
m_CvpcbFrame->SetTitle(msg);
}
return TRUE; frame->ReadNetListe();
} }
else /* Mise a jour du titre de la fenetre principale */
{
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
msg.Printf( wxT( "%s {%s%c} [no file]" ),
Title.GetData(), wxGetCwd().GetData(), DIR_SEP );
frame->SetTitle( msg );
}
return TRUE;
}
...@@ -39,8 +39,8 @@ private: ...@@ -39,8 +39,8 @@ private:
// Constructor and destructor // Constructor and destructor
public: public:
WinEDA_CvpcbFrame( WinEDA_App * parent, const wxString &title, WinEDA_CvpcbFrame( const wxString &title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_CvpcbFrame(); ~WinEDA_CvpcbFrame();
void OnLeftClick( wxListEvent& event ); void OnLeftClick( wxListEvent& event );
...@@ -180,10 +180,10 @@ class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame ...@@ -180,10 +180,10 @@ class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
public: public:
public: public:
WinEDA_DisplayFrame( wxWindow * father, WinEDA_App * parent, WinEDA_DisplayFrame( wxWindow * father,
const wxString &title, const wxString &title,
const wxPoint &pos, const wxSize &size, const wxPoint &pos, const wxSize &size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_DisplayFrame(); ~WinEDA_DisplayFrame();
......
...@@ -72,7 +72,7 @@ wxString title; ...@@ -72,7 +72,7 @@ wxString title;
m_DoUpdate = TRUE; m_DoUpdate = TRUE;
Create(parent, id, caption, pos, size, style); Create(parent, id, caption, pos, size, style);
title = _("from ") + g_EDA_Appl->m_CurrentOptionFile; title = _("from ") + wxGetApp().m_CurrentOptionFile;
SetTitle(title); SetTitle(title);
} }
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "wxstruct.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "id.h" #include "id.h"
#include "bitmaps.h" #include "bitmaps.h"
...@@ -32,11 +31,11 @@ END_EVENT_TABLE() ...@@ -32,11 +31,11 @@ END_EVENT_TABLE()
/* WinEDA_DisplayFrame: the frame to display the current focused footprint */ /* WinEDA_DisplayFrame: the frame to display the current focused footprint */
/***************************************************************************/ /***************************************************************************/
WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent, WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, long style ) : const wxSize& size, long style ) :
WinEDA_BasePcbFrame( father, parent, CVPCB_DISPLAY_FRAME, title, pos, WinEDA_BasePcbFrame( father, CVPCB_DISPLAY_FRAME, title, pos,
size, style ) size, style )
{ {
m_FrameName = wxT( "CmpFrame" ); m_FrameName = wxT( "CmpFrame" );
...@@ -73,7 +72,7 @@ WinEDA_DisplayFrame::~WinEDA_DisplayFrame() ...@@ -73,7 +72,7 @@ WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
delete m_Pcb; delete m_Pcb;
m_Parent->m_CvpcbFrame->DrawFrame = NULL; ( (WinEDA_CvpcbFrame*) wxGetApp().GetTopWindow() )->DrawFrame = NULL;
} }
......
This diff is collapsed.
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h"
#include "common.h" #include "common.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "3d_viewer.h" #include "3d_viewer.h"
...@@ -28,9 +27,9 @@ void WinEDA_CvpcbFrame::CreateScreenCmp() ...@@ -28,9 +27,9 @@ void WinEDA_CvpcbFrame::CreateScreenCmp()
if( DrawFrame == NULL ) if( DrawFrame == NULL )
{ {
DrawFrame = new WinEDA_DisplayFrame( this, m_Parent, _( "Module" ), DrawFrame = new WinEDA_DisplayFrame( this, _( "Module" ),
wxPoint( 0, 0 ), wxSize( 600, wxPoint( 0, 0 ),
400 ), wxSize( 600, 400 ),
KICAD_DEFAULT_DRAWFRAME_STYLE | KICAD_DEFAULT_DRAWFRAME_STYLE |
wxFRAME_FLOAT_ON_PARENT ); wxFRAME_FLOAT_ON_PARENT );
IsNew = TRUE; IsNew = TRUE;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
/*********************************/ /*********************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "program.h" #include "program.h"
...@@ -15,7 +14,8 @@ ...@@ -15,7 +14,8 @@
/* Routines locales */ /* Routines locales */
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm, EDA_DrawLineStruct* TstSegm ); static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
EDA_DrawLineStruct* TstSegm );
/* Variable locales */ /* Variable locales */
...@@ -30,8 +30,12 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC ) ...@@ -30,8 +30,12 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
*/ */
{ {
SCH_ITEM* DrawList, * TstDrawList; SCH_ITEM* DrawList, * TstDrawList;
int flag; int flag;
bool Modify = FALSE; bool Modify = FALSE;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
DrawList = EEDrawList; DrawList = EEDrawList;
for( ; DrawList != NULL; DrawList = DrawList->Next() ) for( ; DrawList != NULL; DrawList = DrawList->Next() )
...@@ -44,7 +48,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC ) ...@@ -44,7 +48,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE ) if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{ {
flag = TstAlignSegment( (EDA_DrawLineStruct*) DrawList, flag = TstAlignSegment( (EDA_DrawLineStruct*) DrawList,
(EDA_DrawLineStruct*) TstDrawList ); (EDA_DrawLineStruct*) TstDrawList );
if( flag ) /* Suppression de TstSegm */ if( flag ) /* Suppression de TstSegm */
{ {
/* keep the bits set in .m_Flags, because the deleted segment can be flagged */ /* keep the bits set in .m_Flags, because the deleted segment can be flagged */
...@@ -63,7 +67,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC ) ...@@ -63,7 +67,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
} }
} }
g_EDA_Appl->m_SchematicFrame->TestDanglingEnds( EEDrawList, DC ); frame->TestDanglingEnds( EEDrawList, DC );
return Modify; return Modify;
} }
...@@ -80,7 +84,8 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen ) ...@@ -80,7 +84,8 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
if( Screen == NULL ) if( Screen == NULL )
{ {
DisplayError( NULL, wxT( "BreakSegmentOnJunction() error: NULL screen" ) ); DisplayError( NULL,
wxT( "BreakSegmentOnJunction() error: NULL screen" ) );
return; return;
} }
...@@ -149,7 +154,8 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen, ...@@ -149,7 +154,8 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
segment = (EDA_DrawLineStruct*) DrawList; segment = (EDA_DrawLineStruct*) DrawList;
ox = segment->m_Start.x; oy = segment->m_Start.y; ox = segment->m_Start.x; oy = segment->m_Start.y;
fx = segment->m_End.x; fy = segment->m_End.y; fx = segment->m_End.x; fy = segment->m_End.y;
if( distance( fx - ox, fy - oy, breakpoint.x - ox, breakpoint.y - oy, 0 ) == 0 ) if( distance( fx - ox, fy - oy, breakpoint.x - ox, breakpoint.y -
oy, 0 ) == 0 )
break; break;
/* Segment connecte: doit etre coupe en 2 si px,py n'est /* Segment connecte: doit etre coupe en 2 si px,py n'est
...@@ -172,7 +178,7 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen, ...@@ -172,7 +178,7 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
} }
NewSegment = segment->GenCopy(); NewSegment = segment->GenCopy();
NewSegment->m_Start = breakpoint; NewSegment->m_Start = breakpoint;
segment->m_End = NewSegment->m_Start; segment->m_End = NewSegment->m_Start;
NewSegment->SetNext( segment->Next() ); NewSegment->SetNext( segment->Next() );
segment->SetNext( NewSegment ); segment->SetNext( NewSegment );
DrawList = NewSegment; DrawList = NewSegment;
...@@ -256,10 +262,10 @@ static int TstAlignSegment( EDA_DrawLineStruct* RefSegm, ...@@ -256,10 +262,10 @@ static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
} }
else else
{ {
if( atan2( (double)(RefSegm->m_Start.x - RefSegm->m_End.x), if( atan2( (double) ( RefSegm->m_Start.x - RefSegm->m_End.x ),
(double)(RefSegm->m_Start.y - RefSegm->m_End.y) ) == (double) ( RefSegm->m_Start.y - RefSegm->m_End.y ) ) ==
atan2( (double)(TstSegm->m_Start.x - TstSegm->m_End.x), atan2( (double) ( TstSegm->m_Start.x - TstSegm->m_End.x ),
(double)(TstSegm->m_Start.y - TstSegm->m_End.y) ) ) (double) ( TstSegm->m_Start.y - TstSegm->m_End.y ) ) )
{ {
RefSegm->m_End = TstSegm->m_End; RefSegm->m_End = TstSegm->m_End;
return 1; return 1;
......
...@@ -36,8 +36,10 @@ void RemoteCommand( const char* cmdline ) ...@@ -36,8 +36,10 @@ void RemoteCommand( const char* cmdline )
char line[1024]; char line[1024];
char* idcmd; char* idcmd;
char* text; char* text;
WinEDA_SchematicFrame* frame = g_EDA_Appl->m_SchematicFrame;
wxString part_ref, msg; wxString part_ref, msg;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
strncpy( line, cmdline, sizeof(line) - 1 ); strncpy( line, cmdline, sizeof(line) - 1 );
...@@ -83,8 +85,8 @@ void RemoteCommand( const char* cmdline ) ...@@ -83,8 +85,8 @@ void RemoteCommand( const char* cmdline )
/*****************************************************************************/ /*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
SCH_COMPONENT* LibItem ) SCH_COMPONENT* LibItem )
/*****************************************************************************/ /*****************************************************************************/
/** Send a remote command to eeschema via a socket, /** Send a remote command to eeschema via a socket,
...@@ -106,17 +108,19 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT ...@@ -106,17 +108,19 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
{ {
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
case COMPONENT_FIELD_DRAW_TYPE: case COMPONENT_FIELD_DRAW_TYPE:
{ {
if( LibItem == NULL ) if( LibItem == NULL )
break; break;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->GetField(REFERENCE)->m_Text ) ); sprintf( Line, "$PART: %s",
SendCommand( MSG_TO_PCB, Line ); CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
} SendCommand( MSG_TO_PCB, Line );
break; }
break;
case TYPE_SCH_COMPONENT: case TYPE_SCH_COMPONENT:
LibItem = (SCH_COMPONENT*) objectToSync; LibItem = (SCH_COMPONENT*) objectToSync;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) ); sprintf( Line, "$PART: %s",
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
SendCommand( MSG_TO_PCB, Line ); SendCommand( MSG_TO_PCB, Line );
break; break;
...@@ -130,10 +134,11 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT ...@@ -130,10 +134,11 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
wxString pinnum; wxString pinnum;
Pin->ReturnPinStringNum( pinnum ); Pin->ReturnPinStringNum( pinnum );
sprintf( Line, "$PIN: %s $PART: %s", CONV_TO_UTF8( pinnum ), sprintf( Line, "$PIN: %s $PART: %s", CONV_TO_UTF8( pinnum ),
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) ); CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
} }
else else
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) ); sprintf( Line, "$PART: %s",
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
SendCommand( MSG_TO_PCB, Line ); SendCommand( MSG_TO_PCB, Line );
break; break;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
/*******************************************************/ /*******************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "program.h" #include "program.h"
...@@ -18,14 +17,16 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -18,14 +17,16 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
/**************************************************************************/ /**************************************************************************/
/* Free (delete) all schematic data (include the sub hierarchy sheets ) /* Free (delete) all schematic data (include the sub hierarchy sheets )
* for the hierarchical sheet FirstSheet * for the hierarchical sheet FirstSheet
* FirstSheet is not deleted. * FirstSheet is not deleted.
*/ */
{ {
EDA_BaseStruct* DrawStruct; EDA_BaseStruct* DrawStruct;
EDA_BaseStruct* EEDrawList; EDA_BaseStruct* EEDrawList;
WinEDA_SchematicFrame* frame = g_EDA_Appl->m_SchematicFrame; wxString msg;
wxString msg; WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
if( FirstSheet == NULL ) if( FirstSheet == NULL )
return; return;
...@@ -33,7 +34,7 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -33,7 +34,7 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
if( FirstSheet->Type() != DRAW_SHEET_STRUCT_TYPE ) if( FirstSheet->Type() != DRAW_SHEET_STRUCT_TYPE )
{ {
DisplayError( NULL, DisplayError( NULL,
wxT( "DeleteSubHierarchy error(): NOT a Sheet" ) ); wxT( "DeleteSubHierarchy error(): NOT a Sheet" ) );
return; return;
} }
...@@ -41,8 +42,8 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -41,8 +42,8 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion ) if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion )
{ {
msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ), msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ),
FirstSheet->m_SheetName.GetData(), FirstSheet->m_SheetName.GetData(),
FirstSheet->GetFileName().GetData() ); FirstSheet->GetFileName().GetData() );
if( IsOK( NULL, msg ) ) if( IsOK( NULL, msg ) )
{ {
frame->SaveEEFile( FirstSheet->m_AssociatedScreen, FILE_SAVE_AS ); frame->SaveEEFile( FirstSheet->m_AssociatedScreen, FILE_SAVE_AS );
...@@ -59,7 +60,8 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -59,7 +60,8 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
EEDrawList = EEDrawList->Next(); EEDrawList = EEDrawList->Next();
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
{ {
DeleteSubHierarchy( (DrawSheetStruct*) DrawStruct, confirm_deletion ); DeleteSubHierarchy( (DrawSheetStruct*) DrawStruct,
confirm_deletion );
} }
} }
...@@ -78,29 +80,29 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -78,29 +80,29 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
//this is redundant -- use FreeDrawList, a member of SCH_SCREEN //this is redundant -- use FreeDrawList, a member of SCH_SCREEN
/* /*
* { * {
* EDA_BaseStruct *DrawStruct; * EDA_BaseStruct *DrawStruct;
* *
* while (DrawList != NULL) * while (DrawList != NULL)
* { * {
* DrawStruct = DrawList; * DrawStruct = DrawList;
* DrawList = DrawList->Pnext; * DrawList = DrawList->Pnext;
* *
* if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE) * if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE)
* { * {
* DeleteSubHierarchy((DrawSheetStruct*) DrawStruct, confirm_deletion); * DeleteSubHierarchy((DrawSheetStruct*) DrawStruct, confirm_deletion);
* } * }
* *
* delete DrawStruct; * delete DrawStruct;
* } * }
* } * }
*/ */
/********************************************************************/ /********************************************************************/
bool ClearProjectDrawList( SCH_SCREEN* screen, bool confirm_deletion ) bool ClearProjectDrawList( SCH_SCREEN* screen, bool confirm_deletion )
/********************************************************************/ /********************************************************************/
/* free the draw list screen->EEDrawList and the subhierarchies /* free the draw list screen->EEDrawList and the subhierarchies
* clear the screen datas (filenames ..) * clear the screen datas (filenames ..)
*/ */
{ {
if( screen == NULL ) if( screen == NULL )
......
...@@ -132,12 +132,15 @@ WinEDA_Build_BOM_Frame::WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* parent, ...@@ -132,12 +132,15 @@ WinEDA_Build_BOM_Frame::WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* parent,
const wxSize& size, const wxSize& size,
long style ) long style )
{ {
wxConfig* config = wxGetApp().m_EDA_Config;
wxASSERT( config != NULL );
m_Parent = parent; m_Parent = parent;
/* Get options */ /* Get options */
s_OutputFormOpt = m_Parent->m_Parent->m_EDA_Config->Read( OPTION_BOM_FORMAT, (long) 0 ); s_OutputFormOpt = config->Read( OPTION_BOM_FORMAT, (long) 0 );
s_OutputSeparatorOpt = m_Parent->m_Parent->m_EDA_Config->Read( OPTION_BOM_SEPARATOR, (long) 0 ); s_OutputSeparatorOpt = config->Read( OPTION_BOM_SEPARATOR, (long) 0 );
long addfields = m_Parent->m_Parent->m_EDA_Config->Read( OPTION_BOM_ADD_FIELD, (long) 0 ); long addfields = config->Read( OPTION_BOM_ADD_FIELD, (long) 0 );
for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ ) for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ )
{ {
if( (addfields & bitmask) ) if( (addfields & bitmask) )
...@@ -491,6 +494,9 @@ void WinEDA_Build_BOM_Frame::OnApplyClick( wxCommandEvent& event ) ...@@ -491,6 +494,9 @@ void WinEDA_Build_BOM_Frame::OnApplyClick( wxCommandEvent& event )
void WinEDA_Build_BOM_Frame::SavePreferences() void WinEDA_Build_BOM_Frame::SavePreferences()
/**************************************************/ /**************************************************/
{ {
wxConfig* config = wxGetApp().m_EDA_Config;
wxASSERT( config != NULL );
// Determine current settings of "List items" and "Options" checkboxes // Determine current settings of "List items" and "Options" checkboxes
// (NOTE: These 6 settings are restored when the dialog box is next // (NOTE: These 6 settings are restored when the dialog box is next
// invoked, but are *not* still saved after EESchema is next shut down.) // invoked, but are *not* still saved after EESchema is next shut down.)
...@@ -519,8 +525,8 @@ void WinEDA_Build_BOM_Frame::SavePreferences() ...@@ -519,8 +525,8 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
s_Add_F8_state = m_AddField8->GetValue(); s_Add_F8_state = m_AddField8->GetValue();
// Now save current settings of both radiobutton groups // Now save current settings of both radiobutton groups
m_Parent->m_Parent->m_EDA_Config->Write( OPTION_BOM_FORMAT, (long) s_OutputFormOpt ); config->Write( OPTION_BOM_FORMAT, (long) s_OutputFormOpt );
m_Parent->m_Parent->m_EDA_Config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt ); config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt );
// Now save current settings of all "Fields to add" checkboxes // Now save current settings of all "Fields to add" checkboxes
long addfields = 0; long addfields = 0;
...@@ -531,5 +537,5 @@ void WinEDA_Build_BOM_Frame::SavePreferences() ...@@ -531,5 +537,5 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
bitmask <<= 1; bitmask <<= 1;
} }
m_Parent->m_Parent->m_EDA_Config->Write( OPTION_BOM_ADD_FIELD, addfields ); config->Write( OPTION_BOM_ADD_FIELD, addfields );
} }
...@@ -102,7 +102,7 @@ wxString msg; ...@@ -102,7 +102,7 @@ wxString msg;
Create(parent, id, caption, pos, size, style); Create(parent, id, caption, pos, size, style);
msg = _("from ") + g_EDA_Appl->m_CurrentOptionFile; msg = _("from ") + wxGetApp().m_CurrentOptionFile;
SetTitle(msg); SetTitle(msg);
SetFormatsNetListes(); SetFormatsNetListes();
m_ListLibr->InsertItems(g_LibName_List, 0); m_ListLibr->InsertItems(g_LibName_List, 0);
...@@ -312,8 +312,8 @@ void KiConfigEeschemaFrame::OnCloseWindow(wxCloseEvent & event) ...@@ -312,8 +312,8 @@ void KiConfigEeschemaFrame::OnCloseWindow(wxCloseEvent & event)
if ( m_LibListChanged ) if ( m_LibListChanged )
{ {
LoadLibraries(m_Parent); LoadLibraries(m_Parent);
if ( m_Parent->m_Parent->m_ViewlibFrame ) if ( m_Parent->m_ViewlibFrame )
m_Parent->m_Parent->m_ViewlibFrame->ReCreateListLib(); m_Parent->m_ViewlibFrame->ReCreateListLib();
} }
EndModal(0); EndModal(0);
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "protos.h" #include "protos.h"
#include "eeconfig.h" #include "eeconfig.h"
#include "worksheet.h" #include "worksheet.h"
#include "hotkeys_basic.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "id.h" #include "id.h"
...@@ -44,7 +43,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) ...@@ -44,7 +43,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
case ID_OPTIONS_SETUP: case ID_OPTIONS_SETUP:
DisplayOptionFrame( this, pos ); DisplayOptionFrame( this, pos );
DrawPanel->Refresh(TRUE); // Redraw, because grid settings may have changed. DrawPanel->Refresh( TRUE ); // Redraw, because grid settings may have changed.
break; break;
case ID_CONFIG_SAVE: case ID_CONFIG_SAVE:
...@@ -58,14 +57,14 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) ...@@ -58,14 +57,14 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext ); ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext );
FullFileName = EDA_FileSelector( _( "Read config file" ), FullFileName = EDA_FileSelector( _( "Read config file" ),
wxGetCwd(), /* Chemin par defaut */ wxGetCwd(), /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */ FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */ g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */ mask, /* Masque d'affichage */
this, this,
wxFD_OPEN, wxFD_OPEN,
TRUE /* ne change pas de repertoire courant */ TRUE /* ne change pas de repertoire courant */
); );
if( FullFileName.IsEmpty() ) if( FullFileName.IsEmpty() )
break; break;
if( !wxFileExists( FullFileName ) ) if( !wxFileExists( FullFileName ) )
...@@ -75,7 +74,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) ...@@ -75,7 +74,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
} }
Read_Config( FullFileName, TRUE ); Read_Config( FullFileName, TRUE );
} }
break; break;
case ID_PREFERENCES_CREATE_CONFIG_HOTKEYS: case ID_PREFERENCES_CREATE_CONFIG_HOTKEYS:
FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ); FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
...@@ -93,12 +92,12 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) ...@@ -93,12 +92,12 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ); FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME; FullFileName += HOTKEY_FILENAME;
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT; FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
AddDelimiterString(FullFileName); AddDelimiterString( FullFileName );
wxString editorname = GetEditorName(); wxString editorname = GetEditorName();
if( !editorname.IsEmpty() ) if( !editorname.IsEmpty() )
ExecuteFile( this, editorname, FullFileName ); ExecuteFile( this, editorname, FullFileName );
} }
break; break;
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME: case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD: case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
...@@ -110,7 +109,9 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) ...@@ -110,7 +109,9 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config internal error" ) ); DisplayError( this,
wxT(
"WinEDA_SchematicFrame::Process_Config internal error" ) );
} }
} }
...@@ -123,11 +124,14 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose ) ...@@ -123,11 +124,14 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose )
* Read the hotkey files config for eeschema and libedit * Read the hotkey files config for eeschema and libedit
*/ */
{ {
wxString FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ); wxString FullFileName = ReturnHotkeyConfigFilePath(
g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME; FullFileName += HOTKEY_FILENAME;
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT; FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
frame->ReadHotkeyConfigFile( FullFileName, s_Eeschema_Hokeys_Descr, verbose ); frame->ReadHotkeyConfigFile( FullFileName,
s_Eeschema_Hokeys_Descr,
verbose );
return TRUE; return TRUE;
} }
...@@ -138,16 +142,19 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig ) ...@@ -138,16 +142,19 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
/***********************************************************************/ /***********************************************************************/
/* lit la configuration, si elle n'a pas deja ete lue /* lit la configuration, si elle n'a pas deja ete lue
* 1 - lit <nom fichier root>.pro * 1 - lit <nom fichier root>.pro
* 2 - si non trouve lit <chemin des binaires>../template/kicad.pro * 2 - si non trouve lit <chemin des binaires>../template/kicad.pro
* 3 - si non trouve: init des variables aux valeurs par defaut * 3 - si non trouve: init des variables aux valeurs par defaut
* *
* Retourne TRUE si lu, FALSE si config non lue * Retourne TRUE si lu, FALSE si config non lue
*/ */
{ {
wxString FullFileName; wxString FullFileName;
bool IsRead = TRUE; bool IsRead = TRUE;
wxArrayString liblist_tmp = g_LibName_List; wxArrayString liblist_tmp = g_LibName_List;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
if( CfgFileName.IsEmpty() ) if( CfgFileName.IsEmpty() )
FullFileName = g_RootSheet->m_AssociatedScreen->m_FileName; FullFileName = g_RootSheet->m_AssociatedScreen->m_FileName;
...@@ -155,8 +162,9 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig ) ...@@ -155,8 +162,9 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
FullFileName = CfgFileName; FullFileName = CfgFileName;
g_LibName_List.Clear(); g_LibName_List.Clear();
if( !g_EDA_Appl->ReadProjectConfig( FullFileName, if( !wxGetApp().ReadProjectConfig( FullFileName,
GROUP, ParamCfgList, ForceRereadConfig ? FALSE : TRUE ) ) // Config non lue GROUP, ParamCfgList,
ForceRereadConfig ? FALSE : TRUE ) ) // Config non lue
{ {
g_LibName_List = liblist_tmp; g_LibName_List = liblist_tmp;
IsRead = FALSE; IsRead = FALSE;
...@@ -172,13 +180,13 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig ) ...@@ -172,13 +180,13 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
g_LibName_List.Add( wxT( "device" ) ); g_LibName_List.Add( wxT( "device" ) );
} }
if( g_EDA_Appl->m_SchematicFrame ) if( frame )
{ {
g_EDA_Appl->m_SchematicFrame->SetDrawBgColor( g_DrawBgColor ); frame->SetDrawBgColor( g_DrawBgColor );
g_EDA_Appl->m_SchematicFrame->m_Draw_Grid = g_ShowGrid; frame->m_Draw_Grid = g_ShowGrid;
} }
LoadLibraries( g_EDA_Appl->m_SchematicFrame ); LoadLibraries( frame );
return IsRead; return IsRead;
} }
...@@ -198,17 +206,17 @@ void WinEDA_SchematicFrame::Save_Config( wxWindow* displayframe ) ...@@ -198,17 +206,17 @@ void WinEDA_SchematicFrame::Save_Config( wxWindow* displayframe )
path = wxGetCwd(); path = wxGetCwd();
FullFileName = EDA_FileSelector( _( "Save preferences" ), FullFileName = EDA_FileSelector( _( "Save preferences" ),
path, /* Chemin par defaut */ path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */ FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */ g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */ mask, /* Masque d'affichage */
displayframe, displayframe,
wxFD_SAVE, wxFD_SAVE,
TRUE TRUE
); );
if( FullFileName.IsEmpty() ) if( FullFileName.IsEmpty() )
return; return;
/* ecriture de la configuration */ /* ecriture de la configuration */
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList ); wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
} }
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#include "fctsys.h" #include "fctsys.h"
#include <wx/image.h>
#include "common.h" #include "common.h"
#include "program.h" #include "program.h"
#include "libcmp.h" #include "libcmp.h"
...@@ -26,7 +24,7 @@ ...@@ -26,7 +24,7 @@
#include "protos.h" #include "protos.h"
// Global variables // Global variables
wxString g_Main_Title( wxT( "EESchema" ) ); wxString g_Main_Title( wxT( "EESchema" ) );
/************************************/ /************************************/
/* Called to initialize the program */ /* Called to initialize the program */
...@@ -42,8 +40,7 @@ IMPLEMENT_APP( WinEDA_App ) ...@@ -42,8 +40,7 @@ IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit() bool WinEDA_App::OnInit()
{ {
wxString FFileName; wxString FFileName;
WinEDA_SchematicFrame* frame = NULL;
g_EDA_Appl = this;
g_DebugLevel = 0; // Debug level */ g_DebugLevel = 0; // Debug level */
...@@ -61,44 +58,43 @@ bool WinEDA_App::OnInit() ...@@ -61,44 +58,43 @@ bool WinEDA_App::OnInit()
/* init EESCHEMA */ /* init EESCHEMA */
GetSettings(); // read current setup GetSettings(); // read current setup
SeedLayers(); SeedLayers();
Read_Hotkey_Config( m_SchematicFrame, false ); /* Must be called before creating the main frame Read_Hotkey_Config( frame, false ); /* Must be called before creating
* in order to display the real hotkeys in menus * the main frame in order to
* or tool tips */ * display the real hotkeys in menus
* or tool tips */
// Create main frame (schematic frame) : // Create main frame (schematic frame) :
m_SchematicFrame = new WinEDA_SchematicFrame( NULL, this, frame = new WinEDA_SchematicFrame( NULL, wxT( "EESchema" ),
wxT( "EESchema" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
SetTopWindow( m_SchematicFrame ); SetTopWindow( frame );
m_SchematicFrame->Show( TRUE ); frame->Show( TRUE );
if( CreateServer( m_SchematicFrame, KICAD_SCH_PORT_SERVICE_NUMBER ) ) if( CreateServer( frame, KICAD_SCH_PORT_SERVICE_NUMBER ) )
{ {
// RemoteCommand is in controle.cpp and is called when PCBNEW // RemoteCommand is in controle.cpp and is called when PCBNEW
// sends EESCHEMA a command // sends EESCHEMA a command
SetupServerFunction( RemoteCommand ); SetupServerFunction( RemoteCommand );
} }
ActiveScreen = m_SchematicFrame->GetScreen(); ActiveScreen = frame->GetScreen();
m_SchematicFrame->Zoom_Automatique( TRUE ); frame->Zoom_Automatique( TRUE );
/* Load file specified in the command line. */ /* Load file specified in the command line. */
if( !FFileName.IsEmpty() ) if( !FFileName.IsEmpty() )
{ {
ChangeFileNameExt( FFileName, g_SchExtBuffer ); ChangeFileNameExt( FFileName, g_SchExtBuffer );
wxSetWorkingDirectory( wxPathOnly( FFileName ) ); wxSetWorkingDirectory( wxPathOnly( FFileName ) );
if( m_SchematicFrame->DrawPanel ) if( frame->DrawPanel )
if( m_SchematicFrame->LoadOneEEProject( FFileName, FALSE ) <= 0 ) if( frame->LoadOneEEProject( FFileName, FALSE ) <= 0 )
m_SchematicFrame->DrawPanel->Refresh( TRUE ); // File not found or error frame->DrawPanel->Refresh( TRUE ); // File not found or error
} }
else else
{ {
Read_Config( wxEmptyString, TRUE ); // Read a default config file if no file to load Read_Config( wxEmptyString, TRUE ); // Read a default config file if no file to load
if( m_SchematicFrame->DrawPanel ) if( frame->DrawPanel )
m_SchematicFrame->DrawPanel->Refresh( TRUE ); frame->DrawPanel->Refresh( TRUE );
} }
return TRUE; return TRUE;
} }
This diff is collapsed.
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "program.h" #include "program.h"
...@@ -22,48 +21,46 @@ ...@@ -22,48 +21,46 @@
/* class WinEDA_LibeditFrame */ /* class WinEDA_LibeditFrame */
/*****************************/ /*****************************/
BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_CLOSE( WinEDA_LibeditFrame::OnCloseWindow ) COMMON_EVENTS_DRAWFRAME
EVT_SIZE( WinEDA_LibeditFrame::OnSize ) EVT_CLOSE( WinEDA_LibeditFrame::OnCloseWindow )
EVT_SIZE( WinEDA_LibeditFrame::OnSize )
EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT, EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT,
WinEDA_LibeditFrame::Process_Zoom ) WinEDA_LibeditFrame::Process_Zoom )
// Tools et boutons de Libedit: // Tools et boutons de Libedit:
/* Main horizontal toolbar */ /* Main horizontal toolbar */
EVT_TOOL_RANGE( ID_LIBEDIT_START_H_TOOL, ID_LIBEDIT_END_H_TOOL, EVT_TOOL_RANGE( ID_LIBEDIT_START_H_TOOL, ID_LIBEDIT_END_H_TOOL,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER, EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS, EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
/* Right Vertical toolbar */ /* Right Vertical toolbar */
EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_LibeditFrame::Process_Special_Functions ) EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_LibeditFrame::Process_Special_Functions )
EVT_TOOL_RANGE( ID_LIBEDIT_START_V_TOOL, ID_LIBEDIT_END_V_TOOL, EVT_TOOL_RANGE( ID_LIBEDIT_START_V_TOOL, ID_LIBEDIT_END_V_TOOL,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
/* PopUp events and commands: */ /* PopUp events and commands: */
EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE, EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
// Annulation de commande en cours // Annulation de commande en cours
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
// PopUp Menus pour Zooms trait�s dans drawpanel.cpp // PopUp Menus pour Zooms trait�s dans drawpanel.cpp
END_EVENT_TABLE() END_EVENT_TABLE()
WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
WinEDA_App* parent,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style ) : long style ) :
WinEDA_DrawFrame( father, LIBEDITOR_FRAME, parent, title, pos, size, style ) WinEDA_DrawFrame( father, LIBEDITOR_FRAME, title, pos, size, style )
{ {
m_FrameName = wxT( "LibeditFrame" ); m_FrameName = wxT( "LibeditFrame" );
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
...@@ -89,7 +86,9 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -89,7 +86,9 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
WinEDA_LibeditFrame::~WinEDA_LibeditFrame() WinEDA_LibeditFrame::~WinEDA_LibeditFrame()
/**********************************************/ /**********************************************/
{ {
m_Parent->m_LibeditFrame = NULL; WinEDA_SchematicFrame* frame =
(WinEDA_SchematicFrame*) wxGetApp().GetTopWindow();
frame->m_LibeditFrame = NULL;
} }
......
...@@ -112,7 +112,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() ...@@ -112,7 +112,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
// Create the list of last edited schematic files // Create the list of last edited schematic files
m_FilesMenu->AppendSeparator(); m_FilesMenu->AppendSeparator();
int max_file = m_Parent->m_LastProjectMaxCount; int max_file = wxGetApp().m_LastProjectMaxCount;
for( ii = 0; ii < max_file; ii++ ) for( ii = 0; ii < max_file; ii++ )
{ {
if( GetLastProject( ii ).IsEmpty() ) if( GetLastProject( ii ).IsEmpty() )
...@@ -376,7 +376,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() ...@@ -376,7 +376,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
// Font selection and setup // Font selection and setup
AddFontSelectionMenu( configmenu ); AddFontSelectionMenu( configmenu );
m_Parent->SetLanguageList( configmenu ); wxGetApp().SetLanguageList( configmenu );
configmenu->AppendSeparator(); configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ), item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ),
...@@ -417,7 +417,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() ...@@ -417,7 +417,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
else // Update the list of last edited schematic files else // Update the list of last edited schematic files
{ {
wxMenuItem* item; wxMenuItem* item;
int max_file = m_Parent->m_LastProjectMaxCount; int max_file = wxGetApp().m_LastProjectMaxCount;
for( ii = max_file - 1; ii >=0; ii-- ) for( ii = max_file - 1; ii >=0; ii-- )
{ {
if( m_FilesMenu->FindItem( ID_LOAD_FILE_1 + ii ) ) if( m_FilesMenu->FindItem( ID_LOAD_FILE_1 + ii ) )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -41,10 +41,10 @@ END_EVENT_TABLE() ...@@ -41,10 +41,10 @@ END_EVENT_TABLE()
/******************************************************************************/ /******************************************************************************/
WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
LibraryStruct* Library, LibraryStruct* Library,
wxSemaphore* semaphore ) : wxSemaphore* semaphore ) :
WinEDA_DrawFrame( father, VIEWER_FRAME, parent, _( "Library browser" ), WinEDA_DrawFrame( father, VIEWER_FRAME, _( "Library browser" ),
wxDefaultPosition, wxDefaultSize ) wxDefaultPosition, wxDefaultSize )
/******************************************************************************/ /******************************************************************************/
{ {
...@@ -105,7 +105,9 @@ WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame() ...@@ -105,7 +105,9 @@ WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame()
delete GetScreen(); delete GetScreen();
SetBaseScreen( 0 ); SetBaseScreen( 0 );
m_Parent->m_ViewlibFrame = NULL; WinEDA_SchematicFrame* frame =
(WinEDA_SchematicFrame*) wxGetApp().GetTopWindow();
frame->m_ViewlibFrame = NULL;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "gerbview.h" #include "gerbview.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "id.h" #include "id.h"
#include "hotkeys_basic.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "gerbview_config.h" #include "gerbview_config.h"
...@@ -76,12 +75,12 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) ...@@ -76,12 +75,12 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ); FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME; FullFileName += HOTKEY_FILENAME;
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT; FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
AddDelimiterString(FullFileName); AddDelimiterString( FullFileName );
wxString editorname = GetEditorName(); wxString editorname = GetEditorName();
if( !editorname.IsEmpty() ) if( !editorname.IsEmpty() )
ExecuteFile( this, editorname, FullFileName ); ExecuteFile( this, editorname, FullFileName );
} }
break; break;
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME: case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD: case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
...@@ -93,7 +92,8 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) ...@@ -93,7 +92,8 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_GerberFrame::Process_Config internal error" ) ); DisplayError( this,
wxT( "WinEDA_GerberFrame::Process_Config internal error" ) );
} }
} }
...@@ -103,15 +103,16 @@ bool Read_Config() ...@@ -103,15 +103,16 @@ bool Read_Config()
/*****************************************************/ /*****************************************************/
/* lit la configuration, si elle n'a pas deja etee lue /* lit la configuration, si elle n'a pas deja etee lue
* 1 - lit gerbview.cnf * 1 - lit gerbview.cnf
* 2 - si non trouve lit <chemin de gerbview.exe>/gerbview.cnf * 2 - si non trouve lit <chemin de gerbview.exe>/gerbview.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut * 3 - si non trouve: init des variables aux valeurs par defaut
* *
* Retourne un pointeur su le message d'erreur a afficher * Retourne un pointeur su le message d'erreur a afficher
*/ */
{ {
g_Prj_Config_Filename_ext = wxT( ".cnf" ); g_Prj_Config_Filename_ext = wxT( ".cnf" );
g_EDA_Appl->ReadProjectConfig( wxT( "gerbview" ), GROUP, ParamCfgList, FALSE ); wxGetApp().ReadProjectConfig( wxT( "gerbview" ), GROUP, ParamCfgList,
FALSE );
/* Inits autres variables */ /* Inits autres variables */
if( ScreenPcb ) if( ScreenPcb )
...@@ -132,14 +133,14 @@ void WinEDA_GerberFrame::Update_config() ...@@ -132,14 +133,14 @@ void WinEDA_GerberFrame::Update_config()
/******************************************/ /******************************************/
/* /*
* creation du fichier de config * creation du fichier de config
*/ */
{ {
wxString FullFileName; wxString FullFileName;
wxString mask( wxT( "*" ) ), wxString mask( wxT( "*" ) );
g_Prj_Config_Filename_ext = wxT( ".cnf"; ) g_Prj_Config_Filename_ext = wxT( ".cnf" );
mask += g_Prj_Config_Filename_ext; mask += g_Prj_Config_Filename_ext;
FullFileName = wxT( "gerbview" ); FullFileName = wxT( "gerbview" );
ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext ); ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext );
...@@ -157,7 +158,7 @@ void WinEDA_GerberFrame::Update_config() ...@@ -157,7 +158,7 @@ void WinEDA_GerberFrame::Update_config()
return; return;
/* ecriture de la configuration */ /* ecriture de la configuration */
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList ); wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
} }
...@@ -169,9 +170,12 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose ) ...@@ -169,9 +170,12 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose )
* Read the hotkey files config for pcbnew and module_edit * Read the hotkey files config for pcbnew and module_edit
*/ */
{ {
wxString FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice ); wxString FullFileName = ReturnHotkeyConfigFilePath(
g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME; FullFileName += HOTKEY_FILENAME;
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT; FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
return frame->ReadHotkeyConfigFile( FullFileName, s_Gerbview_Hokeys_Descr, verbose ); return frame->ReadHotkeyConfigFile( FullFileName,
s_Gerbview_Hokeys_Descr,
verbose );
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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