You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
6.1 KiB

  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 (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. #include <tool/tool_action.h>
  25. #include <bitmaps.h>
  26. #include <eda_item.h>
  27. #include <drawing_sheet/ds_data_item.h>
  28. #include "tools/pl_actions.h"
  29. // Actions, being statically-defined, require specialized I18N handling. We continue to
  30. // use the _() macro so that string harvesting by the I18N framework doesn't have to be
  31. // specialized, but we don't translate on initialization and instead do it in the getters.
  32. #undef _
  33. #define _(s) s
  34. // PL_DRAWING_TOOLS
  35. //
  36. TOOL_ACTION PL_ACTIONS::drawLine( TOOL_ACTION_ARGS()
  37. .Name( "plEditor.InteractiveDrawing.drawLine" )
  38. .Scope( AS_GLOBAL )
  39. .FriendlyName( _( "Add Line" ) )
  40. .Tooltip( _( "Add a line" ) )
  41. .Icon( BITMAPS::add_graphical_segments )
  42. .Flags( AF_ACTIVATE )
  43. .Parameter( DS_DATA_ITEM::DS_SEGMENT ) );
  44. TOOL_ACTION PL_ACTIONS::drawRectangle( TOOL_ACTION_ARGS()
  45. .Name( "plEditor.InteractiveDrawing.drawRectangle" )
  46. .Scope( AS_GLOBAL )
  47. .FriendlyName( _( "Add Rectangle" ) )
  48. .Tooltip( _( "Add a rectangle" ) )
  49. .Icon( BITMAPS::add_rectangle )
  50. .Flags( AF_ACTIVATE )
  51. .Parameter( DS_DATA_ITEM::DS_RECT ) );
  52. TOOL_ACTION PL_ACTIONS::placeText( TOOL_ACTION_ARGS()
  53. .Name( "plEditor.InteractiveDrawing.placeText" )
  54. .Scope( AS_GLOBAL )
  55. .FriendlyName( _( "Add Text" ) )
  56. .Tooltip( _( "Add a text item" ) )
  57. .Icon( BITMAPS::text )
  58. .Flags( AF_ACTIVATE )
  59. .Parameter( DS_DATA_ITEM::DS_TEXT ) );
  60. TOOL_ACTION PL_ACTIONS::placeImage( TOOL_ACTION_ARGS()
  61. .Name( "plEditor.InteractiveDrawing.placeImage" )
  62. .Scope( AS_GLOBAL )
  63. .FriendlyName( _( "Add Bitmap" ) )
  64. .Tooltip( _( "Add a bitmap image" ) )
  65. .Icon( BITMAPS::image )
  66. .Flags( AF_ACTIVATE )
  67. .Parameter( DS_DATA_ITEM::DS_BITMAP ) );
  68. // PL_EDIT_TOOL
  69. //
  70. TOOL_ACTION PL_ACTIONS::move( TOOL_ACTION_ARGS()
  71. .Name( "plEditor.InteractiveMove.move" )
  72. .Scope( AS_GLOBAL )
  73. .DefaultHotkey( 'M' )
  74. .LegacyHotkeyName( "Move Item" )
  75. .FriendlyName( _( "Move" ) )
  76. .Tooltip( _( "Moves the selected item(s)" ) )
  77. .Icon( BITMAPS::move )
  78. .Flags( AF_ACTIVATE ) );
  79. TOOL_ACTION PL_ACTIONS::appendImportedDrawingSheet( TOOL_ACTION_ARGS()
  80. .Name( "plEditor.InteractiveEdit.appendWorksheet" )
  81. .Scope( AS_GLOBAL )
  82. .FriendlyName( _( "Append Existing Drawing Sheet..." ) )
  83. .Tooltip( _( "Append an existing drawing sheet file to current file" ) )
  84. .Icon( BITMAPS::import )
  85. .Flags( AF_ACTIVATE ) );
  86. // PL_EDITOR_CONTROL
  87. //
  88. TOOL_ACTION PL_ACTIONS::showInspector( TOOL_ACTION_ARGS()
  89. .Name( "plEditor.EditorControl.ShowInspector" )
  90. .Scope( AS_GLOBAL )
  91. .FriendlyName( _( "Show Design Inspector" ) )
  92. .Tooltip( _( "Show the list of items in the drawing sheet" ) )
  93. .Icon( BITMAPS::spreadsheet ) );
  94. TOOL_ACTION PL_ACTIONS::previewSettings( TOOL_ACTION_ARGS()
  95. .Name( "plEditor.EditorControl.PreviewSettings" )
  96. .Scope( AS_GLOBAL )
  97. .FriendlyName( _( "Page Preview Settings..." ) )
  98. .Tooltip( _( "Edit preview data for page size and title block" ) )
  99. .Icon( BITMAPS::sheetset ) );
  100. TOOL_ACTION PL_ACTIONS::layoutNormalMode( TOOL_ACTION_ARGS()
  101. .Name( "plEditor.EditorControl.LayoutNormalMode" )
  102. .Scope( AS_GLOBAL )
  103. .FriendlyName( _( "Show title block in preview mode" ) )
  104. .Tooltip( _( "Show title block in preview mode:\n"
  105. "text placeholders will be replaced with preview data." ) )
  106. .Icon( BITMAPS::pagelayout_normal_view_mode ) );
  107. TOOL_ACTION PL_ACTIONS::layoutEditMode( TOOL_ACTION_ARGS()
  108. .Name( "plEditor.EditorControl.LayoutEditMode" )
  109. .Scope( AS_GLOBAL )
  110. .FriendlyName( _( "Show title block in edit mode" ) )
  111. .Tooltip( _( "Show title block in edit mode:\n"
  112. "text placeholders are shown as ${keyword} tokens." ) )
  113. .Icon( BITMAPS::pagelayout_special_view_mode ) );
  114. // PL_SELECTION_TOOL
  115. //
  116. TOOL_ACTION PL_ACTIONS::selectionActivate( TOOL_ACTION_ARGS()
  117. .Name( "plEditor.InteractiveSelection" )
  118. .Scope( AS_GLOBAL )
  119. .Flags( AF_ACTIVATE ) );
  120. TOOL_ACTION PL_ACTIONS::selectionMenu( TOOL_ACTION_ARGS()
  121. .Name( "plEditor.InteractiveSelection.SelectionMenu" )
  122. .Scope( AS_GLOBAL ) );
  123. TOOL_ACTION PL_ACTIONS::addItemToSel( TOOL_ACTION_ARGS()
  124. .Name( "plEditor.InteractiveSelection.AddItemToSel" )
  125. .Scope( AS_GLOBAL ) );
  126. TOOL_ACTION PL_ACTIONS::addItemsToSel( TOOL_ACTION_ARGS()
  127. .Name( "plEditor.InteractiveSelection.AddItemsToSel" )
  128. .Scope( AS_GLOBAL ) );
  129. TOOL_ACTION PL_ACTIONS::removeItemFromSel( TOOL_ACTION_ARGS()
  130. .Name( "plEditor.InteractiveSelection.RemoveItemFromSel" )
  131. .Scope( AS_GLOBAL ) );
  132. TOOL_ACTION PL_ACTIONS::removeItemsFromSel( TOOL_ACTION_ARGS()
  133. .Name( "plEditor.InteractiveSelection.RemoveItemsFromSel" )
  134. .Scope( AS_GLOBAL ) );
  135. TOOL_ACTION PL_ACTIONS::clearSelection( TOOL_ACTION_ARGS()
  136. .Name( "plEditor.InteractiveSelection.ClearSelection" )
  137. .Scope( AS_GLOBAL ) );