appl_wxstruct.h 3.67 KB
Newer Older
1 2 3 4 5
/************************************************************/
/*						appl_wxstruct.h:					*/
/* descriptions des principales classes derivees utilisees: */
/*    Class "EDA_Appl: classe de l'application generale		*/
/************************************************************/
6 7

/* Ce fichier doit etre inclus dans "wxstruct.h"
8
 */
9 10 11 12 13 14 15 16 17

#ifndef  APPL_WXSTRUCT_H
#define  APPL_WXSTRUCT_H

#ifndef eda_global
#define eda_global extern
#endif


18 19 20
/**********************************************/
/*  Class representing the entire Application */
/**********************************************/
21

22
class WinEDA_App : public wxApp
23 24
{
public:
25 26 27 28 29 30
    wxString                 m_Project;
    wxSingleInstanceChecker* m_Checker;
    WinEDA_MainFrame*        m_MainFrame;
    WinEDA_PcbFrame*         m_PcbFrame;
    WinEDA_ModuleEditFrame*  m_ModuleEditFrame;
    WinEDA_GerberFrame*      m_GerberFrame;
31 32 33
    WinEDA_SchematicFrame*   m_SchematicFrame;    // Edition des Schemas
    WinEDA_LibeditFrame*     m_LibeditFrame;      // Edition des composants
    WinEDA_ViewlibFrame*     m_ViewlibFrame;      // Visualisation des composants
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    WinEDA_CvpcbFrame*       m_CvpcbFrame;

    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
    wxString              m_CurrentOptionFileDateAndTime;

    wxString              m_BinDir; /* Chemin ou reside l'executable
                                     *  (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 */
    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)
59 60

public:
61 62 63 64
    WinEDA_App();
    ~WinEDA_App();
    bool    OnInit();
    int     OnRun();
65

66
    bool    SetBinDir();
67 68 69 70
    void    InitEDA_Appl( const wxString& name );
    bool    SetLanguage( bool first_time = FALSE );
    wxMenu* SetLanguageList( wxMenu* MasterMenu );
    void    SetLanguageIdentifier( int menu_id );
71
    void    InitOnLineHelp();
72 73

    // Sauvegarde de configurations et options:
74 75
    void    GetSettings();
    void    SaveSettings();
76 77 78 79 80 81 82 83
    void    SetLastProject( const wxString& FullFileName );
    void    WriteProjectConfig( const wxString& local_config_filename,
                                const wxString& GroupName, PARAM_CFG_BASE** List );

    bool    ReadProjectConfig( const wxString& local_config_filename,
                               const wxString& GroupName, PARAM_CFG_BASE** List,
                               bool Load_Only_if_New );

84 85
    void    ReadPdfBrowserInfos();
    void    WritePdfBrowserInfos();
86 87 88 89
};


#endif  /* APPL_WXSTRUCT_H */