2008-11-02 22:53:38 +00:00
|
|
|
/**
|
2010-12-14 15:56:30 +00:00
|
|
|
* @file kicad/menubar.cpp
|
2010-02-14 14:59:43 +00:00
|
|
|
* @brief Project manager menubars and toolbars
|
2008-11-02 22:53:38 +00:00
|
|
|
*/
|
2007-05-28 18:09:49 +00:00
|
|
|
#include "fctsys.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2007-05-28 18:09:49 +00:00
|
|
|
#include "common.h"
|
|
|
|
#include "kicad.h"
|
|
|
|
#include "macros.h"
|
2010-02-14 14:59:43 +00:00
|
|
|
#include "bitmaps.h"
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Menubar and toolbar event table */
|
2008-12-08 15:27:13 +00:00
|
|
|
BEGIN_EVENT_TABLE( WinEDA_MainFrame, WinEDA_BasicFrame )
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Window events */
|
2008-12-08 15:27:13 +00:00
|
|
|
EVT_SIZE( WinEDA_MainFrame::OnSize )
|
|
|
|
EVT_CLOSE( WinEDA_MainFrame::OnCloseWindow )
|
2010-02-14 14:59:43 +00:00
|
|
|
|
|
|
|
/* Sash drag events */
|
2009-04-05 20:49:15 +00:00
|
|
|
EVT_SASH_DRAGGED( ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag )
|
2010-02-14 14:59:43 +00:00
|
|
|
|
|
|
|
/* Toolbar events */
|
2009-04-05 20:49:15 +00:00
|
|
|
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 )
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Menu events */
|
2009-04-05 20:49:15 +00:00
|
|
|
EVT_MENU( ID_SAVE_PROJECT, WinEDA_MainFrame::OnSaveProject )
|
2010-01-18 19:33:45 +00:00
|
|
|
EVT_MENU( wxID_EXIT, WinEDA_MainFrame::OnExit )
|
2009-04-05 20:49:15 +00:00
|
|
|
EVT_MENU( ID_TO_EDITOR, WinEDA_MainFrame::OnOpenTextEditor )
|
2008-12-08 15:27:13 +00:00
|
|
|
EVT_MENU( ID_BROWSE_AN_SELECT_FILE,
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_MainFrame::OnOpenFileInTextEditor )
|
2008-12-08 15:27:13 +00:00
|
|
|
EVT_MENU( ID_SELECT_PREFERED_EDITOR,
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_MainFrame::OnSelectPreferredEditor )
|
2008-12-08 15:27:13 +00:00
|
|
|
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER,
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_MainFrame::OnSelectDefaultPdfBrowser )
|
2008-12-08 15:27:13 +00:00
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER,
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_MainFrame::OnSelectPreferredPdfBrowser )
|
2008-12-08 15:27:13 +00:00
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
2009-04-05 20:49:15 +00:00
|
|
|
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( ID_KICAD_ABOUT, WinEDA_MainFrame::GetKicadAbout )
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Range menu events */
|
2009-04-05 20:49:15 +00:00
|
|
|
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
|
2008-12-08 15:27:13 +00:00
|
|
|
WinEDA_MainFrame::SetLanguage )
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_MainFrame::OnFileHistory )
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Button events */
|
2009-04-05 20:49:15 +00:00
|
|
|
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 )
|
2010-07-11 16:24:44 +00:00
|
|
|
EVT_BUTTON( ID_TO_BITMAP_CONVERTER, WinEDA_MainFrame::OnRunBitmapConverter )
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER,
|
|
|
|
WinEDA_MainFrame::OnUpdateDefaultPdfBrowser )
|
|
|
|
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER,
|
|
|
|
WinEDA_MainFrame::OnUpdatePreferredPdfBrowser )
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
END_EVENT_TABLE()
|
2007-05-28 18:09:49 +00:00
|
|
|
|
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
/**
|
2010-02-14 14:59:43 +00:00
|
|
|
* @brief (Re)Create the menubar
|
2008-11-02 22:53:38 +00:00
|
|
|
*/
|
|
|
|
void WinEDA_MainFrame::ReCreateMenuBar()
|
|
|
|
{
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenuItem *item;
|
|
|
|
wxMenuBar *menuBar = GetMenuBar();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
if( ! menuBar )
|
|
|
|
menuBar = new wxMenuBar();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Delete all existing menus so they can be rebuilt.
|
|
|
|
// This allows language changes of the menu text on the fly.
|
|
|
|
menuBar->Freeze();
|
|
|
|
while( menuBar->GetMenuCount() )
|
|
|
|
delete menuBar->Remove(0);
|
|
|
|
|
|
|
|
// Recreate all menus:
|
|
|
|
|
|
|
|
// Files menu
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* filesMenu = new wxMenu;
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Open */
|
2009-04-05 20:49:15 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Open an existing project" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( open_project_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Open Recent submenu */
|
|
|
|
wxMenu* openRecentMenu = new wxMenu();
|
|
|
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
|
|
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
|
|
|
-1, _( "Open &Recent" ),
|
|
|
|
_("Open a recent opened schematic project" ),
|
|
|
|
open_project_xpm );
|
|
|
|
|
|
|
|
/* New */
|
2009-04-05 20:49:15 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Start a new project" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( new_project_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Save */
|
2009-04-05 20:49:15 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT, _( "&Save\tCtrl+S" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Save current project" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( save_project_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Separator */
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->AppendSeparator();
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Archive */
|
2009-04-05 20:49:15 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_SAVE_AND_ZIP_FILES, _( "&Archive" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Archive project files in zip archive" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( zip_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Unarchive */
|
2009-04-05 20:49:15 +00:00
|
|
|
item = new wxMenuItem( filesMenu, ID_READ_ZIP_ARCHIVE, _( "&Unarchive" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Unarchive project files from zip file" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( unzip_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
/* Quit on all platforms except WXMAC */
|
|
|
|
#if !defined( __WXMAC__ )
|
|
|
|
|
|
|
|
filesMenu->AppendSeparator();
|
|
|
|
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
|
|
|
_( "Quit KiCad" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( exit_xpm );
|
|
|
|
filesMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Browse menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* browseMenu = new wxMenu();
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Text editor */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( browseMenu, ID_TO_EDITOR, _( "Text E&ditor" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Open preferred text editor" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( editor_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
browseMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Browse files */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( browseMenu, ID_BROWSE_AN_SELECT_FILE,
|
2010-02-14 14:59:43 +00:00
|
|
|
_( "&View File" ),
|
|
|
|
_( "View, read or edit file with a text editor" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( browse_files_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
browseMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Preferences menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* PreferencesMenu = new wxMenu;
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Text editor */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( PreferencesMenu, ID_SELECT_PREFERED_EDITOR,
|
|
|
|
_( "&Text Editor" ),
|
2010-08-24 17:26:51 +00:00
|
|
|
_( "Select your preferred text editor" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( editor_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
PreferencesMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/**
|
|
|
|
* PDF Viewer submenu
|
|
|
|
* System browser or user defined checkbox
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Default */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
|
|
|
ID_SELECT_DEFAULT_PDF_BROWSER,
|
2010-02-14 14:59:43 +00:00
|
|
|
_( "Default" ),
|
|
|
|
_( "Use system default PDF viewer used to browse datasheets" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
wxITEM_CHECK );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
SETBITMAPS( datasheet_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
SubMenuPdfBrowserChoice->Append( item );
|
|
|
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
|
|
|
|
wxGetApp().m_PdfBrowserIsDefault );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Favourite */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER,
|
2010-02-14 14:59:43 +00:00
|
|
|
_( "Favourite" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Use your favourite PDF viewer used to browse datasheets" ),
|
|
|
|
wxITEM_CHECK );
|
2010-05-09 02:04:44 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
SETBITMAPS( preference_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
SubMenuPdfBrowserChoice->Append( item );
|
|
|
|
SubMenuPdfBrowserChoice->AppendSeparator();
|
|
|
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
|
|
|
|
!wxGetApp().m_PdfBrowserIsDefault );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Append PDF Viewer submenu to preferences */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
2010-02-14 14:59:43 +00:00
|
|
|
_( "PDF Viewer" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Select your favourite PDF viewer used to browse datasheets" ) );
|
2010-05-09 02:04:44 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2009-01-17 20:31:19 +00:00
|
|
|
item->SetBitmap( datasheet_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
SubMenuPdfBrowserChoice->Append( item );
|
|
|
|
|
|
|
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( PreferencesMenu,
|
|
|
|
SubMenuPdfBrowserChoice,
|
2010-02-14 14:59:43 +00:00
|
|
|
-1, _( "PDF Viewer" ),
|
|
|
|
_( "PDF viewer preferences" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
datasheet_xpm );
|
|
|
|
|
|
|
|
PreferencesMenu->AppendSeparator();
|
2009-01-18 10:15:10 +00:00
|
|
|
wxGetApp().AddMenuLanguageList( PreferencesMenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Help menu
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* helpMenu = new wxMenu;
|
|
|
|
|
2010-08-24 17:26:51 +00:00
|
|
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Contents */
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
|
|
|
|
_( "Open the kicad manual" ) );
|
2010-08-24 17:26:51 +00:00
|
|
|
|
2010-05-09 02:04:44 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2010-04-20 11:23:59 +00:00
|
|
|
item->SetBitmap( online_help_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
helpMenu->Append( item );
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* About on all platforms except WXMAC */
|
2010-01-18 19:33:45 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
|
|
|
|
|
|
|
helpMenu->AppendSeparator();
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
|
|
|
_( "About kicad project manager" ) );
|
|
|
|
item->SetBitmap( info_xpm );
|
|
|
|
helpMenu->Append( item );
|
|
|
|
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif /* !defined( __WXMAC__ ) */
|
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/**
|
|
|
|
* Create the menubar and append all submenus
|
|
|
|
*/
|
2009-01-17 20:31:19 +00:00
|
|
|
menuBar->Append( filesMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( browseMenu, _( "&Browse" ) );
|
|
|
|
menuBar->Append( PreferencesMenu, _( "&Preferences" ) );
|
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
menuBar->Thaw();
|
|
|
|
|
|
|
|
// Associate the menu bar with the frame, if no previous menubar
|
|
|
|
if( GetMenuBar() == NULL )
|
|
|
|
SetMenuBar( menuBar );
|
|
|
|
else
|
|
|
|
menuBar->Refresh();
|
2007-05-28 18:09:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
/**
|
2010-02-14 14:59:43 +00:00
|
|
|
* @brief (Re)Create the horizontal toolbar
|
2008-11-02 22:53:38 +00:00
|
|
|
*/
|
2007-09-13 11:55:46 +00:00
|
|
|
void WinEDA_MainFrame::RecreateBaseHToolbar()
|
2007-05-28 18:09:49 +00:00
|
|
|
{
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Check if toolbar is not already created */
|
2008-12-08 15:27:13 +00:00
|
|
|
if( m_HToolBar != NULL )
|
|
|
|
return;
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Allocate memory for m_HToolBar */
|
2008-12-08 15:27:13 +00:00
|
|
|
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
2010-02-08 18:15:42 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* New */
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
|
|
|
|
wxBitmap( new_project_xpm ),
|
2009-04-05 20:49:15 +00:00
|
|
|
_( "Start a new project" ) );
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Load */
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
|
|
|
|
wxBitmap( open_project_xpm ),
|
2009-04-05 20:49:15 +00:00
|
|
|
_( "Load existing project" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Save */
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
|
|
|
|
wxBitmap( save_project_xpm ),
|
2009-04-05 20:49:15 +00:00
|
|
|
_( "Save current project" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Separator */
|
2008-12-08 15:27:13 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Archive */
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
|
|
|
|
wxBitmap( zip_xpm ),
|
2010-02-14 14:59:43 +00:00
|
|
|
_( "Archive all project files" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Separator */
|
2008-12-08 15:27:13 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Refresh project tree */
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
|
|
|
|
wxBitmap( reload_xpm ),
|
2009-04-05 20:49:15 +00:00
|
|
|
_( "Refresh project tree" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Create m_HToolBar */
|
|
|
|
m_HToolBar->Realize();
|
2008-11-02 22:53:38 +00:00
|
|
|
}
|