KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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,
[email protected]
5
* Copyright The KiCad Developers, see AUTHORS.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
25
#include <
bitmaps.h
>
26
#include <
tool/actions.h
>
27
#include <
tool/common_control.h
>
28
#include <
tool/conditional_menu.h
>
29
#include <
tool/tool_manager.h
>
30
31
#include <
cvpcb_mainframe.h
>
32
#include <
tools/cvpcb_actions.h
>
33
#include <
widgets/wx_menubar.h
>
34
35
36
void
CVPCB_MAINFRAME::doReCreateMenuBar
()
37
{
38
COMMON_CONTROL
* tool =
m_toolManager
->GetTool<
COMMON_CONTROL
>();
39
40
// wxWidgets handles the Mac Application menu behind the scenes, but that means
41
// we always have to start from scratch with a new wxMenuBar.
42
wxMenuBar* oldMenuBar = GetMenuBar();
43
WX_MENUBAR
* menuBar =
new
WX_MENUBAR
();
44
45
//-- File menu -----------------------------------------------------------
46
//
47
ACTION_MENU
* fileMenu =
new
ACTION_MENU
(
false
, tool );
48
49
fileMenu->
Add
(
CVPCB_ACTIONS::saveAssociationsToSchematic
);
50
fileMenu->AppendSeparator();
51
fileMenu->
AddClose
(
_
(
"Assign Footprints"
) );
52
53
//-- Edit menu -----------------------------------------------------------
54
//
55
ACTION_MENU
* editMenu =
new
ACTION_MENU
(
false
, tool );
56
57
editMenu->
Add
(
ACTIONS::undo
);
58
editMenu->
Add
(
ACTIONS::redo
);
59
60
editMenu->AppendSeparator();
61
editMenu->
Add
(
ACTIONS::cut
);
62
editMenu->
Add
(
ACTIONS::copy
);
63
editMenu->
Add
(
ACTIONS::paste
);
64
65
//-- Preferences menu ----------------------------------------------------
66
//
67
ACTION_MENU
* prefsMenu =
new
ACTION_MENU
(
false
, tool );
68
69
prefsMenu->
Add
(
ACTIONS::configurePaths
);
70
prefsMenu->
Add
(
ACTIONS::showFootprintLibTable
);
71
prefsMenu->
Add
(
CVPCB_ACTIONS::showEquFileTable
);
72
prefsMenu->
Add
(
ACTIONS::openPreferences
);
73
74
prefsMenu->AppendSeparator();
75
AddMenuLanguageList
( prefsMenu, tool );
76
77
//-- Menubar -------------------------------------------------------------
78
//
79
menuBar->Append( fileMenu,
_
(
"&File"
) );
80
menuBar->Append( editMenu,
_
(
"&Edit"
) );
81
menuBar->Append( prefsMenu,
_
(
"&Preferences"
) );
82
AddStandardHelpMenu
( menuBar );
83
84
SetMenuBar( menuBar );
85
delete
oldMenuBar;
86
}
actions.h
bitmaps.h
ACTIONS::paste
static TOOL_ACTION paste
Definition
actions.h:80
ACTIONS::copy
static TOOL_ACTION copy
Definition
actions.h:78
ACTIONS::openPreferences
static TOOL_ACTION openPreferences
Definition
actions.h:281
ACTIONS::showFootprintLibTable
static TOOL_ACTION showFootprintLibTable
Definition
actions.h:284
ACTIONS::undo
static TOOL_ACTION undo
Definition
actions.h:75
ACTIONS::redo
static TOOL_ACTION redo
Definition
actions.h:76
ACTIONS::cut
static TOOL_ACTION cut
Definition
actions.h:77
ACTIONS::configurePaths
static TOOL_ACTION configurePaths
Definition
actions.h:282
ACTION_MENU
Define the structure of a menu based on ACTIONs.
Definition
action_menu.h:47
ACTION_MENU::AddClose
void AddClose(const wxString &aAppname="")
Add a standard close item to the menu with the accelerator key CTRL-W.
Definition
action_menu.cpp:220
ACTION_MENU::Add
wxMenuItem * Add(const wxString &aLabel, int aId, BITMAPS aIcon)
Add a wxWidgets-style entry to the menu.
Definition
action_menu.cpp:152
COMMON_CONTROL
Handle actions that are shared between different applications.
Definition
common_control.h:36
CVPCB_ACTIONS::showEquFileTable
static TOOL_ACTION showEquFileTable
Definition
cvpcb_actions.h:57
CVPCB_ACTIONS::saveAssociationsToSchematic
static TOOL_ACTION saveAssociationsToSchematic
Management actions.
Definition
cvpcb_actions.h:55
CVPCB_MAINFRAME::doReCreateMenuBar
void doReCreateMenuBar() override
Definition
cvpcb/menubar.cpp:36
EDA_BASE_FRAME::AddMenuLanguageList
void AddMenuLanguageList(ACTION_MENU *aMasterMenu, TOOL_INTERACTIVE *aControlTool)
Create a menu list for language choice, and add it as submenu to MasterMenu.
Definition
eda_base_frame.cpp:1785
EDA_BASE_FRAME::AddStandardHelpMenu
void AddStandardHelpMenu(wxMenuBar *aMenuBar)
Add the standard KiCad help menu to the menubar.
Definition
eda_base_frame.cpp:645
TOOLS_HOLDER::m_toolManager
TOOL_MANAGER * m_toolManager
Definition
tools_holder.h:171
WX_MENUBAR
Wrapper around a wxMenuBar object that prevents the accelerator table from being used.
Definition
wx_menubar.h:47
common_control.h
conditional_menu.h
cvpcb_actions.h
cvpcb_mainframe.h
_
#define _(s)
Definition
eda_3d_actions.cpp:36
tool_manager.h
wx_menubar.h
src
cvpcb
menubar.cpp
Generated on Sun Sep 21 2025 01:05:22 for KiCad PCB EDA Suite by
1.13.2