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, see <https://www.gnu.org/licenses/>.
19
*/
20
21
#include <
bitmaps.h
>
22
#include <
tool/actions.h
>
23
#include <
tool/common_control.h
>
24
#include <
tool/conditional_menu.h
>
25
#include <
tool/tool_manager.h
>
26
27
#include <
cvpcb_mainframe.h
>
28
#include <
tools/cvpcb_actions.h
>
29
#include <
widgets/wx_menubar.h
>
30
31
32
void
CVPCB_MAINFRAME::doReCreateMenuBar
()
33
{
34
COMMON_CONTROL
* tool =
m_toolManager
->GetTool<
COMMON_CONTROL
>();
35
36
// wxWidgets handles the Mac Application menu behind the scenes, but that means
37
// we always have to start from scratch with a new wxMenuBar.
38
wxMenuBar* oldMenuBar = GetMenuBar();
39
WX_MENUBAR
* menuBar =
new
WX_MENUBAR
();
40
41
//-- File menu -----------------------------------------------------------
42
//
43
ACTION_MENU
* fileMenu =
new
ACTION_MENU
(
false
, tool );
44
45
fileMenu->
Add
(
CVPCB_ACTIONS::saveAssociationsToSchematic
);
46
fileMenu->AppendSeparator();
47
fileMenu->
AddClose
(
_
(
"Assign Footprints"
) );
48
49
//-- Edit menu -----------------------------------------------------------
50
//
51
ACTION_MENU
* editMenu =
new
ACTION_MENU
(
false
, tool );
52
53
editMenu->
Add
(
ACTIONS::undo
);
54
editMenu->
Add
(
ACTIONS::redo
);
55
56
editMenu->AppendSeparator();
57
editMenu->
Add
(
ACTIONS::cut
);
58
editMenu->
Add
(
ACTIONS::copy
);
59
editMenu->
Add
(
ACTIONS::paste
);
60
61
//-- Preferences menu ----------------------------------------------------
62
//
63
ACTION_MENU
* prefsMenu =
new
ACTION_MENU
(
false
, tool );
64
65
prefsMenu->
Add
(
ACTIONS::configurePaths
);
66
prefsMenu->
Add
(
ACTIONS::showFootprintLibTable
);
67
prefsMenu->
Add
(
CVPCB_ACTIONS::showEquFileTable
);
68
prefsMenu->
Add
(
ACTIONS::openPreferences
);
69
70
prefsMenu->AppendSeparator();
71
AddMenuLanguageList
( prefsMenu, tool );
72
73
//-- Menubar -------------------------------------------------------------
74
//
75
menuBar->Append( fileMenu,
_
(
"&File"
) );
76
menuBar->Append( editMenu,
_
(
"&Edit"
) );
77
menuBar->Append( prefsMenu,
_
(
"&Preferences"
) );
78
AddStandardHelpMenu
( menuBar );
79
80
SetMenuBar( menuBar );
81
delete
oldMenuBar;
82
}
actions.h
bitmaps.h
ACTIONS::paste
static TOOL_ACTION paste
Definition
actions.h:76
ACTIONS::copy
static TOOL_ACTION copy
Definition
actions.h:74
ACTIONS::openPreferences
static TOOL_ACTION openPreferences
Definition
actions.h:276
ACTIONS::showFootprintLibTable
static TOOL_ACTION showFootprintLibTable
Definition
actions.h:279
ACTIONS::undo
static TOOL_ACTION undo
Definition
actions.h:71
ACTIONS::redo
static TOOL_ACTION redo
Definition
actions.h:72
ACTIONS::cut
static TOOL_ACTION cut
Definition
actions.h:73
ACTIONS::configurePaths
static TOOL_ACTION configurePaths
Definition
actions.h:277
ACTION_MENU
Define the structure of a menu based on ACTIONs.
Definition
action_menu.h:43
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:216
ACTION_MENU::Add
wxMenuItem * Add(const wxString &aLabel, int aId, BITMAPS aIcon)
Add a wxWidgets-style entry to the menu.
Definition
action_menu.cpp:148
COMMON_CONTROL
Handle actions that are shared between different applications.
Definition
common_control.h:32
CVPCB_ACTIONS::showEquFileTable
static TOOL_ACTION showEquFileTable
Definition
cvpcb_actions.h:53
CVPCB_ACTIONS::saveAssociationsToSchematic
static TOOL_ACTION saveAssociationsToSchematic
Management actions.
Definition
cvpcb_actions.h:51
CVPCB_MAINFRAME::doReCreateMenuBar
void doReCreateMenuBar() override
Definition
cvpcb/menubar.cpp:32
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:1997
EDA_BASE_FRAME::AddStandardHelpMenu
void AddStandardHelpMenu(wxMenuBar *aMenuBar)
Add the standard KiCad help menu to the menubar.
Definition
eda_base_frame.cpp:839
TOOLS_HOLDER::m_toolManager
TOOL_MANAGER * m_toolManager
Definition
tools_holder.h:167
WX_MENUBAR
Wrapper around a wxMenuBar object that prevents the accelerator table from being used.
Definition
wx_menubar.h:43
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 Fri Jun 26 2026 00:05:33 for KiCad PCB EDA Suite by
1.13.2