2011-12-16 20:12:49 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
2019-06-16 18:35:32 +00:00
|
|
|
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-12-16 20:12:49 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2016-03-11 16:40:24 +00:00
|
|
|
#include <pgm_base.h>
|
2019-06-10 22:17:45 +00:00
|
|
|
#include <bitmaps.h>
|
|
|
|
#include <tool/conditional_menu.h>
|
2019-06-02 18:58:09 +00:00
|
|
|
#include <tool/actions.h>
|
2019-06-10 22:17:45 +00:00
|
|
|
#include <tool/tool_manager.h>
|
|
|
|
#include <tool/common_control.h>
|
2016-03-11 16:40:24 +00:00
|
|
|
#include "cvpcb_id.h"
|
|
|
|
#include "cvpcb_mainframe.h"
|
2019-06-16 18:35:32 +00:00
|
|
|
#include <menus_helpers.h>
|
2012-02-01 19:49:37 +00:00
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void CVPCB_MAINFRAME::ReCreateMenuBar()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2019-06-10 22:17:45 +00:00
|
|
|
COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
|
2018-04-07 13:13:38 +00:00
|
|
|
// wxWidgets handles the Mac Application menu behind the scenes, but that means
|
|
|
|
// we always have to start from scratch with a new wxMenuBar.
|
|
|
|
wxMenuBar* oldMenuBar = GetMenuBar();
|
|
|
|
wxMenuBar* menuBar = new wxMenuBar();
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
//-- File menu -----------------------------------------------------------
|
|
|
|
//
|
|
|
|
CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, tool );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
2019-06-16 18:35:32 +00:00
|
|
|
fileMenu->AddItem( ID_SAVE_PROJECT,
|
2019-06-10 22:17:45 +00:00
|
|
|
_( "&Save Schematic\tCtrl+S" ),
|
|
|
|
_( "Save footprint associations in schematic symbol footprint fields" ),
|
|
|
|
save_xpm, SELECTION_CONDITIONS::ShowAlways );
|
2019-06-16 18:35:32 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
fileMenu->Resolve();
|
2009-04-21 17:56:27 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
//-- Preferences menu -----------------------------------------------
|
|
|
|
//
|
|
|
|
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, tool );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
prefsMenu->AddItem( ACTIONS::configurePaths, SELECTION_CONDITIONS::ShowAlways );
|
|
|
|
prefsMenu->AddItem( ACTIONS::showFootprintLibTable, SELECTION_CONDITIONS::ShowAlways );
|
|
|
|
prefsMenu->AddItem( wxID_PREFERENCES,
|
|
|
|
_( "Preferences...\tCTRL+," ),
|
|
|
|
_( "Show preferences for all open tools" ),
|
|
|
|
preference_xpm, SELECTION_CONDITIONS::ShowAlways );
|
2011-04-06 13:52:47 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
prefsMenu->AddSeparator();
|
2019-06-16 18:35:32 +00:00
|
|
|
prefsMenu->AddItem( ID_CVPCB_EQUFILES_LIST_EDIT,
|
2019-06-10 22:17:45 +00:00
|
|
|
_( "Footprint &Association Files..." ),
|
|
|
|
_( "Configure footprint association file (.equ) list. These files are "
|
|
|
|
"used to automatically assign footprint names from symbol values." ),
|
|
|
|
library_table_xpm, SELECTION_CONDITIONS::ShowAlways );
|
2015-03-29 21:22:53 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
prefsMenu->AddSeparator();
|
2019-06-16 18:35:32 +00:00
|
|
|
AddMenuLanguageList( prefsMenu, tool );
|
2018-05-01 20:46:05 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
prefsMenu->Resolve();
|
2015-01-11 17:22:45 +00:00
|
|
|
|
2019-06-10 22:17:45 +00:00
|
|
|
//-- Menubar -------------------------------------------------------------
|
|
|
|
//
|
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
|
|
|
menuBar->Append( prefsMenu, _( "&Preferences" ) );
|
2019-05-18 10:27:36 +00:00
|
|
|
AddStandardHelpMenu( menuBar );
|
2009-04-21 17:56:27 +00:00
|
|
|
|
2018-04-07 13:13:38 +00:00
|
|
|
SetMenuBar( menuBar );
|
|
|
|
delete oldMenuBar;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|