2017-02-20 18:10:20 +00:00
|
|
|
#include <tool/actions.h>
|
|
|
|
#include <hotkeys.h>
|
|
|
|
#include <bitmaps.h>
|
|
|
|
|
|
|
|
// These members are static in class ACTIONS: Build them here:
|
|
|
|
|
2017-02-06 16:00:51 +00:00
|
|
|
// Generic Actions
|
|
|
|
TOOL_ACTION ACTIONS::cancelInteractive( "common.Interactive.cancel",
|
|
|
|
AS_GLOBAL, 0, // ESC key is handled in the dispatcher
|
|
|
|
_( "Cancel" ), _( "Cancel current tool" ),
|
|
|
|
cancel_xpm, AF_NONE );
|
|
|
|
|
2019-05-13 20:42:40 +00:00
|
|
|
TOOL_ACTION ACTIONS::updateMenu( "common.Interactive.updateMenu",
|
|
|
|
AS_GLOBAL, 0, "", "" ); // This is an internal event
|
|
|
|
|
2019-05-14 19:21:10 +00:00
|
|
|
TOOL_ACTION ACTIONS::undo( "common.Interactive.undo",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_UNDO ),
|
|
|
|
_( "Undo" ), _( "Undo last edit" ),
|
|
|
|
undo_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::redo( "common.Interactive.redo",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_REDO ),
|
|
|
|
_( "Redo" ), _( "Redo last edit" ),
|
|
|
|
redo_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cut( "common.Interactive.cut",
|
2019-05-15 22:49:48 +00:00
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_CUT ),
|
2019-05-14 19:21:10 +00:00
|
|
|
_( "Cut" ), _( "Cut selected item(s) to clipboard" ),
|
|
|
|
cut_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::copy( "common.Interactive.copy",
|
2019-05-15 22:49:48 +00:00
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_COPY ),
|
2019-05-14 19:21:10 +00:00
|
|
|
_( "Copy" ), _( "Copy selected item(s) to clipboard" ),
|
|
|
|
copy_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::paste( "common.Interactive.paste",
|
2019-05-15 22:49:48 +00:00
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_PASTE ),
|
2019-05-14 19:21:10 +00:00
|
|
|
_( "Paste" ), _( "Paste clipboard into schematic" ),
|
|
|
|
paste_xpm );
|
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
TOOL_ACTION ACTIONS::find( "common.Interactive.find",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_FIND ),
|
|
|
|
_( "Find" ), _( "Find text" ),
|
|
|
|
find_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::replace( "common.Interactive.findAndReplace",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_REPLACE ),
|
|
|
|
_( "Find and Replace" ), _( "Find and replace text" ),
|
|
|
|
find_replace_xpm );
|
|
|
|
|
2017-02-20 18:10:20 +00:00
|
|
|
// View Controls
|
2019-04-11 01:23:34 +00:00
|
|
|
TOOL_ACTION ACTIONS::zoomRedraw( "common.Control.zoomRedraw",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_REDRAW ),
|
2019-05-14 19:21:10 +00:00
|
|
|
_( "Refresh" ), "",
|
2019-05-13 20:42:40 +00:00
|
|
|
zoom_redraw_xpm );
|
2019-04-11 01:23:34 +00:00
|
|
|
|
2017-02-20 18:10:20 +00:00
|
|
|
TOOL_ACTION ACTIONS::zoomIn( "common.Control.zoomIn",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_IN ),
|
2019-05-13 20:42:40 +00:00
|
|
|
_( "Zoom In" ), "",
|
|
|
|
zoom_in_xpm );
|
2017-02-20 18:10:20 +00:00
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::zoomOut( "common.Control.zoomOut",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_OUT ),
|
2019-05-13 20:42:40 +00:00
|
|
|
_( "Zoom Out" ), "",
|
|
|
|
zoom_out_xpm );
|
2017-02-20 18:10:20 +00:00
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::zoomInCenter( "common.Control.zoomInCenter",
|
|
|
|
AS_GLOBAL, 0,
|
2019-05-13 20:42:40 +00:00
|
|
|
_( "Zoom In" ), "",
|
|
|
|
zoom_in_xpm );
|
2017-02-20 18:10:20 +00:00
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::zoomOutCenter( "common.Control.zoomOutCenter",
|
|
|
|
AS_GLOBAL, 0,
|
2019-05-13 20:42:40 +00:00
|
|
|
_( "Zoom Out" ), "",
|
|
|
|
zoom_out_xpm );
|
2017-02-20 18:10:20 +00:00
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::zoomCenter( "common.Control.zoomCenter",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_CENTER ),
|
2019-05-13 20:42:40 +00:00
|
|
|
_( "Center" ), "",
|
|
|
|
zoom_center_on_screen_xpm );
|
2017-02-20 18:10:20 +00:00
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::zoomFitScreen( "common.Control.zoomFitScreen",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_AUTO ),
|
2019-05-13 20:42:40 +00:00
|
|
|
_( "Zoom to Fit" ), "",
|
|
|
|
zoom_fit_in_page_xpm );
|
2017-02-20 18:10:20 +00:00
|
|
|
|
2017-08-31 02:35:30 +00:00
|
|
|
TOOL_ACTION ACTIONS::zoomTool( "common.Control.zoomTool",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ZOOM_SELECTION ),
|
2019-05-13 20:42:40 +00:00
|
|
|
_( "Zoom to Selection" ), "",
|
|
|
|
zoom_area_xpm, AF_ACTIVATE );
|
2017-08-31 02:35:30 +00:00
|
|
|
|
2017-02-20 18:10:20 +00:00
|
|
|
TOOL_ACTION ACTIONS::zoomPreset( "common.Control.zoomPreset",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
"", "" );
|
|
|
|
|
2018-09-11 15:28:57 +00:00
|
|
|
TOOL_ACTION ACTIONS::centerContents( "common.Control.centerContents",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
"", "" );
|
|
|
|
|
2018-10-03 16:26:33 +00:00
|
|
|
// Cursor control
|
|
|
|
TOOL_ACTION ACTIONS::cursorUp( "common.Control.cursorUp",
|
|
|
|
AS_GLOBAL, WXK_UP,
|
|
|
|
"", "", NULL, AF_NONE, (void*) CURSOR_UP );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorDown( "common.Control.cursorDown",
|
|
|
|
AS_GLOBAL, WXK_DOWN,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) CURSOR_DOWN );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorLeft( "common.Control.cursorLeft",
|
|
|
|
AS_GLOBAL, WXK_LEFT,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) CURSOR_LEFT );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorRight( "common.Control.cursorRight",
|
|
|
|
AS_GLOBAL, WXK_RIGHT,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) CURSOR_RIGHT );
|
|
|
|
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorUpFast( "common.Control.cursorUpFast",
|
|
|
|
AS_GLOBAL, MD_CTRL + WXK_UP,
|
|
|
|
"", "", NULL, AF_NONE, (void*) ( CURSOR_UP | CURSOR_FAST_MOVE ) );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorDownFast( "common.Control.cursorDownFast",
|
|
|
|
AS_GLOBAL, MD_CTRL + WXK_DOWN,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) ( CURSOR_DOWN | CURSOR_FAST_MOVE ) );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorLeftFast( "common.Control.cursorLeftFast",
|
|
|
|
AS_GLOBAL, MD_CTRL + WXK_LEFT,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) ( CURSOR_LEFT | CURSOR_FAST_MOVE ) );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorRightFast( "common.Control.cursorRightFast",
|
|
|
|
AS_GLOBAL, MD_CTRL + WXK_RIGHT,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) ( CURSOR_RIGHT | CURSOR_FAST_MOVE ) );
|
|
|
|
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorClick( "common.Control.cursorClick",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_LEFT_CLICK ),
|
|
|
|
"", "", NULL, AF_NONE, (void*) CURSOR_CLICK );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::cursorDblClick( "common.Control.cursorDblClick",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_LEFT_DCLICK ),
|
|
|
|
"", "", NULL, AF_NONE, (void*) CURSOR_DBL_CLICK );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::panUp( "common.Control.panUp",
|
|
|
|
AS_GLOBAL, MD_SHIFT + WXK_UP,
|
|
|
|
"", "", NULL, AF_NONE, (void*) CURSOR_UP );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::panDown( "common.Control.panDown",
|
|
|
|
AS_GLOBAL, MD_SHIFT + WXK_DOWN,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) CURSOR_DOWN );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::panLeft( "common.Control.panLeft",
|
|
|
|
AS_GLOBAL, MD_SHIFT + WXK_LEFT,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) CURSOR_LEFT );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::panRight( "common.Control.panRight",
|
|
|
|
AS_GLOBAL, MD_SHIFT + WXK_RIGHT,
|
|
|
|
"", "" , NULL, AF_NONE, (void*) CURSOR_RIGHT );
|
|
|
|
|
2017-02-20 18:10:20 +00:00
|
|
|
// Grid control
|
|
|
|
TOOL_ACTION ACTIONS::gridFast1( "common.Control.gridFast1",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_FASTGRID1 ),
|
|
|
|
"", "" );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::gridFast2( "common.Control.gridFast2",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_FASTGRID2 ),
|
|
|
|
"", "" );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::gridNext( "common.Control.gridNext",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_NEXT ),
|
|
|
|
"", "" );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::gridPrev( "common.Control.gridPrev",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_GRID_TO_PREVIOUS ),
|
|
|
|
"", "" );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::gridSetOrigin( "common.Control.gridSetOrigin",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SET_GRID_ORIGIN ),
|
2019-05-15 22:49:48 +00:00
|
|
|
_( "Grid Origin" ), _( "Set the grid origin point" ),
|
|
|
|
grid_select_axis_xpm );
|
2017-02-20 18:10:20 +00:00
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::gridResetOrigin( "common.Control.gridResetOrigin",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_RESET_GRID_ORIGIN ),
|
|
|
|
"", "" );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::gridPreset( "common.Control.gridPreset",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
"", "" );
|
2019-04-21 23:45:34 +00:00
|
|
|
|
2019-05-13 20:42:40 +00:00
|
|
|
TOOL_ACTION ACTIONS::toggleGrid( "common.Control.toggleGrid",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
_( "Show Grid" ), _( "Display grid dots or lines in the edit window" ),
|
|
|
|
grid_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::gridProperties( "common.Control.gridProperties",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
_( "Grid Properties..." ), _( "Set grid dimensions" ),
|
|
|
|
grid_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::imperialUnits( "common.Control.imperialUnits",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
_( "Imperial" ), _( "Use inches and mils" ),
|
|
|
|
unit_inch_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::metricUnits( "common.Control.metricUnits",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
_( "Metric" ), _( "Use millimeters" ),
|
|
|
|
unit_mm_xpm );
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::toggleUnits( "common.Control.toggleUnits",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_UNITS ),
|
|
|
|
_( "Switch units" ), _( "Switch between inches and millimeters" ),
|
|
|
|
unit_mm_xpm );
|
|
|
|
|
2019-04-21 23:45:34 +00:00
|
|
|
|
2019-05-14 19:21:10 +00:00
|
|
|
TOOL_ACTION ACTIONS::toggleCursor( "common.Control.toggleCursor",
|
|
|
|
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_TOGGLE_CURSOR ),
|
|
|
|
_( "Always Show Cursor" ), _( "Display crosshairs even in selection tool" ),
|
|
|
|
cursor_xpm );
|
|
|
|
|
|
|
|
|
|
|
|
TOOL_ACTION ACTIONS::toggleCursorStyle( "common.Control.toggleCursorStyle",
|
|
|
|
AS_GLOBAL, 0,
|
|
|
|
_( "Full-Window Crosshairs" ), _( "Switch display of full-window crosshairs" ),
|
|
|
|
cursor_shape_xpm );
|
|
|
|
|
|
|
|
|
2019-04-21 23:45:34 +00:00
|
|
|
// System-wide selection Events
|
|
|
|
|
|
|
|
///> Event sent after an item is selected.
|
|
|
|
const TOOL_EVENT EVENTS::SelectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.selected" );
|
|
|
|
|
|
|
|
///> Event sent after an item is unselected.
|
|
|
|
const TOOL_EVENT EVENTS::UnselectedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.unselected" );
|
|
|
|
|
|
|
|
///> Event sent after selection is cleared.
|
|
|
|
const TOOL_EVENT EVENTS::ClearedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.cleared" );
|
|
|
|
|
2019-05-08 18:56:03 +00:00
|
|
|
const TOOL_EVENT EVENTS::SelectedItemsModified( TC_MESSAGE, TA_ACTION, "common.Interactive.modified" );
|
|
|
|
|