Commit Graph

51 Commits

Author SHA1 Message Date
Maciej Suminski 338735c5bf Added a missing include to tool_manager.h
Previously full information about VC_SETTINGS type was not
available, so it was not possible to create a VC_SETTINGS stack
for some compilers.
2017-03-07 17:18:58 +01:00
Maciej Suminski fc4240886b Store VIEW_CONTROLS settings on a stack
This is the right implementation of the commit b25ded4d.
Previously if there were tools launched from another tool,
the settings could be stored in a wrong TOOL_STATE object.
2017-03-06 15:04:27 +01:00
Maciej Suminski 1d8730752c Restore valid force cursor setting before saving VIEW_CONTROLS settings
There are times, when TOOL_MANAGER has to force cursor position
to make tools work as expected (e.g. when popping up a menu,
so tools get the right click position instead of current position
pointing to an entry in the menu).

If another tool is invoked, VIEW_CONTROLS settings have to be stored
in the TOOL_STATE object. In such case, it is necessary to revert the
force cursor setting when saving VIEW_CONTROLS settings.

Fixes: lp:1668712
* https://bugs.launchpad.net/kicad/+bug/1668712
2017-03-02 12:07:09 +01:00
Maciej Suminski e34b73e187 Do not freeze cursor when a tool was cancelled using the context menu
dispatchContextMenu() stores the cursor position before displaying a
menu, so the tools use the original cursor position when processing
events (instead of the mouse position pointing to a menu entry). Later,
the previous position has to be restored, but if in the meantime the
tool was cancelled - previous settings were restored to a wrong tool.
2017-02-24 16:55:18 +01:00
Maciej Suminski b25ded4d90 Store VIEW_CONTROLS settings when tools are switched
Fixes: lp:1663783
* https://bugs.launchpad.net/kicad/+bug/1663783

Fixes: lp:1667580
* https://bugs.launchpad.net/kicad/+bug/1667580
2017-02-24 16:47:19 +01:00
Maciej Suminski 4b9243e0bf Allow registering TOOLs in any order. 2017-01-30 13:21:43 +01:00
decimad ee3d75f273 Add coroutine call invocation context to identify the main stack frame.
Run the text draw-tool on the main stack frame.

Fixes: lp:1547282
* https://bugs.launchpad.net/kicad/+bug/1547282
2016-09-21 11:56:40 +02:00
Maciej Suminski cdc951d0a3 Fixed a crash when dragging a line was interrupted
Crash was caused by removing an element from m_activeTools list, causing other iterators to be invalidated.
2016-08-08 17:20:02 +02:00
Michael Steinberg 86496d3141 Pcbnew: fix dangling board reference crash in GAL. (fixes lp:1584489) 2016-08-05 13:45:14 -04:00
Maciej Suminski 33e7fe6211 Fix a crash caused by invalid iterator (thanks to Michael Steinberg)
TOOL_MANAGER::finishTool() caused iterator to become invalid when an element was removed from the m_activeTools deque.
2016-07-04 16:12:21 +02:00
Simon Richter 96ec9db5d6 Add missing C++ stdlib headers
The GCC standard library headers often include other headers, which makes
some code compile that forgets to include several headers.
2016-05-28 12:46:29 -04:00
Maciej Suminski e9921d8eea Fixed an assert when footprint viewer was closed before the pcbnew window. 2015-07-28 10:29:00 +02:00
Maciej Suminski da75c52665 Hot keys settings are synchronized between GAL & legacy 2015-05-05 20:39:42 +02:00
Maciej Suminski 99e5228948 Moved the list of TOOL_ACTIONs to ACTION_MANAGER. 2015-05-05 20:39:41 +02:00
Maciej Suminski 8390fec69d Minor fixes. 2015-04-30 10:46:08 +02:00
Maciej Suminski 74a902da20 Syntactic sugar for TOOL_MANAGER::RunAction(). 2015-04-30 10:46:02 +02:00
Mikhail Karpenko 886a8521a4 Comments typos fixed. 2015-04-06 21:50:12 +02:00
Maciej Suminski f7a32e839e Moved UndoInhibit related functions from TOOL_MANAGER to EDIT_TOOL. 2015-02-19 14:53:31 +01:00
Maciej Suminski f06690c8d3 Merged lp:~john-j-beard/kicad/moveexact. 2015-02-18 20:27:00 +01:00
Maciej Suminski 902d0e3f1f Tools are processing const TOOL_EVENT& (Tool Framework). 2015-02-14 21:28:47 +01:00
John Beard 4f3672da4d Add "move exact" and "duplicate" tools to pcbnew 2015-02-12 03:22:24 +00:00
Maciej Suminski 18898fe807 tool: Added a generic parameter for RunAction(). 2014-11-21 11:28:34 +01:00
jean-pierre charras 24f516f6ae Fix many doxygen warnings (due to missing info, old comments, typo ...) when building the doxygen doc. 2014-11-02 17:25:04 +01:00
Maciej Suminski b1837615aa Added event queue to handle events at the end of the event processing cycle. 2014-07-09 16:25:50 +02:00
Maciej Suminski 456eeaba10 Routines for handling clipboard with TOOL_MANAGER. 2014-07-09 14:01:07 +02:00
Maciej Suminski 94cc845b3f Added AF_ACTIVATE flag for TOOL_ACTIONs.
Reworked the way of processing events in TOOL_MANAGER class.
Added GetCommandStr() for TOOL_EVENT class.
2014-07-09 13:50:27 +02:00
Maciej Suminski 5f806cfa18 Minor fixes to the Tool Framework. 2014-07-09 13:50:27 +02:00
Maciej Suminski f7ecc749f6 Restored std::map in TOOL_MANAGER. 2014-07-09 13:50:27 +02:00
Maciej Suminski dfc052d537 Added an alternative way to reach tools in the Tool Framework. 2014-07-09 11:59:24 +02:00
Maciej Suminski def53707d5 TOOL_MANAGER is no longer static. Reworked autoregistration of TOOL_ACTIONs. 2014-05-14 16:29:53 +02:00
Maciej Suminski 50b202fe99 Hot keys specific to a tool have priority over global hot keys (TOOL_ACTION scope: AS_GLOBAL/AS_CONTEXT is finally handled properly). 2014-04-09 17:05:05 +02:00
Maciej Suminski 4c5afc46af Added possibility of switching tools by the right toolbar buttons, without deactivating the current tool first (previously tools did not switch if there was one active). 2014-04-04 11:50:15 +02:00
Maciej Suminski c7116e9d03 FIxed too late deletion of TOOLs. 2014-03-21 17:55:46 +01:00
Maciej Suminski 0694f2fa1c TOOL_EVENTs autoregister themselves in ACTION_MANAGER.
ROUTER_TOOL events have temporarily changed their hotkeys assignment.
2014-03-21 10:40:50 +01:00
Maciej Suminski c5c83bd271 Added TOOL_MANAGER & ACTION_MANAGER::RunAction( const TOOL_ACTION aAction ).
Selection clearing is invoked using TOOL_ACTION object rather than its name.
2014-02-28 15:46:05 +01:00
Maciej Suminski d8acd1c718 Moved Init() & Reset() from TOOL_INTERACTIVE to TOOL_BASE.
Added REASON enum for Reset() function, so tools will know why a reset occured.
Fixed SELECTION_TOOL (it was bailing out, when a new board was loaded and some items were still selected).
Added removal of VIEW_ITEM groups after changing layers and removing items.
2013-12-09 10:42:38 +01:00
Maciej Suminski ad3cb1f36a Added TOOL_MANAGER::RunAction() function. 2013-12-03 15:41:41 +01:00
Maciej Suminski 0ac3e1fbf2 Namespace KiGfx->KIGFX.
template<> -> template <>
Some more reformatting according to uncrustify results.
2013-10-14 16:13:35 +02:00
Maciej Suminski 6b74b5771a Even more code comments and reformatting. 2013-09-27 18:51:21 +02:00
Maciej Suminski 7b7a331645 Added some const modifiers. 2013-09-26 11:22:59 +02:00
Maciej Suminski 2c03bf4109 Removed TA_ActivateTool (now tools are invoked by sending TA_Action event, with the tool name as string parameter).
Developed TOOL_Action class & added ActionManager. Hot keys registered by tools are processed.
Selection & move tool can be invoked by a hot key.
2013-09-19 17:02:57 +02:00
Maciej Suminski f2b4c7a18b Added a few comments. 2013-09-06 16:01:46 +02:00
Maciej Suminski f93d297cb5 Some comments. 2013-09-04 16:25:57 +02:00
Maciej Suminski e8083ae808 Added some comments and changed names of classes to match the coding rules. 2013-09-02 14:21:12 +02:00
Maciej Suminski fb9a4c2bfc Added stacking for tools. 2013-08-30 10:37:26 +02:00
Maciej Suminski e87eea7abc Reformatting. 2013-08-19 09:47:36 +02:00
Maciej Suminski 9bd7ba36ac Added resetting of tools after loading a new board. 2013-08-15 10:20:49 +02:00
Maciej Suminski 12e10fd43a Reformatting. 2013-08-08 14:59:59 +02:00
Maciej Suminski 282995eaee Fixed disambiguation menu issue. 2013-08-08 14:50:32 +02:00
Maciej Suminski 7d5a456344 Code reformatting. 2013-08-06 10:30:09 +02:00