Commit Graph

213 Commits

Author SHA1 Message Date
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Fabien Corona 36fba5bd7f PCBnew: placing a blind/buried via sometimes incorrectly place a through via.
Fixes #1819
https://gitlab.com/kicad/code/kicad/issues/1819
2019-12-06 13:11:33 +01:00
Ian McInerney 1b14a38b01 pcbnew: Fix hotkeys during routing
CHANGED: Fix hotkeys for actions during routing

Previously hotkeys on shifted characters would not be
passed through the router and processed.
2019-11-10 17:47:51 +00:00
Ian McInerney d8c80623ce pcbnew: Fix cursor position after via layer select
CHANGED: Move cursor to event position instead of the
dialog position when selecting the via layer
2019-11-10 17:34:16 +00:00
Ian McInerney 58d4a8bb4a pcbnew: Don't reinitialize the router tool in an action
Calling Init() in an action routine will reset the router
settings to the state they were in when first starting pcbnew.
The Init() function is automatically called when the tool is created.

Fixes: lp:1843810
* https://bugs.launchpad.net/kicad/+bug/1843810
2019-10-07 16:07:05 -04:00
Ian McInerney 0aa5424511 pcbnew: Switch over some drawing tools to use PrimeTool
Before, if the tools were activated from the context menu,
they would start drawing where the menu item was selected
instead of where the menu was opened.
2019-10-03 19:04:36 +01:00
Jeff Young 9a349065db Better error messages for router. 2019-10-01 15:02:41 +01:00
Jeff Young 77334628c4 Change default tool behaviour to skip unhandled events.
The problem is that wxEVT_CHAR_HOOK doesn’t do the key translation
properly.  wxEVT_CHAR does, but we only get to that if we skip the
event at the end of the tool’s event processing loop, which most tools
don’t do.  (Selection tools, point editors, pickers, and a couple of
others do skip, which is probably why this didn’t get reported earlier.)

I played around with a couple of ways to fix wxEVT_CHAR_HOOK.  Most of
them don’t work, and the few egregious hacks I tried weren't cross-
platform.

So I’m changing it so that most tools now skip at the end of their
event loops.  I left out a couple that I felt were high risk (length
tuning, for instance).  But there’s still enough risk that I’m 100%
sure it will break something, I just haven’t a clue what.

Fixes: lp:1836903
* https://bugs.launchpad.net/kicad/+bug/1836903
2019-07-26 12:21:24 -06: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 58ca5b71a9 A more robust fix for 36f1d023f0.
This one also handles when the events get out-of-order due to them
starting out in the Simulation window and not getting dispatched until
the mouse goes over the Schematic window.

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

Fixes: lp:1836544
* https://bugs.launchpad.net/kicad/+bug/1836544
2019-07-15 14:15:24 +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 981072598b Overhaul cursor code for new tool/action framework.
Includes the addition of an onSetCursor() handler which must be called
from both the GAL canvas AND the GAL backend (at least on OSX) to prevent
cursor flickering between (for instance) pencil and arrow.

Also includes new architecture for point editors which allows them to
coordiate cursors with the editing tools (so we can switch to an arrow
when over a point).
2019-06-27 22:37:11 +01:00
Jeff Young 2f23aa9556 Implement a more robust tool stacking architecture.
We were running into various corner conditions where a tool's event
loop would exit while the tool was still active, or the tool would
get popped while we were still in the event loop.  (A lot of these
had to do with the POINT_EDITOR's, but not all of them.)

The new architecture:
1) tools always do a Push()/Pop()
2) everyone is responsible for their own pops; no more stack-clearing
on a cancel
3) CancelInteractive events go to all tools to facilitate (2)
2019-06-27 17:01:31 +01:00
Jeff Young f9702aab87 Immediate actions for PlEditor, PcbNew, etc. 2019-06-25 11:34:28 +01:00
Jeff Young dcbd897a95 Push/pop tools even when selected from the toolbar. 2019-06-18 20:24:15 +01:00
Jeff Young 1f35ec5521 Beware of copying events and losing the m_passEvent flag.
Fixes: lp:1833031
* https://bugs.launchpad.net/kicad/+bug/1833031
2019-06-17 14:44:39 +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 bb96255a03 Fix dangerous static_cast-ing to wrong type. 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 1bf04d1722 More ACTIONs work. 2019-06-04 00:51:16 +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 fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
Jeff Young f9e4ee1fc9 CONTEXT_MENU -> ACTION_MENU. (Now used for menu-bar menus too.) 2019-05-15 17:50:52 +01:00
Seth Hillbrand 428e7a900b pcbnew: Prevent aux axis after-image
Grid helper in the router tool is persistent, so remember to turn off
the aux axes after setting.

Fixes: lp:1822577
* https://bugs.launchpad.net/kicad/+bug/1822577
2019-04-01 14:23:46 -07:00
Seth Hillbrand 0de25e557b pcbnew: Adjust drag snapping to avoid start
When dragging, you will seldom want to snap to the original item.  This
commit prevents the "size of track" snap to the original item and
replaces it with an auxilary grid origin for the snap.  This means
effectively that the snap will happen to grid for the original item
unless the cursor is closer to the original item line than it is to the
grid crossing.

Fixes: lp:1820248
* https://bugs.launchpad.net/kicad/+bug/1820248
2019-03-16 20:37:14 -07:00
Tomasz Włostowski 313ebb9dff router: correct walkaround corner case when both ends of the line lie on the hull edge
Fixes: lp:1810935
* https://bugs.launchpad.net/kicad/+bug/1810935
2019-02-03 11:22:18 +01:00
Seth Hillbrand cf6ba6ad94 pcbnew: Get correct end when dragging
The selection for interactive drag uses cursor position  off grid to
choose the element for dragging.  We pass the same value into the start
dragging routine to choose the correct end of the element.

Fixes: lp:1813665
* https://bugs.launchpad.net/kicad/+bug/1813665
2019-01-28 15:16:07 -08:00
jean-pierre charras 31fa3af8d8 Fix a minor I18n issue
Fixes: lp:1811640
https://bugs.launchpad.net/kicad/+bug/1811640
2019-01-14 13:12:20 +01:00
Seth Hillbrand 0a26388901 pcbnew: Break track in edit mode
Enables the ability to break a track into two segments when operating in
the edit mode rather than in router.

Fixes: lp:1779788
* https://bugs.launchpad.net/kicad/+bug/1779788
2018-12-14 09:59:25 -08:00
Seth Hillbrand ff668968f3 pcbnew: Changing the track width while routing
When changing the track width, we need to allow that the track's route
will change based on DRC, so force a move without changing position.

Fixes: lp:1785057
* https://bugs.launchpad.net/kicad/+bug/1785057
2018-11-24 11:52:26 -08:00
Jeff Young f71998b34e Remove repetitive calls to other cancel operations. 2018-11-19 16:03:30 +00:00
Jeff Young 4b493e45eb Don't consider non-tracks when seeing if we can do a router drag.
Fixes: lp:1793979
* https://bugs.launchpad.net/kicad/+bug/1793979
2018-09-23 23:51:13 +01:00
Franck78 009dfa411f Finish track with 'activate router hotkey'
Fixes: lp:1790552
* https://bugs.launchpad.net/kicad/+bug/1790552
2018-09-04 12:08:40 +02: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 95d3336f63 We need the other end of the stick when not yet routing.
Fixes: lp:1781424
* https://bugs.launchpad.net/kicad/+bug/1781424
2018-07-27 14:58:19 +01:00
Jeff Young 7cce283fea Fix diff pair custom values.
Fixes: lp:1782971
* https://bugs.launchpad.net/kicad/+bug/1782971

(cherry picked from commit 53f35a3)
2018-07-22 11:19:17 +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 d5e88f574f Clean up units infrastructure after g_UserUnit removal.
Fixes: lp:1538239
* https://bugs.launchpad.net/kicad/+bug/1538239

(cherry picked from commit 96d7178)
2018-07-17 15:12:36 +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
Tomasz Wlostowski f6f726acab router: allow placing tracks/diff pairs without continuing routing by Shift+L-Click
Fixes: lp:1777688
* https://bugs.launchpad.net/kicad/+bug/1777688
2018-06-19 19:30:03 +02:00
Maciej Suminski 583a9c08c0 Remove duplicated PNS TOOL_ACTIONs to display routing settings 2018-06-15 17:12:15 +02:00
Seth Hillbrand 4dd2de9057 pcbnew: Prevent mouse capture after actions
After an action is completed that required the screen to pan when the
cursor reaches the edge of the screen, we should release the cursor to
allow the user to move their mouse without panning.

Fixes: lp:1763860
* https://bugs.launchpad.net/kicad/+bug/1763860
2018-06-13 14:05:32 -07:00
Seth Hillbrand aae30cc7c1 pcbnew: Hotkey minor fixes
- Ordering of Hotkey list by function
- Use Hotkey assignment instead of hard-coded hotkey for length tuning
- Adjust default Length Tuning settings hotkey to CTRL-L so that we
don't overlap with "Lock" (overlaps are not editable)
2018-06-12 14:22:46 -07:00
Seth Hillbrand 2a87117edc Speed load/unload of complex boards
Corrects an error in polyline estimation

Syncs graphics to world PNS by whole layer set rather than
individual layer at a time.

Prevents reloading of full pns TOOL_BASE during reset of tools unless
the tool is being activated.

Fixes: lp:1766626
* https://bugs.launchpad.net/kicad/+bug/1766626
2018-04-28 16:11:07 +02:00
Seth Hillbrand 45d1c19eb7 Add tooltip text to drag options. 2018-04-17 08:59:52 -07:00
Jeff Young d3e7efcd66 Ignore pads when selecting drag candidates in router tool.
Fixes: lp:1747156
* https://bugs.launchpad.net/kicad/+bug/1747156
2018-03-16 18:01:40 +00:00
Jeff Young 3b0a758f97 Ensure router layer is visible.
Fixes: lp:1663556
* https://bugs.launchpad.net/kicad/+bug/1663556
2018-03-16 02:43:17 +00:00
Jon Evans 0d794b20bb Add null check in ROUTER_TOOL::breakTrack() 2018-02-27 08:45:06 +01:00