Commit Graph

251 Commits

Author SHA1 Message Date
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
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
Jeff Young c1539ae014 Naming changes to reflect sharing between SchEdit and LibEdit. 2019-05-10 19:56:20 +01:00
Jeff Young f81007f74b Some clean-up and moving message panel update to selection event. 2019-05-05 17:12:59 +01:00
Jeff Young 42383ae871 Build out some of the modern toolkit context menus. 2019-05-05 17:12:59 +01:00
Jeff Young 1a007c3e4b Implement SCH_SELECTION_TOOL (but still with legacy semantics). 2019-04-22 22:08:18 +01:00
Jon Evans 1d2db311b2 Set new module parent early enough to allow pad clearance to be shown
Fixes: lp:1824587
* https://bugs.launchpad.net/kicad/+bug/1824587
2019-04-14 14:25:38 -04:00
Jeff Young b63fab92cf Move Eeschema net highlighting to modern toolset. 2019-04-14 12:10:48 +01:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
Seth Hillbrand 3dfa57fe1d pcbnew: Clear highlight cross-probe
When highlighting a new net, clear the Eeschema highlight before
selecting items

Fixes: lp:1815147
* https://bugs.launchpad.net/kicad/+bug/1815147
2019-03-04 12:00:59 -08:00
Seth Hillbrand 1f7022cb64 pcbnew: Do not source highlight from non-copper pads
Highlight connections is meant to show the copper connections on a
board.  We remove the non-copper pads from our selection when attempting
to source the net for highlighting.

Fixes: lp:1815898
* https://bugs.launchpad.net/kicad/+bug/1815898
2019-02-14 15:20:49 -08:00
Seth Hillbrand 05483a06c6 pcbnew: Re-attach snap options
Snapping to item options were partially disconnected when unifying
framework.  This re-attaches the options and adds the additional option
for graphical items.

Fixes: lp:1801377
* https://bugs.launchpad.net/kicad/+bug/1801377
2019-01-29 13:36:17 -08:00
Seth Hillbrand 5182fe15d3 Minor code formatting 2019-01-17 19:17:34 -08:00
Tomasz Włostowski 9657039af2 pcbnew: multiple fixes concerning track->pad net propagation used by Track/Via properties dialog:
- Added ignore netcode option to CONNECTIVITY_DATA::GetConnectedItems()
- PlaceModule() now ensures the module added to the board (and thus to the connectivity database) has correct bounding box necessary for R-trees to work
- Use recursive connected pad search so that the new net is propagated to all pads

Fixes: lp:1787961
* https://bugs.launchpad.net/kicad/+bug/1787961
2019-01-18 02:53:29 +01:00
Seth Hillbrand d1b53028a1 Remove errant printf() debugging statement 2019-01-08 17:21:05 -08: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 daee58a0ab pcbnew: Do not show dynamic ratsnest after most mods
Marking the selection modified should not show the local ratsnest unless
we are currently dragging

Fixes: lp:1809921
* https://bugs.launchpad.net/kicad/+bug/1809921
2019-01-02 12:27:48 -08:00
Seth Hillbrand 583e0173b9 pcbnew: Fix ratsnest display
Checks for ratsnest enabled prior to calculating and displaying the
local/dynamic ratsnest.  Calls the ratsnest clear from selection clear

Notably, it appears that the tool actions do not chain transitions for
the same event.  So only a single action (first specified) will be
executed when an event fires unless the actions are executed by separate
tools.

Fixes: lp:1809752
* https://bugs.launchpad.net/kicad/+bug/1809752
2019-01-02 11:56:23 -08:00
Tomasz Włostowski c777eac000 eeschema: improved highlighting of PCB->SCH cross-probed components/labels/pins
Fixes: lp:1796990
* https://bugs.launchpad.net/kicad/+bug/1796990
2018-12-24 15:35:25 +01:00
Wayne Stambaugh 59b0f553e0 Code cleaning. 2018-11-28 09:58:41 -05:00
Seth Hillbrand 9955d0beb2 MSW Ratsnest: Force marking ratsnest dirty
When updating the status of the ratsnest, we mark its target layer as
dirty to ensure the revised data are used to draw/clear the ratsnest

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

(cherry picked from commit 50eedcf0b3)
2018-11-23 11:45:29 -08:00
Seth Hillbrand ad9916a93d ratsnest: Fix state issue switching in local tool
The ratsnest layer needs to be always enabled in GAL rather than taken
from the board settings.  This also adds a finalize handler to the
picker tool that allows a picker-caller to perform a specific action
when the picker tool exits.  In this case, we use it to clear the local
ratsnest selections back to the default.

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

(cherry picked from commit c0d9b9ab81)
2018-11-20 20:49:18 -08:00
Jeff Young f71998b34e Remove repetitive calls to other cancel operations. 2018-11-19 16:03:30 +00:00
Seth Hillbrand eb689a5221 Ratsnest: Improve show heuristics
When the local ratsnest tool is used, it should toggle the state based
on the global ratsnest visibility.  After changing state, the layer
cache is marked as well.

Possibly related to lp:1800301

(cherry picked from commit 22fbf30f22)
2018-11-18 20:03:46 -08:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Seth Hillbrand 502383b759 pcbnew: Adjust selection behavior in highlight net
Prefer non-zones in highlight net in the same way we do for the
selection tool.  Highlight net just has separate logic and was missed
previously.
2018-10-05 21:20:26 -07:00
Seth Hillbrand 1ff9931333 pcbnew: Remove legacy Magnetize() from GAL picker
Magnetic items handled by GRID_HELPER in GAL.  Also includes the
standard keyboard modifier shift to change magnetic items on/off
2018-10-04 15:48:15 -07:00
Jeff Young dfe164e0dc Only clear link when adding footprint from library, cache, etc.
Fixes: lp:1792256
* https://bugs.launchpad.net/kicad/+bug/1792256
2018-10-01 19:22:42 +01:00
Seth Hillbrand ef6f7e96f3 pcbnew: Handle SEGZONE in GAL
SEGZONEs are no longer created by pcbnew but may exist in older boards.
This allows deleting the old fills in a manner similar to the deletion
in Legacy canvas.

Fixes: lp:1794571
* https://bugs.launchpad.net/kicad/+bug/1794571
2018-09-29 15:09:15 -07:00
Seth Hillbrand a81e3c2b13 pcbnew: Avoid double-separators in context menu 2018-09-29 15:09:15 -07:00
Seth Hillbrand 518b53f78c pcbnew: Cancel highlight with ESC
When editing the pcb, Ctrl-Click will highlight a net.  This allows
de-highlight with the ESC/cancel action from the selection tool.  Inside
the highlight tool, ESC reverts to the selection tool while keeping the
net highlighted.

Fixes: lp:1793842
* https://bugs.launchpad.net/kicad/+bug/1793842
2018-09-23 15:09:18 -07:00
Seth Hillbrand 47fac8a259 Removing some unused code 2018-09-20 12:52:53 -07: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 9322139baa Touch up Footprint Viewer for new Lib Tree. 2018-08-01 11:47:48 +01:00
Jeff Young b400565880 Convert Place Footprint to component tree. 2018-08-01 09:35:45 +01:00
Jeff Young aab97c8385 Consolidate design rules UI.
Implement new Board Setup paged dialog which includes:
  Layers Setup
  Design Rules
  Solder Mask & Paste
  Text & Drawings

Moves line width and text properties to a layer-class-based
system.  Renames unlocked to upright (which also reverses the
logic).

New Edit Text and Graphic Properties dialog which replaces
Edit Footprint Text and adds layer-class-based editing and the
italic, upright and visibility properties.

Adds Import Settings functionality which allows settings to
be imported from another project at page granularity.

Also UNIT_BINDERizes the dialog and adds editing of pcb text.

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

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

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

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

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

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

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

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

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

(cherry picked from commit 3944a5e)
2018-07-17 15:12:34 +01:00
Jeff Young 92dcf43ae8 UNIT_BINDERize zone dialogs.
Also includes a bunch of changes to simplifiy the terminology
and unify the copper, non-copper and keepout versions.

Also removes some legacy features:
Removes contol for fill method.  If the fill method is currently
segments the dialog will ask if you want to convert to polygons
on OK.
Removes control of boundary resolution.  We've done this with trig
since 5.0.

(cherry picked from commit 487aaeb)
2018-07-17 15:11:32 +01:00
Jeff Young eacaa39aa2 Remove global units usage from GetSelectionText...
... and GetMsgPanelInfo.

Step 4 in the g_UserUnit eradication effort.

Also removes a couple of conversion routines that were close
enough to extinction.

(cherry picked from commit c75da51)
2018-07-17 15:11:09 +01:00
Seth Hillbrand 147c1e6088 pcbnew: Allow clearing local ratsnest
The local ratsnest needs to be able to hide as well as show visibility.
Clicking a module will toggle the visibility while clicking off all
modules clears the local ratsnest display.

Fixes: lp:1531332
* https://bugs.launchpad.net/kicad/+bug/1531332
2018-06-19 15:12:20 -07:00
jean-pierre charras 6f249e5eb6 Add missing icons in lock/unlock context submenu 2018-05-22 14:36:35 +02:00
Maciej Suminski 684f085ac5 Coverity fixes
CIDs:
dereference before null check:
175439 @ drc.cpp

uninitalized field:
175435 @ point_editor.cpp
174162 @ zone_filler.cpp
163188 @ footprint_info_impl.cpp

logically dead code:
155146 @ pcb_editor_control.cpp
2018-05-04 14:06:08 +02:00
Seth Hillbrand 76d3b6f04a Adding locking to the context menu for modules
Locking submenu was activated only for tracks and via but it makes sense
(and is probably expected) when right-clicking on modules as well.
2018-05-02 08:35:53 -07:00
Jeff Young 6b3410974d Fix "same layers" test when duplicating zones. 2018-05-01 13:54:31 +01:00
Jeff Young c8a784058e Allow duplicating a zone onto the same layer in a GAL canvas.
Duplicate already works, so there's little reason to disallow
using the zone dialog to do it.

The legacy canvas can't be fixed because we'll immediately
union the two zones, resulting in a no-op.

Fixes: lp:1464677
* https://bugs.launchpad.net/kicad/+bug/1464677
2018-04-29 20:28:45 +01:00
Jeff Young d391489596 Don't clear old footprint till after user has hit OK.
Fixes: lp:1759190
* https://bugs.launchpad.net/kicad/+bug/1759190
2018-04-02 22:32:09 +01:00
Jon Evans 0ded476f9d Add a hotkey to control net highlighting
Fixes: lp:1757446
* https://bugs.launchpad.net/kicad/+bug/1757446
2018-03-26 23:09:44 -04:00
jean-pierre charras 0ab15fa0ee Pcbnew cross-probing: highlight in GAL canvas doesn't work properly when selecting a symbol in Eeschema on some installs.
This fix forces a refresh.

Fixes: lp:1749799
https://bugs.launchpad.net/kicad/+bug/1749799
2018-02-16 12:08:31 +01:00
Maciej Suminski d08f19a0a2 FP placer: enable autopanning/cursor capture only during placement
Fixes: lp:1749548
* https://bugs.launchpad.net/kicad/+bug/1749548
2018-02-15 11:53:23 +01:00
Jeff Young 53e705f634 Add Get and Move Footprint to empty-selection-context menu.
Also adds Cancel context menu items for Place Footprint,
Place Target, Place Drill Origin and Place Grid Origin tools,
as well as the standard Zoom and Grid choices.

Removes the Paste context menu item from the Place Drill
and Place Grid Origin tools.

Fixes: lp:1568396
* https://bugs.launchpad.net/kicad/+bug/1568396
2018-02-12 21:50:51 +01: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
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
Jeff Young 7a28f3d4cf Implement undo/redo for origins in legacy
PICKED_ITEMS_LIST knows the architecture of the undo commands so
that it can delete those ITEMs which it owns.  This represents poor
encapsulation so instead of adding yet another case, I added a
UR_TRANSIENT item flag which is set by callers whenever they create
new objects to “give to” the undo/redo stack.  This allowed some
cleanup of other code, but cleaning up UR_DELETE and UR_WIRE_IMAGE
will be a bigger task and have to wait for another day.

Fixes: lp:1542018
* https://bugs.launchpad.net/kicad/+bug/1542018
2018-01-27 19:51:44 -05:00
Jeff Young 4784ee7fe4 Implement undo/redo for drill and grid origins.
The undo/redo operations are essentially the same as for
UR_CHANGED: we store both the origin marker item and a copy
of it and flip back and forth between the two.  This also
required the implementation of clone() for the markers.

The ORIGIN_VIEWMARKER is moved from being a subclass of
EDA_ITEM to BOARD_ITEM to facilitate the use of a UR_CHANGE-
like implementation without having to know the internals
of the ORIGIN_VIEWMARKER.

In the command processors, the setting of the origins is
broken into two parts: one for UI-level access which includes
setting up undo, and one for low-level access which does not.
The undo/redo code itself of course uses the lower level.

Fixes: lp:1542018
* https://bugs.launchpad.net/kicad/+bug/1542018
2018-01-27 19:40:51 -05:00
Maciej Suminski 388d07a808 Fix disappearance of placed objects after 'Properties' action 2018-01-19 14:20:42 +01: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
Jon Evans ca264f8982 Add bidirectional net highlight cross-probing
Fixes: lp:1738875
* https://bugs.launchpad.net/kicad/+bug/1738875
2018-01-07 14:12:50 -05:00
Maciej Suminski 4671b9b34e Fixed module removal when rotating/flipping a placed module
Module placer did not mark the newly placed modules as selected,
but all edit functions (rotate/place/etc.) rely on getting a selected
item. When a rotation/flip command was issued, the newly placed module
was dropped and the one underneath the cursor has been rotated.

To fix this the newly placed modules are marked as selected.
It also simplifies the placer code a bit.

Fixes: lp:1738148
* https://bugs.launchpad.net/kicad/+bug/1738148
2017-12-14 17:13:42 +01:00
Tomasz Włostowski 316ddadec1 pcbnew: Optimized zone filling algorithm. 2017-12-05 14:54:57 +01:00
Jon Evans f107545a82 Show message panel info for highlighted net in GAL (Fixes lp:1518626) 2017-11-28 08:16:58 +01:00
Tomasz Włostowski 00ad8f24a0 pcbnew: Minor changes in CONNECTIVITY_DATA interface:
- renamed connectivity.[h|cpp] to connectivity_data [.h|.cpp] so that the file name matches the main class name.
- GetNetItems() now returns a vector instead of a list
2017-11-15 18:34:08 +01:00
Tomasz Włostowski b945d2a708 cleanup: replace CLASS_MIRE with CLASS_PCB_TARGET for naming clarity 2017-11-03 20:02:06 +01:00
Tomasz Włostowski 81d1e17f02 refactoring: renamed pcbstruct.h to pcb_display_options.h, DISPLAY_OPTIONS->PCB_DISPLAY_OPTIONS 2017-11-03 20:02:06 +01: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 f573a2e685 wip 2017-09-30 14:28:54 +02:00
Kristoffer Ödmark 4ce38abce2 renamed copypasta functions, fixed a paste_module error 2017-09-30 14:28:53 +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
Kristoffer Ödmark 84b803042c Improvements to copy-paste
-Can paste items from board to module-editor (only module parts)
-Can paste entire modules just as copy
-Can copy items inside module-editor

Known limitations:

-Will crash if trying to paste a module containing module_text inside
the module editor ( dont know why, problem existed before )
-If copying things with strange layer names, the layer names will be
changed.
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
Oliver Walters c977c88a10 Zone keepout exclusion now works on multiple layers!
Bug fixes for keepout layers

- Changed LSET::size() -> LSET::count()
- Save/load functions no longer depend on zone being a keepout
2017-09-27 10:35:00 +02:00
Maciej Suminski efdf0c6b84 Parameter tuning for hiding dynamic ratsnest 2017-08-01 17:57:18 +02:00
Maciej Suminski f303bf2999 Hide temporarily ratsnest when it is too complex for real-time calculation 2017-08-01 15:22:24 +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
jean-pierre charras f4ecc417ac Fix a few doxygen warnings 2017-07-08 21:13:32 +02:00
Maciej Suminski 805bfb048b pcbnew: Configurable hotkeys for PNS
- routing options
- custom track/via size
- differential pair dimensions
- increase/decrease via size
2017-06-30 15:46:27 +02:00
hauptmech 4e908da057 pcbnew: Add hotkeys for Select Trivial Connection and Select Copper Connection 2017-06-30 14:30:10 +02:00
Maciej Suminski 3dd4429ef6 Dead code removal 2017-06-23 18:50:31 +02:00
Maciej Suminski f3fbce9560 Code formatting and clean-up 2017-06-23 15:43:13 +02:00
Tomasz Włostowski a7759efc59 Multiple fixes:
- ratsnest is updated now when undoing in legacy view
- select whole net regression
- local ratsnest in the GAL regression
- pick correct zone net for stitching vias
- mark nets as dirty on net propagation to force ratsnest update

Todo:
- cleanup board algorithm is still broken
2017-06-23 11:12:37 +02:00
Tomasz Włostowski 81dbd930ae Display zone filling progress window in GAL 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 63f4ab697b post-rebase fixes 2017-06-23 11:12:37 +02:00
Tomasz Włostowski c4c329e393 Connectivity: local ratsnest for both legacy & GAL. Further removal of legacy code 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 9ad886344b New connectivity algorithm. 2017-06-23 11:12:36 +02:00
jean-pierre charras 2c21c70f46 Fix a few doxygen warnings 2017-06-22 09:09:52 +02:00
Maciej Suminski dcc803ecb1 VIEW_CONTROLS::GetMousePosition() returns the mouse position in world coordinates. 2017-06-12 16:24:52 +02:00
jean-pierre charras ad48cd435d Replace SetToolID( ID_NO_TOOL_SELECTED, ...) by SetNoToolSelected() in code 2017-06-12 16:17:48 +02:00
jean-pierre charras 6ed4f9b208 Make EDA_DRAW_FRAME::SetToolID and mouse cursor shape setting working in GAL canvases, and uses same mouse cursor shapes in legacy and gal canvases.
Starting fixing incorrect UI behavior of Zoom to selection in Pcbnew.
2017-06-12 15:16:09 +02:00
Maciej Suminski d452a5a30c Moved ratsnest update from EDIT_TOOL to PCB_EDITOR_CONTROL 2017-04-20 14:43:42 +02:00
Alejandro García Montoro f68ce306bd CPolyLine -> SHAPE_POLY_SET refactor.
Removes the need of using the legacy code in polygon/PolyLine.{h,cpp},
refactoring all CPolyLine instances with SHAPE_POLY_SET instances.

The remaining legacy methods have been ported to SHAPE_POLY_SET;
mainly: Chamfer, Fillet, {,Un}Hatch.

The iteration over the polygon vertices have been simplified using the
family of ITERATOR classes.
2017-03-24 10:43:47 +01:00
Maciej Suminski fe4f02f5b9 Coverity fixes
CIDs:
- 153097
- 157120
- 157119
- 155148
- 155146
- 153103
- 153099
- 153095
- 153087
- 153086
2017-03-11 22:20:08 +01:00
Maciej Suminski 3174573361 Removed code resetting VIEW_CONTROLS settings
As the VIEW_CONTROLS settings are managed for each tool,
there is no need to restore the settings to initial state
when a tool is finished.
2017-03-06 15:04:27 +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
Maciej Suminski 906ee77dbf Fixed VIEW_ITEM memory leaks 2017-03-02 23:57:13 +01:00
Chris Pavlina 586c8f0feb Fix signed/unsigned compare warning 2017-03-02 14:46:19 -05:00
Tomasz Włostowski 4a911e0790 Highlight net tool in GAL now cross-probes to EEschema if clicked on a pad
Fixes: lp:1663767
* https://bugs.launchpad.net/kicad/+bug/1663767
2017-03-02 14:43:37 +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
John Beard a0df0f7f06 When filling/unfilling zones, create undo points in GAL
This is a feature which is apparently not available in legacy, but the
undo points created in GAL do work in legacy mode.
2017-02-27 18:00:51 +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 a8eea6155a Move bitmaps.h out of base_struct.h
bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

Only about 130 files actually use the XPM definitions defined there, and
many of those already included bitmaps.h themselves, or via
menu_helpers.h. However, touching bitmaps.h would result in over 400
rebuilt files for pcbnew alone.

This commit moves the bitmap-related types like BITMAT_DEF out to a new
header, which is still included by base_struct.h, which is less
avoidable for now, it's it's used in the interface.

The icon list is still in bitmaps.h. This has the side effect that's
it's now easier to automatically generate this file.

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
2017-02-21 09:50:15 -05:00
Maciej Suminski 95794df088 Code formatting 2017-02-10 23:23:56 +01:00
John Beard 728349ea12 Add similar zone tool in GAL
This action launches the normal interactive zone tool, but re-uses the
settings from an existing zone, based on a flag passed to the main zone
function.
2017-02-10 23:23:55 +01:00
John Beard abe83b54ae Add zone cutout tool to GAL
When activated, the zone interactive editor is launched with a flag. The
drawn zone is then used to modify the existing zone at the end of the
action.
2017-02-10 23:23:55 +01:00
John Beard bed0ad142d Add zone duplicate onto layer to GAL
This adds it into the PCB_EDITOR_CONTROL tool, alongside the zone merge
tool.
2017-02-09 12:50:48 +01:00
John Beard 7045ed92fb Add CCW rotation to GAL canvas
This makes "rotate" into two separate TOOL_EVENTs, which each have a
"multiplier" parameter.

Also added is a namespace for 'free functions' that use TOOL_EVENT
public interfaces (perhaps with other inputs too) to centralise some
decision-making and calculations.

Fixes: lp:1660731
* https://bugs.launchpad.net/kicad/+bug/1660731
2017-02-09 12:50:47 +01:00
Maciej Suminski 24d63fb5d9 Removed redundant calls to wxUpdateUIEvent handlers
This is done automatically by wxWidgets
and does not need to be called explicitly.
2017-01-27 15:39:51 +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 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
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 f1c5b9a9ae Add context menu to GAL DRAWING_TOOL, including the zone menu
Includes a tiny class for scoped set-reset of a variable, which is used
here to store the current drawing mode.

Fixes: lp:1218629
 * https://bugs.launchpad.net/kicad/+bug/1518629
2017-01-11 10:41:08 +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
jean-pierre charras d167407d1a Pcbnew: add "edit all tracks and vias" command in edit menu.
Previously, this command was accessible only by right clicking on a track and only in the legacy mode.
2016-10-14 21:07:39 +02:00
Gustav Bergquist 061a7b8450 Cast TOOL_EVENT parameter type to intptr_t 2016-09-21 21:22:19 +02:00
Maciej Suminski 91ea4242ca Fixed freeze after adding a module 2016-09-12 13:45:57 +02:00
Maciej Suminski 5a1f52bf30 Modified tools to use BOARD_COMMIT. 2016-09-12 13:45:57 +02:00
Maciej Suminski ff6bdeee4b Removed a number 'if(m_editModules)' sections from pcbnew tools. 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
Chris Pavlina 445db7da58 Fix uninitialized fields
Coverity: CIDs 102698, 147347, 147349, 147350
2016-05-10 22:36:23 -04:00
Maciej Suminski ce8f400645 Added menu for locking tracks & vias (GAL). 2016-05-09 10:29:06 +02:00
Maciej Suminski e51adaeefd Highlight a net when crossprobing with eeschema and highlight net tool is enabled. 2016-01-25 16:16:05 +01:00
jean-pierre charras 21d700facc Replace "module" by "footprint" in a few messages. 2015-11-17 17:18:00 +01:00
Maciej Suminski 25d5a2fbfb Disable capture cursor & autopanning for tools in idle state (GAL). 2015-09-21 10:16:23 +02:00
Brian Sidebotham 34aab6f687 Add axis origin to the Footprint Editor to align with the Legacy canvas 2015-09-05 20:47:35 +01:00
Maciej Suminski b1d241c271 Net highlighting mode is toggled when used on the same net (GAL). 2015-09-03 17:56:30 +02:00
Maciej Suminski 9f41fe0bda Added a hot key for (un)locking modules (GAL). 2015-09-03 17:35:41 +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 d010703eaf Fixed cursor freeze in pcbnew (GAL). 2015-07-24 10:58:47 +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 2752953f34 Merging for non-copper zones (GAL). 2015-07-15 14:08:50 +02:00
Maciej Suminski 15857f22ca Fixed dragging offset in eeschema after crossprobing a multipart component in pcbnew GAL canvas. 2015-06-26 17:32:48 +02:00
Maciej Suminski a988ebaabd Zone merging (GAL). 2015-06-19 17:32:33 +02:00
Maciej Suminski a16dd894d5 Show Place & Drill origin in GAL. 2015-06-18 17:51:54 +02:00
Maciej Suminski f63170ca84 Tools available under toolbar buttons: delete items, highlight net, set drill/place origin (GAL). 2015-06-18 17:51: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 ce4b4f8221 Update ratsnest on zone refill (GAL). 2015-06-04 14:54:08 +02:00
Maciej Suminski 99e5228948 Moved the list of TOOL_ACTIONs to ACTION_MANAGER. 2015-05-05 20:39:41 +02:00
Maciej Suminski 872259981a CONDITIONAL_MENU supports separators and ordering. 2015-04-30 10:46:08 +02:00
Maciej Suminski 958046ddb2 Moved SELECTION_TOOL context menu to a separate class. 2015-04-30 10:46:08 +02:00
Maciej Suminski 946b9d1933 setTransitions() are called automatically for tools. 2015-04-30 10:46:03 +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 26f20fbb00 Moved "Place Target" and "Place Module" tools from DRAWING_TOOL to PCB_EDITOR_CONTROL (to avoid placing modules in the footprint editor). 2015-03-10 16:58:26 +01:00
Maciej Suminski b0ad779ee4 Calming down the Coverity report. 2015-02-15 23:21:52 +01:00
Maciej Suminski b19010ff8b Cross-probing pcbnew<->eeschema (GAL). 2015-02-14 21:52:22 +01:00
Maciej Suminski 902d0e3f1f Tools are processing const TOOL_EVENT& (Tool Framework). 2015-02-14 21:28:47 +01:00
Nick Østergaard 1df31338a3 Shortcut for fill all and unfill all zones for GAL. 2014-12-08 23:41:47 +01:00
Maciej Suminski 78853febbe Zone fill/unfill actions in context menu (GAL). 2014-07-09 16:57:01 +02:00