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.

288 lines
8.9 KiB

Horizontal/vertical zoom for Simulator plots ADDED: Horizontal/vertical zoom for simulator plots, via mouse wheel, toolbar buttons, menu commands, and hotkeys. ADDED: Simulator preferences panel, populated with mouse wheel and trackpad settings that control pan and zoom of simulator plots. ADDED: Zoom In/Out Horizontally/Vertically commands that can be bound to hotkeys. CHANGED: Simulator plot scroll wheel gestures are no longer hard-coded and can now be configured via the new Simulator preferences panel. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16597 Other unreported bugs that were fixed: - Fixed wierd, jumpy simulator plot view limiting behavior. - Fixed Zoom In Center and Zoom Out Center commands not preserving the simulator plot center point. - Fixed simulator plot nudging when exported as PNGs. - Fixed rectangular selection zoom being able to exceed simulator plot view limits. Notes: - Provided new SIM_PREFERENCES struct to be used for future simulator preferences set via the simulator preferences dialog. - Bundled pre-existing EESCHEMA_SETTINGS::SIMULATOR settings into EESCHEMA_SETTINGS::SIMULATOR::VIEW. - Replaced mpWindow::EnableMouseWheelPan with more general SetMouseWheelActions. - Refactored and tidied up wxMathPlot's mpWindow code involved with fitting, zooming, and panning. - Consolidated long lists of duplicated member variable initializers to a new mpWindow private delegated constructor. - Provided provisional Zoom In/Out Horizontally/Vertically toolbar icons that need improvement by a graphics designer. - Provided gitignore entries for the Qt Creator IDE
2 years ago
Horizontal/vertical zoom for Simulator plots ADDED: Horizontal/vertical zoom for simulator plots, via mouse wheel, toolbar buttons, menu commands, and hotkeys. ADDED: Simulator preferences panel, populated with mouse wheel and trackpad settings that control pan and zoom of simulator plots. ADDED: Zoom In/Out Horizontally/Vertically commands that can be bound to hotkeys. CHANGED: Simulator plot scroll wheel gestures are no longer hard-coded and can now be configured via the new Simulator preferences panel. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16597 Other unreported bugs that were fixed: - Fixed wierd, jumpy simulator plot view limiting behavior. - Fixed Zoom In Center and Zoom Out Center commands not preserving the simulator plot center point. - Fixed simulator plot nudging when exported as PNGs. - Fixed rectangular selection zoom being able to exceed simulator plot view limits. Notes: - Provided new SIM_PREFERENCES struct to be used for future simulator preferences set via the simulator preferences dialog. - Bundled pre-existing EESCHEMA_SETTINGS::SIMULATOR settings into EESCHEMA_SETTINGS::SIMULATOR::VIEW. - Replaced mpWindow::EnableMouseWheelPan with more general SetMouseWheelActions. - Refactored and tidied up wxMathPlot's mpWindow code involved with fitting, zooming, and panning. - Consolidated long lists of duplicated member variable initializers to a new mpWindow private delegated constructor. - Provided provisional Zoom In/Out Horizontally/Vertically toolbar icons that need improvement by a graphics designer. - Provided gitignore entries for the Qt Creator IDE
2 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2013-2016 CERN
  5. * Copyright (C) 2016-2024 KiCad Developers, see AUTHORS.txt for contributors.
  6. * @author Maciej Suminski <maciej.suminski@cern.ch>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. #ifndef __ACTIONS_H
  26. #define __ACTIONS_H
  27. #include <tool/tool_action.h>
  28. #include <tool/tool_event.h>
  29. #define LEGACY_HK_NAME( x ) x
  30. /**
  31. * Gather all the actions that are shared by tools.
  32. *
  33. * The instance of a subclass of ACTIONS is created inside of #ACTION_MANAGER object that
  34. * registers the actions.
  35. */
  36. class ACTIONS
  37. {
  38. public:
  39. virtual ~ACTIONS() {};
  40. // Generic document actions
  41. static TOOL_ACTION doNew; // sadly 'new' is a reserved word
  42. static TOOL_ACTION newLibrary;
  43. static TOOL_ACTION addLibrary;
  44. static TOOL_ACTION open;
  45. static TOOL_ACTION save;
  46. static TOOL_ACTION saveAs;
  47. static TOOL_ACTION saveCopy;
  48. static TOOL_ACTION saveAll;
  49. static TOOL_ACTION revert;
  50. static TOOL_ACTION pageSettings;
  51. static TOOL_ACTION print;
  52. static TOOL_ACTION plot;
  53. static TOOL_ACTION quit;
  54. static TOOL_ACTION ddAddLibrary; // for drag and drop lib
  55. // Generic edit actions
  56. static TOOL_ACTION cancelInteractive;
  57. static TOOL_ACTION finishInteractive;
  58. static TOOL_ACTION showContextMenu;
  59. static TOOL_ACTION undo;
  60. static TOOL_ACTION redo;
  61. static TOOL_ACTION cut;
  62. static TOOL_ACTION copy;
  63. static TOOL_ACTION paste;
  64. static TOOL_ACTION pasteSpecial;
  65. static TOOL_ACTION selectAll;
  66. static TOOL_ACTION unselectAll;
  67. static TOOL_ACTION duplicate;
  68. static TOOL_ACTION doDelete; // sadly 'delete' is a reserved word
  69. static TOOL_ACTION deleteTool;
  70. static TOOL_ACTION leftJustify;
  71. static TOOL_ACTION centerJustify;
  72. static TOOL_ACTION rightJustify;
  73. static TOOL_ACTION expandAll;
  74. static TOOL_ACTION collapseAll;
  75. // Tables
  76. static TOOL_ACTION selectRows;
  77. static TOOL_ACTION selectColumns;
  78. static TOOL_ACTION selectTable;
  79. static TOOL_ACTION addRowAbove;
  80. static TOOL_ACTION addRowBelow;
  81. static TOOL_ACTION addColBefore;
  82. static TOOL_ACTION addColAfter;
  83. static TOOL_ACTION deleteRows;
  84. static TOOL_ACTION deleteColumns;
  85. static TOOL_ACTION mergeCells;
  86. static TOOL_ACTION unmergeCells;
  87. static TOOL_ACTION editTable;
  88. // Find and Replace
  89. static TOOL_ACTION showSearch;
  90. static TOOL_ACTION find;
  91. static TOOL_ACTION findAndReplace;
  92. static TOOL_ACTION findNext;
  93. static TOOL_ACTION findPrevious;
  94. static TOOL_ACTION findNextMarker;
  95. static TOOL_ACTION replaceAndFindNext;
  96. static TOOL_ACTION replaceAll;
  97. static TOOL_ACTION updateFind;
  98. // RC Lists
  99. static TOOL_ACTION prevMarker;
  100. static TOOL_ACTION nextMarker;
  101. static TOOL_ACTION excludeMarker;
  102. // View controls
  103. static TOOL_ACTION zoomRedraw;
  104. static TOOL_ACTION zoomIn;
  105. static TOOL_ACTION zoomOut;
  106. static TOOL_ACTION zoomInCenter;
  107. static TOOL_ACTION zoomOutCenter;
  108. static TOOL_ACTION zoomInHorizontally;
  109. static TOOL_ACTION zoomOutHorizontally;
  110. static TOOL_ACTION zoomInVertically;
  111. static TOOL_ACTION zoomOutVertically;
  112. static TOOL_ACTION zoomCenter;
  113. static TOOL_ACTION zoomFitScreen;
  114. static TOOL_ACTION zoomFitObjects; // Zooms to bbox of items on screen (except page border)
  115. static TOOL_ACTION zoomPreset;
  116. static TOOL_ACTION zoomTool;
  117. static TOOL_ACTION zoomUndo;
  118. static TOOL_ACTION zoomRedo;
  119. static TOOL_ACTION centerContents;
  120. static TOOL_ACTION toggleCursor;
  121. static TOOL_ACTION toggleCursorStyle;
  122. static TOOL_ACTION highContrastMode;
  123. static TOOL_ACTION highContrastModeCycle;
  124. static TOOL_ACTION toggleBoundingBoxes;
  125. static TOOL_ACTION refreshPreview; // Similar to a synthetic mouseMoved event, but also
  126. // used after a rotate, mirror, etc.
  127. static TOOL_ACTION pinLibrary;
  128. static TOOL_ACTION unpinLibrary;
  129. /// Cursor control with keyboard
  130. static TOOL_ACTION cursorUp;
  131. static TOOL_ACTION cursorDown;
  132. static TOOL_ACTION cursorLeft;
  133. static TOOL_ACTION cursorRight;
  134. static TOOL_ACTION cursorUpFast;
  135. static TOOL_ACTION cursorDownFast;
  136. static TOOL_ACTION cursorLeftFast;
  137. static TOOL_ACTION cursorRightFast;
  138. static TOOL_ACTION cursorClick;
  139. static TOOL_ACTION cursorDblClick;
  140. // Panning with keyboard
  141. static TOOL_ACTION panUp;
  142. static TOOL_ACTION panDown;
  143. static TOOL_ACTION panLeft;
  144. static TOOL_ACTION panRight;
  145. // Grid control
  146. static TOOL_ACTION gridFast1;
  147. static TOOL_ACTION gridFast2;
  148. static TOOL_ACTION gridFastCycle;
  149. static TOOL_ACTION gridNext;
  150. static TOOL_ACTION gridPrev;
  151. static TOOL_ACTION gridSetOrigin;
  152. static TOOL_ACTION gridResetOrigin;
  153. static TOOL_ACTION gridPreset;
  154. static TOOL_ACTION toggleGrid;
  155. static TOOL_ACTION toggleGridOverrides;
  156. static TOOL_ACTION gridProperties;
  157. static TOOL_ACTION gridOrigin;
  158. // Units
  159. static TOOL_ACTION inchesUnits;
  160. static TOOL_ACTION milsUnits;
  161. static TOOL_ACTION millimetersUnits;
  162. static TOOL_ACTION updateUnits;
  163. static TOOL_ACTION toggleUnits;
  164. static TOOL_ACTION togglePolarCoords;
  165. static TOOL_ACTION resetLocalCoords;
  166. // Common Tools
  167. static TOOL_ACTION selectionTool;
  168. static TOOL_ACTION measureTool;
  169. static TOOL_ACTION pickerTool;
  170. static TOOL_ACTION pickerSubTool;
  171. // Misc
  172. static TOOL_ACTION showProjectManager;
  173. static TOOL_ACTION show3DViewer;
  174. static TOOL_ACTION showSymbolBrowser;
  175. static TOOL_ACTION showSymbolEditor;
  176. static TOOL_ACTION showFootprintBrowser;
  177. static TOOL_ACTION showFootprintEditor;
  178. static TOOL_ACTION updatePcbFromSchematic;
  179. static TOOL_ACTION updateSchematicFromPcb;
  180. static TOOL_ACTION showProperties;
  181. // Internal
  182. static TOOL_ACTION updateMenu;
  183. static TOOL_ACTION activatePointEditor;
  184. static TOOL_ACTION cycleArcEditMode;
  185. static TOOL_ACTION updatePreferences;
  186. static TOOL_ACTION selectLibTreeColumns;
  187. // Suite
  188. static TOOL_ACTION openPreferences;
  189. static TOOL_ACTION configurePaths;
  190. static TOOL_ACTION showSymbolLibTable;
  191. static TOOL_ACTION showFootprintLibTable;
  192. static TOOL_ACTION gettingStarted;
  193. static TOOL_ACTION help;
  194. static TOOL_ACTION about;
  195. static TOOL_ACTION listHotKeys;
  196. static TOOL_ACTION donate;
  197. static TOOL_ACTION getInvolved;
  198. static TOOL_ACTION reportBug;
  199. // API
  200. static TOOL_ACTION pluginsReload;
  201. ///< Cursor control event types
  202. enum CURSOR_EVENT_TYPE
  203. {
  204. CURSOR_NONE = 0,
  205. CURSOR_UP,
  206. CURSOR_UP_FAST,
  207. CURSOR_DOWN,
  208. CURSOR_DOWN_FAST,
  209. CURSOR_LEFT,
  210. CURSOR_LEFT_FAST,
  211. CURSOR_RIGHT,
  212. CURSOR_RIGHT_FAST,
  213. CURSOR_CLICK,
  214. CURSOR_DBL_CLICK,
  215. CURSOR_RIGHT_CLICK
  216. };
  217. ///< Remove event modifier flags
  218. enum class REMOVE_FLAGS
  219. {
  220. NORMAL = 0x00,
  221. ALT = 0x01,
  222. CUT = 0x02
  223. };
  224. };
  225. /**
  226. * Gather all the events that are shared by tools.
  227. */
  228. class EVENTS
  229. {
  230. public:
  231. const static TOOL_EVENT PointSelectedEvent;
  232. const static TOOL_EVENT SelectedEvent;
  233. const static TOOL_EVENT UnselectedEvent;
  234. const static TOOL_EVENT ClearedEvent;
  235. const static TOOL_EVENT ConnectivityChangedEvent;
  236. ///< Selected item had a property changed (except movement)
  237. const static TOOL_EVENT SelectedItemsModified;
  238. ///< Selected items were moved, this can be very high frequency on the canvas, use with care
  239. const static TOOL_EVENT SelectedItemsMoved;
  240. ///< Used to inform tools that the selection should temporarily be non-editable
  241. const static TOOL_EVENT InhibitSelectionEditing;
  242. const static TOOL_EVENT UninhibitSelectionEditing;
  243. ///< Used to inform tool that it should display the disambiguation menu
  244. const static TOOL_EVENT DisambiguatePoint;
  245. ///< Used for hotkey feedback
  246. const static TOOL_EVENT GridChangedByKeyEvent;
  247. const static TOOL_EVENT ContrastModeChangedByKeyEvent;
  248. const static TOOL_EVENT UndoRedoPreEvent;
  249. const static TOOL_EVENT UndoRedoPostEvent;
  250. };
  251. #endif // __ACTIONS_H