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-2023 CERN
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 <tool/tool_action.h>
22#include <bitmaps.h>
23#include <eda_item.h>
25
26#include "tools/pl_actions.h"
27
28// Actions, being statically-defined, require specialized I18N handling. We continue to
29// use the _() macro so that string harvesting by the I18N framework doesn't have to be
30// specialized, but we don't translate on initialization and instead do it in the getters.
31
32#undef _
33#define _(s) s
34
35// clang-format off
36
37
38// PL_DRAWING_TOOLS
39//
41 .Name( "plEditor.InteractiveDrawing.drawLine" )
42 .Scope( AS_GLOBAL )
43 .FriendlyName( _( "Draw Lines" ) )
44 .ToolbarState( TOOLBAR_STATE::TOGGLE )
46 .Flags( AF_ACTIVATE )
47 .Parameter( DS_DATA_ITEM::DS_SEGMENT ) );
48
50 .Name( "plEditor.InteractiveDrawing.drawRectangle" )
51 .Scope( AS_GLOBAL )
52 .FriendlyName( _( "Draw Rectangles" ) )
53 .ToolbarState( TOOLBAR_STATE::TOGGLE )
55 .Flags( AF_ACTIVATE )
56 .Parameter( DS_DATA_ITEM::DS_RECT ) );
57
59 .Name( "plEditor.InteractiveDrawing.placeText" )
60 .Scope( AS_GLOBAL )
61 .FriendlyName( _( "Draw Text" ) )
62 .ToolbarState( TOOLBAR_STATE::TOGGLE )
63 .Icon( BITMAPS::text )
64 .Flags( AF_ACTIVATE )
65 .Parameter( DS_DATA_ITEM::DS_TEXT ) );
66
68 .Name( "plEditor.InteractiveDrawing.placeImage" )
69 .Scope( AS_GLOBAL )
70 .FriendlyName( _( "Place Bitmaps" ) )
71 .ToolbarState( TOOLBAR_STATE::TOGGLE )
72 .Icon( BITMAPS::image )
73 .Flags( AF_ACTIVATE )
74 .Parameter( DS_DATA_ITEM::DS_BITMAP ) );
75
76
78 .Name( "plEditor.InteractiveDrawing.placeImportedGraphics" )
79 .Scope( AS_GLOBAL )
80 .DefaultHotkey( MD_CTRL + MD_SHIFT + 'F' )
81 .FriendlyName( _( "Import Graphics..." ) )
82 .Tooltip( _( "Import 2D drawing file" ) )
84 .Flags( AF_ACTIVATE ) );
85
86
87// PL_EDIT_TOOL
88//
90 .Name( "plEditor.InteractiveMove.move" )
91 .Scope( AS_GLOBAL )
92 .DefaultHotkey( 'M' )
93 .LegacyHotkeyName( "Move Item" )
94 .FriendlyName( _( "Move" ) )
95 .Icon( BITMAPS::move )
96 .Flags( AF_ACTIVATE ) );
97
99 .Name( "plEditor.InteractiveEdit.appendWorksheet" )
100 .Scope( AS_GLOBAL )
101 .FriendlyName( _( "Append Existing Drawing Sheet..." ) )
102 .Tooltip( _( "Append an existing drawing sheet file to the current file" ) )
103 .ToolbarState( TOOLBAR_STATE::TOGGLE )
104 .Icon( BITMAPS::import )
105 .Flags( AF_ACTIVATE ) );
106
107
108// PL_EDITOR_CONTROL
109//
111 .Name( "plEditor.EditorControl.ShowInspector" )
112 .Scope( AS_GLOBAL )
113 .FriendlyName( _( "Show Design Inspector" ) )
114 .Icon( BITMAPS::spreadsheet ) );
115
117 .Name( "plEditor.EditorControl.PreviewSettings" )
118 .Scope( AS_GLOBAL )
119 .FriendlyName( _( "Page Preview Settings..." ) )
120 .Tooltip( _( "Edit preview data for page size and title block" ) )
121 .Icon( BITMAPS::sheetset ) );
122
124 .Name( "plEditor.EditorControl.LayoutNormalMode" )
125 .Scope( AS_GLOBAL )
126 .FriendlyName( _( "Show Title Block in Preview Mode" ) )
127 .Tooltip( _( "Text placeholders will be replaced with preview data" ) )
128 .ToolbarState( TOOLBAR_STATE::TOGGLE )
130
132 .Name( "plEditor.EditorControl.LayoutEditMode" )
133 .Scope( AS_GLOBAL )
134 .FriendlyName( _( "Show Title Block in Edit Mode" ) )
135 .Tooltip( _( "Text placeholders are shown as ${keyword} tokens" ) )
136 .ToolbarState( TOOLBAR_STATE::TOGGLE )
138
139// clang-format on
@ pagelayout_normal_view_mode
@ add_rectangle
@ pagelayout_special_view_mode
@ add_graphical_segments
static TOOL_ACTION placeImage
Definition pl_actions.h:37
static TOOL_ACTION drawRectangle
Definition pl_actions.h:39
static TOOL_ACTION showInspector
Definition pl_actions.h:51
static TOOL_ACTION previewSettings
Definition pl_actions.h:52
static TOOL_ACTION layoutNormalMode
Definition pl_actions.h:46
static TOOL_ACTION placeImportedGraphics
Definition pl_actions.h:38
static TOOL_ACTION placeText
Definition pl_actions.h:36
static TOOL_ACTION layoutEditMode
Definition pl_actions.h:47
static TOOL_ACTION appendImportedDrawingSheet
Definition pl_actions.h:41
static TOOL_ACTION move
Definition pl_actions.h:44
static TOOL_ACTION drawLine
Definition pl_actions.h:40
Build up the properties of a TOOL_ACTION in an incremental manner that is static-construction safe.
Represent a single user action.
#define _(s)
@ TOGGLE
Action is a toggle button on the toolbar.
Definition tool_action.h:60
@ 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
@ MD_CTRL
Definition tool_event.h:140
@ MD_SHIFT
Definition tool_event.h:139