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
|
|
|
|
2010-05-29 18:34:18 +00:00
|
|
|
extern const wxString g_KicadPrjFilenameExtension;
|
|
|
|
|
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
|
|
|
/**
|
2011-09-30 18:15:37 +00:00
|
|
|
* Command IDs for KiCad.
|
2009-09-22 12:27:57 +00:00
|
|
|
*
|
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
|
2011-09-30 18:15:37 +00:00
|
|
|
* new commands to KiCad.
|
2009-09-22 12:27:57 +00:00
|
|
|
*/
|
|
|
|
|
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,
|
2010-07-11 16:24:44 +00:00
|
|
|
ID_TO_BITMAP_CONVERTER,
|
2011-08-05 19:53:42 +00:00
|
|
|
ID_TO_PCB_CALCULATOR,
|
2009-09-22 12:27:57 +00:00
|
|
|
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,
|
2010-10-04 12:58:07 +00:00
|
|
|
ID_READ_ZIP_ARCHIVE
|
2009-09-22 12:27:57 +00:00
|
|
|
};
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
/* class KICAD_MANAGER_FRAME
|
2011-09-30 18:15:37 +00:00
|
|
|
* This is the main KiCad frame
|
2007-10-31 17:47:44 +00:00
|
|
|
*/
|
2011-04-17 13:54:17 +00:00
|
|
|
class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-02-19 15:01:32 +00:00
|
|
|
TREE_PROJECT_FRAME* m_LeftWin;
|
2010-07-11 16:24:44 +00:00
|
|
|
RIGHT_KM_FRAME* m_RightWin;
|
2011-12-16 13:32:23 +00:00
|
|
|
wxAuiToolBar* m_VToolBar; // Vertical toolbar (not used)
|
2010-07-11 16:24:44 +00:00
|
|
|
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
|
|
|
|
2011-09-09 19:30:59 +00:00
|
|
|
public: KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title,
|
|
|
|
const wxPoint& pos, const wxSize& size );
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
~KICAD_MANAGER_FRAME();
|
2007-09-13 11:55:46 +00:00
|
|
|
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void OnSize( wxSizeEvent& event );
|
|
|
|
void OnSashDrag( wxSashEvent& event );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnLoadProject
|
|
|
|
* loads an exiting or creates a new project (.pro) file.
|
|
|
|
*/
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnLoadProject( wxCommandEvent& event );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnSaveProject
|
|
|
|
* is the command event hendler to Save the project (.pro) file containing the top level
|
|
|
|
* configuration parameters.
|
|
|
|
*/
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnSaveProject( wxCommandEvent& event );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
2010-07-11 16:24:44 +00:00
|
|
|
void OnArchiveFiles( wxCommandEvent& event );
|
|
|
|
void OnUnarchiveFiles( wxCommandEvent& event );
|
|
|
|
void OnRunPcbNew( wxCommandEvent& event );
|
|
|
|
void OnRunCvpcb( wxCommandEvent& event );
|
|
|
|
void OnRunEeschema( wxCommandEvent& event );
|
|
|
|
void OnRunGerbview( wxCommandEvent& event );
|
|
|
|
void OnRunBitmapConverter( wxCommandEvent& event );
|
2011-08-05 19:53:42 +00:00
|
|
|
void OnRunPcbCalculator( wxCommandEvent& event );
|
2010-07-11 16:24:44 +00:00
|
|
|
|
|
|
|
void OnOpenTextEditor( wxCommandEvent& event );
|
|
|
|
void OnOpenFileInTextEditor( wxCommandEvent& event );
|
|
|
|
void OnOpenFileInEditor( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void OnFileHistory( wxCommandEvent& event );
|
|
|
|
void OnExit( wxCommandEvent& event );
|
|
|
|
void Process_Preferences( wxCommandEvent& event );
|
|
|
|
void ReCreateMenuBar();
|
|
|
|
void RecreateBaseHToolbar();
|
2011-08-19 15:08:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function PrintMsg
|
|
|
|
* displays \a aText in the text panel.
|
|
|
|
*
|
|
|
|
* @param aText The text to display.
|
|
|
|
*/
|
|
|
|
void PrintMsg( const wxString& aText );
|
|
|
|
|
2010-07-11 16:24:44 +00:00
|
|
|
void ClearMsg();
|
|
|
|
void SetLanguage( wxCommandEvent& event );
|
|
|
|
void OnRefresh( wxCommandEvent& event );
|
|
|
|
void OnSelectDefaultPdfBrowser( wxCommandEvent& event );
|
|
|
|
void OnSelectPreferredPdfBrowser( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event );
|
|
|
|
|
|
|
|
void CreateNewProject( const wxString PrjFullFileName );
|
|
|
|
|
2011-08-19 15:08:41 +00:00
|
|
|
/**
|
|
|
|
* Function LoadSettings
|
2011-09-30 18:15:37 +00:00
|
|
|
* loads the KiCad main frame specific configuration settings.
|
2011-08-19 15:08:41 +00:00
|
|
|
*
|
|
|
|
* Don't forget to call this base method from any derived classes or the
|
|
|
|
* settings will not get loaded.
|
|
|
|
*/
|
2010-07-11 16:24:44 +00:00
|
|
|
void LoadSettings();
|
2011-08-19 15:08:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SaveSettings
|
2011-09-30 18:15:37 +00:00
|
|
|
* saves the KiCad main frame specific configuration settings.
|
2011-08-19 15:08:41 +00:00
|
|
|
*
|
|
|
|
* Don't forget to call this base method from any derived classes or the
|
|
|
|
* settings will not get saved.
|
|
|
|
*/
|
2010-07-11 16:24:44 +00:00
|
|
|
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,
|
2010-10-04 12:58:07 +00:00
|
|
|
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:
|
2011-09-09 19:30:59 +00:00
|
|
|
wxTextCtrl* m_MessagesBox;
|
2009-11-18 20:12:11 +00:00
|
|
|
private:
|
2011-09-30 18:15:37 +00:00
|
|
|
KICAD_MANAGER_FRAME* m_Parent; // a wxTextCtrl to displays messages frm KiCad
|
2009-11-18 20:12:11 +00:00
|
|
|
int m_ButtonsPanelHeight;
|
2011-09-09 19:30:59 +00:00
|
|
|
wxPanel* m_ButtPanel;
|
|
|
|
int m_ButtonSeparation; // button distance in pixels
|
|
|
|
wxPoint m_ButtonsListPosition; /* position of the left bottom corner
|
|
|
|
* of the first bitmap button
|
|
|
|
*/
|
|
|
|
wxPoint m_ButtonLastPosition; // position of the last button in the window
|
|
|
|
int m_bitmapButtons_maxHeigth; // height of bigger bitmap buttons
|
|
|
|
// Used to calculate the height of the panel.
|
|
|
|
|
|
|
|
public: RIGHT_KM_FRAME( KICAD_MANAGER_FRAME* parent );
|
2009-11-18 20:12:11 +00:00
|
|
|
~RIGHT_KM_FRAME() { };
|
2011-09-09 19:30:59 +00:00
|
|
|
void OnSize( wxSizeEvent& event );
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2007-10-31 17:47:44 +00:00
|
|
|
private:
|
2011-09-09 19:30:59 +00:00
|
|
|
|
2011-08-19 15:08:41 +00:00
|
|
|
/**
|
|
|
|
* Function CreateCommandToolbar
|
|
|
|
* creates the main tool bar buttons (fast launch buttons)
|
|
|
|
*/
|
2011-09-09 19:30:59 +00:00
|
|
|
void CreateCommandToolbar( void );
|
2011-08-19 15:08:41 +00:00
|
|
|
|
2011-09-09 19:30:59 +00:00
|
|
|
wxBitmapButton* AddBitmapButton( wxWindowID aId, const wxBitmap& aBitmap );
|
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
|