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,
WinEDA3D_DrawFrame::Process_Zoom )
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_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,
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 )
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;
......
......@@ -87,7 +87,7 @@ private:
public:
Pcb3D_GLCanvas(WinEDA3D_DrawFrame *parent, const wxWindowID id = -1,
int* gl_attrib = NULL);
int* gl_attrib = NULL);
~Pcb3D_GLCanvas();
void ClearLists();
......@@ -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;
}
......@@ -76,19 +76,22 @@ void WinEDA_BasicFrame::ReCreateMenuBar()
void WinEDA_BasicFrame::GetSettings()
/*********************************************/
{
wxString text;
int Ypos_min;
wxString text;
int Ypos_min;
wxConfig* config;
config = wxGetApp().m_EDA_Config;
if( m_Parent->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,30 +149,26 @@ static struct LANGUAGE_DESCR s_Language_List[LANGUAGE_DESCR_COUNT] =
}
};
/* Just add new languages to the list. This macro will properly recalculate
* the size of the array. */
#define LANGUAGE_DESCR_COUNT ( sizeof( s_Language_List ) / \
sizeof( struct LANGUAGE_DESCR ) )
/**************************/
/* WinEDA_App Constructor */
/**************************/
WinEDA_App::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_Checker = NULL;
m_LastProjectMaxCount = 10;
m_HtmlCtrl = NULL;
m_EDA_CommonConfig = NULL;
m_EDA_Config = NULL;
m_Env_Defined = FALSE;
m_LanguageId = wxLANGUAGE_DEFAULT;
m_Language_Menu = NULL;
m_Locale = NULL;
m_HtmlCtrl = NULL;
m_EDA_CommonConfig = NULL;
m_EDA_Config = NULL;
m_Env_Defined = FALSE;
m_LanguageId = wxLANGUAGE_DEFAULT;
m_Language_Menu = NULL;
m_Locale = NULL;
m_PdfBrowserIsDefault = TRUE;
}
......@@ -230,7 +220,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
}
/* Prepare On Line Help. Use only lower case for help filenames,
* in order to avoid problems with upper/lower case filenames under windows and unix */
* in order to avoid problems with upper/lower case filenames under windows and unix */
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
m_HelpFileName = name.Lower() + wxT( ".html" );
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
......@@ -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 );
wxFONTFAMILY_ROMAN,
wxFONTSTYLE_ITALIC,
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 );
......@@ -297,12 +292,12 @@ void WinEDA_App::InitOnLineHelp()
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
m_HelpFileName = fullfilename + wxT( ".html" );
fullfilename += wxT( "kicad.hhp" );
fullfilename += wxT( "kicad.hhp" );
if( wxFileExists( fullfilename ) )
{
m_HtmlCtrl = new wxHtmlHelpController( wxHF_TOOLBAR |
wxHF_CONTENTS | wxHF_PRINT | wxHF_OPEN_FILES
/*| wxHF_SEARCH */ );
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" ) );
m_HtmlCtrl->AddBook( fullfilename );
......@@ -335,7 +330,7 @@ bool WinEDA_App::SetBinDir()
return false;
char* native_str = NULL;
int len = CFStringGetMaximumSizeForEncoding( CFStringGetLength( str ),
kCFStringEncodingUTF8 ) + 1;
kCFStringEncodingUTF8 ) + 1;
native_str = new char[len];
CFStringGetCString( str, native_str, len, kCFStringEncodingUTF8 );
m_BinDir = CONV_FROM_UTF8( native_str );
......@@ -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() )
......@@ -584,7 +584,7 @@ wxMenu* WinEDA_App::SetLanguageList( wxMenu* MasterMenu )
s_Language_List[ii].m_Lang_Label :
wxGetTranslation( s_Language_List[ii].m_Lang_Label );
item = new wxMenuItem( m_Language_Menu, s_Language_List[ii].m_KI_Lang_Identifier,
MenuLabel, wxEmptyString, wxITEM_CHECK );
MenuLabel, wxEmptyString, wxITEM_CHECK );
SETBITMAPS( s_Language_List[ii].m_Lang_Icon );
m_Language_Menu->Append( item );
}
......@@ -593,17 +593,19 @@ 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 )
{
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( MasterMenu, m_Language_Menu,
ID_LANGUAGE_CHOICE, _( "Language" ),
_( "Select application language (only for testing!)" ),
language_xpm );
ID_LANGUAGE_CHOICE, _( "Language" ),
_( "Select application language (only for testing!)" ),
language_xpm );
}
return m_Language_Menu;
}
......
This diff is collapsed.
......@@ -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;
......
This diff is collapsed.
......@@ -6,7 +6,6 @@
#include "fctsys.h"
#include "wxstruct.h"
#include "common.h"
#include "cvpcb.h"
#include "protos.h"
......@@ -22,12 +21,12 @@ void Read_Config( const wxString& FileName )
/**************************************************/
/* lit la configuration
* 1 - lit cvpcb.cnf
* 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut
* 1 - lit cvpcb.cnf
* 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut
*
* Remarque:
* le chemin de l'executable cvpcb.exe doit etre dans BinDir
* Remarque:
* le chemin de l'executable cvpcb.exe doit etre dans BinDir
*/
{
wxString FullFileName = FileName;
......@@ -36,8 +35,8 @@ void Read_Config( const wxString& FileName )
g_LibName_List.Clear();
g_ListName_Equ.Clear();
g_EDA_Appl->ReadProjectConfig( FullFileName,
GROUP, ParamCfgList, FALSE );
wxGetApp().ReadProjectConfig( FullFileName,
GROUP, ParamCfgList, FALSE );
if( NetInExtBuffer.IsEmpty() )
NetInExtBuffer = wxT( ".net" );
......@@ -52,7 +51,7 @@ void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event )
/************************************************************/
/* fonction relai d'appel a Save_Config,
* la vraie fonction de sauvegarde de la config
* la vraie fonction de sauvegarde de la config
*/
{
Save_Config( this );
......@@ -73,18 +72,18 @@ void Save_Config( wxWindow* parent )
path = wxGetCwd();
FullFileName = EDA_FileSelector( _( "Save preferences" ),
path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */
parent,
wxFD_SAVE,
TRUE
);
path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */
parent,
wxFD_SAVE,
TRUE
);
if( FullFileName.IsEmpty() )
return;
/* ecriture de la configuration */
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
}
This diff is collapsed.
/*******************/
/* File: cvpcb.cpp */
/*******************/
/*******************/
/* File: cvpcb.cpp */
/*******************/
#define MAIN
#define 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 ( ! IsOK(NULL, _("Cvpcb is already running, Continue?") ) )
return false;
if( m_Checker && m_Checker->IsAnotherRunning() )
{
if( !IsOK( NULL, _( "Cvpcb is already running, Continue?" ) ) )
return false;
}
GetSettings(); // read current setup
wxSetWorkingDirectory(currCWD); // mofifie par GetSetting
SetRealLibraryPath( wxT("modules") );
GetSettings(); // read current setup
if(argc > 1 )
{
NetInNameBuffer = argv[1];
NetNameBuffer = argv[1];
}
wxSetWorkingDirectory( currCWD ); // mofifie par GetSetting
SetRealLibraryPath( wxT( "modules" ) );
if ( ! NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly(NetInNameBuffer) );
g_DrawBgColor = BLACK;
if( argc > 1 )
{
NetInNameBuffer = argv[1];
NetNameBuffer = argv[1];
}
Read_Config(NetInNameBuffer);
if( !NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly( NetInNameBuffer ) );
g_DrawBgColor = BLACK;
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion();
m_CvpcbFrame = new WinEDA_CvpcbFrame(this, Title);
Read_Config( NetInNameBuffer );
msg.Printf( wxT("Modules: %d"), nblib);
m_CvpcbFrame->SetStatusText(msg,2);
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
frame = new WinEDA_CvpcbFrame( Title );
// Show the frame
SetTopWindow(m_CvpcbFrame);
msg.Printf( wxT( "Modules: %d" ), nblib );
frame->SetStatusText( msg, 2 );
m_CvpcbFrame->Show(TRUE);
// Show the frame
SetTopWindow( frame );
listlib();
m_CvpcbFrame->BuildFootprintListBox();
frame->Show( TRUE );
if( ! NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */
{
FFileName = MakeFileName(NetDirBuffer,
NetInNameBuffer, NetInExtBuffer);
listlib();
frame->BuildFootprintListBox();
m_CvpcbFrame->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);
}
if( !NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */
{
FFileName = MakeFileName( NetDirBuffer,
NetInNameBuffer, NetInExtBuffer );
return TRUE;
}
frame->ReadNetListe();
}
else /* Mise a jour du titre de la fenetre principale */
{
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
msg.Printf( wxT( "%s {%s%c} [no file]" ),
Title.GetData(), wxGetCwd().GetData(), DIR_SEP );
frame->SetTitle( msg );
}
return TRUE;
}
......@@ -39,8 +39,8 @@ private:
// Constructor and destructor
public:
WinEDA_CvpcbFrame( WinEDA_App * parent, const wxString &title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
WinEDA_CvpcbFrame( const wxString &title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_CvpcbFrame();
void OnLeftClick( wxListEvent& event );
......@@ -180,10 +180,10 @@ class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
public:
public:
WinEDA_DisplayFrame( wxWindow * father, WinEDA_App * parent,
const wxString &title,
const wxPoint &pos, const wxSize &size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
WinEDA_DisplayFrame( wxWindow * father,
const wxString &title,
const wxPoint &pos, const wxSize &size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~WinEDA_DisplayFrame();
......
......@@ -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 */
......@@ -30,8 +30,12 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
*/
{
SCH_ITEM* DrawList, * TstDrawList;
int flag;
bool Modify = FALSE;
int flag;
bool Modify = FALSE;
WinEDA_SchematicFrame* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow();
DrawList = EEDrawList;
for( ; DrawList != NULL; DrawList = DrawList->Next() )
......@@ -44,7 +48,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
flag = TstAlignSegment( (EDA_DrawLineStruct*) DrawList,
(EDA_DrawLineStruct*) TstDrawList );
(EDA_DrawLineStruct*) TstDrawList );
if( flag ) /* Suppression de TstSegm */
{
/* keep the bits set in .m_Flags, because the deleted segment can be flagged */
......@@ -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
......@@ -172,7 +178,7 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
}
NewSegment = segment->GenCopy();
NewSegment->m_Start = breakpoint;
segment->m_End = NewSegment->m_Start;
segment->m_End = NewSegment->m_Start;
NewSegment->SetNext( segment->Next() );
segment->SetNext( NewSegment );
DrawList = NewSegment;
......@@ -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 );
......@@ -83,8 +85,8 @@ void RemoteCommand( const char* cmdline )
/*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
SCH_COMPONENT* LibItem )
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
SCH_COMPONENT* LibItem )
/*****************************************************************************/
/** Send a remote command to eeschema via a socket,
......@@ -106,17 +108,19 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
{
case DRAW_PART_TEXT_STRUCT_TYPE:
case COMPONENT_FIELD_DRAW_TYPE:
{
if( LibItem == NULL )
break;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->GetField(REFERENCE)->m_Text ) );
SendCommand( MSG_TO_PCB, Line );
}
break;
{
if( LibItem == NULL )
break;
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;
......@@ -130,10 +134,11 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
wxString pinnum;
Pin->ReturnPinStringNum( pinnum );
sprintf( Line, "$PIN: %s $PART: %s", CONV_TO_UTF8( pinnum ),
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
}
else
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"
......@@ -18,14 +17,16 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
/**************************************************************************/
/* Free (delete) all schematic data (include the sub hierarchy sheets )
* for the hierarchical sheet FirstSheet
* FirstSheet is not deleted.
* for the hierarchical sheet FirstSheet
* FirstSheet is not deleted.
*/
{
EDA_BaseStruct* DrawStruct;
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 )
return;
......@@ -33,7 +34,7 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
if( FirstSheet->Type() != DRAW_SHEET_STRUCT_TYPE )
{
DisplayError( NULL,
wxT( "DeleteSubHierarchy error(): NOT a Sheet" ) );
wxT( "DeleteSubHierarchy error(): NOT a Sheet" ) );
return;
}
......@@ -41,8 +42,8 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion )
{
msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ),
FirstSheet->m_SheetName.GetData(),
FirstSheet->GetFileName().GetData() );
FirstSheet->m_SheetName.GetData(),
FirstSheet->GetFileName().GetData() );
if( IsOK( NULL, msg ) )
{
frame->SaveEEFile( FirstSheet->m_AssociatedScreen, FILE_SAVE_AS );
......@@ -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 );
}
}
......@@ -78,29 +80,29 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
//this is redundant -- use FreeDrawList, a member of SCH_SCREEN
/*
* {
* EDA_BaseStruct *DrawStruct;
* {
* EDA_BaseStruct *DrawStruct;
*
* while (DrawList != NULL)
* {
* DrawStruct = DrawList;
* DrawList = DrawList->Pnext;
* while (DrawList != NULL)
* {
* DrawStruct = DrawList;
* DrawList = DrawList->Pnext;
*
* if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE)
* {
* DeleteSubHierarchy((DrawSheetStruct*) DrawStruct, confirm_deletion);
* }
* if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE)
* {
* DeleteSubHierarchy((DrawSheetStruct*) DrawStruct, confirm_deletion);
* }
*
* delete DrawStruct;
* }
* }
* delete DrawStruct;
* }
* }
*/
/********************************************************************/
bool ClearProjectDrawList( SCH_SCREEN* screen, bool confirm_deletion )
/********************************************************************/
/* free the draw list screen->EEDrawList and the subhierarchies
* clear the screen datas (filenames ..)
* clear the screen datas (filenames ..)
*/
{
if( screen == NULL )
......
......@@ -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:
......@@ -58,14 +57,14 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext );
FullFileName = EDA_FileSelector( _( "Read config file" ),
wxGetCwd(), /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */
this,
wxFD_OPEN,
TRUE /* ne change pas de repertoire courant */
);
wxGetCwd(), /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */
this,
wxFD_OPEN,
TRUE /* ne change pas de repertoire courant */
);
if( FullFileName.IsEmpty() )
break;
if( !wxFileExists( FullFileName ) )
......@@ -75,7 +74,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
}
Read_Config( FullFileName, TRUE );
}
break;
break;
case ID_PREFERENCES_CREATE_CONFIG_HOTKEYS:
FullFileName = ReturnHotkeyConfigFilePath( g_ConfigFileLocationChoice );
......@@ -93,12 +92,12 @@ 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 );
}
break;
break;
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
......@@ -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;
}
......@@ -138,16 +142,19 @@ bool Read_Config( const wxString& CfgFileName, bool ForceRereadConfig )
/***********************************************************************/
/* lit la configuration, si elle n'a pas deja ete lue
* 1 - lit <nom fichier root>.pro
* 2 - si non trouve lit <chemin des binaires>../template/kicad.pro
* 3 - si non trouve: init des variables aux valeurs par defaut
* 1 - lit <nom fichier root>.pro
* 2 - si non trouve lit <chemin des binaires>../template/kicad.pro
* 3 - si non trouve: init des variables aux valeurs par defaut
*
* Retourne TRUE si lu, FALSE si config non lue
* Retourne TRUE si lu, FALSE si config non lue
*/
{
wxString FullFileName;
bool IsRead = TRUE;
wxArrayString liblist_tmp = g_LibName_List;
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;
}
......@@ -198,17 +206,17 @@ void WinEDA_SchematicFrame::Save_Config( wxWindow* displayframe )
path = wxGetCwd();
FullFileName = EDA_FileSelector( _( "Save preferences" ),
path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */
displayframe,
wxFD_SAVE,
TRUE
);
path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */
displayframe,
wxFD_SAVE,
TRUE
);
if( FullFileName.IsEmpty() )
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"
......@@ -26,7 +24,7 @@
#include "protos.h"
// Global variables
wxString g_Main_Title( wxT( "EESchema" ) );
wxString g_Main_Title( wxT( "EESchema" ) );
/************************************/
/* Called to initialize the program */
......@@ -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
* or tool tips */
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" ),
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
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;
}
This diff is collapsed.
......@@ -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,
WinEDA_LibeditFrame::Process_Zoom )
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,
WinEDA_LibeditFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_PART_NUMBER,
WinEDA_LibeditFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_LIBEDIT_SELECT_ALIAS,
WinEDA_LibeditFrame::Process_Special_Functions )
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,
WinEDA_LibeditFrame::Process_Special_Functions )
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,
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,
WinEDA_LibeditFrame::Process_Special_Functions )
/* PopUp events and commands: */
EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
WinEDA_LibeditFrame::Process_Special_Functions )
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,
WinEDA_LibeditFrame::Process_Special_Functions )
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.
This diff is collapsed.
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;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -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,12 +75,12 @@ 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 );
}
break;
break;
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
......@@ -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" ) );
}
}
......@@ -103,15 +103,16 @@ bool Read_Config()
/*****************************************************/
/* lit la configuration, si elle n'a pas deja etee lue
* 1 - lit gerbview.cnf
* 2 - si non trouve lit <chemin de gerbview.exe>/gerbview.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut
* 1 - lit gerbview.cnf
* 2 - si non trouve lit <chemin de gerbview.exe>/gerbview.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut
*
* Retourne un pointeur su le message d'erreur a afficher
* Retourne un pointeur su le message d'erreur a afficher
*/
{
g_Prj_Config_Filename_ext = wxT( ".cnf" );
g_EDA_Appl->ReadProjectConfig( wxT( "gerbview" ), GROUP, ParamCfgList, FALSE );
wxGetApp().ReadProjectConfig( wxT( "gerbview" ), GROUP, ParamCfgList,
FALSE );
/* Inits autres variables */
if( ScreenPcb )
......@@ -132,14 +133,14 @@ void WinEDA_GerberFrame::Update_config()
/******************************************/
/*
* creation du fichier de config
* creation du fichier de config
*/
{
wxString FullFileName;
wxString mask( wxT( "*" ) ),
wxString mask( wxT( "*" ) );
g_Prj_Config_Filename_ext = wxT( ".cnf"; )
mask += g_Prj_Config_Filename_ext;
g_Prj_Config_Filename_ext = wxT( ".cnf" );
mask += g_Prj_Config_Filename_ext;
FullFileName = wxT( "gerbview" );
ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext );
......@@ -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 );
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment