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;
......
...@@ -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;
} }
...@@ -78,17 +78,20 @@ void WinEDA_BasicFrame::GetSettings() ...@@ -78,17 +78,20 @@ void WinEDA_BasicFrame::GetSettings()
{ {
wxString text; wxString text;
int Ypos_min; int Ypos_min;
wxConfig* config;
if( m_Parent->m_EDA_Config ) config = wxGetApp().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,6 +149,11 @@ static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] = ...@@ -155,6 +149,11 @@ 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 */
/**************************/ /**************************/
...@@ -162,15 +161,6 @@ static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] = ...@@ -162,15 +161,6 @@ static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] =
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;
...@@ -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 );
...@@ -300,8 +295,8 @@ void WinEDA_App::InitOnLineHelp() ...@@ -300,8 +295,8 @@ void WinEDA_App::InitOnLineHelp()
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" ) );
...@@ -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() )
...@@ -593,9 +593,11 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu ) ...@@ -593,9 +593,11 @@ 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 )
......
...@@ -4,22 +4,9 @@ ...@@ -4,22 +4,9 @@
/************************************************/ /************************************************/
// For compilers that support precompilation, includes "wx.h". // For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h" #include "fctsys.h"
#include "wx/mimetype.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWindows headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <stdio.h> #include "wx/mimetype.h"
#include <string.h>
#include <ctype.h>
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#ifndef _MSC_VER #ifndef _MSC_VER
...@@ -27,9 +14,7 @@ ...@@ -27,9 +14,7 @@
#endif #endif
#endif #endif
#include "fctsys.h"
#include "common.h" #include "common.h"
#include "wxstruct.h"
#include "macros.h" #include "macros.h"
/* List of default paths used to locate help files and kicad library files. /* List of default paths used to locate help files and kicad library files.
...@@ -114,7 +99,6 @@ static wxString s_KicadBinaryPathList[] = { ...@@ -114,7 +99,6 @@ static wxString s_KicadBinaryPathList[] = {
#endif #endif
wxT( "end_list" ) // End of list symbol, do not change wxT( "end_list" ) // End of list symbol, do not change
}; };
extern WinEDA_App* g_EDA_Appl;
/***************************************************************************/ /***************************************************************************/
...@@ -402,12 +386,12 @@ wxString FindKicadHelpPath() ...@@ -402,12 +386,12 @@ wxString FindKicadHelpPath()
bool PathFound = FALSE; bool PathFound = FALSE;
/* find kicad/help/ */ /* find kicad/help/ */
tmp = g_EDA_Appl->m_BinDir; tmp = wxGetApp().m_BinDir;
if( tmp.Last() == '/' ) if( tmp.Last() == '/' )
tmp.RemoveLast(); tmp.RemoveLast();
FullPath = tmp.BeforeLast( '/' ); // cd .. FullPath = tmp.BeforeLast( '/' ); // cd ..
FullPath += wxT( "/doc/help/" ); FullPath += wxT( "/doc/help/" );
LocaleString = g_EDA_Appl->m_Locale->GetCanonicalName(); LocaleString = wxGetApp().m_Locale->GetCanonicalName();
wxString path_tmp = FullPath; wxString path_tmp = FullPath;
#ifdef __WINDOWS__ #ifdef __WINDOWS__
...@@ -420,9 +404,9 @@ wxString FindKicadHelpPath() ...@@ -420,9 +404,9 @@ wxString FindKicadHelpPath()
} }
/* find kicad/help/ from environment variable KICAD */ /* find kicad/help/ from environment variable KICAD */
if( !PathFound && g_EDA_Appl->m_Env_Defined ) if( !PathFound && wxGetApp().m_Env_Defined )
{ {
FullPath = g_EDA_Appl->m_KicadEnv + wxT( "/doc/help/" ); FullPath = wxGetApp().m_KicadEnv + wxT( "/doc/help/" );
if( wxDirExists( FullPath ) ) if( wxDirExists( FullPath ) )
PathFound = TRUE; PathFound = TRUE;
} }
...@@ -483,15 +467,15 @@ wxString FindKicadFile( const wxString& shortname ) ...@@ -483,15 +467,15 @@ wxString FindKicadFile( const wxString& shortname )
/* test de la presence du fichier shortname dans le repertoire de /* test de la presence du fichier shortname dans le repertoire de
* des binaires de kicad */ * des binaires de kicad */
FullFileName = g_EDA_Appl->m_BinDir + shortname; FullFileName = wxGetApp().m_BinDir + shortname;
if( wxFileExists( FullFileName ) ) if( wxFileExists( FullFileName ) )
return FullFileName; return FullFileName;
/* test de la presence du fichier shortname dans le repertoire /* test de la presence du fichier shortname dans le repertoire
* defini par la variable d'environnement KICAD */ * defini par la variable d'environnement KICAD */
if( g_EDA_Appl->m_Env_Defined ) if( wxGetApp().m_Env_Defined )
{ {
FullFileName = g_EDA_Appl->m_KicadEnv + shortname; FullFileName = wxGetApp().m_KicadEnv + shortname;
if( wxFileExists( FullFileName ) ) if( wxFileExists( FullFileName ) )
return FullFileName; return FullFileName;
} }
...@@ -566,7 +550,7 @@ void SetRealLibraryPath( const wxString& shortlibname ) ...@@ -566,7 +550,7 @@ void SetRealLibraryPath( const wxString& shortlibname )
else else
{ {
g_RealLibDirBuffer = ReturnKicadDatasPath(); g_RealLibDirBuffer = ReturnKicadDatasPath();
if( g_EDA_Appl->m_Env_Defined ) // Chemin impose par la variable d'environnement if( wxGetApp().m_Env_Defined ) // Chemin impose par la variable d'environnement
{ {
PathFound = TRUE; PathFound = TRUE;
} }
...@@ -599,35 +583,36 @@ wxString ReturnKicadDatasPath() ...@@ -599,35 +583,36 @@ wxString ReturnKicadDatasPath()
bool PathFound = FALSE; bool PathFound = FALSE;
wxString data_path; wxString data_path;
if( g_EDA_Appl->m_Env_Defined ) // Chemin impose par la variable d'environnement if( wxGetApp().m_Env_Defined ) // Chemin impose par la variable d'environnement
{ {
data_path = g_EDA_Appl->m_KicadEnv; data_path = wxGetApp().m_KicadEnv;
PathFound = TRUE; PathFound = TRUE;
} }
else // Chemin cherche par le chemin des executables else // Chemin cherche par le chemin des executables
{ {
// le chemin est bindir../ // le chemin est bindir../
wxString tmp = g_EDA_Appl->m_BinDir; wxString tmp = wxGetApp().m_BinDir;
#ifdef __WINDOWS__ #ifdef __WINDOWS__
tmp.MakeLower(); tmp.MakeLower();
#endif #endif
if( tmp.Contains( wxT( "kicad" ) ) ) if( tmp.Contains( wxT( "kicad" ) ) )
{ {
#ifdef __WINDOWS__ #ifdef __WINDOWS__
tmp = g_EDA_Appl->m_BinDir; tmp = wxGetApp().m_BinDir;
#endif #endif
if( tmp.Last() == '/' ) if( tmp.Last() == '/' )
tmp.RemoveLast(); tmp.RemoveLast();
data_path = tmp.BeforeLast( '/' ); // id cd ../ data_path = tmp.BeforeLast( '/' ); // id cd ../
data_path += UNIX_STRING_DIR_SEP; data_path += UNIX_STRING_DIR_SEP;
// Old versions of kicad use kicad/ as default for data // Old versions of kicad use kicad/ as default for data
// and last versions kicad/share/ // and last versions kicad/share/
// So we search for kicad/share/ first // So we search for kicad/share/ first
wxString old_path = data_path; wxString old_path = data_path;
data_path += wxT("share/"); data_path += wxT( "share/" );
if( wxDirExists( data_path ) ) if( wxDirExists( data_path ) )
PathFound = TRUE; PathFound = TRUE;
else if ( wxDirExists( old_path ) ) else if( wxDirExists( old_path ) )
{ {
data_path = old_path; data_path = old_path;
PathFound = TRUE; PathFound = TRUE;
...@@ -693,17 +678,19 @@ wxString GetEditorName() ...@@ -693,17 +678,19 @@ wxString GetEditorName()
); );
} }
if( ( !editorname.IsEmpty() ) && g_EDA_Appl->m_EDA_CommonConfig ) if( ( !editorname.IsEmpty() ) && wxGetApp().m_EDA_CommonConfig )
{ {
g_EditorName = editorname; g_EditorName = editorname;
g_EDA_Appl->m_EDA_CommonConfig->Write( wxT( "Editor" ), g_EditorName ); wxGetApp().m_EDA_CommonConfig->Write( wxT( "Editor" ), g_EditorName );
} }
return g_EditorName; return g_EditorName;
} }
/***********************************/ /***********************************/
bool OpenPDF( const wxString& file ) bool OpenPDF( const wxString& file )
/***********************************/ /***********************************/
/** Function OpenPDF /** Function OpenPDF
* run the PDF viewer and display a PDF file * run the PDF viewer and display a PDF file
* @param file = PDF file to open * @param file = PDF file to open
...@@ -715,11 +702,11 @@ bool OpenPDF( const wxString& file ) ...@@ -715,11 +702,11 @@ bool OpenPDF( const wxString& file )
wxString type; wxString type;
bool success = false; bool success = false;
g_EDA_Appl->ReadPdfBrowserInfos(); wxGetApp().ReadPdfBrowserInfos();
if( !g_EDA_Appl->m_PdfBrowserIsDefault ) // Run the prefered PDF Browser if( !wxGetApp().m_PdfBrowserIsDefault ) // Run the prefered PDF Browser
{ {
AddDelimiterString( filename ); AddDelimiterString( filename );
command = g_EDA_Appl->m_PdfBrowser + wxT( " " ) + filename; command = wxGetApp().m_PdfBrowser + wxT( " " ) + filename;
} }
else else
{ {
...@@ -730,14 +717,15 @@ bool OpenPDF( const wxString& file ) ...@@ -730,14 +717,15 @@ bool OpenPDF( const wxString& file )
success = filetype->GetOpenCommand( &command, params ); success = filetype->GetOpenCommand( &command, params );
delete filetype; delete filetype;
#ifndef __WINDOWS__ #ifndef __WINDOWS__
// Bug ? under linux wxWidgets returns acroread as PDF viewer,even it not exists // Bug ? under linux wxWidgets returns acroread as PDF viewer,even it not exists
if ( command.StartsWith(wxT("acroread")) ) // Workaround if( command.StartsWith( wxT( "acroread" ) ) ) // Workaround
success = false; success = false;
#endif #endif
if( success && !command.IsEmpty() ) if( success && !command.IsEmpty() )
{ {
success = ProcessExecute( command ); success = ProcessExecute( command );
if ( success ) if( success )
return success; return success;
} }
...@@ -770,6 +758,7 @@ bool OpenPDF( const wxString& file ) ...@@ -770,6 +758,7 @@ bool OpenPDF( const wxString& file )
break; break;
} }
} }
#endif #endif
} }
} }
...@@ -777,17 +766,17 @@ bool OpenPDF( const wxString& file ) ...@@ -777,17 +766,17 @@ bool OpenPDF( const wxString& file )
if( !command.IsEmpty() ) if( !command.IsEmpty() )
{ {
success = ProcessExecute( command ); success = ProcessExecute( command );
if ( !success ) if( !success )
{ {
wxString msg = _("Problem while running the PDF viewer"); wxString msg = _( "Problem while running the PDF viewer" );
msg << _("\n command is ") << command; msg << _( "\n command is " ) << command;
DisplayError( NULL, msg ); DisplayError( NULL, msg );
} }
} }
else else
{ {
wxString msg = _("Unable to find a PDF viewer for"); wxString msg = _( "Unable to find a PDF viewer for" );
msg << wxT(" ") << filename; msg << wxT( " " ) << filename;
DisplayError( NULL, msg ); DisplayError( NULL, msg );
success = false; success = false;
} }
...@@ -795,6 +784,7 @@ bool OpenPDF( const wxString& file ) ...@@ -795,6 +784,7 @@ bool OpenPDF( const wxString& file )
return success; return success;
} }
/*************************************/ /*************************************/
void OpenFile( const wxString& file ) void OpenFile( const wxString& file )
/*************************************/ /*************************************/
......
...@@ -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;
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
/*********************************************************************/ /*********************************************************************/
static bool ReCreatePrjConfig( const wxString& local_config_filename, static bool ReCreatePrjConfig( const wxString& local_config_filename,
const wxString& GroupName, bool ForceUseLocalConfig ) const wxString& GroupName,
bool ForceUseLocalConfig )
/*********************************************************************/ /*********************************************************************/
/* Cree ou recree la configuration locale de kicad (filename.pro) /* Cree ou recree la configuration locale de kicad (filename.pro)
...@@ -44,8 +45,10 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename, ...@@ -44,8 +45,10 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename,
if( ForceUseLocalConfig || wxFileExists( g_Prj_Config_LocalFilename ) ) if( ForceUseLocalConfig || wxFileExists( g_Prj_Config_LocalFilename ) )
{ {
g_Prj_Default_Config_FullFilename.Empty(); g_Prj_Default_Config_FullFilename.Empty();
g_Prj_Config = new wxFileConfig( wxEmptyString, wxEmptyString, g_Prj_Config = new wxFileConfig( wxEmptyString,
g_Prj_Config_LocalFilename, wxEmptyString, wxEmptyString,
g_Prj_Config_LocalFilename,
wxEmptyString,
wxCONFIG_USE_RELATIVE_PATH ); wxCONFIG_USE_RELATIVE_PATH );
g_Prj_Config->DontCreateOnDemand(); g_Prj_Config->DontCreateOnDemand();
...@@ -73,8 +76,10 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename, ...@@ -73,8 +76,10 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename,
g_Prj_Config_Filename_ext; g_Prj_Config_Filename_ext;
// Recreate new config // Recreate new config
g_Prj_Config = new wxFileConfig( wxEmptyString, wxEmptyString, g_Prj_Config = new wxFileConfig( wxEmptyString,
wxEmptyString, g_Prj_Default_Config_FullFilename, wxEmptyString,
wxEmptyString,
g_Prj_Default_Config_FullFilename,
wxCONFIG_USE_RELATIVE_PATH ); wxCONFIG_USE_RELATIVE_PATH );
g_Prj_Config->DontCreateOnDemand(); g_Prj_Config->DontCreateOnDemand();
...@@ -85,7 +90,8 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename, ...@@ -85,7 +90,8 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename,
/***************************************************************************************/ /***************************************************************************************/
void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename, void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, PARAM_CFG_BASE** List ) const wxString& GroupName,
PARAM_CFG_BASE** List )
/***************************************************************************************/ /***************************************************************************************/
/* enregistrement de la config "projet"*/ /* enregistrement de la config "projet"*/
{ {
...@@ -203,7 +209,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename, ...@@ -203,7 +209,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename,
// We use indexlib+1 because first lib name is LibName1 // We use indexlib+1 because first lib name is LibName1
cle_config << (indexlib + 1); cle_config << (indexlib + 1);
g_Prj_Config->Write( cle_config, libname_list->Item( indexlib ) ); g_Prj_Config->Write( cle_config,
libname_list->Item( indexlib ) );
} }
break; break;
...@@ -227,7 +234,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename, ...@@ -227,7 +234,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename,
/***************************************************************************************/ /***************************************************************************************/
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, bool WinEDA_App::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 )
/***************************************************************************************/ /***************************************************************************************/
...@@ -238,8 +246,8 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, ...@@ -238,8 +246,8 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
* return: * return:
* TRUE si lue. * TRUE si lue.
* Met a jour en plus: * Met a jour en plus:
* g_EDA_Appl->m_CurrentOptionFileDateAndTime * wxGetApp().m_CurrentOptionFileDateAndTime
* g_EDA_Appl->m_CurrentOptionFile * wxGetApp().m_CurrentOptionFile
*/ */
{ {
const PARAM_CFG_BASE* pt_cfg; const PARAM_CFG_BASE* pt_cfg;
...@@ -253,22 +261,22 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, ...@@ -253,22 +261,22 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
g_Prj_Config->SetPath( UNIX_STRING_DIR_SEP ); g_Prj_Config->SetPath( UNIX_STRING_DIR_SEP );
timestamp = g_Prj_Config->Read( wxT( "update" ) ); timestamp = g_Prj_Config->Read( wxT( "update" ) );
if( Load_Only_if_New && ( !timestamp.IsEmpty() ) if( Load_Only_if_New && ( !timestamp.IsEmpty() )
&& (timestamp == g_EDA_Appl->m_CurrentOptionFileDateAndTime) ) && (timestamp == wxGetApp().m_CurrentOptionFileDateAndTime) )
{ {
return FALSE; return FALSE;
} }
g_EDA_Appl->m_CurrentOptionFileDateAndTime = timestamp; wxGetApp().m_CurrentOptionFileDateAndTime = timestamp;
if( !g_Prj_Default_Config_FullFilename.IsEmpty() ) if( !g_Prj_Default_Config_FullFilename.IsEmpty() )
g_EDA_Appl->m_CurrentOptionFile = g_Prj_Default_Config_FullFilename; wxGetApp().m_CurrentOptionFile = g_Prj_Default_Config_FullFilename;
else else
{ {
if( wxPathOnly( g_Prj_Config_LocalFilename ).IsEmpty() ) if( wxPathOnly( g_Prj_Config_LocalFilename ).IsEmpty() )
g_EDA_Appl->m_CurrentOptionFile = wxGetApp().m_CurrentOptionFile =
wxGetCwd() + STRING_DIR_SEP + g_Prj_Config_LocalFilename; wxGetCwd() + STRING_DIR_SEP + g_Prj_Config_LocalFilename;
else else
g_EDA_Appl->m_CurrentOptionFile = g_Prj_Config_LocalFilename; wxGetApp().m_CurrentOptionFile = g_Prj_Config_LocalFilename;
} }
for( ; *List != NULL; List++ ) for( ; *List != NULL; List++ )
...@@ -437,7 +445,8 @@ PARAM_CFG_INT::PARAM_CFG_INT( bool Insetup, const wxChar* ident, int* ptparam, ...@@ -437,7 +445,8 @@ PARAM_CFG_INT::PARAM_CFG_INT( bool Insetup, const wxChar* ident, int* ptparam,
PARAM_CFG_SETCOLOR::PARAM_CFG_SETCOLOR( const wxChar* ident, int* ptparam, PARAM_CFG_SETCOLOR::PARAM_CFG_SETCOLOR( const wxChar* ident, int* ptparam,
int default_val, const wxChar* group ) : int default_val,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_SETCOLOR, group ) PARAM_CFG_BASE( ident, PARAM_SETCOLOR, group )
{ {
m_Pt_param = ptparam; m_Pt_param = ptparam;
...@@ -445,8 +454,11 @@ PARAM_CFG_SETCOLOR::PARAM_CFG_SETCOLOR( const wxChar* ident, int* ptparam, ...@@ -445,8 +454,11 @@ PARAM_CFG_SETCOLOR::PARAM_CFG_SETCOLOR( const wxChar* ident, int* ptparam,
} }
PARAM_CFG_SETCOLOR::PARAM_CFG_SETCOLOR( bool Insetup, const wxChar* ident, int* ptparam, PARAM_CFG_SETCOLOR::PARAM_CFG_SETCOLOR( bool Insetup,
int default_val, const wxChar* group ) : const wxChar* ident,
int* ptparam,
int default_val,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_SETCOLOR, group ) PARAM_CFG_BASE( ident, PARAM_SETCOLOR, group )
{ {
m_Pt_param = ptparam; m_Pt_param = ptparam;
...@@ -467,8 +479,12 @@ PARAM_CFG_DOUBLE::PARAM_CFG_DOUBLE( const wxChar* ident, double* ptparam, ...@@ -467,8 +479,12 @@ PARAM_CFG_DOUBLE::PARAM_CFG_DOUBLE( const wxChar* ident, double* ptparam,
} }
PARAM_CFG_DOUBLE::PARAM_CFG_DOUBLE( bool Insetup, const wxChar* ident, double* ptparam, PARAM_CFG_DOUBLE::PARAM_CFG_DOUBLE( bool Insetup,
double default_val, double min, double max, const wxChar* ident,
double* ptparam,
double default_val,
double min,
double max,
const wxChar* group ) : const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_DOUBLE, group ) PARAM_CFG_BASE( ident, PARAM_DOUBLE, group )
{ {
...@@ -489,8 +505,11 @@ PARAM_CFG_BOOL::PARAM_CFG_BOOL( const wxChar* ident, bool* ptparam, ...@@ -489,8 +505,11 @@ PARAM_CFG_BOOL::PARAM_CFG_BOOL( const wxChar* ident, bool* ptparam,
} }
PARAM_CFG_BOOL::PARAM_CFG_BOOL( bool Insetup, const wxChar* ident, bool* ptparam, PARAM_CFG_BOOL::PARAM_CFG_BOOL( bool Insetup,
int default_val, const wxChar* group ) : const wxChar* ident,
bool* ptparam,
int default_val,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_BOOL, group ) PARAM_CFG_BASE( ident, PARAM_BOOL, group )
{ {
m_Pt_param = ptparam; m_Pt_param = ptparam;
...@@ -500,7 +519,8 @@ PARAM_CFG_BOOL::PARAM_CFG_BOOL( bool Insetup, const wxChar* ident, bool* ptparam ...@@ -500,7 +519,8 @@ PARAM_CFG_BOOL::PARAM_CFG_BOOL( bool Insetup, const wxChar* ident, bool* ptparam
PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( const wxChar* ident, PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( const wxChar* ident,
wxString* ptparam, const wxChar* group ) : wxString* ptparam,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_WXSTRING, group ) PARAM_CFG_BASE( ident, PARAM_WXSTRING, group )
{ {
m_Pt_param = ptparam; m_Pt_param = ptparam;
...@@ -508,7 +528,8 @@ PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( const wxChar* ident, ...@@ -508,7 +528,8 @@ PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( const wxChar* ident,
PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( bool Insetup, const wxChar* ident, PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( bool Insetup, const wxChar* ident,
wxString* ptparam, const wxChar* group ) : wxString* ptparam,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_WXSTRING, group ) PARAM_CFG_BASE( ident, PARAM_WXSTRING, group )
{ {
m_Pt_param = ptparam; m_Pt_param = ptparam;
...@@ -517,7 +538,8 @@ PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( bool Insetup, const wxChar* ident, ...@@ -517,7 +538,8 @@ PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( bool Insetup, const wxChar* ident,
PARAM_CFG_LIBNAME_LIST::PARAM_CFG_LIBNAME_LIST( const wxChar* ident, PARAM_CFG_LIBNAME_LIST::PARAM_CFG_LIBNAME_LIST( const wxChar* ident,
wxArrayString* ptparam, const wxChar* group ) : wxArrayString* ptparam,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_LIBNAME_LIST, group ) PARAM_CFG_BASE( ident, PARAM_LIBNAME_LIST, group )
{ {
m_Pt_param = ptparam; m_Pt_param = ptparam;
......
...@@ -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"
...@@ -36,7 +35,7 @@ void Read_Config( const wxString& FileName ) ...@@ -36,7 +35,7 @@ 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() )
...@@ -86,5 +85,5 @@ void Save_Config( wxWindow* parent ) ...@@ -86,5 +85,5 @@ void Save_Config( wxWindow* parent )
return; return;
/* ecriture de la configuration */ /* ecriture de la configuration */
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList ); wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <wx/fontdlg.h> #include <wx/fontdlg.h>
#include "cvpcb.h" #include "cvpcb.h"
#include "gr_basic.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "bitmaps.h" #include "bitmaps.h"
...@@ -21,10 +20,12 @@ ...@@ -21,10 +20,12 @@
/*******************************************************/ /*******************************************************/
/* Constructeur de WinEDA_CvpcbFrame: la fenetre generale */ /* Constructeur de WinEDA_CvpcbFrame: la fenetre generale */
/*******************************************************/ /*******************************************************/
WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title, long style ) : WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
WinEDA_BasicFrame( NULL, CVPCB_FRAME, parent, title, wxDefaultPosition, wxDefaultSize, style ) WinEDA_BasicFrame( NULL, CVPCB_FRAME, title, wxDefaultPosition,
wxDefaultSize, style )
{ {
m_FrameName = wxT( "CvpcbFrame" ); m_FrameName = wxT( "CvpcbFrame" );
//m_AboutTitle = g_CvpcbAboutTitle; //m_AboutTitle = g_CvpcbAboutTitle;
m_ListCmp = NULL; m_ListCmp = NULL;
m_FootprintList = NULL; m_FootprintList = NULL;
...@@ -97,10 +98,13 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title, ...@@ -97,10 +98,13 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title,
WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame() WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame()
/******************************************/ /******************************************/
{ {
if( m_Parent->m_EDA_Config ) wxConfig* config = wxGetApp().m_EDA_Config;
if( config )
{ {
int state = m_HToolBar->GetToolState( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ); int state = m_HToolBar->GetToolState(
m_Parent->m_EDA_Config->Write( wxT( FILTERFOOTPRINTKEY ), state ); ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST );
config->Write( wxT( FILTERFOOTPRINTKEY ), state );
} }
} }
...@@ -117,77 +121,74 @@ void WinEDA_CvpcbFrame::OnSize( wxSizeEvent& event ) ...@@ -117,77 +121,74 @@ void WinEDA_CvpcbFrame::OnSize( wxSizeEvent& event )
/* Event table for WinEDA_CvpcbFrame */ /* Event table for WinEDA_CvpcbFrame */
/*************************************/ /*************************************/
BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame )
EVT_MENU_RANGE( ID_LOAD_PROJECT,
EVT_MENU_RANGE( ID_LOAD_PROJECT,
ID_LOAD_FILE_10, ID_LOAD_FILE_10,
WinEDA_CvpcbFrame::LoadNetList ) WinEDA_CvpcbFrame::LoadNetList )
// Menu events // Menu events
EVT_MENU( ID_SAVE_PROJECT, EVT_MENU( ID_SAVE_PROJECT,
WinEDA_CvpcbFrame::SaveQuitCvpcb ) WinEDA_CvpcbFrame::SaveQuitCvpcb )
EVT_MENU( ID_CVPCB_QUIT, EVT_MENU( ID_CVPCB_QUIT,
WinEDA_CvpcbFrame::OnQuit ) WinEDA_CvpcbFrame::OnQuit )
EVT_MENU( ID_CVPCB_DISPLAY_HELP, EVT_MENU( ID_CVPCB_DISPLAY_HELP,
WinEDA_CvpcbFrame::GetKicadHelp ) WinEDA_CvpcbFrame::GetKicadHelp )
EVT_MENU( ID_CVPCB_DISPLAY_LICENCE, EVT_MENU( ID_CVPCB_DISPLAY_LICENCE,
WinEDA_CvpcbFrame::GetKicadAbout ) WinEDA_CvpcbFrame::GetKicadAbout )
EVT_MENU( ID_CONFIG_REQ, EVT_MENU( ID_CONFIG_REQ,
WinEDA_CvpcbFrame::ConfigCvpcb ) WinEDA_CvpcbFrame::ConfigCvpcb )
EVT_MENU( ID_CONFIG_SAVE, EVT_MENU( ID_CONFIG_SAVE,
WinEDA_CvpcbFrame::Update_Config ) WinEDA_CvpcbFrame::Update_Config )
EVT_MENU_RANGE( ID_PREFERENCES_FONT_INFOSCREEN, EVT_MENU_RANGE( ID_PREFERENCES_FONT_INFOSCREEN,
ID_PREFERENCES_FONT_END, ID_PREFERENCES_FONT_END,
WinEDA_CvpcbFrame::ProcessFontPreferences ) WinEDA_CvpcbFrame::ProcessFontPreferences )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, EVT_MENU_RANGE( ID_LANGUAGE_CHOICE,
ID_LANGUAGE_CHOICE_END, ID_LANGUAGE_CHOICE_END,
WinEDA_CvpcbFrame::SetLanguage ) WinEDA_CvpcbFrame::SetLanguage )
// Toolbar events // Toolbar events
EVT_TOOL( ID_CVPCB_QUIT, EVT_TOOL( ID_CVPCB_QUIT,
WinEDA_CvpcbFrame::OnQuit ) WinEDA_CvpcbFrame::OnQuit )
EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST, EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST,
WinEDA_CvpcbFrame::LoadNetList ) WinEDA_CvpcbFrame::LoadNetList )
EVT_TOOL( ID_CVPCB_SAVEQUITCVPCB, EVT_TOOL( ID_CVPCB_SAVEQUITCVPCB,
WinEDA_CvpcbFrame::SaveQuitCvpcb ) WinEDA_CvpcbFrame::SaveQuitCvpcb )
EVT_TOOL( ID_CVPCB_CREATE_CONFIGWINDOW, EVT_TOOL( ID_CVPCB_CREATE_CONFIGWINDOW,
WinEDA_CvpcbFrame::ConfigCvpcb ) WinEDA_CvpcbFrame::ConfigCvpcb )
EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP, EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP,
WinEDA_CvpcbFrame::DisplayModule ) WinEDA_CvpcbFrame::DisplayModule )
EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA, EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA,
WinEDA_CvpcbFrame::ToFirstNA ) WinEDA_CvpcbFrame::ToFirstNA )
EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA, EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA,
WinEDA_CvpcbFrame::ToPreviousNA ) WinEDA_CvpcbFrame::ToPreviousNA )
EVT_TOOL( ID_CVPCB_DEL_ASSOCIATIONS, EVT_TOOL( ID_CVPCB_DEL_ASSOCIATIONS,
WinEDA_CvpcbFrame::DelAssociations ) WinEDA_CvpcbFrame::DelAssociations )
EVT_TOOL( ID_CVPCB_AUTO_ASSOCIE, EVT_TOOL( ID_CVPCB_AUTO_ASSOCIE,
WinEDA_CvpcbFrame::AssocieModule ) WinEDA_CvpcbFrame::AssocieModule )
EVT_TOOL( ID_CVPCB_CREATE_STUFF_FILE, EVT_TOOL( ID_CVPCB_CREATE_STUFF_FILE,
WinEDA_CvpcbFrame::WriteStuffList ) WinEDA_CvpcbFrame::WriteStuffList )
EVT_TOOL( ID_PCB_DISPLAY_FOOTPRINT_DOC, EVT_TOOL( ID_PCB_DISPLAY_FOOTPRINT_DOC,
WinEDA_CvpcbFrame::DisplayDocFile ) WinEDA_CvpcbFrame::DisplayDocFile )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
WinEDA_CvpcbFrame::OnSelectFilteringFootprint ) WinEDA_CvpcbFrame::OnSelectFilteringFootprint )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
WinEDA_CvpcbFrame::OnSelectFilteringFootprint ) WinEDA_CvpcbFrame::OnSelectFilteringFootprint )
// Frame events // Frame events
EVT_CHAR_HOOK( WinEDA_CvpcbFrame::OnChar ) EVT_CHAR_HOOK( WinEDA_CvpcbFrame::OnChar )
EVT_CLOSE( WinEDA_CvpcbFrame::OnCloseWindow ) EVT_CLOSE( WinEDA_CvpcbFrame::OnCloseWindow )
EVT_SIZE( WinEDA_CvpcbFrame::OnSize ) EVT_SIZE( WinEDA_CvpcbFrame::OnSize )
// List item events // List item events
EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST, EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST,
WinEDA_CvpcbFrame::OnLeftClick ) WinEDA_CvpcbFrame::OnLeftClick )
EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST, EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST,
WinEDA_CvpcbFrame::OnLeftDClick ) WinEDA_CvpcbFrame::OnLeftDClick )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST,
WinEDA_CvpcbFrame::OnSelectComponent ) WinEDA_CvpcbFrame::OnSelectComponent )
END_EVENT_TABLE() END_EVENT_TABLE()
/******************************************************/ /******************************************************/
void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event ) void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event )
/******************************************************/ /******************************************************/
...@@ -196,7 +197,6 @@ void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event ) ...@@ -196,7 +197,6 @@ void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event )
} }
/**********************************************************/ /**********************************************************/
void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
/**********************************************************/ /**********************************************************/
...@@ -206,10 +206,10 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -206,10 +206,10 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
if( modified ) if( modified )
{ {
unsigned ii; unsigned ii;
wxMessageDialog dialog( this, _( "Net and component list modified.\n Save before exit ?" ), wxMessageDialog dialog( this,
_( "Net and component list modified.\n Save before exit ?" ),
_( "Confirmation" ), _( "Confirmation" ),
wxYES_NO | wxCANCEL | wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT );
wxICON_EXCLAMATION | wxYES_DEFAULT );
ii = dialog.ShowModal(); ii = dialog.ShowModal();
...@@ -229,7 +229,8 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -229,7 +229,8 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
modified = 0; modified = 0;
else if( diag == 0 ) else if( diag == 0 )
{ {
if( !IsOK( this, _( "Problem when saving files, exit anyway ?" ) ) ) if( !IsOK( this,
_( "Problem when saving files, exit anyway ?" ) ) )
{ {
Event.Veto(); Event.Veto();
return; return;
...@@ -240,10 +241,10 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -240,10 +241,10 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
} }
// Close the help frame // Close the help frame
if( m_Parent->m_HtmlCtrl ) if( wxGetApp().m_HtmlCtrl )
{ {
if( m_Parent->m_HtmlCtrl->GetFrame() ) // returns NULL if no help frame active if( wxGetApp().m_HtmlCtrl->GetFrame() ) // returns NULL if no help frame active
m_Parent->m_HtmlCtrl->GetFrame()->Close( TRUE ); wxGetApp().m_HtmlCtrl->GetFrame()->Close( TRUE );
} }
if( !NetInNameBuffer.IsEmpty() ) if( !NetInNameBuffer.IsEmpty() )
...@@ -372,7 +373,8 @@ void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event ) ...@@ -372,7 +373,8 @@ void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event )
composants_non_affectes = nbcomp; composants_non_affectes = nbcomp;
} }
Line.Printf( _( "Componants: %d (free: %d)" ), nbcomp, composants_non_affectes ); Line.Printf( _( "Componants: %d (free: %d)" ), nbcomp,
composants_non_affectes );
SetStatusText( Line, 1 ); SetStatusText( Line, 1 );
} }
...@@ -486,8 +488,8 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event ) ...@@ -486,8 +488,8 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
m_Parent->SetLanguageIdentifier( id ); wxGetApp().SetLanguageIdentifier( id );
m_Parent->SetLanguage(); wxGetApp().SetLanguage();
} }
...@@ -497,12 +499,13 @@ void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event ) ...@@ -497,12 +499,13 @@ void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
{ {
wxString DocModuleFileName, fullfilename; wxString DocModuleFileName, fullfilename;
DocModuleFileName = g_EDA_Appl->m_EDA_CommonConfig->Read( DOC_FOOTPRINTS_LIST_KEY, DocModuleFileName = wxGetApp().m_EDA_CommonConfig->Read(
DOC_FOOTPRINTS_LIST_KEY,
DEFAULT_FOOTPRINTS_LIST_FILENAME ); DEFAULT_FOOTPRINTS_LIST_FILENAME );
if( wxIsAbsolutePath(DocModuleFileName) ) if( wxIsAbsolutePath( DocModuleFileName ) )
fullfilename = DocModuleFileName; fullfilename = DocModuleFileName;
else else
fullfilename = FindKicadHelpPath() + wxT("../") + DocModuleFileName; fullfilename = FindKicadHelpPath() + wxT( "../" ) + DocModuleFileName;
GetAssociatedDocument( this, wxEmptyString, fullfilename ); GetAssociatedDocument( this, wxEmptyString, fullfilename );
} }
...@@ -537,7 +540,8 @@ void WinEDA_CvpcbFrame::ProcessFontPreferences( wxCommandEvent& event ) ...@@ -537,7 +540,8 @@ void WinEDA_CvpcbFrame::ProcessFontPreferences( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_DrawFrame::ProcessFontPreferences Internal Error" ) ); DisplayError( this,
wxT( "WinEDA_DrawFrame::ProcessFontPreferences Internal Error" ) );
break; break;
} }
} }
......
/*******************/ /*******************/
/* 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 GetSettings(); // read current setup
wxSetWorkingDirectory(currCWD); // mofifie par GetSetting wxSetWorkingDirectory( currCWD ); // mofifie par GetSetting
SetRealLibraryPath( wxT("modules") ); SetRealLibraryPath( wxT( "modules" ) );
if(argc > 1 ) if( argc > 1 )
{ {
NetInNameBuffer = argv[1]; NetInNameBuffer = argv[1];
NetNameBuffer = argv[1]; NetNameBuffer = argv[1];
} }
if ( ! NetInNameBuffer.IsEmpty() ) if( !NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly(NetInNameBuffer) ); wxSetWorkingDirectory( wxPathOnly( NetInNameBuffer ) );
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
Read_Config(NetInNameBuffer); Read_Config( NetInNameBuffer );
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion(); wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
m_CvpcbFrame = new WinEDA_CvpcbFrame(this, Title); frame = new WinEDA_CvpcbFrame( Title );
msg.Printf( wxT("Modules: %d"), nblib); msg.Printf( wxT( "Modules: %d" ), nblib );
m_CvpcbFrame->SetStatusText(msg,2); frame->SetStatusText( msg, 2 );
// Show the frame // Show the frame
SetTopWindow(m_CvpcbFrame); SetTopWindow( frame );
m_CvpcbFrame->Show(TRUE); frame->Show( TRUE );
listlib(); listlib();
m_CvpcbFrame->BuildFootprintListBox(); frame->BuildFootprintListBox();
if( ! NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */ if( !NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */
{ {
FFileName = MakeFileName(NetDirBuffer, FFileName = MakeFileName( NetDirBuffer,
NetInNameBuffer, NetInExtBuffer); NetInNameBuffer, NetInExtBuffer );
m_CvpcbFrame->ReadNetListe(); frame->ReadNetListe();
} }
else /* Mise a jour du titre de la fenetre principale */ else /* Mise a jour du titre de la fenetre principale */
{ {
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion(); wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
msg.Printf( wxT("%s {%s%c} [no file]"), msg.Printf( wxT( "%s {%s%c} [no file]" ),
Title.GetData(), wxGetCwd().GetData(), DIR_SEP); Title.GetData(), wxGetCwd().GetData(), DIR_SEP );
m_CvpcbFrame->SetTitle(msg); frame->SetTitle( msg );
} }
return TRUE; return TRUE;
} }
...@@ -39,7 +39,7 @@ private: ...@@ -39,7 +39,7 @@ 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();
...@@ -180,7 +180,7 @@ class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame ...@@ -180,7 +180,7 @@ 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 );
......
...@@ -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 */
...@@ -33,6 +33,10 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC ) ...@@ -33,6 +33,10 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
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() )
{ {
...@@ -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
...@@ -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 );
...@@ -109,14 +111,16 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT ...@@ -109,14 +111,16 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
{ {
if( LibItem == NULL ) if( LibItem == NULL )
break; break;
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;
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;
...@@ -133,7 +137,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT ...@@ -133,7 +137,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
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"
...@@ -24,8 +23,10 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion ) ...@@ -24,8 +23,10 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
{ {
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;
...@@ -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 );
} }
} }
......
...@@ -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:
...@@ -93,7 +92,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) ...@@ -93,7 +92,7 @@ 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 );
...@@ -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;
} }
...@@ -148,6 +152,9 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig ) ...@@ -148,6 +152,9 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
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;
} }
...@@ -210,5 +218,5 @@ void WinEDA_SchematicFrame::Save_Config( wxWindow* displayframe ) ...@@ -210,5 +218,5 @@ void WinEDA_SchematicFrame::Save_Config( wxWindow* displayframe )
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"
...@@ -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
* display the real hotkeys in menus
* or tool tips */ * 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;
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
/*************************************************/ /*************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
...@@ -30,18 +29,17 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent ) ...@@ -30,18 +29,17 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
wxString name; wxString name;
WinEDA_ViewlibFrame* Viewer; WinEDA_ViewlibFrame* Viewer;
wxSemaphore semaphore( 0, 1 ); wxSemaphore semaphore( 0, 1 );
WinEDA_SchematicFrame* frame;
Viewer = parent->m_Parent->m_ViewlibFrame; frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
Viewer = frame->m_ViewlibFrame;
/* Close the current Lib browser, if open, and open a new one, in "modal" mode */ /* Close the current Lib browser, if open, and open a new one, in "modal" mode */
if( Viewer ) if( Viewer )
Viewer->Destroy(); Viewer->Destroy();
Viewer = parent->m_Parent->m_ViewlibFrame = new Viewer = frame->m_ViewlibFrame =
WinEDA_ViewlibFrame( new WinEDA_ViewlibFrame( frame, NULL, &semaphore );
parent->m_Parent->m_SchematicFrame,
parent->m_Parent,
NULL,
&semaphore );
Viewer->AdjustScrollBars(); Viewer->AdjustScrollBars();
// Show the library viewer frame until it is closed // Show the library viewer frame until it is closed
...@@ -57,7 +55,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent ) ...@@ -57,7 +55,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
/**************************************************************************/ /**************************************************************************/
SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component(wxDC* DC,
const wxString& libname, const wxString& libname,
wxArrayString& HistoryList, wxArrayString& HistoryList,
bool UseLibBrowser ) bool UseLibBrowser )
...@@ -179,7 +177,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -179,7 +177,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp; DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp;
DrawLibItem = new SCH_COMPONENT( GetScreen()->m_Curseur ); DrawLibItem = new SCH_COMPONENT( GetScreen()->m_Curseur );
DrawLibItem->m_Multi = 1;/* Selection de l'unite 1 dans le boitier */ DrawLibItem->m_Multi = 1; /* Selection de l'unite 1 dans le boitier */
DrawLibItem->m_Convert = 1; DrawLibItem->m_Convert = 1;
DrawLibItem->m_ChipName = Name; DrawLibItem->m_ChipName = Name;
DrawLibItem->m_TimeStamp = GetTimeStamp(); DrawLibItem->m_TimeStamp = GetTimeStamp();
...@@ -203,7 +201,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -203,7 +201,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
msg += wxT( "?" ); msg += wxT( "?" );
//update the reference -- just the prefix for now. //update the reference -- just the prefix for now.
DrawLibItem->SetRef(GetSheet(), msg ); DrawLibItem->SetRef( GetSheet(), msg );
/* Init champ Reference */ /* Init champ Reference */
DrawLibItem->GetField( REFERENCE )->m_Pos.x = DrawLibItem->GetField( REFERENCE )->m_Pos.x =
...@@ -213,9 +211,12 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -213,9 +211,12 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
DrawLibItem->GetField( REFERENCE )->m_Orient = Entry->m_Prefix.m_Orient; DrawLibItem->GetField( REFERENCE )->m_Orient = Entry->m_Prefix.m_Orient;
DrawLibItem->GetField( REFERENCE )->m_Size = Entry->m_Prefix.m_Size; DrawLibItem->GetField( REFERENCE )->m_Size = Entry->m_Prefix.m_Size;
DrawLibItem->m_PrefixString = Entry->m_Prefix.m_Text; DrawLibItem->m_PrefixString = Entry->m_Prefix.m_Text;
DrawLibItem->GetField( REFERENCE )->m_Attributs = Entry->m_Prefix.m_Attributs; DrawLibItem->GetField( REFERENCE )->m_Attributs =
DrawLibItem->GetField( REFERENCE )->m_HJustify = Entry->m_Prefix.m_HJustify; Entry->m_Prefix.m_Attributs;
DrawLibItem->GetField( REFERENCE )->m_VJustify = Entry->m_Prefix.m_VJustify; DrawLibItem->GetField( REFERENCE )->m_HJustify =
Entry->m_Prefix.m_HJustify;
DrawLibItem->GetField( REFERENCE )->m_VJustify =
Entry->m_Prefix.m_VJustify;
/* Init des autres champs si predefinis dans la librairie */ /* Init des autres champs si predefinis dans la librairie */
for( Field = Entry->Fields; Field != NULL; Field = Field->Next() ) for( Field = Entry->Fields; Field != NULL; Field = Field->Next() )
...@@ -298,7 +299,7 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( ...@@ -298,7 +299,7 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else else
{ {
DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox()); DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox() );
} }
} }
...@@ -310,7 +311,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( ...@@ -310,7 +311,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); DrawComponent->Draw( DrawPanel, DC, wxPoint( 0,
0 ),
GR_DEFAULT_DRAWMODE );
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
} }
...@@ -369,7 +372,8 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent, ...@@ -369,7 +372,8 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
if( DrawComponent == NULL ) if( DrawComponent == NULL )
return; return;
LibEntry = FindLibPart( DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); LibEntry = FindLibPart(
DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( LibEntry == NULL ) if( LibEntry == NULL )
return; return;
...@@ -399,7 +403,8 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent, ...@@ -399,7 +403,8 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); DrawComponent->Draw( DrawPanel, DC, wxPoint( 0,
0 ), GR_DEFAULT_DRAWMODE );
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->EEDrawList, DC );
GetScreen()->SetModify(); GetScreen()->SetModify();
...@@ -417,7 +422,8 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, ...@@ -417,7 +422,8 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
if( DrawComponent == NULL ) if( DrawComponent == NULL )
return; return;
LibEntry = FindLibPart( DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); LibEntry = FindLibPart(
DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( LibEntry == NULL ) if( LibEntry == NULL )
return; return;
...@@ -440,7 +446,8 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, ...@@ -440,7 +446,8 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
if( DrawComponent->m_Flags & IS_MOVED ) if( DrawComponent->m_Flags & IS_MOVED )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); DrawComponent->Draw( DrawPanel, DC, wxPoint( 0,
0 ), GR_DEFAULT_DRAWMODE );
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->EEDrawList, DC );
GetScreen()->SetModify(); GetScreen()->SetModify();
...@@ -487,7 +494,8 @@ void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component, ...@@ -487,7 +494,8 @@ void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
if( Component->m_Flags == 0 ) if( Component->m_Flags == 0 )
{ {
if( g_ItemToUndoCopy ){ if( g_ItemToUndoCopy )
{
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
} }
g_ItemToUndoCopy = Component->GenCopy(); g_ItemToUndoCopy = Component->GenCopy();
...@@ -504,6 +512,7 @@ void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component, ...@@ -504,6 +512,7 @@ void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
memcpy( OldTransMat, Component->m_Transform, sizeof(OldTransMat) ); memcpy( OldTransMat, Component->m_Transform, sizeof(OldTransMat) );
#if 1 #if 1
// switch from normal mode to xor mode for the duration of the move, first // switch from normal mode to xor mode for the duration of the move, first
// by erasing fully any "normal drawing mode" primitives with the PostDirtyRect(), // by erasing fully any "normal drawing mode" primitives with the PostDirtyRect(),
// then by drawing the first time in xor mode so that subsequent xor // then by drawing the first time in xor mode so that subsequent xor
......
...@@ -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.
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
/*******************************/ /*******************************/
BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, COMMON_EVENTS_DRAWFRAME
EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV,
WinEDA_DrawFrame::OnSockRequestServer ) WinEDA_DrawFrame::OnSockRequestServer )
EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_DrawFrame::OnSockRequest ) EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_DrawFrame::OnSockRequest )
...@@ -128,13 +129,14 @@ END_EVENT_TABLE() ...@@ -128,13 +129,14 @@ END_EVENT_TABLE()
/****************/ /****************/
WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, WinEDA_SchematicFrame::WinEDA_SchematicFrame( 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, SCHEMATIC_FRAME, parent, title, pos, size, style ) WinEDA_DrawFrame( father, SCHEMATIC_FRAME, title, pos, size, style )
{ {
wxConfig* config = wxGetApp().m_EDA_Config;
m_FrameName = wxT( "SchematicFrame" ); m_FrameName = wxT( "SchematicFrame" );
m_Draw_Axis = FALSE; // TRUE to show axis m_Draw_Axis = FALSE; // TRUE to show axis
m_Draw_Grid = g_ShowGrid; // TRUE to show a grid m_Draw_Grid = g_ShowGrid; // TRUE to show a grid
...@@ -143,7 +145,8 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -143,7 +145,8 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
m_CurrentField = NULL; m_CurrentField = NULL;
m_Multiflag = 0; m_Multiflag = 0;
m_TextFieldSize = DEFAULT_SIZE_TEXT; m_TextFieldSize = DEFAULT_SIZE_TEXT;
m_LibeditFrame = NULL; // Component editor frame.
m_ViewlibFrame = NULL; // Frame for browsing component libraries
CreateScreens(); CreateScreens();
...@@ -159,11 +162,13 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -159,11 +162,13 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
/* Get config */ /* Get config */
GetSettings(); GetSettings();
g_DrawMinimunLineWidth = if( config )
m_Parent->m_EDA_Config->Read( MINI_DRAW_LINE_WIDTH_KEY, (long) 0 ); {
g_DrawMinimunLineWidth = config->Read( MINI_DRAW_LINE_WIDTH_KEY,
g_PlotPSMinimunLineWidth = (long) 0 );
m_Parent->m_EDA_Config->Read( MINI_PLOTPS_LINE_WIDTH_KEY, (long) 4 ); g_PlotPSMinimunLineWidth = config->Read( MINI_PLOTPS_LINE_WIDTH_KEY,
(long) 4 );
}
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
...@@ -183,7 +188,6 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -183,7 +188,6 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
WinEDA_SchematicFrame::~WinEDA_SchematicFrame() WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
{ {
m_Parent->m_SchematicFrame = NULL;
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;
...@@ -290,10 +294,11 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -290,10 +294,11 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
/*****************************************************************/ /*****************************************************************/
{ {
DrawSheetPath* sheet; DrawSheetPath* sheet;
wxConfig* config = wxGetApp().m_EDA_Config;
if( m_Parent->m_LibeditFrame ) // Can close component editor ? if( m_LibeditFrame ) // Can close component editor ?
{ {
if( !m_Parent->m_LibeditFrame->Close() ) if( !m_LibeditFrame->Close() )
return; return;
} }
...@@ -349,10 +354,12 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -349,10 +354,12 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
SaveSettings(); SaveSettings();
m_Parent->m_EDA_Config->Write( MINI_DRAW_LINE_WIDTH_KEY, if( config )
(long) g_DrawMinimunLineWidth ); {
m_Parent->m_EDA_Config->Write( MINI_PLOTPS_LINE_WIDTH_KEY, config->Write( MINI_DRAW_LINE_WIDTH_KEY, (long) g_DrawMinimunLineWidth );
config->Write( MINI_PLOTPS_LINE_WIDTH_KEY,
(long) g_PlotPSMinimunLineWidth ); (long) g_PlotPSMinimunLineWidth );
}
Destroy(); Destroy();
} }
...@@ -576,16 +583,14 @@ void WinEDA_SchematicFrame::OnOpenCvpcb( wxCommandEvent& event ) ...@@ -576,16 +583,14 @@ void WinEDA_SchematicFrame::OnOpenCvpcb( wxCommandEvent& event )
void WinEDA_SchematicFrame::OnOpenLibraryViewer( wxCommandEvent& event ) void WinEDA_SchematicFrame::OnOpenLibraryViewer( wxCommandEvent& event )
/*************************************************************************/ /*************************************************************************/
{ {
if( m_Parent->m_ViewlibFrame ) if( m_ViewlibFrame )
{ {
m_Parent->m_ViewlibFrame->Show( TRUE ); m_ViewlibFrame->Show( TRUE );
} }
else else
{ {
m_Parent->m_ViewlibFrame = m_ViewlibFrame = new WinEDA_ViewlibFrame( this );
new WinEDA_ViewlibFrame( m_Parent->m_SchematicFrame, m_ViewlibFrame->AdjustScrollBars();
m_Parent );
m_Parent->m_ViewlibFrame->AdjustScrollBars();
} }
} }
...@@ -593,20 +598,18 @@ void WinEDA_SchematicFrame::OnOpenLibraryViewer( wxCommandEvent& event ) ...@@ -593,20 +598,18 @@ void WinEDA_SchematicFrame::OnOpenLibraryViewer( wxCommandEvent& event )
void WinEDA_SchematicFrame::OnOpenLibraryEditor( wxCommandEvent& event ) void WinEDA_SchematicFrame::OnOpenLibraryEditor( wxCommandEvent& event )
/*************************************************************************/ /*************************************************************************/
{ {
if( m_Parent->m_LibeditFrame ) if( m_LibeditFrame )
{ {
m_Parent->m_LibeditFrame->Show( TRUE ); m_LibeditFrame->Show( TRUE );
} }
else else
{ {
m_Parent->m_LibeditFrame = m_LibeditFrame = new WinEDA_LibeditFrame( this,
new WinEDA_LibeditFrame( m_Parent->m_SchematicFrame,
m_Parent,
wxT( "Library Editor" ), wxT( "Library Editor" ),
wxPoint( -1, -1 ), wxPoint( -1, -1 ),
wxSize( 600, 400 ) ); wxSize( 600, 400 ) );
ActiveScreen = g_ScreenLib; ActiveScreen = g_ScreenLib;
m_Parent->m_LibeditFrame->AdjustScrollBars(); m_LibeditFrame->AdjustScrollBars();
} }
} }
......
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;
} }
......
...@@ -22,99 +22,104 @@ ...@@ -22,99 +22,104 @@
/****************************************/ /****************************************/
BEGIN_EVENT_TABLE( WinEDA_GerberFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA_GerberFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_CLOSE( WinEDA_GerberFrame::OnCloseWindow ) COMMON_EVENTS_DRAWFRAME
EVT_SIZE( WinEDA_GerberFrame::OnSize ) EVT_CLOSE( WinEDA_GerberFrame::OnCloseWindow )
EVT_SIZE( WinEDA_GerberFrame::OnSize )
EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT, EVT_TOOL_RANGE( ID_ZOOM_IN_BUTT, ID_ZOOM_PAGE_BUTT,
WinEDA_GerberFrame::Process_Zoom ) WinEDA_GerberFrame::Process_Zoom )
EVT_TOOL( ID_LOAD_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_LOAD_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_APPEND_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DCODE_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_GERBVIEW_LOAD_DCODE_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_NEW_BOARD, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_NEW_BOARD, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
EVT_MENU_RANGE( ID_PREFERENCES_FONT_INFOSCREEN, ID_PREFERENCES_FONT_END, EVT_MENU_RANGE( ID_PREFERENCES_FONT_INFOSCREEN, ID_PREFERENCES_FONT_END,
WinEDA_DrawFrame::ProcessFontPreferences ) WinEDA_DrawFrame::ProcessFontPreferences )
// Menu Files: // Menu Files:
EVT_MENU( ID_MENU_LOAD_FILE, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_MENU_LOAD_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_APPEND_FILE, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_MENU_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_MENU_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_NEW_BOARD, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_MENU_NEW_BOARD, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_SAVE_BOARD, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_MENU_SAVE_BOARD, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_MENU_SAVE_BOARD_AS, WinEDA_GerberFrame::Files_io ) EVT_MENU( ID_MENU_SAVE_BOARD_AS, WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_GEN_PLOT, WinEDA_GerberFrame::ToPlotter ) EVT_MENU( ID_GEN_PLOT, WinEDA_GerberFrame::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, WinEDA_GerberFrame::ExportDataInPcbnewFormat ) EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW,
WinEDA_GerberFrame::ExportDataInPcbnewFormat )
EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10,
EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10,
WinEDA_GerberFrame::Files_io ) WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_MENU( ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions )
// menu Config // menu Config
EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START, ID_CONFIG_AND_PREFERENCES_END, EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START,
ID_CONFIG_AND_PREFERENCES_END,
WinEDA_GerberFrame::Process_Config ) WinEDA_GerberFrame::Process_Config )
EVT_MENU( ID_COLORS_SETUP, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_COLORS_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU( ID_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU( ID_PCB_LOOK_SETUP, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_PCB_LOOK_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
WinEDA_DrawFrame::SetLanguage ) WinEDA_DrawFrame::SetLanguage )
// menu Postprocess // menu Postprocess
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, WinEDA_GerberFrame::Process_Special_Functions ) EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES,
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE,
WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
// menu Miscellaneous // menu Miscellaneous
EVT_MENU( ID_PCB_GLOBAL_DELETE, WinEDA_GerberFrame::Process_Special_Functions ) EVT_MENU( ID_PCB_GLOBAL_DELETE,
WinEDA_GerberFrame::Process_Special_Functions )
// Menu Help // Menu Help
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp ) EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout ) EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout )
EVT_TOOL( ID_SHEET_SET, WinEDA_DrawFrame::Process_PageSettings ) EVT_TOOL( ID_SHEET_SET, WinEDA_DrawFrame::Process_PageSettings )
EVT_TOOL( wxID_CUT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( wxID_CUT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_COPY, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( wxID_COPY, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_PASTE, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( wxID_PASTE, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_UNDO_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_UNDO_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter ) EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER, EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER,
WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_GERBER_SELECT_TOOL, EVT_KICAD_CHOICEBOX( ID_TOOLBARH_GERBER_SELECT_TOOL,
WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
// Vertical toolbar: // Vertical toolbar:
EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_TRACK_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_TRACK_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ZONES_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_ZONES_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT,
WinEDA_GerberFrame::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_PcbFrame::Process_Special_Functions ) WinEDA_PcbFrame::Process_Special_Functions )
// Pop up menu // Pop up menu
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
WinEDA_GerberFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
// Option toolbar // Option toolbar
EVT_TOOL_RANGE( ID_TB_OPTIONS_START, ID_TB_OPTIONS_END, EVT_TOOL_RANGE( ID_TB_OPTIONS_START, ID_TB_OPTIONS_END,
WinEDA_GerberFrame::OnSelectOptionToolbar ) WinEDA_GerberFrame::OnSelectOptionToolbar )
// PopUp Menu trait�s dans drawpanel.cpp // PopUp Menu trait�s dans drawpanel.cpp
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -123,14 +128,14 @@ END_EVENT_TABLE() ...@@ -123,14 +128,14 @@ END_EVENT_TABLE()
/****************/ /****************/
WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, WinEDA_GerberFrame::WinEDA_GerberFrame( 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_BasePcbFrame( father, parent, GERBER_FRAME, title, pos, size, style ) WinEDA_BasePcbFrame( father, GERBER_FRAME, title, pos, size, style )
{ {
m_FrameName = wxT( "GerberFrame" ); m_FrameName = wxT( "GerberFrame" );
//m_AboutTitle = g_GerbviewAboutTitle; //m_AboutTitle = g_GerbviewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee
...@@ -160,7 +165,6 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -160,7 +165,6 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
WinEDA_GerberFrame::~WinEDA_GerberFrame() WinEDA_GerberFrame::~WinEDA_GerberFrame()
{ {
m_Parent->m_GerberFrame = NULL;
SetBaseScreen( ScreenPcb ); SetBaseScreen( ScreenPcb );
} }
...@@ -237,9 +241,11 @@ void WinEDA_GerberFrame::SetToolbars() ...@@ -237,9 +241,11 @@ void WinEDA_GerberFrame::SetToolbars()
} }
if( m_SelLayerBox->GetSelection() != ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer ) if( m_SelLayerBox->GetSelection() !=
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer )
{ {
m_SelLayerBox->SetSelection( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer ); m_SelLayerBox->SetSelection(
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
} }
if( gerber ) if( gerber )
...@@ -264,8 +270,10 @@ void WinEDA_GerberFrame::SetToolbars() ...@@ -264,8 +270,10 @@ void WinEDA_GerberFrame::SetToolbars()
if( m_OptionsToolBar ) if( m_OptionsToolBar )
{ {
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM, m_OptionsToolBar->ToggleTool(
g_UnitMetric == MILLIMETRE ? TRUE : FALSE ); ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UnitMetric ==
MILLIMETRE ? TRUE : FALSE );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UnitMetric == INCHES ? TRUE : FALSE ); g_UnitMetric == INCHES ? TRUE : FALSE );
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "fctsys.h" #include "fctsys.h"
#include <wx/image.h>
#include <wx/file.h> #include <wx/file.h>
#include "common.h" #include "common.h"
...@@ -25,16 +24,16 @@ IMPLEMENT_APP( WinEDA_App ) ...@@ -25,16 +24,16 @@ IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit() bool WinEDA_App::OnInit()
{ {
g_EDA_Appl = this; WinEDA_GerberFrame* frame = NULL;
InitEDA_Appl( wxT( "gerbview" ) ); InitEDA_Appl( wxT( "gerbview" ) );
ScreenPcb = new PCB_SCREEN(); ScreenPcb = new PCB_SCREEN();
ScreenPcb->m_CurrentSheetDesc = &g_Sheet_GERBER; ScreenPcb->m_CurrentSheetDesc = &g_Sheet_GERBER;
ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb;
GetSettings(); GetSettings();
if( m_Checker && m_Checker->IsAnotherRunning() ) if( m_Checker && m_Checker->IsAnotherRunning() )
{ {
if( !IsOK( NULL, _( "GerbView is already running. Continue?" ) ) ) if( !IsOK( NULL, _( "GerbView is already running. Continue?" ) ) )
...@@ -43,31 +42,33 @@ bool WinEDA_App::OnInit() ...@@ -43,31 +42,33 @@ bool WinEDA_App::OnInit()
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
Read_Hotkey_Config( m_PcbFrame, false ); /* Must be called before creating the main frame Read_Hotkey_Config( frame, false ); /* Must be called before creating the main frame
* in order to display the real hotkeys * in order to display the real hotkeys
* in menus or tool tips */ * in menus or tool tips */
m_GerberFrame = new WinEDA_GerberFrame( NULL, this, wxT( "GerbView" ), frame = new WinEDA_GerberFrame( NULL, wxT( "GerbView" ),
wxPoint( 0, 0 ), wxSize( 600, 400 ) ); wxPoint( 0, 0 ),
wxSize( 600, 400 ) );
/* Gerbview mainframe title */ /* Gerbview mainframe title */
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion(); wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
m_GerberFrame->SetTitle( Title ); frame->SetTitle( Title );
m_GerberFrame->m_Pcb = new BOARD( NULL, m_GerberFrame ); frame->m_Pcb = new BOARD( NULL, frame );
SetTopWindow( m_GerberFrame ); // Set GerbView mainframe on top
m_GerberFrame->Show( TRUE ); // Show GerbView mainframe SetTopWindow( frame ); // Set GerbView mainframe on top
m_GerberFrame->Zoom_Automatique( TRUE ); // Zoomfit drawing in frame frame->Show( TRUE ); // Show GerbView mainframe
frame->Zoom_Automatique( TRUE ); // Zoomfit drawing in frame
if( argc > 1 ) if( argc > 1 )
{ {
wxString fileName = MakeFileName( wxEmptyString, argv[1], g_PhotoFilenameExt ); wxString fileName = MakeFileName( wxEmptyString,
argv[1],
g_PhotoFilenameExt );
if( !fileName.IsEmpty() ) if( !fileName.IsEmpty() )
{ {
wxClientDC dc( m_GerberFrame->DrawPanel ); wxClientDC dc( frame->DrawPanel );
m_GerberFrame->DrawPanel->PrepareGraphicContext( &dc ); frame->DrawPanel->PrepareGraphicContext( &dc );
wxString path = wxPathOnly( fileName ); wxString path = wxPathOnly( fileName );
...@@ -77,14 +78,17 @@ bool WinEDA_App::OnInit() ...@@ -77,14 +78,17 @@ bool WinEDA_App::OnInit()
Read_Config(); Read_Config();
// Load all files specified on the command line. // Load all files specified on the command line.
for( int i=1; i<argc; ++i ) for( int i = 1; i<argc; ++i )
{ {
fileName = MakeFileName( wxEmptyString, argv[i], g_PhotoFilenameExt ); fileName = MakeFileName( wxEmptyString,
argv[i],
g_PhotoFilenameExt );
if( wxFileExists( fileName ) ) if( wxFileExists( fileName ) )
{ {
((PCB_SCREEN*)m_GerberFrame->GetScreen())->m_Active_Layer = i-1; ( (PCB_SCREEN*) frame->GetScreen() )->
m_GerberFrame->LoadOneGerberFile( fileName, &dc, FALSE ); m_Active_Layer = i - 1;
frame->LoadOneGerberFile( fileName, &dc, FALSE );
} }
} }
} }
......
...@@ -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,7 +75,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) ...@@ -76,7 +75,7 @@ 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 );
...@@ -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" ) );
} }
} }
...@@ -111,7 +111,8 @@ bool Read_Config() ...@@ -111,7 +111,8 @@ bool Read_Config()
*/ */
{ {
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 )
...@@ -136,9 +137,9 @@ void WinEDA_GerberFrame::Update_config() ...@@ -136,9 +137,9 @@ void WinEDA_GerberFrame::Update_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" );
...@@ -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 );
} }
...@@ -51,9 +51,9 @@ private: ...@@ -51,9 +51,9 @@ private:
}; };
/* Construction de la table des evenements pour WinEDA_ConfigFrame */ /* Construction de la table des evenements pour WinEDA_ConfigFrame */
BEGIN_EVENT_TABLE( WinEDA_ConfigFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_ConfigFrame, wxDialog )
EVT_BUTTON( ID_SAVE_CFG, WinEDA_ConfigFrame::SaveCfg ) EVT_BUTTON( ID_SAVE_CFG, WinEDA_ConfigFrame::SaveCfg )
EVT_BUTTON( wxID_OK, WinEDA_ConfigFrame::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_ConfigFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_ConfigFrame::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_ConfigFrame::OnCancelClick )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -87,7 +87,7 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent, ...@@ -87,7 +87,7 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent,
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
/* Shows the config filename currently used : */ /* Shows the config filename currently used : */
title = _( "from " ) + g_EDA_Appl->m_CurrentOptionFile; title = _( "from " ) + wxGetApp().m_CurrentOptionFile;
SetTitle( title ); SetTitle( title );
LibModified = FALSE; LibModified = FALSE;
...@@ -117,15 +117,18 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent, ...@@ -117,15 +117,18 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent,
size.x = LEN_EXT; size.x = LEN_EXT;
size.y = -1; size.y = -1;
TextDrillExt = new WinEDA_EnterText( this, TextDrillExt = new WinEDA_EnterText( this,
_( "Drill File Ext:" ), g_DrillFilenameExt, _( "Drill File Ext:" ),
g_DrillFilenameExt,
LeftBoxSizer, size ); LeftBoxSizer, size );
TextPhotoExt = new WinEDA_EnterText( this, TextPhotoExt = new WinEDA_EnterText( this,
_( "Gerber File Ext:" ), g_PhotoFilenameExt, _( "Gerber File Ext:" ),
g_PhotoFilenameExt,
LeftBoxSizer, size ); LeftBoxSizer, size );
TextPenExt = new WinEDA_EnterText( this, TextPenExt = new WinEDA_EnterText( this,
_( "D code File Ext:" ), g_PenFilenameExt, _( "D code File Ext:" ),
g_PenFilenameExt,
LeftBoxSizer, size ); LeftBoxSizer, size );
GetSizer()->Fit( this ); GetSizer()->Fit( this );
......
This diff is collapsed.
...@@ -24,14 +24,6 @@ class WinEDA_App : public wxApp ...@@ -24,14 +24,6 @@ class WinEDA_App : public wxApp
public: public:
wxString m_Project; wxString m_Project;
wxSingleInstanceChecker* m_Checker; wxSingleInstanceChecker* m_Checker;
WinEDA_MainFrame* m_MainFrame;
WinEDA_PcbFrame* m_PcbFrame;
WinEDA_ModuleEditFrame* m_ModuleEditFrame;
WinEDA_GerberFrame* m_GerberFrame;
WinEDA_SchematicFrame* m_SchematicFrame; // Edition des Schemas
WinEDA_LibeditFrame* m_LibeditFrame; // Edition des composants
WinEDA_ViewlibFrame* m_ViewlibFrame; // Visualisation des composants
WinEDA_CvpcbFrame* m_CvpcbFrame;
wxPoint m_HelpPos; wxPoint m_HelpPos;
wxSize m_HelpSize; wxSize m_HelpSize;
...@@ -46,9 +38,10 @@ public: ...@@ -46,9 +38,10 @@ public:
* (utilis si KICAD non dfini)*/ * (utilis si KICAD non dfini)*/
wxArrayString m_LastProject; /* liste des derniers projets chargs */ wxArrayString m_LastProject; /* liste des derniers projets chargs */
unsigned int m_LastProjectMaxCount; /* Max histhory file length */ unsigned int m_LastProjectMaxCount; /* Max histhory file length */
wxString m_KicadEnv; /* Chemin de kicad dfini dans la variable wxString m_KicadEnv; /* Chemin de kicad dfini dans la
* d'environnement KICAD, * variable d'environnement KICAD,
* typiquement /usr/local/kicad ou c:\kicad */ * typiquement /usr/local/kicad ou
* c:\kicad */
bool m_Env_Defined; // TRUE si variable d'environnement KICAD definie bool m_Env_Defined; // TRUE si variable d'environnement KICAD definie
wxLocale* m_Locale; // Gestion de la localisation wxLocale* m_Locale; // Gestion de la localisation
......
...@@ -276,9 +276,6 @@ COMMON_GLOBL wxString g_ProductName ...@@ -276,9 +276,6 @@ COMMON_GLOBL wxString g_ProductName
#endif #endif
; ;
COMMON_GLOBL WinEDA_App* g_EDA_Appl; /* this is the main application */
/* Gestion des librairies */ /* Gestion des librairies */
COMMON_GLOBL wxString g_RealLibDirBuffer; // Chemin reel des librairies de module COMMON_GLOBL wxString g_RealLibDirBuffer; // Chemin reel des librairies de module
// = UserLibDirBuffer si non vide // = UserLibDirBuffer si non vide
......
...@@ -52,6 +52,8 @@ public: ...@@ -52,6 +52,8 @@ public:
DrawSheetPath* m_CurrentSheet; ///< which sheet we are presently working on. DrawSheetPath* m_CurrentSheet; ///< which sheet we are presently working on.
int m_Multiflag; int m_Multiflag;
wxPoint m_OldPos; wxPoint m_OldPos;
WinEDA_LibeditFrame* m_LibeditFrame;
WinEDA_ViewlibFrame* m_ViewlibFrame;
private: private:
...@@ -62,7 +64,7 @@ private: ...@@ -62,7 +64,7 @@ private:
public: public:
WinEDA_SchematicFrame( wxWindow* father, WinEDA_App* parent, WinEDA_SchematicFrame( 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 );
...@@ -362,7 +364,7 @@ public: ...@@ -362,7 +364,7 @@ public:
WinEDAChoiceBox* m_SelAliasBox; WinEDAChoiceBox* m_SelAliasBox;
public: public:
WinEDA_LibeditFrame( wxWindow* father, WinEDA_App* parent, WinEDA_LibeditFrame( 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 );
...@@ -473,7 +475,7 @@ public: ...@@ -473,7 +475,7 @@ public:
wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog
public: public:
WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent, WinEDA_ViewlibFrame( wxWindow* father,
LibraryStruct* Library = NULL, LibraryStruct* Library = NULL,
wxSemaphore* semaphore = NULL ); wxSemaphore* semaphore = NULL );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -52,7 +52,7 @@ private: ...@@ -52,7 +52,7 @@ private:
public: public:
// Constructor and destructor // Constructor and destructor
WinEDA_MainFrame( WinEDA_App* eda_app, wxWindow* parent, const wxString& title, WinEDA_MainFrame( wxWindow* parent, const wxString& title,
const wxPoint& pos, const wxSize& size ); const wxPoint& pos, const wxSize& size );
~WinEDA_MainFrame(); ~WinEDA_MainFrame();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -40,7 +40,7 @@ dialog_copper_zone::dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* z ...@@ -40,7 +40,7 @@ dialog_copper_zone::dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* z
/************************************************************************************************/ /************************************************************************************************/
{ {
m_Parent = parent; m_Parent = parent;
m_Config = m_Parent->m_Parent->m_EDA_Config; m_Config = wxGetApp().m_EDA_Config;
m_Zone_Setting = zone_setting; m_Zone_Setting = zone_setting;
m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort, and filtering net names m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort, and filtering net names
if( m_Config ) if( m_Config )
......
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