2007-08-14 19:24:48 +00:00
|
|
|
|
/************************************************************/
|
|
|
|
|
/* appl_wxstruct.h: */
|
|
|
|
|
/* descriptions des principales classes derivees utilisees: */
|
|
|
|
|
/* Class "EDA_Appl: classe de l'application generale */
|
|
|
|
|
/************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Ce fichier doit etre inclus dans "wxstruct.h"
|
2007-08-14 19:24:48 +00:00
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#ifndef APPL_WXSTRUCT_H
|
|
|
|
|
#define APPL_WXSTRUCT_H
|
|
|
|
|
|
|
|
|
|
#ifndef eda_global
|
|
|
|
|
#define eda_global extern
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2007-08-14 19:24:48 +00:00
|
|
|
|
/**********************************************/
|
|
|
|
|
/* Class representing the entire Application */
|
|
|
|
|
/**********************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-14 19:24:48 +00:00
|
|
|
|
class WinEDA_App : public wxApp
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-14 19:24:48 +00:00
|
|
|
|
wxString m_Project;
|
|
|
|
|
wxSingleInstanceChecker* m_Checker;
|
|
|
|
|
|
2008-12-05 16:03:05 +00:00
|
|
|
|
wxPoint m_HelpPos;
|
|
|
|
|
wxSize m_HelpSize;
|
|
|
|
|
wxHtmlHelpController* m_HtmlCtrl;
|
|
|
|
|
wxConfig* m_EDA_Config; // Config courante (tailles et positions fenetres ...*/
|
|
|
|
|
wxConfig* m_EDA_CommonConfig; // common setup (language ...) */
|
|
|
|
|
wxString m_HelpFileName;
|
|
|
|
|
wxString m_CurrentOptionFile; // dernier fichier .cnf utilis<69>
|
|
|
|
|
wxString m_CurrentOptionFileDateAndTime;
|
|
|
|
|
|
|
|
|
|
wxString m_BinDir; /* Chemin ou reside l'executable
|
|
|
|
|
* (utilis<EFBFBD> si KICAD non d<EFBFBD>fini)*/
|
|
|
|
|
wxArrayString m_LastProject; /* liste des derniers projets charg<72>s */
|
|
|
|
|
unsigned int m_LastProjectMaxCount; /* Max histhory file length */
|
2008-12-08 15:27:13 +00:00
|
|
|
|
wxString m_KicadEnv; /* Chemin de kicad d<>fini dans la
|
|
|
|
|
* variable d'environnement KICAD,
|
|
|
|
|
* typiquement /usr/local/kicad ou
|
|
|
|
|
* c:\kicad */
|
2008-12-05 16:03:05 +00:00
|
|
|
|
bool m_Env_Defined; // TRUE si variable d'environnement KICAD definie
|
|
|
|
|
|
|
|
|
|
wxLocale* m_Locale; // Gestion de la localisation
|
|
|
|
|
int m_LanguageId; // indicateur de choix du langage ( 0 = defaut)
|
|
|
|
|
wxMenu* m_Language_Menu; // List menu for languages
|
|
|
|
|
wxString m_PdfBrowser; // Name of the selected browser, for browsing pdf datasheets
|
|
|
|
|
bool m_PdfBrowserIsDefault; // True if the pdf browser is the default (m_PdfBrowser not used)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
WinEDA_App();
|
|
|
|
|
~WinEDA_App();
|
|
|
|
|
bool OnInit();
|
|
|
|
|
int OnRun();
|
2007-08-14 19:24:48 +00:00
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
bool SetBinDir();
|
2007-08-14 19:24:48 +00:00
|
|
|
|
void InitEDA_Appl( const wxString& name );
|
|
|
|
|
bool SetLanguage( bool first_time = FALSE );
|
|
|
|
|
wxMenu* SetLanguageList( wxMenu* MasterMenu );
|
|
|
|
|
void SetLanguageIdentifier( int menu_id );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void InitOnLineHelp();
|
2007-08-14 19:24:48 +00:00
|
|
|
|
|
|
|
|
|
// Sauvegarde de configurations et options:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void GetSettings();
|
|
|
|
|
void SaveSettings();
|
2007-08-14 19:24:48 +00:00
|
|
|
|
void SetLastProject( const wxString& FullFileName );
|
|
|
|
|
void WriteProjectConfig( const wxString& local_config_filename,
|
2008-12-05 16:03:05 +00:00
|
|
|
|
const wxString& GroupName,
|
|
|
|
|
PARAM_CFG_BASE** List );
|
2007-08-14 19:24:48 +00:00
|
|
|
|
|
|
|
|
|
bool ReadProjectConfig( const wxString& local_config_filename,
|
|
|
|
|
const wxString& GroupName, PARAM_CFG_BASE** List,
|
|
|
|
|
bool Load_Only_if_New );
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void ReadPdfBrowserInfos();
|
|
|
|
|
void WritePdfBrowserInfos();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2008-12-05 16:03:05 +00:00
|
|
|
|
/*
|
|
|
|
|
* Use wxGetApp() to access WinEDA_App. It is not necessary to keep copies
|
|
|
|
|
* of the application pointer all over the place or worse yet in a global
|
|
|
|
|
* variable.
|
|
|
|
|
*/
|
|
|
|
|
DECLARE_APP(WinEDA_App);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#endif /* APPL_WXSTRUCT_H */
|