2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
|
|
|
* Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
/**
|
2010-12-14 15:56:30 +00:00
|
|
|
* @file kicad/menubar.cpp
|
2011-04-06 13:52:47 +00:00
|
|
|
* @brief (Re)Create the project manager menubar for KiCad
|
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 "kicad.h"
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2010-02-14 14:59:43 +00:00
|
|
|
/* Menubar and toolbar event table */
|
2011-04-17 13:54:17 +00:00
|
|
|
BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
|
2011-04-13 19:30:27 +00:00
|
|
|
/* Window events */
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_SIZE( KICAD_MANAGER_FRAME::OnSize )
|
|
|
|
EVT_CLOSE( KICAD_MANAGER_FRAME::OnCloseWindow )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
|
|
|
/* Sash drag events */
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_SASH_DRAGGED( ID_LEFT_FRAME, KICAD_MANAGER_FRAME::OnSashDrag )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
|
|
|
/* Toolbar events */
|
2011-04-17 13:54:17 +00:00
|
|
|
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 )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
|
|
|
/* Menu events */
|
2011-04-17 13:54:17 +00:00
|
|
|
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 )
|
2011-04-13 19:30:27 +00:00
|
|
|
EVT_MENU( ID_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor )
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser )
|
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
|
2011-10-18 19:59:19 +00:00
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
|
|
|
KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
|
2011-04-17 13:54:17 +00:00
|
|
|
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 )
|
2011-08-04 18:03:26 +00:00
|
|
|
EVT_MENU( wxID_INDEX, KICAD_MANAGER_FRAME::GetKicadHelp )
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU( wxID_ABOUT, KICAD_MANAGER_FRAME::GetKicadAbout )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
|
|
|
/* Range menu events */
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, KICAD_MANAGER_FRAME::SetLanguage )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, KICAD_MANAGER_FRAME::OnFileHistory )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
|
|
|
/* Button events */
|
2011-04-17 13:54:17 +00:00
|
|
|
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 )
|
2011-08-05 19:53:42 +00:00
|
|
|
EVT_BUTTON( ID_TO_PCB_CALCULATOR, KICAD_MANAGER_FRAME::OnRunPcbCalculator )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser )
|
2011-10-18 19:59:19 +00:00
|
|
|
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER,
|
|
|
|
KICAD_MANAGER_FRAME::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
|
|
|
*/
|
2011-04-17 13:54:17 +00:00
|
|
|
void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
2008-11-02 22:53:38 +00:00
|
|
|
{
|
2011-04-06 13:52:47 +00:00
|
|
|
// Create and try to get the current menubar
|
2011-03-13 18:03:43 +00:00
|
|
|
wxMenuItem* item;
|
|
|
|
wxMenuBar* menuBar = GetMenuBar();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-03-13 18:03:43 +00:00
|
|
|
if( !menuBar )
|
2010-12-17 20:34:29 +00:00
|
|
|
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();
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
while( menuBar->GetMenuCount() )
|
2011-03-13 18:03:43 +00:00
|
|
|
delete menuBar->Remove( 0 );
|
2010-12-17 20:34:29 +00:00
|
|
|
|
|
|
|
// Recreate all menus:
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu File:
|
|
|
|
wxMenu* fileMenu = new wxMenu;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Open
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
ID_LOAD_PROJECT,
|
|
|
|
_( "&Open\tCtrl+O" ),
|
|
|
|
_( "Open an existing project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( open_project_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Open Recent submenu
|
2011-04-17 13:54:17 +00:00
|
|
|
static wxMenu* openRecentMenu;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
// 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 );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
openRecentMenu = new wxMenu();
|
|
|
|
wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
|
|
|
|
wxGetApp().m_fileHistory.AddFilesToMenu( );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu, openRecentMenu,
|
|
|
|
wxID_ANY,
|
|
|
|
_( "Open &Recent" ),
|
|
|
|
_( "Open a recent opened schematic project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( open_project_xpm ) );
|
2010-02-14 14:59:43 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// New
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu, ID_NEW_PROJECT,
|
|
|
|
_( "&New\tCtrl+N" ),
|
|
|
|
_( "Start a new project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( new_project_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
ID_SAVE_PROJECT,
|
|
|
|
_( "&Save\tCtrl+S" ),
|
|
|
|
_( "Save current project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( save_project_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Archive
|
2011-04-06 13:52:47 +00:00
|
|
|
fileMenu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
ID_SAVE_AND_ZIP_FILES,
|
|
|
|
_( "&Archive" ),
|
|
|
|
_( "Archive project files in zip archive" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( zip_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Unarchive
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
ID_READ_ZIP_ARCHIVE,
|
|
|
|
_( "&Unarchive" ),
|
|
|
|
_( "Unarchive project files from zip file" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( unzip_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
|
|
|
fileMenu->AppendSeparator();
|
2011-04-04 18:05:55 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Quit
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
wxID_EXIT,
|
|
|
|
_( "&Quit" ),
|
|
|
|
_( "Quit KiCad" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( exit_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Browse:
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* browseMenu = new wxMenu();
|
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Text editor
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( browseMenu,
|
|
|
|
ID_TO_EDITOR,
|
|
|
|
_( "Text E&ditor" ),
|
|
|
|
_( "Launch preferred text editor" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( editor_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-04 18:05:55 +00:00
|
|
|
// View file
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( browseMenu,
|
|
|
|
ID_BROWSE_AN_SELECT_FILE,
|
|
|
|
_( "&View File" ),
|
|
|
|
_( "View, read or edit file with a text editor" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( browse_files_xpm ) );
|
2010-02-14 14:59:43 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Preferences:
|
|
|
|
wxMenu* preferencesMenu = new wxMenu;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Text editor
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
|
|
|
ID_SELECT_PREFERED_EDITOR,
|
|
|
|
_( "&Text Editor" ),
|
|
|
|
_( "Select your preferred text editor" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( editor_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// PDF Viewer submenu:System browser or user defined checkbox
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Default
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
|
|
|
ID_SELECT_DEFAULT_PDF_BROWSER,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Default" ),
|
2010-02-14 14:59:43 +00:00
|
|
|
_( "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
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
SETBITMAPS( datasheet_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
SubMenuPdfBrowserChoice->Append( item );
|
|
|
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
|
|
|
|
wxGetApp().m_PdfBrowserIsDefault );
|
|
|
|
|
2011-04-04 18:05:55 +00:00
|
|
|
// Favourite
|
2009-01-17 20:31:19 +00:00
|
|
|
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Favourite" ),
|
2009-01-17 20:31:19 +00:00
|
|
|
_( "Use your favourite PDF viewer used to browse datasheets" ),
|
|
|
|
wxITEM_CHECK );
|
2011-04-04 18:05:55 +00:00
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
SETBITMAPS( preference_xpm );
|
2010-05-09 02:04:44 +00:00
|
|
|
|
2009-01-17 20:31:19 +00:00
|
|
|
SubMenuPdfBrowserChoice->Append( item );
|
|
|
|
SubMenuPdfBrowserChoice->AppendSeparator();
|
|
|
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
|
|
|
|
!wxGetApp().m_PdfBrowserIsDefault );
|
|
|
|
|
2010-12-18 16:09:06 +00:00
|
|
|
// Append PDF Viewer submenu to preferences
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( SubMenuPdfBrowserChoice,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&PDF Viewer" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "Select your favourite PDF viewer used to browse datasheets" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( datasheet_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// PDF viewer submenu
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
|
|
|
SubMenuPdfBrowserChoice, -1,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&PDF Viewer" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "PDF viewer preferences" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( datasheet_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Language submenu
|
|
|
|
preferencesMenu->AppendSeparator();
|
|
|
|
wxGetApp().AddMenuLanguageList( preferencesMenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Help:
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* helpMenu = new wxMenu;
|
2011-04-13 19:30:27 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Version info
|
2010-08-24 17:26:51 +00:00
|
|
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
|
|
|
|
2011-04-04 18:05:55 +00:00
|
|
|
// Contents
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( helpMenu,
|
|
|
|
wxID_HELP,
|
|
|
|
_( "&Contents" ),
|
2011-09-30 18:15:37 +00:00
|
|
|
_( "Open the KiCad handbook" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( online_help_xpm ) );
|
|
|
|
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( helpMenu,
|
|
|
|
wxID_INDEX,
|
|
|
|
_( "&Getting Started in KiCad" ),
|
|
|
|
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( help_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2010-01-18 19:33:45 +00:00
|
|
|
helpMenu->AppendSeparator();
|
2011-04-06 13:52:47 +00:00
|
|
|
|
|
|
|
// About
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( helpMenu,
|
|
|
|
wxID_ABOUT,
|
|
|
|
_( "&About KiCad" ),
|
2011-09-30 18:15:37 +00:00
|
|
|
_( "About KiCad project manager" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( info_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Create the menubar and append all submenus
|
2011-04-06 13:52:47 +00:00
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
menuBar->Append( browseMenu, _( "&Browse" ) );
|
2011-04-06 13:52:47 +00:00
|
|
|
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
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
|
|
|
*/
|
2011-04-17 13:54:17 +00:00
|
|
|
void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
|
2007-05-28 18:09:49 +00:00
|
|
|
{
|
2011-04-06 13:52:47 +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
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Allocate memory for m_HToolBar
|
2011-04-13 19:30:27 +00:00
|
|
|
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
2010-02-08 18:15:42 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// New
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( new_project_xpm ),
|
2011-04-13 19:30:27 +00:00
|
|
|
_( "Start a new project" ) );
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Load
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( open_project_xpm ),
|
2011-04-13 19:30:27 +00:00
|
|
|
_( "Load existing project" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( save_project_xpm ),
|
2011-04-13 19:30:27 +00:00
|
|
|
_( "Save current project" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2008-12-08 15:27:13 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Archive
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( zip_xpm ),
|
2011-04-13 19:30:27 +00:00
|
|
|
_( "Archive all project files" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2008-12-08 15:27:13 +00:00
|
|
|
m_HToolBar->AddSeparator();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Refresh project tree
|
2009-05-21 17:42:42 +00:00
|
|
|
m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
|
2011-08-28 20:02:27 +00:00
|
|
|
KiBitmap( reload_xpm ),
|
2011-04-13 19:30:27 +00:00
|
|
|
_( "Refresh project tree" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Create m_HToolBar
|
2010-02-14 14:59:43 +00:00
|
|
|
m_HToolBar->Realize();
|
2008-11-02 22:53:38 +00:00
|
|
|
}
|