Commit Graph

86 Commits

Author SHA1 Message Date
Ian McInerney 6692935808 Consolidate common viewer actions across cvpcb and pcbnew frames
* Consolidate the measure tool into one tool (this gives cvpcb
  unit changing and snapping capabilities in its measure tool)
* Transition cvpcb to use actions for the sketch modes
* Replumb how magnetic items settings are stored and used
2020-05-24 11:58:33 +01:00
Andrew Downing a8dea9274f modify behavior of position relative tool
CHANGED: The reset buttons now set the X or Y offset to the current
offset from the reference position. Selecting individual pads as the reference item is now also possible.
2020-03-02 20:55:06 +00:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Jeff Young 48c8ac9663 Added new action for "Change Track Width".
Default out-of-the-box is no hotkey. Removed all the preference stuff.

Note that the new implementation is a little different: the old one only
operated on a selection with a single item where the new one operates on
all selected items. So if you want the whole track do a 'U' before the 'W'
(or whatever you have Change Track Width assigned to).

Fixes: lp:1844023
* https://bugs.launchpad.net/kicad/+bug/1844023
2019-11-05 17:22:51 +00:00
Jeff Young 045f5f6a61 Move some functions out of SELECTION_TOOL that don't really belong there. 2019-08-13 13:29:18 +01:00
Jeff Young c836cc9cf8 Don't use activate to move as the edit tool must activate for other ops.
Fixes: lp:1839534
* https://bugs.launchpad.net/kicad/+bug/1839534
2019-08-10 11:58:05 +01:00
Jeff Young 7c1049d86b Fix event-loop issue with some pickers.
RunAction returns immediately even when called with "run now" flag.

Fixes: lp:1836905
* https://bugs.launchpad.net/kicad/+bug/1836905
2019-07-17 21:35:28 +01:00
Jeff Young e816a0c29d Push Eeschema & PLEditor PICKER_TOOLs down into common.
Also implements a more robust push/pop tool strategy for pickers.
2019-07-16 00:44:01 +01:00
Jeff Young ecc5fc9894 Cleanup. 2019-07-10 01:38:02 +01:00
Jeff Young da71a51029 Cleanup. 2019-07-02 00:48:05 +01:00
Jeff Young 9effd24f3a Allow move tool to run on top of other tools.
Fixes: lp:1784480
* https://bugs.launchpad.net/kicad/+bug/1784480
2019-07-01 22:15:25 +01:00
Jeff Young ce1f35a1be Cleanup some left-over vestiages of the legacy canvas architecture. 2019-06-13 15:51:32 +01:00
Jeff Young 765606012f Convert separate-compilation of selection.cpp to polymorphism. 2019-06-10 23:46:00 +01:00
Jeff Young 3912c7407f Move global commands to ACTIONs.
Also fixes a crash bug opening Edit Tracks and Vias dialog.
2019-06-03 21:08:30 +01:00
Jeff Young 568c8c336b Move DRC control to a tool; move assorted commands to ACTIONS. 2019-06-03 21:08:30 +01:00
Jeff Young f602ccd814 Insert EE_TOOL_BASE under SchEdit and LibEdit tools, and fix errant rename scope which clobbered PCBNew's PICKER_TOOL. 2019-05-12 13:47:08 +01:00
Seth Hillbrand 994be43782 ratsnest: Calculate ratsnest per pad
The local/dynamic ratsnest needs to calculate on a per-pad basis as the
module is always listed as having a visible ratsnest.  This fixes the
finalized ratsnest viewed when routing as well as the show local
ratsnest regression.

Fixes: lp:1811010
* https://bugs.launchpad.net/kicad/+bug/1811010
2019-01-08 17:19:30 -08:00
Seth Hillbrand 1c99784e92 pcbnew: Locked deletion prompting
Instead of a nag screen for locked items, we allow first the unlocked
items to be deleted and then, with a repeated request, the locked items.

This adds a popup cursor window informing the user of the option for
repeating the delete

Fixes: lp:1806507
* https://bugs.launchpad.net/kicad/+bug/1806507
2018-12-13 12:32:58 -08:00
Jeff Young 6764cda34d Fix issues with pad locking.
Fixes: lp:1794548
* https://bugs.launchpad.net/kicad/+bug/1794548
2018-09-26 21:57:35 +01:00
Jeff Young 37f7faf433 Move lock checks to CLIENT_SELECTION_FILTER.
Also checks render item visibility as well as layer visibility
when making selections.

Fixes: lp:1066220
* https://bugs.launchpad.net/kicad/+bug/1066220

Fixes: lp:1541756
* https://bugs.launchpad.net/kicad/+bug/1541756
2018-09-25 17:56:38 +01:00
Jeff Young 30bb911154 Bring PICKER_TOOL in line with other tools.
Use standard Magnetize() to handle grid and magnetic pads.

Use the standard menu from PCB_TOOL.  Delegating the menu to
the SELECTION_TOOL just caused grief.

Also brings clients (such as Position Relative To) into line,
and implements better Cancel behaviour.

Also improves visibility of modal status messages:
- moves Select Anchor message from status bar to popup
- moves Select Reference message from dialog to popup

Fixes: lp:1786727
* https://bugs.launchpad.net/kicad/+bug/1786727
2018-08-23 00:58:01 +01:00
Jeff Young c655bffac1 Improve context menu consistency.
Also fixes some interactivity issues in the microwave tools around
single-click tools that have initial properties dialogs.  Those
need to act kind of like a hybrid between single-click and two-click
tools.

Fixes: lp:1751381
* https://bugs.launchpad.net/kicad/+bug/1751381
2018-08-02 11:01:03 +01:00
Jeff Young afd80c3cdb Fix botched attempt to have ruler adjust to unit changes.
Also fixes the context menu so there's a specific one for the
measurement tool, allowing zooming for instance without cancelling
the tool.
2018-07-23 12:37:01 +01:00
Jeff Young 05ef6f05d1 Move SanitizePads to CLIENT_SELECTION_FILTER architecture.
This not only reduces the number of different mechanisms, but
will also reduce (yet again) the number of Clarify Selection
pop-ups (because the CLIENT_SELECTION_FILTER runs before the
pop-up, while SanitizePads ran after it).

Fixes: lp:1710451
* https://bugs.launchpad.net/kicad/+bug/1710451

(cherry picked from commit e50a993)
2018-07-17 15:10:18 +01:00
Carsten Schoenert 77b3a662fc fix misspelled 'Allows to' -> 'Allows one to' 2018-04-08 13:24:30 -04:00
Jeff Young 4c29ab6c09 Simplify Exchange Footprints dialog and add Update mode.
This commit also adds a no-selection-mode, which allows the user
to specify what gets update (through the various match modes).
The no-selection-mode is accessed via the Edit menu, although
it could also be applied to the context menu.

Fixes: lp:1466857
* https://bugs.launchpad.net/kicad/+bug/1466857
2018-01-24 09:55:39 -05:00
Jeff Young 3f6af59cac Avoid selection disambiguation menu when possible.
Some actions, such as select trivial connection, don't need the
user to choose which trace at a corner to start from -- either
one will do.  Same for moving a simple trace corner.

Likewise, Edit in Footprint Editor shouldn't ask if you mean the
footprint or the pad.  Obviously it's the footprint.

This change adds a CLIENT_SELECTION_FILTER which allows clients
to do tool- or action-specific filtering of the selection before
the disambiguation menu is run.

It also removes some tool- and action-specific code which was
in the selection_tool and shouldn't have been.

Fixes: lp:1708869
* https://bugs.launchpad.net/kicad/+bug/1708869
2018-01-18 09:09:25 +01:00
Tomasz Włostowski c6a0ad895b pcbnew: code formatting, removed previous module editor copy/paste functions 2017-09-30 14:28:54 +02:00
Tomasz Włostowski 5731000135 pcbnew/copy&paste: multiple improvements:
- fixed netcode propagation bug
- factored out EDIT_TOOL::m_offset, now selection offset is stored in SELECTION class
- added VECTOR2I-based Move/Flip/Rotate methods in BOARD_ITEM
2017-09-30 14:28:54 +02:00
Tomasz Włostowski 931a1ccaff Improved copy/paste functionality by Kristoffer:
- added selection of reference point
- added snapping when pasting
- some minor code refactoring
- disabled pasting between footprint and pcb editors due to model incompatibility
2017-09-30 14:28:54 +02:00
Kristoffer Ödmark b4879d061c Fixed menu items, moved the copy and cut to the EDIT_TOOL, Fixed rendering when copying a module 2017-09-30 14:28:53 +02:00
Tomasz Włostowski 60fdc6229d router: fixed inline dragging & settings dialogs inconsistency 2017-08-22 16:44:58 +02:00
Tomasz Włostowski 2d9ab80b4e Few improvements to the GAL router:
- missing 'break track' functionality
- 'drag 45 degree' and 'drag free angle' context menu shorcuts, both in the router tool and in the default context menu
- bugfix: length tuner tool can now be used again

Fixes: lp:1708386
* https://bugs.launchpad.net/kicad/+bug/1708386

Fixes: lp:1708402
* https://bugs.launchpad.net/kicad/+bug/1708402
2017-08-07 14:28:46 +02:00
Maciej Suminski 1ac34b44bf Removed explicit calls to update ratsnest from EDIT_TOOL 2017-08-01 15:22:23 +02:00
Maciej Suminski 76bd05a69b Prevent creating too many transitions by TOOL_MANAGER
- added TOOL_INTERACTIVE::resetTransitions()
- made protected and moved TOOL_BASE::setTransitions() to TOOL_INTERACTIVE
- TOOL_MANAGER calls TOOL_INTERACTIVE::resetTransitions() instead of
setTransitions()
2017-07-31 15:09:19 +02:00
Maciej Suminski 64f00f447f pcbnew - refactor move exactly tool (3/2)
* code formatting
* turned EDIT_TOOL::getAnchorPoint() to static getAnchorPoint()
* removed unnecessary include directives
2017-07-19 11:36:35 +02:00
Robbert Lagerweij b7f2525c5d pcbnew - refactor move exactly tool (2/2)
This patch does the following:
* extracts a method to determine the anchor point of the move
* improves the logic of the anchor point determination for selections of multiple objects which do not contain footprints
2017-07-19 11:36:35 +02:00
Maciej Suminski f3fbce9560 Code formatting and clean-up 2017-06-23 15:43:13 +02:00
Tomasz Włostowski 9ad886344b New connectivity algorithm. 2017-06-23 11:12:36 +02:00
Oliver Walters 18488342a5 Improved speed of Duplicate action
- Removed repetitive tool calls
2017-06-12 11:16:30 +02:00
Maciej Suminski d452a5a30c Moved ratsnest update from EDIT_TOOL to PCB_EDITOR_CONTROL 2017-04-20 14:43:42 +02:00
John Beard 8c3b8ee693 Add a ruler tool to pcbnew GAL
This allows to measure between features on a PCB. It uses a preview
EDA_ITEM in common, but due to the use of the IDs, it's currently
Pcbnew/Modedit only.

This also adds several "utils" for graphical functons useful when
drawing preview items on GAL canvases.

Fixes: lp:1467313
* https://bugs.launchpad.net/kicad/+bug/1467313
2017-03-10 16:21:44 +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
John Beard fb6de689b9 Factor an EDIT_TOOL selection routine
Also add some commentary to other EDIT_TOOL selection functions.
2017-02-01 09:57:58 +01:00
John Beard 45b60b1bb0 Add exchange modules GAL tool (in EDIT_TOOL)
Includes tool action and the transistion binding in EDIT_TOOL.

Fixes: lp:1541460
* https://bugs.launchpad.net/kicad/+bug/1541460
2017-02-01 09:57:36 +01:00
John Beard 0f5bfdb156 Add mirror tool action for GAL module editor
This is basically a simple clone of the legacy tool with a few minor
tidy-ups for GAL mode.

Fixes: lp:1619301
* https://bugs.launchpad.net/kicad/+bug/1619301
2017-01-25 20:17:28 +01:00
Maciej Suminski 89055c4425 Code formatting 2016-12-12 16:45:52 +01:00
Tomasz Włostowski 1c1f4e9a50 Refactoring of VIEW/VIEW_ITEM classes:
- Remove dependency of EDA_ITEM on VIEW
- VIEW_ITEM is now a pure virtual interface
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 27a10e8597 Multiple simplifications to GAL tools in PCBNew:
- Finalize transition to BOARD_COMMIT (removed all remaining uses of PICKED_ITEMS_LIST) and implicit view/ratsnest updates
- Simplified SELECTION class, it now can be directly added to a VIEW
- Removed unnecesary casts and templates
- Introduced C++11 features (range based for, lambdas) where they improve code readability
- Added non-undoable COMMITs, which can be used to propagate change notifications to interested listeners (e.g. ratsnest/view)
2016-12-12 16:45:52 +01:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00