Commit 2611a547 authored by stambaughw's avatar stambaughw

Convert global and embedded application pointers to wxGetApp()

parent 0745188d
......@@ -27,19 +27,21 @@
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 )
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 )
EVT_MENU( wxID_EXIT, WinEDA3D_DrawFrame::Exit3DFrame )
EVT_MENU( ID_MENU_SCREENCOPY_PNG, WinEDA3D_DrawFrame::Process_Special_Functions )
EVT_MENU( ID_MENU_SCREENCOPY_JPEG, WinEDA3D_DrawFrame::Process_Special_Functions )
EVT_CLOSE( WinEDA3D_DrawFrame::OnCloseWindow )
EVT_MENU( wxID_EXIT, WinEDA3D_DrawFrame::Exit3DFrame )
EVT_MENU( ID_MENU_SCREENCOPY_PNG,
WinEDA3D_DrawFrame::Process_Special_Functions )
EVT_MENU( ID_MENU_SCREENCOPY_JPEG,
WinEDA3D_DrawFrame::Process_Special_Functions )
EVT_CLOSE( WinEDA3D_DrawFrame::OnCloseWindow )
END_EVENT_TABLE()
/*******************************************************************/
WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
WinEDA_App* app_parent, const wxString& title,
const wxString& title,
long style ) :
wxFrame( parent, DISPLAY3D_FRAME, title,
wxPoint( -1, -1 ), wxSize( -1, -1 ), style )
......@@ -48,7 +50,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
m_FrameName = wxT( "Frame3D" );
m_Canvas = NULL;
m_Parent = parent;
m_ParentAppl = app_parent;
m_HToolBar = NULL;
m_VToolBar = NULL;
m_InternalUnits = 10000; // Unites internes = 1/10000 inch
......@@ -104,21 +105,24 @@ void WinEDA3D_DrawFrame::GetSettings()
/******************************************/
{
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" );
Config->Read( text, &m_FramePos.x );
config->Read( text, &m_FramePos.x );
text = m_FrameName + wxT( "Pos_y" );
Config->Read( text, &m_FramePos.y );
config->Read( text, &m_FramePos.y );
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" );
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_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 );
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_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__
......@@ -134,7 +138,7 @@ void WinEDA3D_DrawFrame::SaveSettings()
/*******************************************/
{
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 )
return;
......
......@@ -125,7 +125,6 @@ class WinEDA3D_DrawFrame: public wxFrame
{
public:
WinEDA_BasePcbFrame * m_Parent;
WinEDA_App * m_ParentAppl;
Pcb3D_GLCanvas * m_Canvas;
wxToolBar * m_HToolBar;
wxToolBar * m_VToolBar;
......@@ -138,8 +137,9 @@ private:
// It is "Frame3D"
public:
WinEDA3D_DrawFrame(WinEDA_BasePcbFrame * parent, WinEDA_App *app_parent,
const wxString& title, long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
WinEDA3D_DrawFrame(WinEDA_BasePcbFrame * parent,
const wxString& title,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
void Exit3DFrame(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent & Event);
......@@ -169,7 +169,7 @@ public:
void Set3DEco1OnOff();
void Set3DEco2OnOff();
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE()
};
void SetGLColor(int color);
......
......@@ -5,6 +5,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
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>
================================================================================
++pcbnew & gerbview
......
......@@ -23,14 +23,14 @@
/*******************************************************/
WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype,
WinEDA_App* parent, const wxString& title,
const wxPoint& pos, const wxSize& size, long style ) :
const wxString& title,
const wxPoint& pos, const wxSize& size,
long style ) :
wxFrame( father, -1, title, pos, size, style )
{
wxSize minsize;
m_Ident = idtype;
m_Parent = parent;
SetFont( *g_StdFont );
m_MenuBar = NULL; // menu du haut d'ecran
m_HToolBar = NULL;
......@@ -57,9 +57,9 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, int idtype,
WinEDA_BasicFrame::~WinEDA_BasicFrame()
/******************************************/
{
if( m_Parent->m_HtmlCtrl )
delete m_Parent->m_HtmlCtrl;
m_Parent->m_HtmlCtrl = NULL;
if( wxGetApp().m_HtmlCtrl )
delete wxGetApp().m_HtmlCtrl;
wxGetApp().m_HtmlCtrl = NULL;
}
......@@ -78,17 +78,20 @@ void WinEDA_BasicFrame::GetSettings()
{
wxString text;
int Ypos_min;
wxConfig* config;
if( m_Parent->m_EDA_Config )
config = wxGetApp().m_EDA_Config;
if( config )
{
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" );
m_Parent->m_EDA_Config->Read( text, &m_FramePos.y );
config->Read( text, &m_FramePos.y );
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" );
m_Parent->m_EDA_Config->Read( text, &m_FrameSize.y, 400 );
config->Read( text, &m_FrameSize.y, 400 );
}
// Ensure Window title bar is visible
......@@ -109,24 +112,24 @@ void WinEDA_BasicFrame::SaveSettings()
/*****************************************/
{
wxString text;
wxConfig* config;
if( !m_Parent || !m_Parent->m_EDA_Config )
return;
config = wxGetApp().m_EDA_Config;
if( !m_Parent->m_EDA_Config || IsIconized() )
if( ( config == NULL ) || IsIconized() )
return;
m_FrameSize = GetSize();
m_FramePos = GetPosition();
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" );
m_Parent->m_EDA_Config->Write( text, (long) m_FramePos.y );
config->Write( text, (long) m_FramePos.y );
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" );
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 )
return;
//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;
#ifdef __WINDOWS__
if( m_Parent->m_LastProject[ii].CmpNoCase( FullFileName ) == 0 )
if( wxGetApp().m_LastProject[ii].CmpNoCase( FullFileName ) == 0 )
#else
if( m_Parent->m_LastProject[ii] == FullFileName )
if( wxGetApp().m_LastProject[ii] == FullFileName )
#endif
{
#if ( ( wxMAJOR_VERSION < 2) || ( ( wxMAJOR_VERSION == 2)&& (wxMINOR_VERSION <= 4 ) ) )
m_Parent->m_LastProject.Remove( ii );
#else
m_Parent->m_LastProject.RemoveAt( ii );
#endif
wxGetApp().m_LastProject.RemoveAt( ii );
}
else
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 ) ) )
files.Remove( files.GetCount() - 1 );
#else
m_Parent->m_LastProject.RemoveAt( m_Parent->m_LastProject.GetCount() - 1 );
#endif
wxGetApp().m_LastProject.RemoveAt( wxGetApp().m_LastProject.GetCount() - 1 );
}
m_Parent->m_LastProject.Insert( FullFileName, 0 );
wxGetApp().m_LastProject.Insert( FullFileName, 0 );
ReCreateMenuBar();
}
......@@ -216,9 +211,9 @@ wxString WinEDA_BasicFrame::GetLastProject( int rang )
{
if( rang < 0 )
rang = 0;
if( (unsigned) rang >= m_Parent->m_LastProject.GetCount() )
if( (unsigned) rang >= wxGetApp().m_LastProject.GetCount() )
return wxEmptyString;
return m_Parent->m_LastProject[rang];
return wxGetApp().m_LastProject[rang];
}
......@@ -227,30 +222,30 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
/**************************************************************/
{
#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();
m_Parent->m_HtmlCtrl->Display( m_Parent->m_HelpFileName );
wxGetApp().m_HtmlCtrl->DisplayContents();
wxGetApp().m_HtmlCtrl->Display( wxGetApp().m_HelpFileName );
}
else
{
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 );
}
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
wxString fullfilename = FindKicadHelpPath() + m_Parent->m_HelpFileName;
wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName;
if ( wxFileExists(fullfilename) )
GetAssociatedDocument( this, wxEmptyString, fullfilename );
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 );
}
......
......@@ -14,14 +14,9 @@
#endif
#include "fctsys.h"
#include <wx/image.h>
#include "wx/html/htmlwin.h"
#include "wx/fs_zip.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "common.h"
#include "worksheet.h"
#include "id.h"
......@@ -53,8 +48,7 @@ struct LANGUAGE_DESCR
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[LANGUAGE_DESCR_COUNT] =
static struct LANGUAGE_DESCR s_Language_List[] =
{
{
wxLANGUAGE_DEFAULT,
......@@ -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 */
/**************************/
......@@ -162,15 +161,6 @@ static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] =
WinEDA_App::WinEDA_App()
{
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_HtmlCtrl = NULL;
m_EDA_CommonConfig = NULL;
......@@ -250,14 +240,18 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
g_MsgFontPointSize = FONT_DEFAULT_SIZE;
g_DialogFontPointSize = FONT_DEFAULT_SIZE;
g_FixedFontPointSize = FONT_DEFAULT_SIZE;
g_StdFont = new wxFont( g_StdFontPointSize, 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_StdFont = new wxFont( g_StdFontPointSize, 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,
wxFONTFAMILY_ROMAN,
wxFONTSTYLE_ITALIC,
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) */
wxImage::AddHandler( new wxPNGHandler );
......@@ -271,14 +265,15 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
ReadPdfBrowserInfos();
// 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 );
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
PyHandler::GetInstance()->SetAppName( name );
......@@ -300,8 +295,8 @@ void WinEDA_App::InitOnLineHelp()
fullfilename += wxT( "kicad.hhp" );
if( wxFileExists( fullfilename ) )
{
m_HtmlCtrl = new wxHtmlHelpController( wxHF_TOOLBAR |
wxHF_CONTENTS | wxHF_PRINT | wxHF_OPEN_FILES
m_HtmlCtrl = new wxHtmlHelpController( wxHF_TOOLBAR | wxHF_CONTENTS |
wxHF_PRINT | wxHF_OPEN_FILES
/*| wxHF_SEARCH */ );
m_HtmlCtrl->UseConfig( m_EDA_CommonConfig );
m_HtmlCtrl->SetTitleFormat( wxT( "Kicad Help" ) );
......@@ -396,7 +391,8 @@ void WinEDA_App::GetSettings()
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_ConfigFileLocationChoice = m_EDA_CommonConfig->Read( HOTKEY_CFG_PATH_OPT, 0L );
}
......@@ -416,10 +412,14 @@ void WinEDA_App::GetSettings()
m_LastProject.Add( Line );
}
g_StdFontPointSize = m_EDA_Config->Read( wxT( "SdtFontSize" ), FONT_DEFAULT_SIZE );
g_MsgFontPointSize = m_EDA_Config->Read( wxT( "MsgFontSize" ), 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 );
g_StdFontPointSize = m_EDA_Config->Read( wxT( "SdtFontSize" ),
FONT_DEFAULT_SIZE );
g_MsgFontPointSize = m_EDA_Config->Read( wxT( "MsgFontSize" ),
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 );
if( !Line.IsEmpty() )
......@@ -593,9 +593,11 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{
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
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 )
......
......@@ -4,22 +4,9 @@
/************************************************/
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.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 "fctsys.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "wx/mimetype.h"
#ifdef __WINDOWS__
#ifndef _MSC_VER
......@@ -27,9 +14,7 @@
#endif
#endif
#include "fctsys.h"
#include "common.h"
#include "wxstruct.h"
#include "macros.h"
/* List of default paths used to locate help files and kicad library files.
......@@ -114,7 +99,6 @@ static wxString s_KicadBinaryPathList[] = {
#endif
wxT( "end_list" ) // End of list symbol, do not change
};
extern WinEDA_App* g_EDA_Appl;
/***************************************************************************/
......@@ -402,12 +386,12 @@ wxString FindKicadHelpPath()
bool PathFound = FALSE;
/* find kicad/help/ */
tmp = g_EDA_Appl->m_BinDir;
tmp = wxGetApp().m_BinDir;
if( tmp.Last() == '/' )
tmp.RemoveLast();
FullPath = tmp.BeforeLast( '/' ); // cd ..
FullPath += wxT( "/doc/help/" );
LocaleString = g_EDA_Appl->m_Locale->GetCanonicalName();
LocaleString = wxGetApp().m_Locale->GetCanonicalName();
wxString path_tmp = FullPath;
#ifdef __WINDOWS__
......@@ -420,9 +404,9 @@ wxString FindKicadHelpPath()
}
/* 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 ) )
PathFound = TRUE;
}
......@@ -483,15 +467,15 @@ wxString FindKicadFile( const wxString& shortname )
/* test de la presence du fichier shortname dans le repertoire de
* des binaires de kicad */
FullFileName = g_EDA_Appl->m_BinDir + shortname;
FullFileName = wxGetApp().m_BinDir + shortname;
if( wxFileExists( FullFileName ) )
return FullFileName;
/* test de la presence du fichier shortname dans le repertoire
* 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 ) )
return FullFileName;
}
......@@ -566,7 +550,7 @@ void SetRealLibraryPath( const wxString& shortlibname )
else
{
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;
}
......@@ -599,35 +583,36 @@ wxString ReturnKicadDatasPath()
bool PathFound = FALSE;
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;
}
else // Chemin cherche par le chemin des executables
{
// le chemin est bindir../
wxString tmp = g_EDA_Appl->m_BinDir;
wxString tmp = wxGetApp().m_BinDir;
#ifdef __WINDOWS__
tmp.MakeLower();
#endif
if( tmp.Contains( wxT( "kicad" ) ) )
{
#ifdef __WINDOWS__
tmp = g_EDA_Appl->m_BinDir;
tmp = wxGetApp().m_BinDir;
#endif
if( tmp.Last() == '/' )
tmp.RemoveLast();
data_path = tmp.BeforeLast( '/' ); // id cd ../
data_path += UNIX_STRING_DIR_SEP;
// Old versions of kicad use kicad/ as default for data
// and last versions kicad/share/
// So we search for kicad/share/ first
wxString old_path = data_path;
data_path += wxT("share/");
data_path += wxT( "share/" );
if( wxDirExists( data_path ) )
PathFound = TRUE;
else if ( wxDirExists( old_path ) )
else if( wxDirExists( old_path ) )
{
data_path = old_path;
PathFound = TRUE;
......@@ -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_EDA_Appl->m_EDA_CommonConfig->Write( wxT( "Editor" ), g_EditorName );
wxGetApp().m_EDA_CommonConfig->Write( wxT( "Editor" ), g_EditorName );
}
return g_EditorName;
}
/***********************************/
bool OpenPDF( const wxString& file )
/***********************************/
/** Function OpenPDF
* run the PDF viewer and display a PDF file
* @param file = PDF file to open
......@@ -715,11 +702,11 @@ bool OpenPDF( const wxString& file )
wxString type;
bool success = false;
g_EDA_Appl->ReadPdfBrowserInfos();
if( !g_EDA_Appl->m_PdfBrowserIsDefault ) // Run the prefered PDF Browser
wxGetApp().ReadPdfBrowserInfos();
if( !wxGetApp().m_PdfBrowserIsDefault ) // Run the prefered PDF Browser
{
AddDelimiterString( filename );
command = g_EDA_Appl->m_PdfBrowser + wxT( " " ) + filename;
command = wxGetApp().m_PdfBrowser + wxT( " " ) + filename;
}
else
{
......@@ -730,14 +717,15 @@ bool OpenPDF( const wxString& file )
success = filetype->GetOpenCommand( &command, params );
delete filetype;
#ifndef __WINDOWS__
// 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;
#endif
if( success && !command.IsEmpty() )
{
success = ProcessExecute( command );
if ( success )
if( success )
return success;
}
......@@ -770,6 +758,7 @@ bool OpenPDF( const wxString& file )
break;
}
}
#endif
}
}
......@@ -777,17 +766,17 @@ bool OpenPDF( const wxString& file )
if( !command.IsEmpty() )
{
success = ProcessExecute( command );
if ( !success )
if( !success )
{
wxString msg = _("Problem while running the PDF viewer");
msg << _("\n command is ") << command;
wxString msg = _( "Problem while running the PDF viewer" );
msg << _( "\n command is " ) << command;
DisplayError( NULL, msg );
}
}
else
{
wxString msg = _("Unable to find a PDF viewer for");
msg << wxT(" ") << filename;
wxString msg = _( "Unable to find a PDF viewer for" );
msg << wxT( " " ) << filename;
DisplayError( NULL, msg );
success = false;
}
......@@ -795,6 +784,7 @@ bool OpenPDF( const wxString& file )
return success;
}
/*************************************/
void OpenFile( const wxString& file )
/*************************************/
......
......@@ -674,6 +674,8 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id )
*/
{
wxMenuBar* menu = frame->GetMenuBar();
wxConfig * config = wxGetApp().m_EDA_CommonConfig;
wxASSERT( config != NULL );
switch( id )
{
......@@ -683,8 +685,7 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id )
g_ConfigFileLocationChoice = 0;
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, true );
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, false );
frame->m_Parent->m_EDA_CommonConfig->Write( HOTKEY_CFG_PATH_OPT,
g_ConfigFileLocationChoice );
config->Write( HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice );
}
break;
......@@ -694,8 +695,7 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id )
g_ConfigFileLocationChoice = 1;
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, false );
menu->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, true );
frame->m_Parent->m_EDA_CommonConfig->Write( HOTKEY_CFG_PATH_OPT,
g_ConfigFileLocationChoice );
config->Write( HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice );
}
break;
......
......@@ -14,7 +14,8 @@
/*********************************************************************/
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)
......@@ -44,8 +45,10 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename,
if( ForceUseLocalConfig || wxFileExists( g_Prj_Config_LocalFilename ) )
{
g_Prj_Default_Config_FullFilename.Empty();
g_Prj_Config = new wxFileConfig( wxEmptyString, wxEmptyString,
g_Prj_Config_LocalFilename, wxEmptyString,
g_Prj_Config = new wxFileConfig( wxEmptyString,
wxEmptyString,
g_Prj_Config_LocalFilename,
wxEmptyString,
wxCONFIG_USE_RELATIVE_PATH );
g_Prj_Config->DontCreateOnDemand();
......@@ -73,8 +76,10 @@ static bool ReCreatePrjConfig( const wxString& local_config_filename,
g_Prj_Config_Filename_ext;
// Recreate new config
g_Prj_Config = new wxFileConfig( wxEmptyString, wxEmptyString,
wxEmptyString, g_Prj_Default_Config_FullFilename,
g_Prj_Config = new wxFileConfig( wxEmptyString,
wxEmptyString,
wxEmptyString,
g_Prj_Default_Config_FullFilename,
wxCONFIG_USE_RELATIVE_PATH );
g_Prj_Config->DontCreateOnDemand();
......@@ -85,7 +90,8 @@ static bool ReCreatePrjConfig( 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"*/
{
......@@ -203,7 +209,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename,
// We use indexlib+1 because first lib name is LibName1
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;
......@@ -227,7 +234,8 @@ void WinEDA_App::WriteProjectConfig( 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 )
/***************************************************************************************/
......@@ -238,8 +246,8 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
* return:
* TRUE si lue.
* Met a jour en plus:
* g_EDA_Appl->m_CurrentOptionFileDateAndTime
* g_EDA_Appl->m_CurrentOptionFile
* wxGetApp().m_CurrentOptionFileDateAndTime
* wxGetApp().m_CurrentOptionFile
*/
{
const PARAM_CFG_BASE* pt_cfg;
......@@ -253,22 +261,22 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
g_Prj_Config->SetPath( UNIX_STRING_DIR_SEP );
timestamp = g_Prj_Config->Read( wxT( "update" ) );
if( Load_Only_if_New && ( !timestamp.IsEmpty() )
&& (timestamp == g_EDA_Appl->m_CurrentOptionFileDateAndTime) )
&& (timestamp == wxGetApp().m_CurrentOptionFileDateAndTime) )
{
return FALSE;
}
g_EDA_Appl->m_CurrentOptionFileDateAndTime = timestamp;
wxGetApp().m_CurrentOptionFileDateAndTime = timestamp;
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
{
if( wxPathOnly( g_Prj_Config_LocalFilename ).IsEmpty() )
g_EDA_Appl->m_CurrentOptionFile =
wxGetApp().m_CurrentOptionFile =
wxGetCwd() + STRING_DIR_SEP + g_Prj_Config_LocalFilename;
else
g_EDA_Appl->m_CurrentOptionFile = g_Prj_Config_LocalFilename;
wxGetApp().m_CurrentOptionFile = g_Prj_Config_LocalFilename;
}
for( ; *List != NULL; List++ )
......@@ -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,
int default_val, const wxChar* group ) :
int default_val,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_SETCOLOR, group )
{
m_Pt_param = 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,
int default_val, const wxChar* group ) :
PARAM_CFG_SETCOLOR::PARAM_CFG_SETCOLOR( bool Insetup,
const wxChar* ident,
int* ptparam,
int default_val,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_SETCOLOR, group )
{
m_Pt_param = 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,
double default_val, double min, double max,
PARAM_CFG_DOUBLE::PARAM_CFG_DOUBLE( bool Insetup,
const wxChar* ident,
double* ptparam,
double default_val,
double min,
double max,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_DOUBLE, group )
{
......@@ -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,
int default_val, const wxChar* group ) :
PARAM_CFG_BOOL::PARAM_CFG_BOOL( bool Insetup,
const wxChar* ident,
bool* ptparam,
int default_val,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_BOOL, group )
{
m_Pt_param = 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,
wxString* ptparam, const wxChar* group ) :
wxString* ptparam,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_WXSTRING, group )
{
m_Pt_param = ptparam;
......@@ -508,7 +528,8 @@ PARAM_CFG_WXSTRING::PARAM_CFG_WXSTRING( 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 )
{
m_Pt_param = ptparam;
......@@ -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,
wxArrayString* ptparam, const wxChar* group ) :
wxArrayString* ptparam,
const wxChar* group ) :
PARAM_CFG_BASE( ident, PARAM_LIBNAME_LIST, group )
{
m_Pt_param = ptparam;
......
......@@ -6,7 +6,6 @@
#include "fctsys.h"
#include "wxstruct.h"
#include "common.h"
#include "cvpcb.h"
#include "protos.h"
......@@ -36,7 +35,7 @@ void Read_Config( const wxString& FileName )
g_LibName_List.Clear();
g_ListName_Equ.Clear();
g_EDA_Appl->ReadProjectConfig( FullFileName,
wxGetApp().ReadProjectConfig( FullFileName,
GROUP, ParamCfgList, FALSE );
if( NetInExtBuffer.IsEmpty() )
......@@ -86,5 +85,5 @@ void Save_Config( wxWindow* parent )
return;
/* ecriture de la configuration */
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
}
......@@ -6,7 +6,6 @@
#include <wx/fontdlg.h>
#include "cvpcb.h"
#include "gr_basic.h"
#include "pcbnew.h"
#include "bitmaps.h"
......@@ -21,10 +20,12 @@
/*******************************************************/
/* Constructeur de WinEDA_CvpcbFrame: la fenetre generale */
/*******************************************************/
WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title, long style ) :
WinEDA_BasicFrame( NULL, CVPCB_FRAME, parent, title, wxDefaultPosition, wxDefaultSize, style )
WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
WinEDA_BasicFrame( NULL, CVPCB_FRAME, title, wxDefaultPosition,
wxDefaultSize, style )
{
m_FrameName = wxT( "CvpcbFrame" );
//m_AboutTitle = g_CvpcbAboutTitle;
m_ListCmp = NULL;
m_FootprintList = NULL;
......@@ -97,10 +98,13 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title,
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 );
m_Parent->m_EDA_Config->Write( wxT( FILTERFOOTPRINTKEY ), state );
int state = m_HToolBar->GetToolState(
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST );
config->Write( wxT( FILTERFOOTPRINTKEY ), state );
}
}
......@@ -117,77 +121,74 @@ void WinEDA_CvpcbFrame::OnSize( wxSizeEvent& event )
/* Event table for WinEDA_CvpcbFrame */
/*************************************/
BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, wxFrame )
EVT_MENU_RANGE( ID_LOAD_PROJECT,
EVT_MENU_RANGE( ID_LOAD_PROJECT,
ID_LOAD_FILE_10,
WinEDA_CvpcbFrame::LoadNetList )
// Menu events
EVT_MENU( ID_SAVE_PROJECT,
EVT_MENU( ID_SAVE_PROJECT,
WinEDA_CvpcbFrame::SaveQuitCvpcb )
EVT_MENU( ID_CVPCB_QUIT,
EVT_MENU( ID_CVPCB_QUIT,
WinEDA_CvpcbFrame::OnQuit )
EVT_MENU( ID_CVPCB_DISPLAY_HELP,
EVT_MENU( ID_CVPCB_DISPLAY_HELP,
WinEDA_CvpcbFrame::GetKicadHelp )
EVT_MENU( ID_CVPCB_DISPLAY_LICENCE,
EVT_MENU( ID_CVPCB_DISPLAY_LICENCE,
WinEDA_CvpcbFrame::GetKicadAbout )
EVT_MENU( ID_CONFIG_REQ,
EVT_MENU( ID_CONFIG_REQ,
WinEDA_CvpcbFrame::ConfigCvpcb )
EVT_MENU( ID_CONFIG_SAVE,
EVT_MENU( ID_CONFIG_SAVE,
WinEDA_CvpcbFrame::Update_Config )
EVT_MENU_RANGE( ID_PREFERENCES_FONT_INFOSCREEN,
EVT_MENU_RANGE( ID_PREFERENCES_FONT_INFOSCREEN,
ID_PREFERENCES_FONT_END,
WinEDA_CvpcbFrame::ProcessFontPreferences )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE,
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE,
ID_LANGUAGE_CHOICE_END,
WinEDA_CvpcbFrame::SetLanguage )
// Toolbar events
EVT_TOOL( ID_CVPCB_QUIT,
EVT_TOOL( ID_CVPCB_QUIT,
WinEDA_CvpcbFrame::OnQuit )
EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST,
EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST,
WinEDA_CvpcbFrame::LoadNetList )
EVT_TOOL( ID_CVPCB_SAVEQUITCVPCB,
EVT_TOOL( ID_CVPCB_SAVEQUITCVPCB,
WinEDA_CvpcbFrame::SaveQuitCvpcb )
EVT_TOOL( ID_CVPCB_CREATE_CONFIGWINDOW,
EVT_TOOL( ID_CVPCB_CREATE_CONFIGWINDOW,
WinEDA_CvpcbFrame::ConfigCvpcb )
EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP,
EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP,
WinEDA_CvpcbFrame::DisplayModule )
EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA,
EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA,
WinEDA_CvpcbFrame::ToFirstNA )
EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA,
EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA,
WinEDA_CvpcbFrame::ToPreviousNA )
EVT_TOOL( ID_CVPCB_DEL_ASSOCIATIONS,
EVT_TOOL( ID_CVPCB_DEL_ASSOCIATIONS,
WinEDA_CvpcbFrame::DelAssociations )
EVT_TOOL( ID_CVPCB_AUTO_ASSOCIE,
EVT_TOOL( ID_CVPCB_AUTO_ASSOCIE,
WinEDA_CvpcbFrame::AssocieModule )
EVT_TOOL( ID_CVPCB_CREATE_STUFF_FILE,
EVT_TOOL( ID_CVPCB_CREATE_STUFF_FILE,
WinEDA_CvpcbFrame::WriteStuffList )
EVT_TOOL( ID_PCB_DISPLAY_FOOTPRINT_DOC,
EVT_TOOL( ID_PCB_DISPLAY_FOOTPRINT_DOC,
WinEDA_CvpcbFrame::DisplayDocFile )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
WinEDA_CvpcbFrame::OnSelectFilteringFootprint )
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
WinEDA_CvpcbFrame::OnSelectFilteringFootprint )
// Frame events
EVT_CHAR_HOOK( WinEDA_CvpcbFrame::OnChar )
EVT_CLOSE( WinEDA_CvpcbFrame::OnCloseWindow )
EVT_SIZE( WinEDA_CvpcbFrame::OnSize )
EVT_CHAR_HOOK( WinEDA_CvpcbFrame::OnChar )
EVT_CLOSE( WinEDA_CvpcbFrame::OnCloseWindow )
EVT_SIZE( WinEDA_CvpcbFrame::OnSize )
// List item events
EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST,
EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST,
WinEDA_CvpcbFrame::OnLeftClick )
EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST,
EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST,
WinEDA_CvpcbFrame::OnLeftDClick )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST,
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST,
WinEDA_CvpcbFrame::OnSelectComponent )
END_EVENT_TABLE()
/******************************************************/
void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event )
/******************************************************/
......@@ -196,7 +197,6 @@ void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event )
}
/**********************************************************/
void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
/**********************************************************/
......@@ -206,10 +206,10 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
if( modified )
{
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" ),
wxYES_NO | wxCANCEL |
wxICON_EXCLAMATION | wxYES_DEFAULT );
wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT );
ii = dialog.ShowModal();
......@@ -229,7 +229,8 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
modified = 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();
return;
......@@ -240,10 +241,10 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
}
// 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
m_Parent->m_HtmlCtrl->GetFrame()->Close( TRUE );
if( wxGetApp().m_HtmlCtrl->GetFrame() ) // returns NULL if no help frame active
wxGetApp().m_HtmlCtrl->GetFrame()->Close( TRUE );
}
if( !NetInNameBuffer.IsEmpty() )
......@@ -372,7 +373,8 @@ void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event )
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 );
}
......@@ -486,8 +488,8 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
{
int id = event.GetId();
m_Parent->SetLanguageIdentifier( id );
m_Parent->SetLanguage();
wxGetApp().SetLanguageIdentifier( id );
wxGetApp().SetLanguage();
}
......@@ -497,12 +499,13 @@ void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
{
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 );
if( wxIsAbsolutePath(DocModuleFileName) )
if( wxIsAbsolutePath( DocModuleFileName ) )
fullfilename = DocModuleFileName;
else
fullfilename = FindKicadHelpPath() + wxT("../") + DocModuleFileName;
fullfilename = FindKicadHelpPath() + wxT( "../" ) + DocModuleFileName;
GetAssociatedDocument( this, wxEmptyString, fullfilename );
}
......@@ -537,7 +540,8 @@ void WinEDA_CvpcbFrame::ProcessFontPreferences( wxCommandEvent& event )
break;
default:
DisplayError( this, wxT( "WinEDA_DrawFrame::ProcessFontPreferences Internal Error" ) );
DisplayError( this,
wxT( "WinEDA_DrawFrame::ProcessFontPreferences Internal Error" ) );
break;
}
}
......
/*******************/
/* File: cvpcb.cpp */
/*******************/
/*******************/
/* File: cvpcb.cpp */
/*******************/
#define MAIN
#define eda_global
......@@ -9,7 +9,6 @@
#include "cvpcb.h"
#include "trigo.h"
#include "gr_basic.h"
#include "zones.h"
#include "bitmaps.h"
......@@ -18,77 +17,76 @@
#include "id.h"
wxString g_Main_Title = wxT("CVpcb");
wxString g_Main_Title = wxT( "CVpcb" );
// Create a new application object
IMPLEMENT_APP(WinEDA_App)
IMPLEMENT_APP( WinEDA_App )
/* fonctions locales */
/************************************/
/* Called to initialize the program */
/************************************/
/************************************/
/* Called to initialize the program */
/************************************/
bool WinEDA_App::OnInit()
{
wxString msg;
wxString currCWD = wxGetCwd();
wxString msg;
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;
}
GetSettings(); // read current setup
wxSetWorkingDirectory(currCWD); // mofifie par GetSetting
SetRealLibraryPath( wxT("modules") );
wxSetWorkingDirectory( currCWD ); // mofifie par GetSetting
SetRealLibraryPath( wxT( "modules" ) );
if(argc > 1 )
if( argc > 1 )
{
NetInNameBuffer = argv[1];
NetNameBuffer = argv[1];
}
if ( ! NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly(NetInNameBuffer) );
if( !NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly( NetInNameBuffer ) );
g_DrawBgColor = BLACK;
Read_Config(NetInNameBuffer);
Read_Config( NetInNameBuffer );
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion();
m_CvpcbFrame = new WinEDA_CvpcbFrame(this, Title);
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
frame = new WinEDA_CvpcbFrame( Title );
msg.Printf( wxT("Modules: %d"), nblib);
m_CvpcbFrame->SetStatusText(msg,2);
msg.Printf( wxT( "Modules: %d" ), nblib );
frame->SetStatusText( msg, 2 );
// Show the frame
SetTopWindow(m_CvpcbFrame);
SetTopWindow( frame );
m_CvpcbFrame->Show(TRUE);
frame->Show( TRUE );
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,
NetInNameBuffer, NetInExtBuffer);
FFileName = MakeFileName( NetDirBuffer,
NetInNameBuffer, NetInExtBuffer );
m_CvpcbFrame->ReadNetListe();
frame->ReadNetListe();
}
else /* Mise a jour du titre de la fenetre principale */
{
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion();
msg.Printf( wxT("%s {%s%c} [no file]"),
Title.GetData(), wxGetCwd().GetData(), DIR_SEP);
m_CvpcbFrame->SetTitle(msg);
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
msg.Printf( wxT( "%s {%s%c} [no file]" ),
Title.GetData(), wxGetCwd().GetData(), DIR_SEP );
frame->SetTitle( msg );
}
return TRUE;
}
......@@ -39,7 +39,7 @@ private:
// Constructor and destructor
public:
WinEDA_CvpcbFrame( WinEDA_App * parent, const wxString &title,
WinEDA_CvpcbFrame( const wxString &title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_CvpcbFrame();
......@@ -180,7 +180,7 @@ class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
public:
public:
WinEDA_DisplayFrame( wxWindow * father, WinEDA_App * parent,
WinEDA_DisplayFrame( wxWindow * father,
const wxString &title,
const wxPoint &pos, const wxSize &size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
......
......@@ -72,7 +72,7 @@ wxString title;
m_DoUpdate = TRUE;
Create(parent, id, caption, pos, size, style);
title = _("from ") + g_EDA_Appl->m_CurrentOptionFile;
title = _("from ") + wxGetApp().m_CurrentOptionFile;
SetTitle(title);
}
......
......@@ -5,7 +5,6 @@
#include "fctsys.h"
#include "common.h"
#include "wxstruct.h"
#include "cvpcb.h"
#include "id.h"
#include "bitmaps.h"
......@@ -32,11 +31,11 @@ END_EVENT_TABLE()
/* 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 wxPoint& pos,
const wxSize& size, long style ) :
WinEDA_BasePcbFrame( father, parent, CVPCB_DISPLAY_FRAME, title, pos,
WinEDA_BasePcbFrame( father, CVPCB_DISPLAY_FRAME, title, pos,
size, style )
{
m_FrameName = wxT( "CmpFrame" );
......@@ -73,7 +72,7 @@ WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
delete m_Pcb;
m_Parent->m_CvpcbFrame->DrawFrame = NULL;
( (WinEDA_CvpcbFrame*) wxGetApp().GetTopWindow() )->DrawFrame = NULL;
}
......
This diff is collapsed.
......@@ -4,7 +4,6 @@
#include "fctsys.h"
#include "wxstruct.h"
#include "common.h"
#include "cvpcb.h"
#include "3d_viewer.h"
......@@ -28,9 +27,9 @@ void WinEDA_CvpcbFrame::CreateScreenCmp()
if( DrawFrame == NULL )
{
DrawFrame = new WinEDA_DisplayFrame( this, m_Parent, _( "Module" ),
wxPoint( 0, 0 ), wxSize( 600,
400 ),
DrawFrame = new WinEDA_DisplayFrame( this, _( "Module" ),
wxPoint( 0, 0 ),
wxSize( 600, 400 ),
KICAD_DEFAULT_DRAWFRAME_STYLE |
wxFRAME_FLOAT_ON_PARENT );
IsNew = TRUE;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,6 @@
/*********************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
......@@ -15,7 +14,8 @@
/* Routines locales */
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm, EDA_DrawLineStruct* TstSegm );
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
EDA_DrawLineStruct* TstSegm );
/* Variable locales */
......@@ -33,6 +33,10 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
int flag;
bool Modify = FALSE;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
DrawList = EEDrawList;
for( ; DrawList != NULL; DrawList = DrawList->Next() )
{
......@@ -63,7 +67,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
}
}
g_EDA_Appl->m_SchematicFrame->TestDanglingEnds( EEDrawList, DC );
frame->TestDanglingEnds( EEDrawList, DC );
return Modify;
}
......@@ -80,7 +84,8 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
if( Screen == NULL )
{
DisplayError( NULL, wxT( "BreakSegmentOnJunction() error: NULL screen" ) );
DisplayError( NULL,
wxT( "BreakSegmentOnJunction() error: NULL screen" ) );
return;
}
......@@ -149,7 +154,8 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
segment = (EDA_DrawLineStruct*) DrawList;
ox = segment->m_Start.x; oy = segment->m_Start.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;
/* Segment connecte: doit etre coupe en 2 si px,py n'est
......@@ -256,10 +262,10 @@ static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
}
else
{
if( atan2( (double)(RefSegm->m_Start.x - RefSegm->m_End.x),
(double)(RefSegm->m_Start.y - RefSegm->m_End.y) ) ==
atan2( (double)(TstSegm->m_Start.x - TstSegm->m_End.x),
(double)(TstSegm->m_Start.y - TstSegm->m_End.y) ) )
if( atan2( (double) ( RefSegm->m_Start.x - RefSegm->m_End.x ),
(double) ( RefSegm->m_Start.y - RefSegm->m_End.y ) ) ==
atan2( (double) ( TstSegm->m_Start.x - TstSegm->m_End.x ),
(double) ( TstSegm->m_Start.y - TstSegm->m_End.y ) ) )
{
RefSegm->m_End = TstSegm->m_End;
return 1;
......
......@@ -36,8 +36,10 @@ void RemoteCommand( const char* cmdline )
char line[1024];
char* idcmd;
char* text;
WinEDA_SchematicFrame* frame = g_EDA_Appl->m_SchematicFrame;
wxString part_ref, msg;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
strncpy( line, cmdline, sizeof(line) - 1 );
......@@ -109,14 +111,16 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
{
if( LibItem == NULL )
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 );
}
break;
case TYPE_SCH_COMPONENT:
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 );
break;
......@@ -133,7 +137,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
}
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 );
break;
......
......@@ -3,7 +3,6 @@
/*******************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
......@@ -24,8 +23,10 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
{
EDA_BaseStruct* DrawStruct;
EDA_BaseStruct* EEDrawList;
WinEDA_SchematicFrame* frame = g_EDA_Appl->m_SchematicFrame;
wxString msg;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
if( FirstSheet == NULL )
return;
......@@ -59,7 +60,8 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
EEDrawList = EEDrawList->Next();
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,
const wxSize& size,
long style )
{
wxConfig* config = wxGetApp().m_EDA_Config;
wxASSERT( config != NULL );
m_Parent = parent;
/* Get options */
s_OutputFormOpt = m_Parent->m_Parent->m_EDA_Config->Read( OPTION_BOM_FORMAT, (long) 0 );
s_OutputSeparatorOpt = m_Parent->m_Parent->m_EDA_Config->Read( OPTION_BOM_SEPARATOR, (long) 0 );
long addfields = m_Parent->m_Parent->m_EDA_Config->Read( OPTION_BOM_ADD_FIELD, (long) 0 );
s_OutputFormOpt = config->Read( OPTION_BOM_FORMAT, (long) 0 );
s_OutputSeparatorOpt = config->Read( OPTION_BOM_SEPARATOR, (long) 0 );
long addfields = config->Read( OPTION_BOM_ADD_FIELD, (long) 0 );
for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ )
{
if( (addfields & bitmask) )
......@@ -491,6 +494,9 @@ void WinEDA_Build_BOM_Frame::OnApplyClick( wxCommandEvent& event )
void WinEDA_Build_BOM_Frame::SavePreferences()
/**************************************************/
{
wxConfig* config = wxGetApp().m_EDA_Config;
wxASSERT( config != NULL );
// Determine current settings of "List items" and "Options" checkboxes
// (NOTE: These 6 settings are restored when the dialog box is next
// invoked, but are *not* still saved after EESchema is next shut down.)
......@@ -519,8 +525,8 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
s_Add_F8_state = m_AddField8->GetValue();
// Now save current settings of both radiobutton groups
m_Parent->m_Parent->m_EDA_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_FORMAT, (long) s_OutputFormOpt );
config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt );
// Now save current settings of all "Fields to add" checkboxes
long addfields = 0;
......@@ -531,5 +537,5 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
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;
Create(parent, id, caption, pos, size, style);
msg = _("from ") + g_EDA_Appl->m_CurrentOptionFile;
msg = _("from ") + wxGetApp().m_CurrentOptionFile;
SetTitle(msg);
SetFormatsNetListes();
m_ListLibr->InsertItems(g_LibName_List, 0);
......@@ -312,8 +312,8 @@ void KiConfigEeschemaFrame::OnCloseWindow(wxCloseEvent & event)
if ( m_LibListChanged )
{
LoadLibraries(m_Parent);
if ( m_Parent->m_Parent->m_ViewlibFrame )
m_Parent->m_Parent->m_ViewlibFrame->ReCreateListLib();
if ( m_Parent->m_ViewlibFrame )
m_Parent->m_ViewlibFrame->ReCreateListLib();
}
EndModal(0);
}
......
......@@ -10,7 +10,6 @@
#include "protos.h"
#include "eeconfig.h"
#include "worksheet.h"
#include "hotkeys_basic.h"
#include "hotkeys.h"
#include "id.h"
......@@ -44,7 +43,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
case ID_OPTIONS_SETUP:
DisplayOptionFrame( this, pos );
DrawPanel->Refresh(TRUE); // Redraw, because grid settings may have changed.
DrawPanel->Refresh( TRUE ); // Redraw, because grid settings may have changed.
break;
case ID_CONFIG_SAVE:
......@@ -93,7 +92,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME;
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
AddDelimiterString(FullFileName);
AddDelimiterString( FullFileName );
wxString editorname = GetEditorName();
if( !editorname.IsEmpty() )
ExecuteFile( this, editorname, FullFileName );
......@@ -110,7 +109,9 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
break;
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 )
* Read the hotkey files config for eeschema and libedit
*/
{
wxString FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
wxString FullFileName = ReturnHotkeyConfigFilePath(
g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME;
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
frame->ReadHotkeyConfigFile( FullFileName, s_Eeschema_Hokeys_Descr, verbose );
frame->ReadHotkeyConfigFile( FullFileName,
s_Eeschema_Hokeys_Descr,
verbose );
return TRUE;
}
......@@ -148,6 +152,9 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
wxString FullFileName;
bool IsRead = TRUE;
wxArrayString liblist_tmp = g_LibName_List;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
if( CfgFileName.IsEmpty() )
FullFileName = g_RootSheet->m_AssociatedScreen->m_FileName;
......@@ -155,8 +162,9 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
FullFileName = CfgFileName;
g_LibName_List.Clear();
if( !g_EDA_Appl->ReadProjectConfig( FullFileName,
GROUP, ParamCfgList, ForceRereadConfig ? FALSE : TRUE ) ) // Config non lue
if( !wxGetApp().ReadProjectConfig( FullFileName,
GROUP, ParamCfgList,
ForceRereadConfig ? FALSE : TRUE ) ) // Config non lue
{
g_LibName_List = liblist_tmp;
IsRead = FALSE;
......@@ -172,13 +180,13 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
g_LibName_List.Add( wxT( "device" ) );
}
if( g_EDA_Appl->m_SchematicFrame )
if( frame )
{
g_EDA_Appl->m_SchematicFrame->SetDrawBgColor( g_DrawBgColor );
g_EDA_Appl->m_SchematicFrame->m_Draw_Grid = g_ShowGrid;
frame->SetDrawBgColor( g_DrawBgColor );
frame->m_Draw_Grid = g_ShowGrid;
}
LoadLibraries( g_EDA_Appl->m_SchematicFrame );
LoadLibraries( frame );
return IsRead;
}
......@@ -210,5 +218,5 @@ void WinEDA_SchematicFrame::Save_Config( wxWindow* displayframe )
return;
/* ecriture de la configuration */
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
}
......@@ -11,8 +11,6 @@
#include "fctsys.h"
#include <wx/image.h>
#include "common.h"
#include "program.h"
#include "libcmp.h"
......@@ -42,8 +40,7 @@ IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit()
{
wxString FFileName;
g_EDA_Appl = this;
WinEDA_SchematicFrame* frame = NULL;
g_DebugLevel = 0; // Debug level */
......@@ -61,44 +58,43 @@ bool WinEDA_App::OnInit()
/* init EESCHEMA */
GetSettings(); // read current setup
SeedLayers();
Read_Hotkey_Config( m_SchematicFrame, false ); /* Must be called before creating the main frame
* in order to display the real hotkeys in menus
Read_Hotkey_Config( frame, false ); /* Must be called before creating
* the main frame in order to
* display the real hotkeys in menus
* or tool tips */
// Create main frame (schematic frame) :
m_SchematicFrame = new WinEDA_SchematicFrame( NULL, this,
wxT( "EESchema" ),
frame = new WinEDA_SchematicFrame( NULL, wxT( "EESchema" ),
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
SetTopWindow( m_SchematicFrame );
m_SchematicFrame->Show( TRUE );
SetTopWindow( frame );
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
// sends EESCHEMA a command
SetupServerFunction( RemoteCommand );
}
ActiveScreen = m_SchematicFrame->GetScreen();
m_SchematicFrame->Zoom_Automatique( TRUE );
ActiveScreen = frame->GetScreen();
frame->Zoom_Automatique( TRUE );
/* Load file specified in the command line. */
if( !FFileName.IsEmpty() )
{
ChangeFileNameExt( FFileName, g_SchExtBuffer );
wxSetWorkingDirectory( wxPathOnly( FFileName ) );
if( m_SchematicFrame->DrawPanel )
if( m_SchematicFrame->LoadOneEEProject( FFileName, FALSE ) <= 0 )
m_SchematicFrame->DrawPanel->Refresh( TRUE ); // File not found or error
if( frame->DrawPanel )
if( frame->LoadOneEEProject( FFileName, FALSE ) <= 0 )
frame->DrawPanel->Refresh( TRUE ); // File not found or error
}
else
{
Read_Config( wxEmptyString, TRUE ); // Read a default config file if no file to load
if( m_SchematicFrame->DrawPanel )
m_SchematicFrame->DrawPanel->Refresh( TRUE );
if( frame->DrawPanel )
frame->DrawPanel->Refresh( TRUE );
}
return TRUE;
}
......@@ -3,7 +3,6 @@
/*************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
......@@ -30,18 +29,17 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
wxString name;
WinEDA_ViewlibFrame* Viewer;
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 */
if( Viewer )
Viewer->Destroy();
Viewer = parent->m_Parent->m_ViewlibFrame = new
WinEDA_ViewlibFrame(
parent->m_Parent->m_SchematicFrame,
parent->m_Parent,
NULL,
&semaphore );
Viewer = frame->m_ViewlibFrame =
new WinEDA_ViewlibFrame( frame, NULL, &semaphore );
Viewer->AdjustScrollBars();
// Show the library viewer frame until it is closed
......@@ -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,
wxArrayString& HistoryList,
bool UseLibBrowser )
......@@ -179,7 +177,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp;
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_ChipName = Name;
DrawLibItem->m_TimeStamp = GetTimeStamp();
......@@ -203,7 +201,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
msg += wxT( "?" );
//update the reference -- just the prefix for now.
DrawLibItem->SetRef(GetSheet(), msg );
DrawLibItem->SetRef( GetSheet(), msg );
/* Init champ Reference */
DrawLibItem->GetField( REFERENCE )->m_Pos.x =
......@@ -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_Size = Entry->m_Prefix.m_Size;
DrawLibItem->m_PrefixString = Entry->m_Prefix.m_Text;
DrawLibItem->GetField( REFERENCE )->m_Attributs = Entry->m_Prefix.m_Attributs;
DrawLibItem->GetField( REFERENCE )->m_HJustify = Entry->m_Prefix.m_HJustify;
DrawLibItem->GetField( REFERENCE )->m_VJustify = Entry->m_Prefix.m_VJustify;
DrawLibItem->GetField( REFERENCE )->m_Attributs =
Entry->m_Prefix.m_Attributs;
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 */
for( Field = Entry->Fields; Field != NULL; Field = Field->Next() )
......@@ -298,7 +299,7 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else
{
DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox());
DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox() );
}
}
......@@ -310,7 +311,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0,
0 ),
GR_DEFAULT_DRAWMODE );
DrawPanel->CursorOn( DC );
}
......@@ -369,7 +372,8 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
if( DrawComponent == NULL )
return;
LibEntry = FindLibPart( DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
LibEntry = FindLibPart(
DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( LibEntry == NULL )
return;
......@@ -399,7 +403,8 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
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 );
GetScreen()->SetModify();
......@@ -417,7 +422,8 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
if( DrawComponent == NULL )
return;
LibEntry = FindLibPart( DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
LibEntry = FindLibPart(
DrawComponent->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( LibEntry == NULL )
return;
......@@ -440,7 +446,8 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
if( DrawComponent->m_Flags & IS_MOVED )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
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 );
GetScreen()->SetModify();
......@@ -487,7 +494,8 @@ void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
if( Component->m_Flags == 0 )
{
if( g_ItemToUndoCopy ){
if( g_ItemToUndoCopy )
{
SAFE_DELETE( g_ItemToUndoCopy );
}
g_ItemToUndoCopy = Component->GenCopy();
......@@ -504,6 +512,7 @@ void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
memcpy( OldTransMat, Component->m_Transform, sizeof(OldTransMat) );
#if 1
// 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(),
// then by drawing the first time in xor mode so that subsequent xor
......
......@@ -6,7 +6,6 @@
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
......@@ -22,48 +21,46 @@
/* class WinEDA_LibeditFrame */
/*****************************/
BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_CLOSE( WinEDA_LibeditFrame::OnCloseWindow )
EVT_SIZE( WinEDA_LibeditFrame::OnSize )
COMMON_EVENTS_DRAWFRAME
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 )
// Tools et boutons de Libedit:
/* 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 )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER,
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER,
WinEDA_LibeditFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS,
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS,
WinEDA_LibeditFrame::Process_Special_Functions )
/* Right Vertical toolbar */
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( ID_NO_SELECT_BUTT, WinEDA_LibeditFrame::Process_Special_Functions )
EVT_TOOL_RANGE( ID_LIBEDIT_START_V_TOOL, ID_LIBEDIT_END_V_TOOL,
WinEDA_LibeditFrame::Process_Special_Functions )
/* 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 )
// 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 )
// PopUp Menus pour Zooms trait�s dans drawpanel.cpp
END_EVENT_TABLE()
WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
WinEDA_App* parent,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
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_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
......@@ -89,7 +86,9 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
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()
// Create the list of last edited schematic files
m_FilesMenu->AppendSeparator();
int max_file = m_Parent->m_LastProjectMaxCount;
int max_file = wxGetApp().m_LastProjectMaxCount;
for( ii = 0; ii < max_file; ii++ )
{
if( GetLastProject( ii ).IsEmpty() )
......@@ -376,7 +376,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
// Font selection and setup
AddFontSelectionMenu( configmenu );
m_Parent->SetLanguageList( configmenu );
wxGetApp().SetLanguageList( configmenu );
configmenu->AppendSeparator();
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ),
......@@ -417,7 +417,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
else // Update the list of last edited schematic files
{
wxMenuItem* item;
int max_file = m_Parent->m_LastProjectMaxCount;
int max_file = wxGetApp().m_LastProjectMaxCount;
for( ii = max_file - 1; ii >=0; ii-- )
{
if( m_FilesMenu->FindItem( ID_LOAD_FILE_1 + ii ) )
......
This diff is collapsed.
......@@ -30,7 +30,8 @@
/*******************************/
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 )
EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_DrawFrame::OnSockRequest )
......@@ -128,13 +129,14 @@ END_EVENT_TABLE()
/****************/
WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
WinEDA_App* parent,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
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_Draw_Axis = FALSE; // TRUE to show axis
m_Draw_Grid = g_ShowGrid; // TRUE to show a grid
......@@ -143,7 +145,8 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
m_CurrentField = NULL;
m_Multiflag = 0;
m_TextFieldSize = DEFAULT_SIZE_TEXT;
m_LibeditFrame = NULL; // Component editor frame.
m_ViewlibFrame = NULL; // Frame for browsing component libraries
CreateScreens();
......@@ -159,11 +162,13 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
/* Get config */
GetSettings();
g_DrawMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_DRAW_LINE_WIDTH_KEY, (long) 0 );
g_PlotPSMinimunLineWidth =
m_Parent->m_EDA_Config->Read( MINI_PLOTPS_LINE_WIDTH_KEY, (long) 4 );
if( config )
{
g_DrawMinimunLineWidth = config->Read( MINI_DRAW_LINE_WIDTH_KEY,
(long) 0 );
g_PlotPSMinimunLineWidth = config->Read( MINI_PLOTPS_LINE_WIDTH_KEY,
(long) 4 );
}
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
......@@ -183,7 +188,6 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
{
m_Parent->m_SchematicFrame = NULL;
SAFE_DELETE( g_RootSheet );
SAFE_DELETE( m_CurrentSheet ); //a DrawSheetPath, on the heap.
m_CurrentSheet = NULL;
......@@ -290,10 +294,11 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
/*****************************************************************/
{
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;
}
......@@ -349,10 +354,12 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
SaveSettings();
m_Parent->m_EDA_Config->Write( MINI_DRAW_LINE_WIDTH_KEY,
(long) g_DrawMinimunLineWidth );
m_Parent->m_EDA_Config->Write( MINI_PLOTPS_LINE_WIDTH_KEY,
if( config )
{
config->Write( MINI_DRAW_LINE_WIDTH_KEY, (long) g_DrawMinimunLineWidth );
config->Write( MINI_PLOTPS_LINE_WIDTH_KEY,
(long) g_PlotPSMinimunLineWidth );
}
Destroy();
}
......@@ -576,16 +583,14 @@ void WinEDA_SchematicFrame::OnOpenCvpcb( 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
{
m_Parent->m_ViewlibFrame =
new WinEDA_ViewlibFrame( m_Parent->m_SchematicFrame,
m_Parent );
m_Parent->m_ViewlibFrame->AdjustScrollBars();
m_ViewlibFrame = new WinEDA_ViewlibFrame( this );
m_ViewlibFrame->AdjustScrollBars();
}
}
......@@ -593,20 +598,18 @@ void WinEDA_SchematicFrame::OnOpenLibraryViewer( 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
{
m_Parent->m_LibeditFrame =
new WinEDA_LibeditFrame( m_Parent->m_SchematicFrame,
m_Parent,
m_LibeditFrame = new WinEDA_LibeditFrame( this,
wxT( "Library Editor" ),
wxPoint( -1, -1 ),
wxSize( 600, 400 ) );
ActiveScreen = g_ScreenLib;
m_Parent->m_LibeditFrame->AdjustScrollBars();
m_LibeditFrame->AdjustScrollBars();
}
}
......
This diff is collapsed.
......@@ -41,10 +41,10 @@ END_EVENT_TABLE()
/******************************************************************************/
WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
LibraryStruct* Library,
wxSemaphore* semaphore ) :
WinEDA_DrawFrame( father, VIEWER_FRAME, parent, _( "Library browser" ),
WinEDA_DrawFrame( father, VIEWER_FRAME, _( "Library browser" ),
wxDefaultPosition, wxDefaultSize )
/******************************************************************************/
{
......@@ -105,7 +105,9 @@ WinEDA_ViewlibFrame::~WinEDA_ViewlibFrame()
delete GetScreen();
SetBaseScreen( 0 );
m_Parent->m_ViewlibFrame = NULL;
WinEDA_SchematicFrame* frame =
(WinEDA_SchematicFrame*) wxGetApp().GetTopWindow();
frame->m_ViewlibFrame = NULL;
}
......
......@@ -22,99 +22,104 @@
/****************************************/
BEGIN_EVENT_TABLE( WinEDA_GerberFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_CLOSE( WinEDA_GerberFrame::OnCloseWindow )
EVT_SIZE( WinEDA_GerberFrame::OnSize )
COMMON_EVENTS_DRAWFRAME
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 )
EVT_TOOL( ID_LOAD_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_GERBVIEW_LOAD_DRILL_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_SAVE_BOARD, 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_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_DCODE_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_NEW_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 )
// Menu Files:
EVT_MENU( ID_MENU_LOAD_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_NEW_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_GEN_PLOT, WinEDA_GerberFrame::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, WinEDA_GerberFrame::ExportDataInPcbnewFormat )
EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10,
EVT_MENU( ID_MENU_LOAD_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_NEW_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_GEN_PLOT, WinEDA_GerberFrame::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW,
WinEDA_GerberFrame::ExportDataInPcbnewFormat )
EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10,
WinEDA_GerberFrame::Files_io )
EVT_MENU( ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_EXIT, WinEDA_GerberFrame::Process_Special_Functions )
// 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 )
EVT_MENU( ID_COLORS_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_COLORS_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_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
WinEDA_DrawFrame::SetLanguage )
// menu Postprocess
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE,
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES,
WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
WinEDA_GerberFrame::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE,
WinEDA_GerberFrame::Process_Special_Functions )
// 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
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout )
EVT_TOOL( ID_SHEET_SET, WinEDA_DrawFrame::Process_PageSettings )
EVT_TOOL( wxID_CUT, 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( ID_UNDO_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER,
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout )
EVT_TOOL( ID_SHEET_SET, WinEDA_DrawFrame::Process_PageSettings )
EVT_TOOL( wxID_CUT, 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( ID_UNDO_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER,
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 )
// Vertical toolbar:
EVT_TOOL( ID_NO_SELECT_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_DELETE_ITEM_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_PCB_ZONES_BUTT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT,
WinEDA_GerberFrame::Process_Special_Functions )
// 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 )
// Pop up menu
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
WinEDA_GerberFrame::Process_Special_Functions )
// 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 )
// PopUp Menu trait�s dans drawpanel.cpp
END_EVENT_TABLE()
......@@ -123,14 +128,14 @@ END_EVENT_TABLE()
/****************/
WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
WinEDA_App* parent,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
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_AboutTitle = g_GerbviewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee
......@@ -160,7 +165,6 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
WinEDA_GerberFrame::~WinEDA_GerberFrame()
{
m_Parent->m_GerberFrame = NULL;
SetBaseScreen( ScreenPcb );
}
......@@ -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 )
......@@ -264,8 +270,10 @@ void WinEDA_GerberFrame::SetToolbars()
if( m_OptionsToolBar )
{
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UnitMetric == MILLIMETRE ? TRUE : FALSE );
m_OptionsToolBar->ToggleTool(
ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UnitMetric ==
MILLIMETRE ? TRUE : FALSE );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UnitMetric == INCHES ? TRUE : FALSE );
......
......@@ -7,7 +7,6 @@
#include "fctsys.h"
#include <wx/image.h>
#include <wx/file.h>
#include "common.h"
......@@ -25,16 +24,16 @@ IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit()
{
g_EDA_Appl = this;
WinEDA_GerberFrame* frame = NULL;
InitEDA_Appl( wxT( "gerbview" ) );
ScreenPcb = new PCB_SCREEN();
ScreenPcb->m_CurrentSheetDesc = &g_Sheet_GERBER;
ActiveScreen = ScreenPcb;
GetSettings();
if( m_Checker && m_Checker->IsAnotherRunning() )
{
if( !IsOK( NULL, _( "GerbView is already running. Continue?" ) ) )
......@@ -43,31 +42,33 @@ bool WinEDA_App::OnInit()
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 menus or tool tips */
m_GerberFrame = new WinEDA_GerberFrame( NULL, this, wxT( "GerbView" ),
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
frame = new WinEDA_GerberFrame( NULL, wxT( "GerbView" ),
wxPoint( 0, 0 ),
wxSize( 600, 400 ) );
/* Gerbview mainframe title */
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
m_GerberFrame->SetTitle( Title );
m_GerberFrame->m_Pcb = new BOARD( NULL, m_GerberFrame );
SetTopWindow( m_GerberFrame ); // Set GerbView mainframe on top
frame->SetTitle( Title );
frame->m_Pcb = new BOARD( NULL, frame );
m_GerberFrame->Show( TRUE ); // Show GerbView mainframe
m_GerberFrame->Zoom_Automatique( TRUE ); // Zoomfit drawing in frame
SetTopWindow( frame ); // Set GerbView mainframe on top
frame->Show( TRUE ); // Show GerbView mainframe
frame->Zoom_Automatique( TRUE ); // Zoomfit drawing in frame
if( argc > 1 )
{
wxString fileName = MakeFileName( wxEmptyString, argv[1], g_PhotoFilenameExt );
wxString fileName = MakeFileName( wxEmptyString,
argv[1],
g_PhotoFilenameExt );
if( !fileName.IsEmpty() )
{
wxClientDC dc( m_GerberFrame->DrawPanel );
m_GerberFrame->DrawPanel->PrepareGraphicContext( &dc );
wxClientDC dc( frame->DrawPanel );
frame->DrawPanel->PrepareGraphicContext( &dc );
wxString path = wxPathOnly( fileName );
......@@ -77,14 +78,17 @@ bool WinEDA_App::OnInit()
Read_Config();
// 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 ) )
{
((PCB_SCREEN*)m_GerberFrame->GetScreen())->m_Active_Layer = i-1;
m_GerberFrame->LoadOneGerberFile( fileName, &dc, FALSE );
( (PCB_SCREEN*) frame->GetScreen() )->
m_Active_Layer = i - 1;
frame->LoadOneGerberFile( fileName, &dc, FALSE );
}
}
}
......
......@@ -10,7 +10,6 @@
#include "gerbview.h"
#include "pcbplot.h"
#include "id.h"
#include "hotkeys_basic.h"
#include "hotkeys.h"
#include "gerbview_config.h"
......@@ -76,7 +75,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME;
FullFileName += DEFAULT_HOTKEY_FILENAME_EXT;
AddDelimiterString(FullFileName);
AddDelimiterString( FullFileName );
wxString editorname = GetEditorName();
if( !editorname.IsEmpty() )
ExecuteFile( this, editorname, FullFileName );
......@@ -93,7 +92,8 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
break;
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()
*/
{
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 */
if( ScreenPcb )
......@@ -136,9 +137,9 @@ void WinEDA_GerberFrame::Update_config()
*/
{
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;
FullFileName = wxT( "gerbview" );
......@@ -157,7 +158,7 @@ void WinEDA_GerberFrame::Update_config()
return;
/* 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 )
* Read the hotkey files config for pcbnew and module_edit
*/
{
wxString FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
wxString FullFileName = ReturnHotkeyConfigFilePath(
g_ConfigFileLocationChoice );
FullFileName += HOTKEY_FILENAME;
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:
};
/* Construction de la table des evenements pour WinEDA_ConfigFrame */
BEGIN_EVENT_TABLE( WinEDA_ConfigFrame, wxDialog )
EVT_BUTTON( ID_SAVE_CFG, WinEDA_ConfigFrame::SaveCfg )
EVT_BUTTON( wxID_OK, WinEDA_ConfigFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_ConfigFrame::OnCancelClick )
EVT_BUTTON( ID_SAVE_CFG, WinEDA_ConfigFrame::SaveCfg )
EVT_BUTTON( wxID_OK, WinEDA_ConfigFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_ConfigFrame::OnCancelClick )
END_EVENT_TABLE()
......@@ -87,7 +87,7 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent,
SetFont( *g_DialogFont );
/* Shows the config filename currently used : */
title = _( "from " ) + g_EDA_Appl->m_CurrentOptionFile;
title = _( "from " ) + wxGetApp().m_CurrentOptionFile;
SetTitle( title );
LibModified = FALSE;
......@@ -117,15 +117,18 @@ WinEDA_ConfigFrame::WinEDA_ConfigFrame( WinEDA_GerberFrame* parent,
size.x = LEN_EXT;
size.y = -1;
TextDrillExt = new WinEDA_EnterText( this,
_( "Drill File Ext:" ), g_DrillFilenameExt,
_( "Drill File Ext:" ),
g_DrillFilenameExt,
LeftBoxSizer, size );
TextPhotoExt = new WinEDA_EnterText( this,
_( "Gerber File Ext:" ), g_PhotoFilenameExt,
_( "Gerber File Ext:" ),
g_PhotoFilenameExt,
LeftBoxSizer, size );
TextPenExt = new WinEDA_EnterText( this,
_( "D code File Ext:" ), g_PenFilenameExt,
_( "D code File Ext:" ),
g_PenFilenameExt,
LeftBoxSizer, size );
GetSizer()->Fit( this );
......
This diff is collapsed.
......@@ -24,14 +24,6 @@ class WinEDA_App : public wxApp
public:
wxString m_Project;
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;
wxSize m_HelpSize;
......@@ -46,9 +38,10 @@ public:
* (utilis si KICAD non dfini)*/
wxArrayString m_LastProject; /* liste des derniers projets chargs */
unsigned int m_LastProjectMaxCount; /* Max histhory file length */
wxString m_KicadEnv; /* Chemin de kicad dfini dans la variable
* d'environnement KICAD,
* typiquement /usr/local/kicad ou c:\kicad */
wxString m_KicadEnv; /* Chemin de kicad dfini dans la
* variable d'environnement KICAD,
* typiquement /usr/local/kicad ou
* c:\kicad */
bool m_Env_Defined; // TRUE si variable d'environnement KICAD definie
wxLocale* m_Locale; // Gestion de la localisation
......
......@@ -276,9 +276,6 @@ COMMON_GLOBL wxString g_ProductName
#endif
;
COMMON_GLOBL WinEDA_App* g_EDA_Appl; /* this is the main application */
/* Gestion des librairies */
COMMON_GLOBL wxString g_RealLibDirBuffer; // Chemin reel des librairies de module
// = UserLibDirBuffer si non vide
......
......@@ -52,6 +52,8 @@ public:
DrawSheetPath* m_CurrentSheet; ///< which sheet we are presently working on.
int m_Multiflag;
wxPoint m_OldPos;
WinEDA_LibeditFrame* m_LibeditFrame;
WinEDA_ViewlibFrame* m_ViewlibFrame;
private:
......@@ -62,7 +64,7 @@ private:
public:
WinEDA_SchematicFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_SchematicFrame( wxWindow* father,
const wxString& title,
const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
......@@ -362,7 +364,7 @@ public:
WinEDAChoiceBox* m_SelAliasBox;
public:
WinEDA_LibeditFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_LibeditFrame( wxWindow* father,
const wxString& title,
const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
......@@ -473,7 +475,7 @@ public:
wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog
public:
WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
WinEDA_ViewlibFrame( wxWindow* father,
LibraryStruct* Library = 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:
public:
// 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 );
~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
/************************************************************************************************/
{
m_Parent = parent;
m_Config = m_Parent->m_Parent->m_EDA_Config;
m_Config = wxGetApp().m_EDA_Config;
m_Zone_Setting = zone_setting;
m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort, and filtering net names
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