KiCad PCB EDA Suite
actions.cpp
Go to the documentation of this file.
1 #include <tool/actions.h>
2 #include <hotkeys.h>
3 #include <bitmaps.h>
4 
5 // These members are static in class ACTIONS: Build them here:
6 
7 // Generic Actions
8 TOOL_ACTION ACTIONS::cancelInteractive( "common.Interactive.cancel",
9  AS_GLOBAL, 0, // ESC key is handled in the dispatcher
10  _( "Cancel" ), _( "Cancel current tool" ),
11  cancel_xpm, AF_NONE );
12 
13 TOOL_ACTION ACTIONS::updateMenu( "common.Interactive.updateMenu",
14  AS_GLOBAL, 0, "", "" ); // This is an internal event
15 
16 TOOL_ACTION ACTIONS::undo( "common.Interactive.undo",
18  _( "Undo" ), _( "Undo last edit" ),
19  undo_xpm );
20 
21 TOOL_ACTION ACTIONS::redo( "common.Interactive.redo",
23  _( "Redo" ), _( "Redo last edit" ),
24  redo_xpm );
25 
26 TOOL_ACTION ACTIONS::cut( "common.Interactive.cut",
28  _( "Cut" ), _( "Cut selected item(s) to clipboard" ),
29  cut_xpm );
30 
31 TOOL_ACTION ACTIONS::copy( "common.Interactive.copy",
33  _( "Copy" ), _( "Copy selected item(s) to clipboard" ),
34  copy_xpm );
35 
36 TOOL_ACTION ACTIONS::paste( "common.Interactive.paste",
38  _( "Paste" ), _( "Paste clipboard into schematic" ),
39  paste_xpm );
40 
41 // View Controls
42 TOOL_ACTION ACTIONS::zoomRedraw( "common.Control.zoomRedraw",
44  _( "Refresh" ), "",
45  zoom_redraw_xpm );
46 
47 TOOL_ACTION ACTIONS::zoomIn( "common.Control.zoomIn",
49  _( "Zoom In" ), "",
50  zoom_in_xpm );
51 
52 TOOL_ACTION ACTIONS::zoomOut( "common.Control.zoomOut",
54  _( "Zoom Out" ), "",
55  zoom_out_xpm );
56 
57 TOOL_ACTION ACTIONS::zoomInCenter( "common.Control.zoomInCenter",
58  AS_GLOBAL, 0,
59  _( "Zoom In" ), "",
60  zoom_in_xpm );
61 
62 TOOL_ACTION ACTIONS::zoomOutCenter( "common.Control.zoomOutCenter",
63  AS_GLOBAL, 0,
64  _( "Zoom Out" ), "",
65  zoom_out_xpm );
66 
67 TOOL_ACTION ACTIONS::zoomCenter( "common.Control.zoomCenter",
69  _( "Center" ), "",
70  zoom_center_on_screen_xpm );
71 
72 TOOL_ACTION ACTIONS::zoomFitScreen( "common.Control.zoomFitScreen",
74  _( "Zoom to Fit" ), "",
75  zoom_fit_in_page_xpm );
76 
77 TOOL_ACTION ACTIONS::zoomTool( "common.Control.zoomTool",
79  _( "Zoom to Selection" ), "",
80  zoom_area_xpm, AF_ACTIVATE );
81 
82 TOOL_ACTION ACTIONS::zoomPreset( "common.Control.zoomPreset",
83  AS_GLOBAL, 0,
84  "", "" );
85 
86 TOOL_ACTION ACTIONS::centerContents( "common.Control.centerContents",
87  AS_GLOBAL, 0,
88  "", "" );
89 
90 // Cursor control
91 TOOL_ACTION ACTIONS::cursorUp( "common.Control.cursorUp",
92  AS_GLOBAL, WXK_UP,
93  "", "", NULL, AF_NONE, (void*) CURSOR_UP );
94 
95 TOOL_ACTION ACTIONS::cursorDown( "common.Control.cursorDown",
96  AS_GLOBAL, WXK_DOWN,
97  "", "" , NULL, AF_NONE, (void*) CURSOR_DOWN );
98 
99 TOOL_ACTION ACTIONS::cursorLeft( "common.Control.cursorLeft",
100  AS_GLOBAL, WXK_LEFT,
101  "", "" , NULL, AF_NONE, (void*) CURSOR_LEFT );
102 
103 TOOL_ACTION ACTIONS::cursorRight( "common.Control.cursorRight",
104  AS_GLOBAL, WXK_RIGHT,
105  "", "" , NULL, AF_NONE, (void*) CURSOR_RIGHT );
106 
107 
108 TOOL_ACTION ACTIONS::cursorUpFast( "common.Control.cursorUpFast",
109  AS_GLOBAL, MD_CTRL + WXK_UP,
110  "", "", NULL, AF_NONE, (void*) ( CURSOR_UP | CURSOR_FAST_MOVE ) );
111 
112 TOOL_ACTION ACTIONS::cursorDownFast( "common.Control.cursorDownFast",
113  AS_GLOBAL, MD_CTRL + WXK_DOWN,
114  "", "" , NULL, AF_NONE, (void*) ( CURSOR_DOWN | CURSOR_FAST_MOVE ) );
115 
116 TOOL_ACTION ACTIONS::cursorLeftFast( "common.Control.cursorLeftFast",
117  AS_GLOBAL, MD_CTRL + WXK_LEFT,
118  "", "" , NULL, AF_NONE, (void*) ( CURSOR_LEFT | CURSOR_FAST_MOVE ) );
119 
120 TOOL_ACTION ACTIONS::cursorRightFast( "common.Control.cursorRightFast",
121  AS_GLOBAL, MD_CTRL + WXK_RIGHT,
122  "", "" , NULL, AF_NONE, (void*) ( CURSOR_RIGHT | CURSOR_FAST_MOVE ) );
123 
124 
125 TOOL_ACTION ACTIONS::cursorClick( "common.Control.cursorClick",
127  "", "", NULL, AF_NONE, (void*) CURSOR_CLICK );
128 
129 TOOL_ACTION ACTIONS::cursorDblClick( "common.Control.cursorDblClick",
131  "", "", NULL, AF_NONE, (void*) CURSOR_DBL_CLICK );
132 
133 TOOL_ACTION ACTIONS::panUp( "common.Control.panUp",
134  AS_GLOBAL, MD_SHIFT + WXK_UP,
135  "", "", NULL, AF_NONE, (void*) CURSOR_UP );
136 
137 TOOL_ACTION ACTIONS::panDown( "common.Control.panDown",
138  AS_GLOBAL, MD_SHIFT + WXK_DOWN,
139  "", "" , NULL, AF_NONE, (void*) CURSOR_DOWN );
140 
141 TOOL_ACTION ACTIONS::panLeft( "common.Control.panLeft",
142  AS_GLOBAL, MD_SHIFT + WXK_LEFT,
143  "", "" , NULL, AF_NONE, (void*) CURSOR_LEFT );
144 
145 TOOL_ACTION ACTIONS::panRight( "common.Control.panRight",
146  AS_GLOBAL, MD_SHIFT + WXK_RIGHT,
147  "", "" , NULL, AF_NONE, (void*) CURSOR_RIGHT );
148 
149 // Grid control
150 TOOL_ACTION ACTIONS::gridFast1( "common.Control.gridFast1",
152  "", "" );
153 
154 TOOL_ACTION ACTIONS::gridFast2( "common.Control.gridFast2",
156  "", "" );
157 
158 TOOL_ACTION ACTIONS::gridNext( "common.Control.gridNext",
160  "", "" );
161 
162 TOOL_ACTION ACTIONS::gridPrev( "common.Control.gridPrev",
164  "", "" );
165 
166 TOOL_ACTION ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
168  "", "" );
169 
170 TOOL_ACTION ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
172  "", "" );
173 
174 TOOL_ACTION ACTIONS::gridPreset( "common.Control.gridPreset",
175  AS_GLOBAL, 0,
176  "", "" );
177 
178 TOOL_ACTION ACTIONS::toggleGrid( "common.Control.toggleGrid",
179  AS_GLOBAL, 0,
180  _( "Show Grid" ), _( "Display grid dots or lines in the edit window" ),
181  grid_xpm );
182 
183 TOOL_ACTION ACTIONS::gridProperties( "common.Control.gridProperties",
184  AS_GLOBAL, 0,
185  _( "Grid Properties..." ), _( "Set grid dimensions" ),
186  grid_xpm );
187 
188 TOOL_ACTION ACTIONS::imperialUnits( "common.Control.imperialUnits",
189  AS_GLOBAL, 0,
190  _( "Imperial" ), _( "Use inches and mils" ),
191  unit_inch_xpm );
192 
193 TOOL_ACTION ACTIONS::metricUnits( "common.Control.metricUnits",
194  AS_GLOBAL, 0,
195  _( "Metric" ), _( "Use millimeters" ),
196  unit_mm_xpm );
197 
198 TOOL_ACTION ACTIONS::toggleUnits( "common.Control.toggleUnits",
200  _( "Switch units" ), _( "Switch between inches and millimeters" ),
201  unit_mm_xpm );
202 
203 
204 TOOL_ACTION ACTIONS::toggleCursor( "common.Control.toggleCursor",
206  _( "Always Show Cursor" ), _( "Display crosshairs even in selection tool" ),
207  cursor_xpm );
208 
209 
210 TOOL_ACTION ACTIONS::toggleCursorStyle( "common.Control.toggleCursorStyle",
211  AS_GLOBAL, 0,
212  _( "Full-Window Crosshairs" ), _( "Switch display of full-window crosshairs" ),
213  cursor_shape_xpm );
214 
215 
216 // System-wide selection Events
217 
219 const TOOL_EVENT EVENTS::SelectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.selected" );
220 
222 const TOOL_EVENT EVENTS::UnselectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.unselected" );
223 
225 const TOOL_EVENT EVENTS::ClearedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.cleared" );
226 
227 const TOOL_EVENT EVENTS::SelectedItemsModified( TC_MESSAGE, TA_ACTION, "common.Interactive.modified" );
228 
static const TOOL_EVENT SelectedEvent
Event sent after an item is selected.
Definition: actions.h:132
static TOOL_ACTION zoomPreset
Definition: actions.h:64
static TOOL_ACTION zoomInCenter
Definition: actions.h:60
static const TOOL_EVENT UnselectedEvent
Event sent after an item is unselected.
Definition: actions.h:133
static TOOL_ACTION zoomTool
Definition: actions.h:65
static TOOL_ACTION gridResetOrigin
Definition: actions.h:96
static TOOL_ACTION cancelInteractive
Definition: actions.h:45
static TOOL_ACTION cursorRight
Definition: actions.h:74
static TOOL_ACTION zoomFitScreen
Definition: actions.h:63
static TOOL_ACTION cursorRightFast
Definition: actions.h:79
static int LegacyHotKey(int aHotKey)
Creates a hot key code that refers to a legacy hot key setting, instead of a particular key.
Definition: tool_action.h:165
static TOOL_ACTION gridFast1
Definition: actions.h:91
static TOOL_ACTION panLeft
Definition: actions.h:87
static TOOL_ACTION imperialUnits
Definition: actions.h:102
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
static TOOL_ACTION zoomOutCenter
Definition: actions.h:61
Pcbnew hotkeys.
static TOOL_ACTION copy
Definition: actions.h:53
static TOOL_ACTION centerContents
Definition: actions.h:66
static TOOL_ACTION gridFast2
Definition: actions.h:92
static TOOL_ACTION toggleCursor
Definition: actions.h:67
static TOOL_ACTION gridPreset
Definition: actions.h:97
static TOOL_ACTION gridPrev
Definition: actions.h:94
static TOOL_ACTION panDown
Definition: actions.h:86
static TOOL_ACTION toggleGrid
Definition: actions.h:98
Class TOOL_EVENT.
Definition: tool_event.h:167
static TOOL_ACTION cursorUpFast
Definition: actions.h:76
static TOOL_ACTION cursorDownFast
Definition: actions.h:77
static TOOL_ACTION cursorLeft
Definition: actions.h:73
static TOOL_ACTION panRight
Definition: actions.h:88
static TOOL_ACTION cut
Definition: actions.h:52
static const TOOL_EVENT ClearedEvent
Event sent after selection is cleared.
Definition: actions.h:134
static TOOL_ACTION cursorLeftFast
Definition: actions.h:78
static TOOL_ACTION updateMenu
Definition: actions.h:49
All active tools
Definition: tool_event.h:143
static TOOL_ACTION metricUnits
Definition: actions.h:103
static TOOL_ACTION redo
Definition: actions.h:51
static TOOL_ACTION zoomCenter
Definition: actions.h:62
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition: actions.h:71
static TOOL_ACTION zoomRedraw
Definition: actions.h:57
static TOOL_ACTION cursorDblClick
Definition: actions.h:82
Class TOOL_ACTION.
Definition: tool_action.h:46
static TOOL_ACTION gridNext
Definition: actions.h:93
static TOOL_ACTION gridProperties
Definition: actions.h:99
static TOOL_ACTION panUp
Definition: actions.h:85
static TOOL_ACTION zoomIn
Definition: actions.h:58
static TOOL_ACTION zoomOut
Definition: actions.h:59
static TOOL_ACTION undo
Definition: actions.h:50
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:68
static TOOL_ACTION gridSetOrigin
Definition: actions.h:95
static TOOL_ACTION cursorDown
Definition: actions.h:72
static TOOL_ACTION toggleUnits
Definition: actions.h:104
static TOOL_ACTION paste
Definition: actions.h:54
static TOOL_ACTION cursorClick
Definition: actions.h:81