Commit Graph

4475 Commits

Author SHA1 Message Date
Seth Hillbrand d650cca088 Enforcing rational limits on length tuner
The length tuning dialog needed validators on close to prevent negative
and percentages >100%

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

(cherry picked from commit 3974c6fd89)
2019-06-29 09:38:27 -07:00
Jeff Young 16cf1a4d09 Output text content as a description of the stroked path.
Fixes: lp:1544918
* https://bugs.launchpad.net/kicad/+bug/1544918
2019-06-28 22:18:30 +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 e175eb25b8 Fix bug with accidental modification of legacy hotkey name. 2019-06-27 11:29:05 +01:00
Jeff Young 6253b44f20 Fix bug when poping only tool on stack. 2019-06-27 00:18:38 +01:00
Jeff Young 7099614041 Expose a bunch of cursor, panning and grid shortcuts.
Fixes: lp:1819249
* https://bugs.launchpad.net/kicad/+bug/1819249
2019-06-26 21:54:03 +01:00
Jeff Young e785c140b9 Eradicate globals for PCB_GENERAL_SETTINGS.
Fixes: lp:1832896
* https://bugs.launchpad.net/kicad/+bug/1832896
2019-06-26 21:54:03 +01:00
Jeff Young 7903cfa1da Add alt-click (for show Clarify Selection menu) to gestures list. 2019-06-26 21:54:03 +01:00
jean-pierre charras 8d84e22f31 Functions.cmake: add missing dependency to *.keywords.
Due to this missing dependency, when a xxx.keyword file was modified, the files built from it were not rebuilt
2019-06-26 19:25:24 +02:00
jean-pierre charras e800bc5ffe Avoid crashed in eeschema after selecting/deselecting and reselecting highlight tool or delete tool
It was due to use of items in std::deque without testing if these items exist.
2019-06-26 13:17:03 +02:00
jean-pierre charras c1eee56785 Prepare changes to support a better board stack management in .gbrjob file.
In .gbrjob file, one can specify the thickness and color of some layers.
Currently, there is no way to enter these parameters.
This commit prepare a better support of .gbrjob files.
2019-06-25 18:39:11 +02:00
Jeff Young f9702aab87 Immediate actions for PlEditor, PcbNew, etc. 2019-06-25 11:34:28 +01:00
Jeff Young cda3a82c66 Implement our own navigation out of a grid.
While wxWidgets has Navigate() and NavigateIn(), they're not compiled
on GTK because it supposedly has native TAB control.  Of course its
native TAB control won't get you out of a grid, so that leaves us in
a bit of a pinch.  This implements a poor-man's Navigate() which will
at least get us out of the grid.

Fixes: lp:1810569
* https://bugs.launchpad.net/kicad/+bug/1810569
2019-06-25 11:34:28 +01:00
Jeff Young f088d4d762 Add env-var setting to CommonSettingsChanged().
Fixes: lp:1804925
* https://bugs.launchpad.net/kicad/+bug/1804925
2019-06-25 11:34:28 +01:00
Jeff Young 3784950603 Added more sophisticated checking for thermal spoke connections.
And, again, some more performance optimizations to make up for it.
2019-06-25 11:34:28 +01:00
Jeff Young 0ed26e4e33 Fix some geometry error in thermal spoke calculations.
Also introduces some performance enhancements to make up for the
extra time spent in the calculations.
2019-06-25 11:34:28 +01:00
Jeff Young f8f1476f63 Performance enhancement for Fracture(). 2019-06-25 11:34:28 +01:00
Jeff Young 1099befab1 Performance improvement for SHAPE_LINE_CHANGE::PointInside().
It was calculating the bounding box twice (and failing to honour
the accuracy parameter on the bounding box test).

Worse, constructing the bounding box is about the same speed as
the rigorous test, so it never improves things.
2019-06-25 11:34:28 +01:00
Jeff Young fbfcba6e4d Add action for context menu (right-mouse-click).
Fixes: lp:1663595
* https://bugs.launchpad.net/kicad/+bug/1663595
2019-06-25 11:34:27 +01:00
jean-pierre charras 29ca96cfe7 Gerber drill file: Modify a aperture attribute for oblong holes (slots).
Oblong holes (slots) use now a aperture attribute similar to round holes.
(The previous attribute "slot" is now deprecated)
However they have a specific aperture, and a comment is added in drill files for these apertures.
2019-06-25 09:43:29 +02:00
Seth Hillbrand 98124e68c7 Update exit strategy to match UI guidelines
In singletop mode, all frames show the "Quit" option in the file menu
and will quit on Ctrl-Q.  When launched from the main KiCad interface,
sub-programs show the "Close" option instead and will close with Ctrl-W.
In this mode, Ctrl-Q will instruct the main program to exit.

Fixes: lp:1779938
* https://bugs.launchpad.net/kicad/+bug/1779938
2019-06-24 21:46:42 -07:00
Seth Hillbrand f9c476d851 Cleanup EDA_DRAW_FRAME init 2019-06-24 21:46:42 -07:00
Tomasz Włostowski 6180687bbd TestSegmentHit: add corner case for null segment (start == end)
Fixes: lp:1833059
* https://bugs.launchpad.net/kicad/+bug/1833059
2019-06-25 01:06:25 +02:00
Seth Hillbrand 77cefe0c16 Normalize line endings
A few files snuck in with CRLF for the line endings.  These make it hard
to look at diffs as every line appears to have changed.  This commit
makes only line ending changes, so can be ignored
2019-06-19 15:18:30 -07:00
Jeff Young 6aa0ceff36 Don't throw out search hits because they have unit children. 2019-06-19 21:27:58 +01:00
Jeff Young 485d436860 Clear ctx-menu before rebuilding; don't veto ctx-menu mousewarp for non-ctx-menu dialog.
Fixes: lp:1833312
* https://bugs.launchpad.net/kicad/+bug/1833312
2019-06-19 21:17:56 +01:00
Jeff Young eb95202708 Fix grid update when edited from menubar.
Fixes: lp:1833399
* https://bugs.launchpad.net/kicad/+bug/1833399
2019-06-19 18:35:17 +01:00
Jeff Young 730b89af6d Another round of changes for immediate actions. 2019-06-19 18:35:17 +01:00
Jeff Young 3a0256aade Add handle-based editing for eeschema bitmaps.
Also cleans out a bunch of duplicated functionality from the image
editor dialog.

Fixes: lp:1828722
* https://bugs.launchpad.net/kicad/+bug/1828722
2019-06-19 18:35:17 +01:00
Seth Hillbrand b876309999 Don't skip handled events in GTK
Now that our tool framework handles the hotkeys, we need to skip the
passed handling work-around for actions that are already handled in the
event.

Fixes: lp:1832604
* https://bugs.launchpad.net/kicad/+bug/1832604
2019-06-18 17:19:40 -07:00
Seth Hillbrand 6444cfd345 Greyscale plotting adjustment
When plotting greyscale, we should use luminance preservation for the
image output (blues get washed out otherwise).
2019-06-18 17:12:53 -07:00
Jeff Young dcbd897a95 Push/pop tools even when selected from the toolbar. 2019-06-18 20:24:15 +01:00
Jeff Young 7dd247f1dc Make better use of TOOL_EVENT parameters. 2019-06-18 20:24:15 +01:00
Wayne Stambaugh 9f9e87f11f Minor library identifier validator change.
Use the wxTextValidator style flag to allow the user to clear the library
identifier string.  Use wxTextValidator::SetStyle( wxFILTER_EMPTY ) to
prevent empty library identifier strings which is the current behavior.
2019-06-18 11:18:09 -04:00
Seth Hillbrand 66e8795656 Plotting: Handle mask transparency
This handles images with transparent colors by mapping the transparent
color to white.  This only works when plotted into the background.

(cherry picked from commit b32439a694)
2019-06-17 14:59:38 -07:00
Jeff Young 4eab89d9ef Fix OSX button order issue in Unsaved Changes dialog.
Also changes the presentation of the string when the checkbox appears
so that the "Changes will be lost" warning isn't hidden by the turndown.
This last part may require conditional compilation as it's undocumented.

Lastly, regularizes the Unsaved Changes strings between the apps.
2019-06-17 17:01:57 +01:00
jean-pierre charras 8085899d0a Pcbnew: better approximation of arcs by polygons for pads having a very small size.
Especially, small round rect pads have a ugly shape because the number of segments is
small and the 90 deg arcs are not very well approximated.
The minimal seg count for 90 deg arcs is now 4 (16 segm/circle) for pads.

Fixes: lp:1833005
https://bugs.launchpad.net/kicad/+bug/1833005
2019-06-17 17:26:15 +02: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 666705c1f8 Fix compiler warning. 2019-06-17 14:44:38 +01:00
Jeff Young 5d7739a662 Handle '&'s in menu labels.
Fixes: lp:1832904
* https://bugs.launchpad.net/kicad/+bug/1832904
2019-06-17 10:45:23 +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 b2ee2a4d88 Add checking to languages menu.
This also required having KICAD_MANAGER_CONTROL handle UpdateMenu
since there's no seletion tool for the Kicad Manager frame.
2019-06-16 20:26:43 +01:00
Jeff Young 909aeba3d9 Transition some more stuff from the MVC view to the controller. 2019-06-16 19:53:30 +01:00
jean-pierre charras 66d2060942 Partial fix for missing language selection menu.
The fix is partial because in the list of languages the menuitem corresponding to the selected language is not checked.
2019-06-16 20:35:57 +02:00
Wayne Stambaugh 77bf575742 CvPcb: fix save changes dialog layout issue.
DIALOG_EXIT was not being laid out correctly after setting the dialog
message.  Rather than fix our custom DIALOG_EXIT, wxMessageDialog and
wxRichMessageDialog were substituted as direct replacements for all
of the variants of DIALOG_EXIT.  This make message dialogs appear more
consistent because wxMessageDialog uses the default platform message
dialog and wxRichMessageDialog uses the default platform rich message
dialog on windows.

Remove DIALOG_EXIT_BASE as it is no longer required.

Fixes lp:1832899

https://bugs.launchpad.net/kicad/+bug/1832899
2019-06-16 12:10:24 -04:00
Jeff Young e4fbd003e0 Make m_passEvent event-specific rather than global.
If a tool called something like clearSelection while processing a
MOUSE_CLICK, the SELECTION_TOOL will pass the clearSelection
COMMAND_EVENT because it handles it as a transition, not as an
event. Because m_passEvent is effectively global, the tool manager
would then interpret that as passing the MOUSE_CLICK and we'd end
up processing the click by multiple tools.
2019-06-16 12:06:49 +01:00
Seth Hillbrand 552815d486 tool_mgr: Don't invalidate our own iterators
Re-arranging the stack will invalidate the iterator that is removed and
inserted (begin()).  Because this is not a threaded operation, we can
only do it to ourselves, so check that the operation isn't a NOP before
performing.

Fixes: lp:1832930
* https://bugs.launchpad.net/kicad/+bug/1832930
2019-06-15 17:49:15 -07:00
Jeff Young 18ebced8f4 Code hygiene. 2019-06-15 20:43:52 +01:00
Jeff Young 19aba615c2 Remove selection condition from conditional menu separators.
We don't allow duplicate separators anyway so all they really do
is complicate the code.
2019-06-15 20:43:51 +01:00