Commit Graph

332 Commits

Author SHA1 Message Date
Maciej Suminski fe4f02f5b9 Coverity fixes
CIDs:
- 153097
- 157120
- 157119
- 155148
- 155146
- 153103
- 153099
- 153095
- 153087
- 153086
2017-03-11 22:20:08 +01:00
Tomasz Włostowski 0a55d8e053 Fixed differential pair gap clearance error when gap equaled minimum clearance.
Fixes: lp:1533551
* https://bugs.launchpad.net/kicad/+bug/1533551
2017-03-11 20:57:59 +01:00
Julius Schmidt 29eb696ef7 Fix crash when switching from dragging to routine (PNS router)
The attached patch fixes a bug where triggering InlineDrag while routing
is in progress will crash pcbnew.  The problem is that the InlineDrag
event does not terminate performRouting.  Once InlineDrag is finished
it will call StopRouting which deletes the m_placer.  The Wait() in
performRouting will then return and it will crash as soon as it tries
to access the m_placer.
2017-03-07 13:56:44 +01:00
Maciej Suminski 906ee77dbf Fixed VIEW_ITEM memory leaks 2017-03-02 23:57:13 +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 d3edc4f843 Disable router menu when the tool is stopped 2017-02-24 13:32:47 +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
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +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 7806cb7bca Drag tracks/vias menu entry (GAL) 2017-02-09 12:03:28 +01:00
Maciej Suminski 77af6547c1 Coverity fixes (mostly initializing variables) 2017-02-01 17:31:55 +01:00
Maciej Suminski 39317eac83 Display clearance for routed tracks (GAL) 2017-01-27 19:11:12 +01:00
Maciej Suminski fc122834c2 Code formatting 2017-01-27 19:08:32 +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
jean-pierre charras 2de913797a Fix a UI policy issue. Very minor cosmetic change: give same look to Zoom and Grid selection in 2 menus. 2017-01-20 11:35:24 +01:00
jean-pierre charras adb679dc46 ROUTER_TOOL_MENU: add zoom selection to this menu. 2017-01-20 08:51:12 +01:00
jean-pierre charras d51d53c6b9 CONTEXT_TRACK_WIDTH_MENU EventHandler: better filtering of received events ID.
This is mandatory because currently, on Windows, this handler is also called when clicking on an other menu with submenus like the grid menu.
2017-01-20 08:29:24 +01:00
Tomasz Włostowski ba9576b014 router: snap to clearance boundaries in Highlight Collisions mode
Fixes: lp:1655819
* https://bugs.launchpad.net/kicad/+bug/1655819
2017-01-19 17:47:15 +01:00
Tomasz Włostowski bb463ad434 pns: fix assertion fail when placing diff pairs 2017-01-18 15:55:46 +01:00
Maciej Suminski 75fb04d650 TOOL_ACTIONs are handled with transitions, no handlers needed in the event loops
There used to be a number of TOOL_ACTIONs that had entries both in
SetTransitions() and the event loop, which seemed redundant and
troublesome.
Now it is not necessary anymore, transitions setup is enough to execute
associated actions.
2017-01-18 14:20:39 +01:00
Maciej Suminski 3c61b16e7b Code formatting 2017-01-18 13:22:40 +01:00
Maciej Suminski ee862e1db4 Fixed a hidden overloaded virtual function warning in PNS 2017-01-18 13:22:18 +01:00
John Beard 3448698849 Add grid menu to routing context menu
This is a missing GAL feature (though grid cycling by hotkey was already
working fine).

Fixes: lp:1519973
* https://bugs.launchpad.net/kicad/+bug/1519973
2017-01-10 11:18:25 +01:00
jean-pierre charras b8b08dafd6 Code cleaning: remove pcbcommon.* which contains nothing really useful. The very few lines of code are moved to a better place. 2016-12-31 12:56:21 +01:00
Tomasz Wlostowski c45cc1de68 Fixes: lp:1653146 (Assertion failed when trying to delete track with router tool active, in debug mode)
https://bugs.launchpad.net/kicad/+bug/1653146
2016-12-30 20:14:44 +01:00
jean-pierre charras dec2d6e8cc Fix a few Coverity warnings. A bit of clean code in export_vrml.cpp. 2016-12-30 12:40:05 +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
Maciej Suminski 524dddaf70 Sync the PNS model when its changed 2016-11-28 15:51:18 +01:00
jean-pierre charras bcfc1e7a3f fix shadowed local variables 2016-11-25 16:00:42 +01:00
jean-pierre charras 7051b6d21f Fixes: lp:1635723 (pcbnew: allows sometimes to draw tracks in non copper layers in Gal Mode)
https://bugs.launchpad.net/kicad/+bug/1635723
2016-11-13 19:02:44 +01:00
Tomasz Włostowski 4d180efa5f router: correct handling of per-pad/per-module clearance 2016-10-19 17:54:00 +02:00
Maciej Suminski abbd47e2f2 Remove an unused variable and a debug printf 2016-09-30 09:31:40 +02:00
Tomasz Włostowski 3257f1a863 pns: fixed inline drag grid snapping & undo-related assertion failure
Fixes: lp:1628697
* https://bugs.launchpad.net/kicad/+bug/1628697
2016-09-30 09:29:49 +02:00
Tomasz Włostowski 4bc4dc80b6 pns: unique_ptr for BOARD_COMMIT member 2016-09-30 09:05:58 +02:00
Simon Richter ad088db6d2 Add more "override" markers. 2016-09-25 13:59:41 -04: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
Maciej Suminski 65821328d2 Fix a crash when dragging a via attached to a locked track (PNS)
Fixes: lp:1625835
* https://bugs.launchpad.net/kicad/+bug/1625835
2016-09-21 14:47:14 +02:00
Chris Pavlina c57fd7ccbf Fix signed/unsigned comparison warning in PNS::LINE::ClipVertexRange 2016-09-20 14:26:16 -04:00
Maciej Suminski 17806b58f6 Fixed unused variable warnings 2016-09-13 10:06:49 +02:00
Maciej Suminski 5a1f52bf30 Modified tools to use BOARD_COMMIT. 2016-09-12 13:45:57 +02:00
Maciej Suminski 5c0605f6dc Mute a few warnings 2016-09-12 11:50:06 +02:00
Tomasz Włostowski 0b8ab2f73d router: fixed incorrect clearance computation in highlight collisions mode.
Fixes: lp:1621186

https://bugs.launchpad.net/kicad/+bug/1621186
2016-09-08 10:30:02 -04:00
Tomasz Wlostowski 03d372a0ec Fixed an assertion triggered upon line simplification (PNS). 2016-09-06 16:40:40 +02:00
Maciej Suminski f1e2a2c4c1 Corrected debug information display call. Removed an unused variable. 2016-09-06 16:27:35 +02:00