Tomasz Włostowski
eedf7cb243
Switched coroutine library from Boost libcotext to custom libcontext.
...
Fixes lp:1658249
https://bugs.launchpad.net/kicad/+bug/1658249
2017-03-07 11:45:29 -05:00
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
Tomasz Włostowski
966052272f
Coding style fixes
2017-03-03 20:27:05 +01:00
Tomasz Włostowski
cc3d79f932
Reworked selection passing mechanism in SELECTION_TOOL.
...
- The tools can now specify if the items in the selection must be editable/
deletable. This is groundwork to be able to select/delete DRC markers, which can't
otherwise be edited.
- Fixed disappearing of selected objects
2017-03-03 20:26:34 +01:00
Jon Evans
88f7c55d95
Move ZoomFitScreen and ZoomPreset from PCBNEW_CONTROL to COMMON_TOOLS
...
BOARD::GetBoundingBox() now directly calls BOARD::ComputeBoundingBox()
and there is a new method BOARD::GetBoardEdgesBoundingBox() used for
call sites that needed to use ComputeBoundingBox( true ) in the past.
This allows COMMON_TOOLS to implement ZoomFitScreen without knowledge
of the BOARD class.
2017-03-03 13:28:19 +01:00
Kristoffer Ödmark
dda51ab550
CrossProbes Schematics from eeschema to pcbnew
...
Adds a similar crossprobe as modules has in pcbnew. When clicking a
sheet in eeschema, the items that are exclusive in that scheet will be
selected in pcbnew if using the GAL canvas.
2017-03-03 07:25:32 -05: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
Jon Evans
fd4e2b042c
Refactor SELECTION, SELECTION_CONDITIONS, and context menus to common
...
SELECTION now holds EDA_ITEMs not BOARD_ITEMs so various places had to
change to casting the selected items to BOARD_ITEMs.
Fixed compilation warnings on clang (Tom)
2017-02-28 14:47:20 +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
John Beard
c001c6114f
Add cancel interactive tool action to GAL
...
This is used to provide menu entries that allows cancellation of
interactive drawing and routing tools without needing the keyboard.
It is provided in the drawing tools and the router tool.
The cancel event doesn't have any new functionality (e.g. track rip-up
for the PNS router - lp:1448460), this just adds it to the menu, where
it behaves the same as an Escape keypress.
2017-02-24 10:37:07 +01:00
jean-pierre charras
a9d6af8001
Fix a comment
2017-02-23 13:17:23 +01:00
jean-pierre charras
10396ff435
Tool manager: renames Yield() to KiYield(), due to a collision name between the Yield macro in wxWidgets and Tool manager Yield.
...
Can be dependent on platforms.
2017-02-23 08:30:29 +01:00
Maciej Suminski
d7bf44eee0
Removed a few more headers from base_struct.h
2017-02-22 17:54:01 +01:00
Jon Evans
4c83b0a94d
Move TOOL_ACTIONs to their corresponding tools; create COMMON_TOOLS
...
Some grid/zoom tools are left in PCBNEW_CONTROL because they currently
depend on Pcbnew-specific class members. Once refactoring is done to
make it possible to use all zoom and grid controls outside of pcbnew,
these last tools can be moved to common to match their ACTIONs.
2017-02-22 10:32:48 +01:00
Jon Evans
167f45ca2b
Refactor COMMON_ACTIONS into a base and derived class
...
New virtual class ACTIONS is added as a member to EDA_DRAW_FRAME so
that the TOOL_DISPATCHER can have access to the appropriate derived
version of TranslateLegacyId()
2017-02-22 10:32:48 +01:00
John Beard
ca91c27852
Adjust pad sub-menu enablements
...
The apply settings and push settings options now take account of the
validity of the global pad settings when deciding whether to show or
not.
Global pad push now requires a source pad and doesn't push from the
global pad setting when there is no selection.
The whole submenu is hidden when there are no enabled items.
Fixes: lp:1664016
* https://bugs.launchpad.net/kicad/+bug/1664016
2017-02-20 11:08:34 +01:00
Maciej Suminski
060e163511
Fixed invoking TOOL_ACTIONs in submenus
...
Fixes: lp:1663101
* https://bugs.launchpad.net/kicad/+bug/1663101
2017-02-10 00:08:23 +01:00
Maciej Suminski
4b9243e0bf
Allow registering TOOLs in any order.
2017-01-30 13:21:43 +01:00
Maciej Suminski
1102eb0d0d
Store menu titles in CONTEXT_MENU
...
Previously a title had to be provided when a submenu was added,
but this led to storing the same title in many places.
2017-01-23 14:52:11 +01:00
Maciej Suminski
fc7be1a497
Removed redundant CONTEXT_MENU::m_parent field.
2017-01-23 11:40:59 +01:00
Maciej Suminski
682da70a86
Fixed the issue of creating and event handling in context menus (GAL).
...
When creating a copy of CONTEXT_MENU, always a CONTEXT_MENU instance was
constructed, whereas an inherited type should be used. Solved with
CONTEXT_MENU::create() that has to be overridden in inheriting classes.
Event & update handlers are now virtual functions, instead of setting
the handlers with Set{Event,Update}Handler().
2017-01-23 11:40:59 +01:00
Maciej Suminski
524dddaf70
Sync the PNS model when its changed
2016-11-28 15:51:18 +01:00
Simon Richter
59c81976dc
Explicitly mark overriding functions.
2016-09-24 14:53:15 -04:00
Maciej Suminski
3623421912
Fixed a PNS crash after undoing the last operation while routing
2016-09-23 13:58:33 +02:00
decimad
6a9c1cb6a1
Split the undo/redo event into the two stages "pre" and "post" for convenient synchronization of dependent state.
2016-09-23 13:29:25 +02: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
decimad
18b7dbf4d1
Refactor coroutine to improve readability and removed unnecessary heap allocations. Added documentation/links to various boost doc revisions.
2016-08-02 11:39:39 +02:00
decimad
78bc3c65de
use a guarded stack for coroutines in boost version 1.61
2016-07-05 18:02:50 +02:00
Michael Steinberg
06d4894fdb
boost::context fixes to make it compatible with boost 1.61
2016-07-05 00:14:32 +02: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
Michael Steinberg
fde12ebd25
Replace boost::function and boost::bind with their std:: counterparts
2016-06-29 12:23:11 +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
9ecc593aac
TOOL_SETTINGS acquires wxConfigBase each time it is used.
2015-08-07 18:17:51 +02:00
Tomasz Wlostowski
9c2bcb2f3c
Fixed crash on right click on zone with GAL mode.
2015-08-03 11:53:58 +02: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
59af7a96f8
Minor code cleaning.
2015-07-15 14:08:52 +02:00
Andrew Zonenberg
6289f5bcf4
Fixed a bug causing layer-switch events to noe be handled by GAL.
2015-07-13 17:18:29 +02:00
Andrew Zonenberg
0a5847c71a
Removed a couple of trailing spaces
2015-07-12 21:57:07 -07:00
Andrew Zonenberg
1ad3b05664
Fixed a bug causing layer-switch events to not be handled by GAL
2015-07-12 21:52:17 -07:00
Maciej Suminski
3cb095b7c2
GAL canvases update status bar, message panel & zoom widget.
2015-07-03 20:58:12 +02:00
Maciej Suminski
766da1e494
Code formatting.
2015-07-02 16:11:15 +02:00
Tomasz Wlostowski
a86fda1d37
tools: added TOOL_SETTINGS class for storing persistent tool settings in config file (just a wrapper for wxConfigBase) router: free angle mode (mark obstacles only) & persistent settings
2015-07-02 16:09:51 +02:00
Maciej Suminski
a988ebaabd
Zone merging (GAL).
2015-06-19 17:32:33 +02:00
Maciej Suminski
b9805e4530
Added missing contents for TOOL_EVENT_LIST operator||.
2015-06-05 17:49:01 +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
b218c1099f
Added TA_CONTEXT_MENU_CLOSED tool event.
2015-04-30 10:46:07 +02:00
Maciej Suminski
06b978b829
Refactored CONTEXT_MENU, added handler for updating.
2015-04-30 10:46:05 +02:00
Maciej Suminski
4be876a13a
Expandable CONTEXT_MENUs (GAL). Minor CONTEXT_MENU
2015-04-30 10:46:04 +02:00
Maciej Suminski
946b9d1933
setTransitions() are called automatically for tools.
2015-04-30 10:46:03 +02:00
Maciej Suminski
74a902da20
Syntactic sugar for TOOL_MANAGER::RunAction().
2015-04-30 10:46:02 +02:00
Maciej Suminski
5c984aa069
Parametrized TOOL_ACTIONs.
2015-04-30 10:46:01 +02:00
Mikhail Karpenko
886a8521a4
Comments typos fixed.
2015-04-06 21:50:12 +02:00
jean-pierre charras
4def0958a5
Fix some coverity warnings. Fix typo and errors in comments. Very minor other fixes.
2015-04-03 11:13:06 +02:00
Maciej Suminski
b1cd83c197
Icons in GAL context menus.
2015-04-02 16:09:48 +02:00
Maciej Suminski
6083f3b011
Internationalization of GAL dialogs & menus.
2015-04-02 16:09:26 +02:00
Maciej Suminski
a72a04654c
MInor fix for Tool Framework notifications.
2015-03-10 13:20:22 +01: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
2647fdfd89
Fixed context submenus event handlers (GAL/Windows).
2015-01-25 19:11:02 +01: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
b30e0dd869
Boost 1.56 compatibility fix.
2014-08-26 11:16:56 +02:00
Maciej Suminski
468e9e4ac9
Initalize fields in TOOL_EVENT constructors.
2014-08-08 14:34:44 +02: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
c0a96141df
Added AF_NOTIFY flag for TOOL_ACTIONs.
2014-07-09 15:10:32 +02:00
Maciej Suminski
2b0e27f132
Introduced SELECTION_CONDITIONS to determine which menu entries should be visible in the SELECTION_TOOL context menu, depending on the selection.
2014-07-09 15:10:32 +02:00
Maciej Suminski
72c70148e8
Fixed a few memory leaks and Valgrind warnings.
2014-07-09 15:02:56 +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
f8f6fd41ad
Introduced a new type of action: TA_ACTIVATE to distinguish events activating tools from common tool actions.
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
2ee890d74b
Minor changes.
2014-07-09 11:59:24 +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
60b0a4e0be
Alternative approach to handling events and commands by TOOL_DISPATCHER.
...
Event handlers are (dis)connected depending on the active view.
TOOL_DISPATCHER inherits from wxEvtHandler, so now it receives events directly instead of being fed by external handlers.
2014-07-09 11:22:42 +02:00
Maciej Suminski
3fd26b6dd2
TOOL_ACTIONs are automagically registered by TOOL_MANAGER upon its construction.
2014-07-09 11:22:42 +02:00
Maciej Suminski
f5325f8d79
Removed a redundant pointer to EDA_EDIT_FRAME.
2014-07-09 11:22:42 +02:00
Maciej Suminski
f5de166a7e
Removed an unused parameter from TOOL_BASE::getModel<T>() method.
2014-06-06 14:59:25 +02:00
Maciej Suminski
b1a19b1225
Setting proper tool for submenus of CONTEXT_MENU class.
2014-05-31 16:04:10 +02:00
Maciej Suminski
dd1fcd0588
Fix for context menu hanging up in GAL.
2014-05-22 17:59:36 +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
e2feefc08c
Fixed custom event handlers for CONTEXT_MENU.
...
Moved menuCopy to CONTEXT_MENU copy constructor.
2014-05-13 11:22:51 +02:00
Maciej Suminski
05ee03d6b0
Recursive copy constructor for CONTEXT_MENU.
2014-05-13 11:22:51 +02:00
Maciej Suminski
8bb5eaa434
Better way of adding CONTEXT_MENU entries.
2014-05-13 11:22:50 +02:00
Maciej Suminski
3f8d9da31f
Key events are handled by wxEVT_CHAR instead of wxEVT_KEY_[UP|DOWN]. Fixed issue of chars that require modifiers (e.g. ? is Shift+/ on US keyboard layout).
2014-04-09 17:33:22 +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
60e9546b62
PCB_EDIT_FRAME::SetHighContrastLayer() went public.
...
Refactored code that handled zooming events.
Added PCB_RENDER_SETTINGS::Get/SetSketchMode().
PCBNEW_CONTROL reacts to hot keys changing display modes (sketch via/tracks, high contrast).
2014-03-24 17:20:23 +01: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
e6598e9d41
Added VIEW::ToWorld( double ).
...
TOOL_EVENT message is supposed to contain string as parameter.
Added missing header for class_drawsegment.h (KiROUND).
Renamed SELECTION_TOOL::containsSelected() to SELECTION_TOOL::selectionContains().
2014-02-27 16:13:27 +01:00