Commit Graph

99 Commits

Author SHA1 Message Date
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
Jeff Young f76e7568bc Don't warp cursor if the disambiguation menu is cancelled.
Also fixes the empty-selection-context-menu coming up after
a cancelled disambiguation menu.

Fixes: lp:1738339
* https://bugs.launchpad.net/kicad/+bug/1738339
2018-01-02 13:01:55 -05:00
Tomasz Włostowski 3170eba801 refactoring: implemented SELECTION_TOOL's own GetCollectorsGuide() to avoid dependency on PCB_BASE_FRAME 2017-11-03 20:02:06 +01: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
Kristoffer Ödmark c0981b8444 Added a new plugin that can save and load to clipboard, using ctrl+shift+c/v for copy pasting
Added the needed kicad_clipboard files and made copy pasted modules have no path
2017-09-30 14:28:53 +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
Oliver Walters 18488342a5 Improved speed of Duplicate action
- Removed repetitive tool calls
2017-06-12 11:16:30 +02:00
Oliver Walters b53ba56ac2 Use CTRL modifier to deselect items 2017-05-10 10:57:29 +02:00
Robbert Lagerweij e57c962336 Pcbnew: add option to select origin & anchor in move exactly tool
This patch adds a radiobox to allow the user to select a reference point for
the move. The additional options are: User Origin (set with <space>),
Grid Origin and Sheet Origin (effectively making it an absolute coordinate).

A checkbox is added (where it makes sense) to allow overriding which point
within the component is put on top of the designated coordinate.

Fixes: lp:1460460
* https://bugs.launchpad.net/kicad/+bug/1460460
2017-04-25 11:32:49 -04:00
Maciej Suminski bb999f1bbf Fixed items disappearing after a rotation/flip
Fixes: lp:1683831
* https://bugs.launchpad.net/kicad/+bug/1683831
2017-04-20 14:11:59 +02:00
John Beard 9c08873210 Make SELECTION_AREA a generic overlay item
This simplifies the (already simple) SELECTION_AREA class. It is also
moved into KIGFX::PREVIEW and put in the common library, where it can be
reused by other GAL-aware tools (not just in Pcbnew) in future.
2017-03-10 16:21:44 +01:00
jean-pierre charras 7a120ad698 selection_tool.* add comments and use better names for 2 similar methods. 2017-03-04 17:35:34 +01:00
jean-pierre charras 101a600be6 Fix coding style issue and a minor other issue. 2017-03-04 17:35:34 +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
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
Kristoffer Ödmark 69a649c093 Refactored out the function that selects items based on the sheetname 2017-03-03 07:21:41 -05: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
John Beard c6046d6da2 Add selection filter dialog to GAL
Fixes: lp:1535805
* https://bugs.launchpad.net/kicad/+bug/1535805
2017-02-23 10:50:38 +01:00
Kristoffer Ödmark 37c086896e Enables selection of components and tracks on same sheet.
Modifies the selection menu to be adaptive and disable selection options
that are not possible.

Adds a new selection option that is only available when selecting
modules, this tool will select all footprints on the same sheet level or
belonging to subsheets. It will also search for nets that are only
connecting between modules on the same sheet or lower and select every
segment and via belonging to it.
2017-02-11 07:33:49 -05:00
John Beard 0cd121049f Allow selectConnection/Copper/Net on multiple items
The previous behaviour was to act on only the first item in the
selection. The new behaviour is to act on every eligible item (in this
case, tracks and vias).
2017-02-10 22:42:55 +01:00
Maciej Suminski e5fbd0c442 Fixed crash upon finished zone drawing in GAL.
In principle, this patch reverts 2eefa117. The difference is removal of
one unused method (SELECTION::clear) and fixing hidden overloaded
virtual methods warnings.

Fixes: lp:1657569
* https://bugs.launchpad.net/kicad/+bug/1657569
2017-01-18 22:06:23 +01:00
Maciej Suminski 2eefa11732 SELECTION has-a VIEW_GROUP instead of being-a VIEW_GROUP
Fixed numerous warnings caused by hidden overloaded methods
provided in both classes (Add(), Remove(), etc.)
2017-01-18 13:22:41 +01:00
Maciej Suminski c758f434c0 Removed unused fields in VIEW & ANTIALIASING_SMAA classes 2017-01-18 13:22:18 +01:00
John Beard c50d28d94d Access tools' TOOL_MENUs rather than CONDITIONAL_MENUs
This means that non-top-level tools, for example EDIT_TOOL and
PCB_EDITOR_CONTROL can submit their own menus to the top-level tool's
TOOL_MENU, which will then retain a reference to it and make it
available for the CONTEXT_MENU that is shown.
2017-01-12 14:34:03 +01:00
John Beard d7db84e282 Break out tools' common menu functions and ownership
Add a class TOOL_MENU, which provides a management class for a
CONDITIONAL_MENU and a set of CONTEXT_MENUs. The aim of this is to
provide a central place where all TOOL_INTERACTIVEs can get a "basic"
context menu that either they or other tools can register new items and
sub-menus against.

This means that "top-level" tools no longer need to manage the lifetimes
of any CONTEXT_MENUs that they add, and can also delegate simple menu
display functions.
2017-01-12 14:33:57 +01:00
Tomasz Włostowski b20323dc63 SELECTION: fixed pointer arithmetic-related segfault in operator[] 2016-12-20 12:01:09 +01:00
Maciej Suminski 89055c4425 Code formatting 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
Maciej Suminski b661993427 Removed SELECTION_TOOL::EditModules()
as there is already PCB_TOOL::SetEditModules() and
SELECTION_TOOL::m_editModules shadows PCB_TOOL::m_editModules.
2016-09-12 11:50:06 +02:00
Tomasz Wlostowski 1924507001 Added a PCB_TOOL subclass. 2016-09-12 11:50:06 +02:00
Michael Steinberg fde12ebd25 Replace boost::function and boost::bind with their std:: counterparts 2016-06-29 12:23:11 +02:00
Maciej Suminski 75c8094b5a Make DRC markers not editable with the standard tools (GAL). 2016-01-20 15:22:09 +01:00
Maciej Suminski 0bd85fd8d1 Fixed a minor memleak. 2015-08-07 18:20:49 +02:00
Maciej Suminski d6bc33bd42 Removed a few more memory leaks and fixed crash on exit. 2015-07-24 09:42:46 +02:00
Maciej Suminski f0a1f6dd78 Hotkeys for selecting trivial or copper connection (GAL). 2015-07-09 17:11:34 +02:00
Maciej Suminski 33e1797116 Tracks & vias properties dialog. 2015-07-09 13:35:51 +02:00
Maciej Suminski ac10ca40f8 Net highlighting is moved to a separate TOOL_ACTION. 2015-06-18 17:51:50 +02:00
Maciej Suminski 4fe65715a2 Added trivial connection selection (GAL). 2015-05-18 13:48:10 +02:00
Maciej Suminski 958046ddb2 Moved SELECTION_TOOL context menu to a separate class. 2015-04-30 10:46:08 +02:00
Maciej Suminski 9ef9b7b8e1 Preliminary selection mode for SELECTION_TOOL. 2015-04-30 10:46:07 +02:00
Maciej Suminski b8295b6af8 Code formatting. 2015-04-30 10:46:07 +02:00
Maciej Suminski 6379d80636 Zoom & grid menus for GAL canvases. 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
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 56b692ae3e "Select net/connection" (GAL). 2015-03-10 09:36:04 +01:00
Maciej Suminski 0dd9efd9db Merged the differential pair router & length tuning tool. 2015-03-03 11:50:50 +01:00
Maciej Suminski 3e9bb6b887 SELECTION::GetCenter() returns VECTOR2I instead of wxPoint. 2015-02-20 11:40:36 +01:00
Maciej Suminski f06690c8d3 Merged lp:~john-j-beard/kicad/moveexact. 2015-02-18 20:27:00 +01:00