|
|
|
@ -10,49 +10,49 @@ |
|
|
|
#include "bitmaps.h"
|
|
|
|
|
|
|
|
/* Menubar and toolbar event table */ |
|
|
|
BEGIN_EVENT_TABLE( WinEDA_MainFrame, EDA_BASE_FRAME ) |
|
|
|
BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME ) |
|
|
|
/* Window events */ |
|
|
|
EVT_SIZE( WinEDA_MainFrame::OnSize ) |
|
|
|
EVT_CLOSE( WinEDA_MainFrame::OnCloseWindow ) |
|
|
|
EVT_SIZE( KICAD_MANAGER_FRAME::OnSize ) |
|
|
|
EVT_CLOSE( KICAD_MANAGER_FRAME::OnCloseWindow ) |
|
|
|
|
|
|
|
/* Sash drag events */ |
|
|
|
EVT_SASH_DRAGGED( ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag ) |
|
|
|
EVT_SASH_DRAGGED( ID_LEFT_FRAME, KICAD_MANAGER_FRAME::OnSashDrag ) |
|
|
|
|
|
|
|
/* Toolbar events */ |
|
|
|
EVT_TOOL( ID_NEW_PROJECT, WinEDA_MainFrame::OnLoadProject ) |
|
|
|
EVT_TOOL( ID_LOAD_PROJECT, WinEDA_MainFrame::OnLoadProject ) |
|
|
|
EVT_TOOL( ID_SAVE_PROJECT, WinEDA_MainFrame::OnSaveProject ) |
|
|
|
EVT_TOOL( ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::OnArchiveFiles ) |
|
|
|
EVT_TOOL( ID_NEW_PROJECT, KICAD_MANAGER_FRAME::OnLoadProject ) |
|
|
|
EVT_TOOL( ID_LOAD_PROJECT, KICAD_MANAGER_FRAME::OnLoadProject ) |
|
|
|
EVT_TOOL( ID_SAVE_PROJECT, KICAD_MANAGER_FRAME::OnSaveProject ) |
|
|
|
EVT_TOOL( ID_SAVE_AND_ZIP_FILES, KICAD_MANAGER_FRAME::OnArchiveFiles ) |
|
|
|
|
|
|
|
/* Menu events */ |
|
|
|
EVT_MENU( ID_SAVE_PROJECT, WinEDA_MainFrame::OnSaveProject ) |
|
|
|
EVT_MENU( wxID_EXIT, WinEDA_MainFrame::OnExit ) |
|
|
|
EVT_MENU( ID_TO_EDITOR, WinEDA_MainFrame::OnOpenTextEditor ) |
|
|
|
EVT_MENU( ID_BROWSE_AN_SELECT_FILE, WinEDA_MainFrame::OnOpenFileInTextEditor ) |
|
|
|
EVT_MENU( ID_SAVE_PROJECT, KICAD_MANAGER_FRAME::OnSaveProject ) |
|
|
|
EVT_MENU( wxID_EXIT, KICAD_MANAGER_FRAME::OnExit ) |
|
|
|
EVT_MENU( ID_TO_EDITOR, KICAD_MANAGER_FRAME::OnOpenTextEditor ) |
|
|
|
EVT_MENU( ID_BROWSE_AN_SELECT_FILE, KICAD_MANAGER_FRAME::OnOpenFileInTextEditor ) |
|
|
|
EVT_MENU( ID_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor ) |
|
|
|
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, WinEDA_MainFrame::OnSelectDefaultPdfBrowser ) |
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, WinEDA_MainFrame::OnSelectPreferredPdfBrowser ) |
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME, WinEDA_MainFrame::OnSelectPreferredPdfBrowser ) |
|
|
|
EVT_MENU( ID_SAVE_AND_ZIP_FILES, WinEDA_MainFrame::OnArchiveFiles ) |
|
|
|
EVT_MENU( ID_READ_ZIP_ARCHIVE, WinEDA_MainFrame::OnUnarchiveFiles ) |
|
|
|
EVT_MENU( ID_PROJECT_TREE_REFRESH, WinEDA_MainFrame::OnRefresh ) |
|
|
|
EVT_MENU( ID_GENERAL_HELP, WinEDA_MainFrame::GetKicadHelp ) |
|
|
|
EVT_MENU( wxID_ABOUT, WinEDA_MainFrame::GetKicadAbout ) |
|
|
|
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser ) |
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser ) |
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser ) |
|
|
|
EVT_MENU( ID_SAVE_AND_ZIP_FILES, KICAD_MANAGER_FRAME::OnArchiveFiles ) |
|
|
|
EVT_MENU( ID_READ_ZIP_ARCHIVE, KICAD_MANAGER_FRAME::OnUnarchiveFiles ) |
|
|
|
EVT_MENU( ID_PROJECT_TREE_REFRESH, KICAD_MANAGER_FRAME::OnRefresh ) |
|
|
|
EVT_MENU( wxID_HELP, KICAD_MANAGER_FRAME::GetKicadHelp ) |
|
|
|
EVT_MENU( wxID_ABOUT, KICAD_MANAGER_FRAME::GetKicadAbout ) |
|
|
|
|
|
|
|
/* Range menu events */ |
|
|
|
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, WinEDA_MainFrame::SetLanguage ) |
|
|
|
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, KICAD_MANAGER_FRAME::SetLanguage ) |
|
|
|
|
|
|
|
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_MainFrame::OnFileHistory ) |
|
|
|
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, KICAD_MANAGER_FRAME::OnFileHistory ) |
|
|
|
|
|
|
|
/* Button events */ |
|
|
|
EVT_BUTTON( ID_TO_PCB, WinEDA_MainFrame::OnRunPcbNew ) |
|
|
|
EVT_BUTTON( ID_TO_CVPCB, WinEDA_MainFrame::OnRunCvpcb ) |
|
|
|
EVT_BUTTON( ID_TO_EESCHEMA, WinEDA_MainFrame::OnRunEeschema ) |
|
|
|
EVT_BUTTON( ID_TO_GERBVIEW, WinEDA_MainFrame::OnRunGerbview ) |
|
|
|
EVT_BUTTON( ID_TO_BITMAP_CONVERTER, WinEDA_MainFrame::OnRunBitmapConverter ) |
|
|
|
EVT_BUTTON( ID_TO_PCB, KICAD_MANAGER_FRAME::OnRunPcbNew ) |
|
|
|
EVT_BUTTON( ID_TO_CVPCB, KICAD_MANAGER_FRAME::OnRunCvpcb ) |
|
|
|
EVT_BUTTON( ID_TO_EESCHEMA, KICAD_MANAGER_FRAME::OnRunEeschema ) |
|
|
|
EVT_BUTTON( ID_TO_GERBVIEW, KICAD_MANAGER_FRAME::OnRunGerbview ) |
|
|
|
EVT_BUTTON( ID_TO_BITMAP_CONVERTER, KICAD_MANAGER_FRAME::OnRunBitmapConverter ) |
|
|
|
|
|
|
|
EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, WinEDA_MainFrame::OnUpdateDefaultPdfBrowser ) |
|
|
|
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER, WinEDA_MainFrame::OnUpdatePreferredPdfBrowser ) |
|
|
|
EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser ) |
|
|
|
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser ) |
|
|
|
|
|
|
|
END_EVENT_TABLE() |
|
|
|
|
|
|
|
@ -60,7 +60,7 @@ END_EVENT_TABLE() |
|
|
|
/**
|
|
|
|
* @brief (Re)Create the menubar |
|
|
|
*/ |
|
|
|
void WinEDA_MainFrame::ReCreateMenuBar() |
|
|
|
void KICAD_MANAGER_FRAME::ReCreateMenuBar() |
|
|
|
{ |
|
|
|
// Create and try to get the current menubar
|
|
|
|
wxMenuItem* item; |
|
|
|
@ -88,8 +88,14 @@ void WinEDA_MainFrame::ReCreateMenuBar() |
|
|
|
open_project_xpm ); |
|
|
|
|
|
|
|
// Open Recent submenu
|
|
|
|
wxMenu* openRecentMenu = new wxMenu(); |
|
|
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu ); |
|
|
|
static wxMenu* openRecentMenu; |
|
|
|
// Add this menu to list menu managed by m_fileHistory
|
|
|
|
// (the file history will be updated when adding/removing files in history
|
|
|
|
if( openRecentMenu ) |
|
|
|
wxGetApp().m_fileHistory.RemoveMenu( openRecentMenu ); |
|
|
|
openRecentMenu = new wxMenu(); |
|
|
|
wxGetApp().m_fileHistory.UseMenu( openRecentMenu ); |
|
|
|
wxGetApp().m_fileHistory.AddFilesToMenu( ); |
|
|
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu, |
|
|
|
wxID_ANY, |
|
|
|
_( "Open &Recent" ), |
|
|
|
@ -217,9 +223,9 @@ void WinEDA_MainFrame::ReCreateMenuBar() |
|
|
|
|
|
|
|
// Contents
|
|
|
|
ADD_MENUITEM_WITH_HELP( helpMenu, |
|
|
|
ID_GENERAL_HELP, |
|
|
|
wxID_HELP, |
|
|
|
_( "&Contents" ), |
|
|
|
_( "Open the kicad manual" ), |
|
|
|
_( "Open the Kicad handbook" ), |
|
|
|
online_help_xpm ); |
|
|
|
|
|
|
|
// Separator
|
|
|
|
@ -251,7 +257,7 @@ void WinEDA_MainFrame::ReCreateMenuBar() |
|
|
|
/**
|
|
|
|
* @brief (Re)Create the horizontal toolbar |
|
|
|
*/ |
|
|
|
void WinEDA_MainFrame::RecreateBaseHToolbar() |
|
|
|
void KICAD_MANAGER_FRAME::RecreateBaseHToolbar() |
|
|
|
{ |
|
|
|
// Check if toolbar is not already created
|
|
|
|
if( m_HToolBar != NULL ) |
|
|
|
|