KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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, 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//
43 .Name( "plEditor.InteractiveDrawing.drawLine" )
44 .Scope( AS_GLOBAL )
45 .FriendlyName( _( "Draw Lines" ) )
46 .ToolbarState( TOOLBAR_STATE::TOGGLE )
48 .Flags( AF_ACTIVATE )
49 .Parameter( DS_DATA_ITEM::DS_SEGMENT ) );
50
52 .Name( "plEditor.InteractiveDrawing.drawRectangle" )
53 .Scope( AS_GLOBAL )
54 .FriendlyName( _( "Draw Rectangles" ) )
55 .ToolbarState( TOOLBAR_STATE::TOGGLE )
57 .Flags( AF_ACTIVATE )
58 .Parameter( DS_DATA_ITEM::DS_RECT ) );
59
61 .Name( "plEditor.InteractiveDrawing.placeText" )
62 .Scope( AS_GLOBAL )
63 .FriendlyName( _( "Draw Text" ) )
64 .ToolbarState( TOOLBAR_STATE::TOGGLE )
65 .Icon( BITMAPS::text )
66 .Flags( AF_ACTIVATE )
67 .Parameter( DS_DATA_ITEM::DS_TEXT ) );
68
70 .Name( "plEditor.InteractiveDrawing.placeImage" )
71 .Scope( AS_GLOBAL )
72 .FriendlyName( _( "Place Bitmaps" ) )
73 .ToolbarState( TOOLBAR_STATE::TOGGLE )
74 .Icon( BITMAPS::image )
75 .Flags( AF_ACTIVATE )
76 .Parameter( DS_DATA_ITEM::DS_BITMAP ) );
77
78
79// PL_EDIT_TOOL
80//
82 .Name( "plEditor.InteractiveMove.move" )
83 .Scope( AS_GLOBAL )
84 .DefaultHotkey( 'M' )
85 .LegacyHotkeyName( "Move Item" )
86 .FriendlyName( _( "Move" ) )
87 .Icon( BITMAPS::move )
88 .Flags( AF_ACTIVATE ) );
89
91 .Name( "plEditor.InteractiveEdit.appendWorksheet" )
92 .Scope( AS_GLOBAL )
93 .FriendlyName( _( "Append Existing Drawing Sheet..." ) )
94 .Tooltip( _( "Append an existing drawing sheet file to the current file" ) )
95 .ToolbarState( TOOLBAR_STATE::TOGGLE )
96 .Icon( BITMAPS::import )
97 .Flags( AF_ACTIVATE ) );
98
99
100// PL_EDITOR_CONTROL
101//
103 .Name( "plEditor.EditorControl.ShowInspector" )
104 .Scope( AS_GLOBAL )
105 .FriendlyName( _( "Show Design Inspector" ) )
106 .Icon( BITMAPS::spreadsheet ) );
107
109 .Name( "plEditor.EditorControl.PreviewSettings" )
110 .Scope( AS_GLOBAL )
111 .FriendlyName( _( "Page Preview Settings..." ) )
112 .Tooltip( _( "Edit preview data for page size and title block" ) )
113 .Icon( BITMAPS::sheetset ) );
114
116 .Name( "plEditor.EditorControl.LayoutNormalMode" )
117 .Scope( AS_GLOBAL )
118 .FriendlyName( _( "Show Title Block in Preview Mode" ) )
119 .Tooltip( _( "Text placeholders will be replaced with preview data" ) )
120 .ToolbarState( TOOLBAR_STATE::TOGGLE )
122
124 .Name( "plEditor.EditorControl.LayoutEditMode" )
125 .Scope( AS_GLOBAL )
126 .FriendlyName( _( "Show Title Block in Edit Mode" ) )
127 .Tooltip( _( "Text placeholders are shown as ${keyword} tokens" ) )
128 .ToolbarState( TOOLBAR_STATE::TOGGLE )
@ pagelayout_normal_view_mode
@ add_rectangle
@ pagelayout_special_view_mode
@ add_graphical_segments
static TOOL_ACTION placeImage
Definition: pl_actions.h:41
static TOOL_ACTION drawRectangle
Definition: pl_actions.h:42
static TOOL_ACTION showInspector
Definition: pl_actions.h:54
static TOOL_ACTION previewSettings
Definition: pl_actions.h:55
static TOOL_ACTION layoutNormalMode
Definition: pl_actions.h:49
static TOOL_ACTION placeText
Definition: pl_actions.h:40
static TOOL_ACTION layoutEditMode
Definition: pl_actions.h:50
static TOOL_ACTION appendImportedDrawingSheet
Definition: pl_actions.h:44
static TOOL_ACTION move
Definition: pl_actions.h:47
static TOOL_ACTION drawLine
Definition: pl_actions.h:43
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)
Definition: pl_actions.cpp:37
@ 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