2007-09-13 11:55:46 +00:00
|
|
|
/***********/
|
|
|
|
/* kicad.h */
|
|
|
|
/***********/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#ifndef KICAD_H
|
|
|
|
#define KICAD_H
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
#include <vector>
|
2009-04-05 20:49:15 +00:00
|
|
|
|
|
|
|
#include <wx/treectrl.h>
|
2007-05-28 18:09:49 +00:00
|
|
|
#include <wx/dragimag.h>
|
2009-04-05 20:49:15 +00:00
|
|
|
#include <wx/filename.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "id.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "wxstruct.h"
|
2009-04-05 20:49:15 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
class RIGHT_KM_FRAME;
|
2010-02-19 15:01:32 +00:00
|
|
|
class TREEPROJECTFILES;
|
|
|
|
class TREE_PROJECT_FRAME;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
/**
|
|
|
|
* Command IDs for Kicad.
|
|
|
|
*
|
2009-11-12 15:43:38 +00:00
|
|
|
* Please add IDs that are unique to Kicad here and not in the global id.h
|
2009-09-22 12:27:57 +00:00
|
|
|
* file. This will prevent the entire project from being rebuilt when adding
|
|
|
|
* new commands to Kicad.
|
|
|
|
*/
|
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
enum id_kicad_frm {
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LEFT_FRAME = ID_END_LIST,
|
|
|
|
ID_PROJECT_TREE,
|
|
|
|
ID_PROJECT_TXTEDIT,
|
|
|
|
ID_PROJECT_TREE_REFRESH,
|
|
|
|
ID_PROJECT_NEWDIR,
|
|
|
|
ID_PROJECT_DELETE,
|
|
|
|
ID_PROJECT_RENAME,
|
|
|
|
ID_PROJECT_OPEN_FILE_WITH_TEXT_EDITOR,
|
|
|
|
|
|
|
|
ID_TO_EDITOR,
|
|
|
|
ID_TO_EESCHEMA,
|
|
|
|
ID_TO_GERBVIEW,
|
|
|
|
ID_BROWSE_AN_SELECT_FILE,
|
|
|
|
ID_SELECT_PREFERED_EDITOR,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER,
|
|
|
|
ID_SELECT_DEFAULT_PDF_BROWSER,
|
|
|
|
ID_SAVE_AND_ZIP_FILES,
|
|
|
|
ID_READ_ZIP_ARCHIVE,
|
|
|
|
};
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
/* class WinEDA_MainFrame
|
|
|
|
* This is the main kicad frame
|
|
|
|
*/
|
2007-09-13 11:55:46 +00:00
|
|
|
class WinEDA_MainFrame : public WinEDA_BasicFrame
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-02-19 15:01:32 +00:00
|
|
|
TREE_PROJECT_FRAME* m_LeftWin;
|
2009-11-18 20:12:11 +00:00
|
|
|
RIGHT_KM_FRAME* m_RightWin;
|
|
|
|
WinEDA_Toolbar* m_VToolBar; // Vertical toolbar (not used)
|
|
|
|
wxString m_BoardFileName;
|
|
|
|
wxString m_SchematicRootFileName;
|
|
|
|
wxFileName m_ProjectFileName;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
private:
|
|
|
|
int m_LeftWin_Width;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
public:
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
WinEDA_MainFrame( wxWindow* parent, const wxString& title,
|
2007-10-31 17:47:44 +00:00
|
|
|
const wxPoint& pos, const wxSize& size );
|
2007-09-13 11:55:46 +00:00
|
|
|
|
|
|
|
~WinEDA_MainFrame();
|
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
/** Function CreateCommandToolbar
|
|
|
|
* Create the main buttons (fast launch buttons)
|
|
|
|
*/
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void OnSize( wxSizeEvent& event );
|
|
|
|
void OnSashDrag( wxSashEvent& event );
|
|
|
|
void OnLoadProject( wxCommandEvent& event );
|
|
|
|
void OnSaveProject( wxCommandEvent& event );
|
|
|
|
void OnArchiveFiles( wxCommandEvent& event );
|
|
|
|
void OnUnarchiveFiles( wxCommandEvent& event );
|
|
|
|
void OnRunPcbNew( wxCommandEvent& event );
|
|
|
|
void OnRunCvpcb( wxCommandEvent& event );
|
|
|
|
void OnRunEeschema( wxCommandEvent& event );
|
|
|
|
void OnRunGerbview( wxCommandEvent& event );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
void OnOpenTextEditor( wxCommandEvent& event );
|
|
|
|
void OnOpenFileInTextEditor( wxCommandEvent& event );
|
|
|
|
void OnOpenFileInEditor( wxCommandEvent& event );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
void OnFileHistory( wxCommandEvent& event );
|
|
|
|
void OnExit( wxCommandEvent& event );
|
|
|
|
void Process_Preferences( wxCommandEvent& event );
|
|
|
|
void ReCreateMenuBar();
|
|
|
|
void RecreateBaseHToolbar();
|
|
|
|
void PrintMsg( const wxString& text );
|
|
|
|
void ClearMsg();
|
|
|
|
void SetLanguage( wxCommandEvent& event );
|
|
|
|
void OnRefresh( wxCommandEvent& event );
|
|
|
|
void OnSelectDefaultPdfBrowser( wxCommandEvent& event );
|
|
|
|
void OnSelectPreferredPdfBrowser( wxCommandEvent& event );
|
|
|
|
void OnSelectPreferredEditor( wxCommandEvent& event );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
void OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
void CreateNewProject( const wxString PrjFullFileName );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
void LoadSettings();
|
|
|
|
void SaveSettings();
|
2007-09-13 11:55:46 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
// Order of this enum changes AddFile() internal working
|
|
|
|
// please update both
|
|
|
|
enum TreeFileType {
|
2007-09-13 11:55:46 +00:00
|
|
|
TREE_PROJECT = 1,
|
|
|
|
TREE_SCHEMA,
|
|
|
|
TREE_PCB,
|
|
|
|
TREE_GERBER,
|
|
|
|
TREE_PDF,
|
|
|
|
TREE_TXT,
|
|
|
|
TREE_NET,
|
|
|
|
TREE_UNKNOWN,
|
|
|
|
TREE_DIRECTORY,
|
|
|
|
TREE_MAX,
|
2007-05-28 18:09:49 +00:00
|
|
|
};
|
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
/** class RIGHT_KM_FRAME
|
2007-10-31 17:47:44 +00:00
|
|
|
*/
|
2009-11-18 20:12:11 +00:00
|
|
|
class RIGHT_KM_FRAME : public wxSashLayoutWindow
|
2007-10-31 17:47:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-11-18 20:12:11 +00:00
|
|
|
wxTextCtrl* m_DialogWin;
|
|
|
|
private:
|
|
|
|
WinEDA_MainFrame* m_Parent;
|
|
|
|
int m_ButtonsPanelHeight;
|
|
|
|
wxPanel* m_ButtPanel;
|
|
|
|
wxPoint m_ButtonLastPosition; /* position of the last button in the window */
|
|
|
|
int m_ButtonSeparation; /* button distance in pixels */
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
public:
|
2009-11-18 20:12:11 +00:00
|
|
|
RIGHT_KM_FRAME( WinEDA_MainFrame* parent );
|
|
|
|
~RIGHT_KM_FRAME() { };
|
|
|
|
void OnSize( wxSizeEvent& event );
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
private:
|
2009-11-18 20:12:11 +00:00
|
|
|
void CreateCommandToolbar( void );
|
|
|
|
void AddFastLaunch( wxBitmapButton* button );
|
2007-10-31 17:47:44 +00:00
|
|
|
|
2009-11-18 20:12:11 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2007-10-31 17:47:44 +00:00
|
|
|
};
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|