Commit Graph

65 Commits

Author SHA1 Message Date
Jeff Young 98330098ac Yet another overhaul to locking.
This unifies everything under a single architecture with a "don't
show again" dialog.  Since everything now goes through the same
path it should be reasonably easy to make it do whatever we want
in the future.

Right now it presents 3 options: modify only unlocked items, override
locks and modify all items, or cancel command.
2020-12-10 17:36:19 +00:00
Jeff Young 9113f93ebe Uniformly apply current locking strategy.
I make no claims that this is the right strategy, but at least it's
consistent now.

Fixes https://gitlab.com/kicad/code/kicad/issues/6369
2020-12-10 01:34:37 +00:00
Jeff Young bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young 3451ac3088 PCB_MODULE_T -> PCB_FOOTPRINT_T 2020-11-13 15:16:24 +00:00
Jeff Young 84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Joshua Redstone ee428876ec ADDED: Group/Ungroup function
This implements the group/ungroup functions to mark a set of EDA_ITEMs as a unit, allowing them to be moved and rotated as a unit
2020-08-11 19:37:07 +00:00
Seth Hillbrand 8c57821e9b pcbnew: Move ratsnest items to separate folder 2020-06-16 11:15:14 -07:00
Eli 2a334a5c59 Updates wording used in alignment submenu to make the actions clearer when icons are missing. Also reorganises the order of items in the submenu. 2020-06-15 16:49:36 +00:00
jean-pierre charras 825d202480 Fix some strings to help translation.
Remove translation mark for strings used in debug, or strings
that cannot be translated (for instance because they are char strings
instead of wide char strings)
2020-04-23 07:40:19 +02:00
Seth Hillbrand 16026e75cf pcbnew: Don't compare across containers
std:: defines cross-container comparison as invalid and is not
guaranteed to work.  This breaks the comparison out into separate
steps, each for the separate containers.
2020-01-07 16:03:32 -08:00
Jeff Young 10c25a2290 Update frame type enum to match current class names. 2019-09-06 23:38:20 +01:00
Jeff Young e6d5110ccf Implement I18N for ACTIONs.
It's a bit of a hack because they're statically initialized and
so we can't make use of the _() macro.  We do still want it in the
code, however, because the string harvesting is based off of it.

Fixes: lp:1833000
* https://bugs.launchpad.net/kicad/+bug/1833000
2019-06-17 10:45:23 +01:00
Jeff Young 5610261dce Immediate-action hotkeys (and context menu actions) for eeschema. 2019-06-15 20:43:51 +01:00
Jeff Young 1f6a5c92d7 Make sure placement menu has a pointer back to its tool.
Fixes: lp:1831730
* https://bugs.launchpad.net/kicad/+bug/1831730
2019-06-10 23:46:01 +01:00
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
Jeff Young 765606012f Convert separate-compilation of selection.cpp to polymorphism. 2019-06-10 23:46:00 +01:00
Jeff Young f9e4ee1fc9 CONTEXT_MENU -> ACTION_MENU. (Now used for menu-bar menus too.) 2019-05-15 17:50:52 +01:00
Jeff Young ef5c69167a Start moving some LibEdit and SchEdit menubar menus to actions.
Also includes a bunch of bug fixes that got intermingled.

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

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

Fixes: lp:1828793
* https://bugs.launchpad.net/kicad/+bug/1828793
2019-05-13 21:44:29 +01:00
Seth Hillbrand aeedb3543b pcbnew: Update strings
Moving pcbnew error strings that may be seen by the user to translated
strings.  Strings that denote unexpected cases are moved to debug logs
as they are essentially asserts that should never be shown.  The
exceptions are the messages shown when files are loaded.  All unknown
items should show an error here.
2019-01-02 14:43:55 -08:00
Seth Hillbrand 7e9fee285f pcbnew: Align/Distribute handle locking
This fixes the handling of align/distribute tool when called on locked
items.  Locked items cannot be moved but they may be used for the target
of an align/distribute operation.

Fixes: lp:1808238
* https://bugs.launchpad.net/kicad/+bug/1808238
2018-12-14 16:04:07 -08:00
Seth Hillbrand 9a86b26b82 pcbnew: Distribute footprints not pads
When using the board edit, align tool automatically moved footprints
instead of pads but distribute tool did not.  This standardizes the
behavior.

Fixes: lp:1796997
* https://bugs.launchpad.net/kicad/+bug/1796997
2018-10-09 22:01:23 -07: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 c90a3efea2 Change KIDIALOG hashing algorithm to __FILE__ + __LINE__.
Using Title + Message wasn't working for all the dialogs which
did substitutions in the message (which was a lot of them).

Fixes: lp:1789348
* https://bugs.launchpad.net/kicad/+bug/1789348
2018-08-29 23:38:23 +01:00
Jeff Young 9175a48c90 Enable Distribute H/V on pads.
Fixes: lp:1782988
* https://bugs.launchpad.net/kicad/+bug/1782988
2018-08-01 09:35:46 +01:00
Jeff Young 99db5cb543 Allow for reduced nagging with wider use of KIDIALOG.
(cherry picked from commit c2dd5df)
2018-07-17 15:13:53 +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
Seth Hillbrand 3760b6820f pcbnew: align centers to the top and left
When aligning module centers, it can be hard to determine which item
will be chosen for the alignment target when it chooses based on the
median of the center values.  Instead, this patch chooses the alignment
target as the top and left most items of the Y and X centering,
respectively
2018-03-02 20:15:51 -08:00
Seth Hillbrand 818d4257c9 pcbnew: Prevent alignment on pads + parents
Filter a selection that contains pads and the pads' parent modules
before performing alignment operations.
2018-03-02 20:15:51 -08:00
Seth Hillbrand d5cd9761dd pcbnew: Check locks in alignment
When aligning in pcbnew, check for pad/module locks before performing a
move and query the user.

When aligning on pads, don't move the pad without moving the footprint,
so we don't break footprints.

Fixes: lp:1751352
* https://bugs.launchpad.net/kicad/+bug/1751352
2018-03-02 20:15:51 -08:00
Robbert Lagerweij a59864201a pcbnew: use centerpoint distribution in align tool for overlaping items
reimplement the centerpoint distribution and use it when the items to be
distributed overlap leaving no gap to use for spacing

Fixes: lp:1748763
* https://bugs.launchpad.net/kicad/+bug/1748763
2018-02-27 17:58:19 +01:00
Robbert Lagerweij ed0e226aab pcbnew: add and use new icons for align left, right, top & bottom
NEW: add new align icons based on the existing align_items.svg icon, just flipped and rotated
CHANGED: change the context menu to use the new align icons
2018-02-17 11:58:36 -05:00
Maciej Suminski 28f1209ce9 Fixed invalid dynamic_cast in Align Tool
Fixes: lp:1750107
* https://bugs.launchpad.net/kicad/+bug/1750107
2018-02-17 11:36:51 +01:00
Robbert Lagerweij b356275e76 pcbnew: add align center and align middle tools and related icons
NEW: add placement tools that allow aligning the centers of items in a selection, both vertically and horizonally
2018-02-16 12:01:01 -05:00
Robbert Lagerweij 7683364bdb pcbnew: code improvements align tools 2018-02-16 11:46:38 -05:00
Jeff Young 1afbfad44a Use "..." uniformly in menus.
See the bug report for some wording changes and a couple of
menu restructurings that were also cleaned up.

Fixes: lp:1597827
* https://bugs.launchpad.net/kicad/+bug/1597827
2018-02-10 17:32:28 -05:00
Robbert Lagerweij 54ce01f8d5 pcbnew: make the distribute horizonally and vertically tools gap based
This changes the distribute horizonally and vertically tools to place
items with constant gaps between them. The previous implementation put
item centers evenly apart but thereby ignored the relative width and
height of the items (i.e. wide items appeared closer together than
narrow items).

Fixes lp;1745366

https://bugs.launchpad.net/kicad/+bug/1745366
2018-02-08 08:44:55 -05:00
Robbert Lagerweij 3556c4b8d6 pcbnew: change alignment tools use footprint rect where appropriate
Using footprint rects instead of the larger bounding box means that
reference and value texts no longer influence the positioning of the
footprint in unexpected ways. Treatment of non-module items is
unchanged.
2018-02-08 08:44:55 -05:00
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
Jon Evans b6ac603f0a Fix AlignLeft / AlignRight when using Flip Board view
Fixes: lp:1734377
* https://bugs.launchpad.net/kicad/+bug/1734377
2017-12-11 09:40:08 +01: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
Tomasz Włostowski bfdd1191ab pcbnew: rename PLACEMENT_TOOL to ALIGN_DISTRIBUTE_TOOL, some fixes in the connectivity algo 2017-06-23 11:12:37 +02: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
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
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 59346a6ef1 Alternative way for setting icons for align/distribute actions. 2017-01-23 11:41:00 +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
jean-pierre charras 9be5398cd2 Add bitmaps to Align/distribute menu ans menu items 2016-12-20 17:50:29 +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