KiCad PCB EDA Suite
cvpcb/menubar.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #include <common_help_msg.h>
31 #include <kiface_i.h>
32 #include <menus_helpers.h>
33 #include <pgm_base.h>
34 
35 #include "cvpcb.h"
36 #include "cvpcb_id.h"
37 #include "cvpcb_mainframe.h"
38 
39 
44 {
45  // wxWidgets handles the Mac Application menu behind the scenes, but that means
46  // we always have to start from scratch with a new wxMenuBar.
47  wxMenuBar* oldMenuBar = GetMenuBar();
48  wxMenuBar* menuBar = new wxMenuBar();
49 
50  // Recreate all menus:
51 
52  // Menu File:
53  wxMenu* filesMenu = new wxMenu;
54 
55  // Save the footprints back into eeschema
56  AddMenuItem( filesMenu, wxID_SAVE,
57  _( "&Save Schematic\tCtrl+S" ),
59  KiBitmap( save_xpm ) );
60 
61  // Preferences Menu :
62  wxMenu* preferencesMenu = new wxMenu;
63 
64  // Path configuration edit dialog.
65  AddMenuItem( preferencesMenu,
67  _( "&Configure Paths..." ),
68  _( "Edit path configuration environment variables" ),
69  KiBitmap( editor_xpm ) );
70 
71  AddMenuItem( preferencesMenu, ID_CVPCB_LIB_TABLE_EDIT,
72  _( "Manage &Footprint Libraries..." ), _( "Manage footprint libraries" ),
73  KiBitmap( library_table_xpm ) );
74 
75  preferencesMenu->AppendSeparator();
76  AddMenuItem( preferencesMenu, ID_CVPCB_EQUFILES_LIST_EDIT,
77  _( "Footprint &Association Files..." ),
78  _( "Configure footprint association file (.equ) list."
79  "These files are used to automatically assign "
80  "the footprint name from the symbol value" ),
81  KiBitmap( library_table_xpm ) );
82  preferencesMenu->AppendSeparator();
83 
84  // Language submenu
85  Pgm().AddMenuLanguageList( preferencesMenu );
86 
87  // Menu Help:
88  wxMenu* helpMenu = new wxMenu;
89 
90  // Manual Contents
91  AddMenuItem( helpMenu, wxID_HELP, _( "CvPcb &Manual" ),
92  _( "Open CvPcb Manual" ),
93  KiBitmap( online_help_xpm ) );
94 
95  AddMenuItem( helpMenu,
96  wxID_INDEX,
97  _( "&Getting Started in KiCad" ),
98  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
99  KiBitmap( help_xpm ) );
100 
101  // About CvPcb
102  AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
103 
104  // Create the menubar and append all submenus
105  menuBar->Append( filesMenu, _( "&File" ) );
106  menuBar->Append( preferencesMenu, _( "&Preferences" ) );
107  menuBar->Append( helpMenu, _( "&Help" ) );
108 
109  SetMenuBar( menuBar );
110  delete oldMenuBar;
111 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:223
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#define SAVE_HLP_MSG
virtual void ReCreateMenuBar() override
(Re)Create the menubar for the CvPcb mainframe
see class PGM_BASE
VTBL_ENTRY void AddMenuLanguageList(wxMenu *MasterMenu)
Function AddMenuLanguageList creates a menu list for language choice, and add it as submenu to Master...
Definition: pgm_base.cpp:800