KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cvpcb_actions.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) 2017 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * Copyright (C) 2023 CERN
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include "tool/tool_action.h"
23#include <bitmaps.h>
24
25#include <cvpcb_mainframe.h>
26#include <listboxes.h>
27#include <tools/cvpcb_actions.h>
28
29// Actions, being statically-defined, require specialized I18N handling. We continue to
30// use the _() macro so that string harvesting by the I18N framework doesn't have to be
31// specialized, but we don't translate on initialization and instead do it in the getters.
32
33#undef _
34#define _(s) s
35
36
37// No description, it is not supposed to be shown anywhere
39 .Name( "cvpcb.Control" )
40 .Scope( AS_GLOBAL )
41 .Flags( AF_ACTIVATE ) );
42
43
44// Action to show the footprint viewer window
46 .Name( "cvpcb.Control.ShowFootprintViewer" )
47 .Scope( AS_GLOBAL )
48 .FriendlyName( _( "View Selected Footprint" ) )
49 .Icon( BITMAPS::show_footprint ) );
50
51
52// Actions to handle management tasks
54 .Name( "cvpcb.Control.ShowEquFileTable" )
55 .Scope( AS_GLOBAL )
56 .FriendlyName( _( "Manage Footprint Association Files..." ) )
57 .Tooltip( _( "Edit the footprint association files list. These files are used to "
58 "automatically assign footprints based on symbol values." ) ) );
59
61 .Name( "cvpcb.Control.SaveAssociationsToSchematic" )
62 .Scope( AS_GLOBAL )
63 .DefaultHotkey( MD_CTRL + 'S' )
64 .LegacyHotkeyName( "Save" )
65 .FriendlyName( _( "Save to Schematic" ) )
66 .Tooltip( _( "Save footprint assignments in 'footprint' fields of schematic symbols" ) )
67 .Icon( BITMAPS::save ) );
68
70 .Name( "cvpcb.Control.SaveAssociationsToFile" )
71 .Scope( AS_GLOBAL )
72 .DefaultHotkey( MD_CTRL + 'S' )
73 .LegacyHotkeyName( "Save" )
74 .FriendlyName( _( "Save to Schematic and File" ) )
75 .Tooltip( _( "Save footprint assignments in 'footprint' fields of schematic symbols and "
76 "then save schematic files" ) )
77 .Icon( BITMAPS::save ) );
78
79// Actions to navigate the display
81 .Name( "cvpcb.Control.changeFocusRight" )
82 .Scope( AS_GLOBAL )
83 .DefaultHotkey( WXK_TAB )
84 .Flags( AF_NONE )
86
88 .Name( "cvpcb.Control.changeFocusLeft" )
89 .Scope( AS_GLOBAL )
90 .DefaultHotkey( MD_SHIFT + static_cast<int>( WXK_TAB ) )
91 .Flags( AF_NONE )
93
94// Actions to navigate the component list
96 .Name( "cvpcb.Control.GotoNextNA" )
97 .Scope( AS_GLOBAL )
98 .FriendlyName( _( "Select Next Unassigned Symbol" ) )
99 .Tooltip( _( "Select next symbol with no footprint assignment" ) )
100 .Icon( BITMAPS::right )
101 .Flags( AF_NONE )
102 .Parameter( CVPCB_MAINFRAME::ITEM_NEXT ) );
103
105 .Name( "cvpcb.Control.GotoPreviousNA" )
106 .Scope( AS_GLOBAL )
107 .FriendlyName( _( "Select Previous Unassigned Symbol" ) )
108 .Tooltip( _( "Select previous symbol with no footprint assignment" ) )
109 .Icon( BITMAPS::left )
110 .Flags( AF_NONE )
111 .Parameter( CVPCB_MAINFRAME::ITEM_PREV ) );
112
113
114// Actions to modify component associations
116 .Name( "cvpcb.Association.Associate" )
117 .Scope( AS_GLOBAL )
118 .DefaultHotkey( WXK_RETURN )
119 .FriendlyName( _( "Assign Footprint" ) )
120 .Icon( BITMAPS::auto_associate ) );
121
123 .Name( "cvpcb.Association.AutoAssociate" )
124 .Scope( AS_GLOBAL )
125 .FriendlyName( _( "Automatically Assign Footprints" ) )
126 .Tooltip( _( "Assign footprints automatically using a footprint association file" ) )
127 .Icon( BITMAPS::auto_associate ) );
128
130 .Name( "cvpcb.Association.Delete" )
131 .Scope( AS_GLOBAL )
132 .DefaultHotkey( WXK_DELETE )
133 .FriendlyName( _( "Delete Footprint Assignment" ) )
135
137 .Name( "cvpcb.Association.DeleteAll" )
138 .Scope( AS_GLOBAL )
139 .FriendlyName( _( "Delete All Footprint Assignments" ) )
141
142// Actions to filter the footprint list
144 .Name( "cvpcb.Control.FilterFPbyFPFilters" )
145 .Scope( AS_GLOBAL )
146 .FriendlyName( _( "Use symbol footprint filters" ) )
147 .Tooltip( _( "Filter footprint list by footprint filters defined in the symbol" ) )
149 .ToolbarState( TOOLBAR_STATE::TOGGLE )
150 .Flags( AF_NONE )
152
154 .Name( "cvpcb.Control.FilterFPByPin" )
155 .Scope( AS_GLOBAL )
156 .FriendlyName( _( "Filter by pin count" ) )
157 .Tooltip( _( "Filter footprint list by pin count" ) )
159 .ToolbarState( TOOLBAR_STATE::TOGGLE )
160 .Flags( AF_NONE )
162
164 .Name( "cvpcb.Control.FilterFPbyLibrary" )
165 .Scope( AS_GLOBAL )
166 .FriendlyName( _( "Filter by library" ) )
167 .Tooltip( _( "Filter footprint list by library" ) )
169 .ToolbarState( TOOLBAR_STATE::TOGGLE )
170 .Flags( AF_NONE )
@ module_library_list
@ module_filtered_list
@ show_footprint
@ auto_associate
@ module_pin_filtered_list
@ delete_association
static TOOL_ACTION deleteAll
Definition: cvpcb_actions.h:62
static TOOL_ACTION showEquFileTable
Definition: cvpcb_actions.h:57
static TOOL_ACTION gotoPreviousNA
Navigate the component tree.
Definition: cvpcb_actions.h:51
static TOOL_ACTION changeFocusLeft
Definition: cvpcb_actions.h:45
static TOOL_ACTION gotoNextNA
Definition: cvpcb_actions.h:52
static TOOL_ACTION saveAssociationsToFile
Definition: cvpcb_actions.h:56
static TOOL_ACTION FilterFPbyLibrary
Definition: cvpcb_actions.h:68
static TOOL_ACTION filterFPbyPin
Definition: cvpcb_actions.h:67
static TOOL_ACTION deleteAssoc
Definition: cvpcb_actions.h:63
static TOOL_ACTION associate
Definition: cvpcb_actions.h:61
static TOOL_ACTION changeFocusRight
Window control actions.
Definition: cvpcb_actions.h:44
static TOOL_ACTION autoAssociate
Footprint Association actions.
Definition: cvpcb_actions.h:60
static TOOL_ACTION controlActivate
Activation actions.
Definition: cvpcb_actions.h:41
static TOOL_ACTION FilterFPbyFPFilters
Footprint Filtering actions.
Definition: cvpcb_actions.h:66
static TOOL_ACTION saveAssociationsToSchematic
Management actions.
Definition: cvpcb_actions.h:55
static TOOL_ACTION showFootprintViewer
Open the footprint viewer.
Definition: cvpcb_actions.h:48
@ ITEM_NEXT
The next item.
@ ITEM_PREV
The previous item.
@ FILTERING_BY_COMPONENT_FP_FILTERS
Definition: listboxes.h:101
Build up the properties of a TOOL_ACTION in an incremental manner that is static-construction safe.
Definition: tool_action.h:118
Represent a single user action.
Definition: tool_action.h:304
#define _(s)
@ TOGGLE
Action is a toggle button on the toolbar.
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:49
@ AF_ACTIVATE
Action activates a tool.
Definition: tool_action.h:56
@ AF_NONE
Definition: tool_action.h:55
@ MD_CTRL
Definition: tool_event.h:144
@ MD_SHIFT
Definition: tool_event.h:143