KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pl_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) 2019 CERN
5 * Copyright (C) 2019 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 <tool/tool_action.h>
26#include <bitmaps.h>
27#include <eda_item.h>
29
30#include "tools/pl_actions.h"
31
32// Actions, being statically-defined, require specialized I18N handling. We continue to
33// use the _() macro so that string harvesting by the I18N framework doesn't have to be
34// specialized, but we don't translate on initialization and instead do it in the getters.
35
36#undef _
37#define _(s) s
38
39
40// PL_DRAWING_TOOLS
41//
42TOOL_ACTION PL_ACTIONS::drawLine( "plEditor.InteractiveDrawing.drawLine",
43 AS_GLOBAL, 0, "",
44 _( "Add Line" ), _( "Add a line" ),
46
47TOOL_ACTION PL_ACTIONS::drawRectangle( "plEditor.InteractiveDrawing.drawRectangle",
48 AS_GLOBAL, 0, "",
49 _( "Add Rectangle" ), _( "Add a rectangle" ),
51
52TOOL_ACTION PL_ACTIONS::placeText( "plEditor.InteractiveDrawing.placeText",
53 AS_GLOBAL, 0, "",
54 _( "Add Text" ), _( "Add a text item" ),
56
57TOOL_ACTION PL_ACTIONS::placeImage( "plEditor.InteractiveDrawing.placeImage",
58 AS_GLOBAL, 0, "",
59 _( "Add Bitmap" ), _( "Add a bitmap image" ),
61
62
63// PL_EDIT_TOOL
64//
65TOOL_ACTION PL_ACTIONS::move( "plEditor.InteractiveMove.move",
67 'M', LEGACY_HK_NAME( "Move Item" ),
68 _( "Move" ), _( "Moves the selected item(s)" ),
70
71TOOL_ACTION PL_ACTIONS::appendImportedDrawingSheet( "plEditor.InteractiveEdit.appendWorksheet",
72 AS_GLOBAL, 0, "",
73 _( "Append Existing Drawing Sheet..." ),
74 _( "Append an existing drawing sheet file to current file" ),
76
77
78// PL_EDITOR_CONTROL
79//
80TOOL_ACTION PL_ACTIONS::showInspector( "plEditor.EditorControl.ShowInspector",
81 AS_GLOBAL, 0, "",
82 _( "Show Design Inspector" ), _( "Show the list of items in the drawing sheet" ),
84
85TOOL_ACTION PL_ACTIONS::previewSettings( "plEditor.EditorControl.PreviewSettings",
86 AS_GLOBAL, 0, "",
87 _( "Page Preview Settings..." ), _( "Edit preview data for page size and title block" ),
89
90TOOL_ACTION PL_ACTIONS::layoutNormalMode( "plEditor.EditorControl.LayoutNormalMode",
91 AS_GLOBAL, 0, "",
92 _( "Show title block in preview mode" ),
93 _( "Show title block in preview mode:\n"
94 "text placeholders will be replaced with preview data." ),
96
97TOOL_ACTION PL_ACTIONS::layoutEditMode( "plEditor.EditorControl.LayoutEditMode",
98 AS_GLOBAL, 0, "",
99 _( "Show title block in edit mode" ),
100 _( "Show title block in edit mode:\n"
101 "text placeholders are shown as ${keyword} tokens." ),
103
104
105// PL_SELECTION_TOOL
106//
107TOOL_ACTION PL_ACTIONS::selectionActivate( "plEditor.InteractiveSelection",
108 AS_GLOBAL, 0, "", "", "", // No description, not shown anywhere
110
111TOOL_ACTION PL_ACTIONS::selectionMenu( "plEditor.InteractiveSelection.SelectionMenu",
112 AS_GLOBAL );
113
114TOOL_ACTION PL_ACTIONS::addItemToSel( "plEditor.InteractiveSelection.AddItemToSel",
115 AS_GLOBAL );
116
117TOOL_ACTION PL_ACTIONS::addItemsToSel( "plEditor.InteractiveSelection.AddItemsToSel",
118 AS_GLOBAL );
119
120TOOL_ACTION PL_ACTIONS::removeItemFromSel( "plEditor.InteractiveSelection.RemoveItemFromSel",
121 AS_GLOBAL );
122
123TOOL_ACTION PL_ACTIONS::removeItemsFromSel( "plEditor.InteractiveSelection.RemoveItemsFromSel",
124 AS_GLOBAL );
125
126TOOL_ACTION PL_ACTIONS::clearSelection( "plEditor.InteractiveSelection.ClearSelection",
127 AS_GLOBAL );
128
129
#define LEGACY_HK_NAME(x)
Definition: actions.h:32
@ pagelayout_normal_view_mode
@ add_rectangle
@ pagelayout_special_view_mode
@ add_graphical_segments
@ INVALID_BITMAP
static TOOL_ACTION clearSelection
Clear the current selection.
Definition: pl_actions.h:43
static TOOL_ACTION placeImage
Definition: pl_actions.h:59
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Definition: pl_actions.h:40
static TOOL_ACTION selectionMenu
Run a selection menu to select from a list of items.
Definition: pl_actions.h:54
static TOOL_ACTION drawRectangle
Definition: pl_actions.h:60
static TOOL_ACTION showInspector
Definition: pl_actions.h:72
static TOOL_ACTION previewSettings
Definition: pl_actions.h:73
static TOOL_ACTION removeItemFromSel
Definition: pl_actions.h:47
static TOOL_ACTION layoutNormalMode
Definition: pl_actions.h:67
static TOOL_ACTION addItemsToSel
Select a list of items (specified as the event parameter)
Definition: pl_actions.h:50
static TOOL_ACTION removeItemsFromSel
Definition: pl_actions.h:51
static TOOL_ACTION addItemToSel
Select an item (specified as the event parameter).
Definition: pl_actions.h:46
static TOOL_ACTION placeText
Definition: pl_actions.h:58
static TOOL_ACTION layoutEditMode
Definition: pl_actions.h:68
static TOOL_ACTION appendImportedDrawingSheet
Definition: pl_actions.h:62
static TOOL_ACTION move
Definition: pl_actions.h:65
static TOOL_ACTION drawLine
Definition: pl_actions.h:61
Represent a single user action.
Definition: tool_action.h:68
#define _(s)
Definition: pl_actions.cpp:37
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:45
@ AF_ACTIVATE
Action activates a tool.
Definition: tool_action.h:52