Commit Graph

4439 Commits

Author SHA1 Message Date
Ian McInerney 45f10fcff1 gal: Decoupled X and Y grid step sizes
Made the X and Y step sizes for the grid separate in the GAL.

Cleaned up the types inside the DrawGrid functions.

Fixes: lp:1821416
* https://bugs.launchpad.net/kicad/+bug/1821416
2019-05-28 20:07:45 -07:00
Jeff Young 1e9da7f57b Remove CurItem() architecture and legacy routers and drawing code. 2019-05-29 00:26:30 +01:00
Jeff Young 9d29e94cb5 Remove some more legacy code. 2019-05-29 00:26:29 +01:00
Jeff Young 0260b32125 Push resetLocalCoords down into COMMON_TOOLS.
Fixes: lp:1830693
* https://bugs.launchpad.net/kicad/+bug/1830693
2019-05-29 00:26:29 +01:00
Jeff Young a27e4246e0 Move some more menu commands to ACTIONs. 2019-05-29 00:26:29 +01:00
Jeff Young c0909611d3 Remove a bunch more legacy editing code. 2019-05-29 00:26:29 +01:00
John Beard 6b4b2d61f8 Common: do not conditionally define wxPoint/Size operator<<
Due to an interaction with old (<1.59) versions of Boost, the ostream
operator<< for wxPoint and wxSize is requried to use
BOOST_CHECK_EQUAL_COLLECTIONS (the print_log_value<T> function is not
used by this macro until 1.59).

Because these functions are available in Debug builds, unit tests that
use such functions will break when compiled as Release or
RelWithDebugInfo.

The change here is to not disable these functions in Release builds.

Also, the functions are moved to common.h, to go with other generic
WX "polyfill" functions. Although they might be commonly used by the
EDA_ITEM::Show functions, they are not specifically related to that
class.

Fixes: lp:1830612
* https://bugs.launchpad.net/kicad/+bug/1830612
2019-05-28 13:52:36 +01:00
Jeff Young 718ad77891 Fix a bug introduced when UseGalCanvas() no longer switches.
We still need to setup the viewport the first time.
Also removes some more legacy editing code.
2019-05-27 18:47:20 +01:00
Jeff Young 9d9745b555 Remove more legacy editing code. 2019-05-27 18:47:20 +01:00
Jon Evans 0a6b1ea256 Improve image alpha handling in PDF and PS plotters
Fixes: lp:1825276
* https://bugs.launchpad.net/kicad/+bug/1825276

(cherry picked from commit 4adf89b40b)
2019-05-27 13:06:26 -04:00
Jeff Young e9e28b9aac Retire legacy block architecture. 2019-05-27 11:58:56 +01:00
Jeff Young 21c216556b Cut/copy/paste for PlEditor. 2019-05-27 11:58:55 +01:00
Jeff Young 6936effaa7 Implement undo for Page Settings in PlEditor, Eeschema and PCBNew.
Fixes: lp:1820059
* https://bugs.launchpad.net/kicad/+bug/1820059
2019-05-27 11:58:55 +01:00
Jeff Young 248089c934 Get rid of PageLayout globals so drawing the preview doesn't mess up the document. 2019-05-27 11:55:58 +01:00
Jeff Young bdd44ce88c Use consistent PageLayout data structure names. 2019-05-27 11:55:58 +01:00
Seth Hillbrand 0e5cc54ec9 Eagle: Fix crash when importing Eagle V6
This fixes multiple issues when importing Eagle V6 files.

Crashes occured when arcs of 0-length were found and when parts were
referenced in the schematic that were not found in the library.  This
could happen if the library and schematic were different cases.

Fixes: lp:1830564
* https://bugs.launchpad.net/kicad/+bug/1830564
2019-05-26 20:31:55 -07:00
Jon Evans d2a2dea9c4 Eeschema: fix worksheet and background color for printing
Fixes: lp:1820611
* https://bugs.launchpad.net/kicad/+bug/1820611

(cherry picked from commit 720b26d11e)
2019-05-26 14:26:26 -04:00
Jon Evans b40289c1bd Eeschema: use worksheet color when plotting
Fixes: lp:1825568
* https://bugs.launchpad.net/kicad/+bug/1825568

(cherry picked from commit e35be13b23)
2019-05-26 13:03:23 -04:00
Jon Evans 15cf25a6fc GerbView: Fix selection of the last two grid settings
Fixes: lp:1827642
* https://bugs.launchpad.net/kicad/+bug/1827642

(cherry picked from commit ba19d93df9)
2019-05-26 13:03:23 -04:00
Jon Evans e156e4509c Report actual intersection position for crossing tracks
Fixes: lp:1825588
* https://bugs.launchpad.net/kicad/+bug/1825588

(cherry picked from commit f101934909)
2019-05-26 13:03:23 -04:00
Jon Evans 549b76739e Exclude invisible items from view bounding box for zoom-to-fit
Fixes: lp:1116457
* https://bugs.launchpad.net/kicad/+bug/1116457

(cherry picked from commit ede2575018)
2019-05-26 13:03:23 -04:00
jean-pierre charras b5c80fe689 Fix missing include to compile pcbnew_wrap.cxx 2019-05-26 09:12:03 +02:00
jean-pierre charras 568d4e2b19 Avoid including id.h in a lot of files that do not use it. 2019-05-26 08:14:25 +02:00
jean-pierre charras a6e6e914af Eeschema: make menu file history working again.
(the bug was due to an unexpected menuitem ID range used for the  menuitems of the history)
2019-05-25 20:58:28 +02:00
Seth Hillbrand 6bcf1839b7 pcbnew: Add arc approximation setting to board
This places the arc approximation setting in the kicad_pcb file and uses
it for all parts of the board rendering where arcs are converted to
segments.  This allows the user to customize their speed vs. accuracy
tradeoff.  The default setting of maximum error of 0.005mm is acceptable
for small boards on moderate systems.
2019-05-24 21:21:06 -07:00
Jeff Young b9898e2bb0 Fix crash when a pagelayout includes a bitmap or polygon.
Fixes: lp:1830439
* https://bugs.launchpad.net/kicad/+bug/1830439
2019-05-25 01:37:08 +01:00
Jeff Young a3dfce5adb Implement common file menu actions and move Eeschema over. 2019-05-25 01:14:21 +01:00
Jeff Young ba4ba5b668 Implementing boundingbox getters for WS_DRAW_ITEMs. 2019-05-24 21:23:26 +01:00
Seth Hillbrand f0352176ec Fix a compile error in Linux
Operands to the ternary operator cannot have different types under g++
(linux)
2019-05-24 12:12:10 -07:00
jean-pierre charras 32f25cf8b4 ACTION_MENU::appendCopy: Fix an issue on Windows with Check-able menu-items.
The source bitmap was copied to the new created item.
However, for Checkable menu-items, when setting a bitmap, our standard check bitmap is also added.
This is unwanted when the source bitmap is the wxNullBitmap (bitmap sizes are different)
2019-05-24 21:01:49 +02:00
Jeff Young 71f188f3de Hook up import-page-layout and change-background-color actions. 2019-05-24 19:49:10 +01:00
Jeff Young 85f984ccd9 Add point-editor activation for immediate-mode drawing. 2019-05-24 19:49:09 +01:00
Jeff Young 09424db68f Restore selection around undo/redo. 2019-05-24 19:49:09 +01:00
Jeff Young 323bb0f8e1 Moving PageLayout editor to GAL canvas and modern toolset. 2019-05-24 19:49:09 +01:00
jean-pierre charras 40382f4d52 Viewlib: menubar/view menu: make grid select working
Set also a better icon for this menu item
2019-05-24 15:49:51 +02:00
jean-pierre charras e957fb403b eda_draw_frame.cpp: fix missing EVT_MENU_CLOSE capture, that can create crashes.
in this case the crash can happens because a menu pointer used in EVT_MENU_HIGHLIGHT
is not cleared when closing the menu
2019-05-24 10:22:09 +02:00
Seth Hillbrand 1a56dfe342 Plotter: Ensure group style is respected in SVG
Graphics Changed is cleared when setting graphics for a group but needs
to be reset when the group ends.

Fixes: lp:1830245
* https://bugs.launchpad.net/kicad/+bug/1830245
2019-05-23 09:40:35 -07:00
John Beard 2dd5757eb5 Common: Fix copy-construction of empty BITMAP_BASE
The bitmap pointer is not checked at copy construct. This is
an instant segfault if you copy an empty bitmap.

Fix the constructor and remove the expected test failure, from the
previous commit.
2019-05-23 16:58:08 +01:00
John Beard 94b46ce176 QA common: add some BITMAP_BASE tests
Also:

* Init wx image handlers for qa_common
* Break out COLOR4D test predicates
* Fix some bitmap_base.h headers/forwards
2019-05-23 15:19:51 +01:00
jean-pierre charras 83e08c9277 Fix crash in Eeschema when clicking on a menubar item.
It happens if an other frame (libedit) was opened, a menubar clicked, an this frame was closed.
2019-05-23 13:35:12 +02:00
Jeff Young 0047f88f82 Mark unfold bus menu as clean so it doesn't get generated a second time.
Fixes: lp:1829878
* https://bugs.launchpad.net/kicad/+bug/1829878
2019-05-23 00:27:53 +01:00
Seth Hillbrand ac435ecd68 Moving further arc approximations down
This corrects an issue with fill segments-per-circle and moves the error
to segmetns calculation down in a number of functions to expose the
single value for approximation
2019-05-22 14:35:17 -07:00
Jeff Young 67cc2aac2e Rework Eeschema find/replace for modern toolset.
Fixes: lp:1827274
* https://bugs.launchpad.net/kicad/+bug/1827274

Fixes: lp:1827240
* https://bugs.launchpad.net/kicad/+bug/1827240
2019-05-22 21:48:04 +01:00
Seth Hillbrand 06b22594ca libedit: Prevent null dereference in popup
Lack of tool manager can happen when the popup is not connected to the
main tool.

Fixes: lp:1829825
* https://bugs.launchpad.net/kicad/+bug/1829825
2019-05-21 19:59:43 -07:00
Seth Hillbrand 490c805319 Allow squared inflation and inflate Eagle Zones
Sometimes we want to inflate a polygon without adding rounded edges.
This add the option using the jtMiter setting.

This is used in the Eagle parser to expand the Eagle zones for KiCad.
Eagle Zones are drawn on the polygon edge, so they extend out from the
outline.  KiCad zones are drawn inside the polygon.  We need to both
increase the zone size and decrease the minimum pen width to account for
this.

Fixes: lp:1817312
* https://bugs.launchpad.net/kicad/+bug/1817312
2019-05-21 13:49:18 -07:00
jean-pierre charras aee1fe45f4 Fix a few issues related to Bitmaps in menus.
- fix missing icons.
- remove duplicate (and incorrect) code to set these icons in wxMenuItems
2019-05-21 17:50:05 +02:00
jean-pierre charras 62a5302bc4 Fix issues created by commit cbb0d74bd5.
This commit redirected too many menuitem IDs to the tool manager.
Only some context menu items have to be redirected, not all inside ACTION_EVENT events.

This hack is not perfect. It needs a better handling of ACTION_EVENT handling.
2019-05-21 12:48:37 +02:00
Jon Evans cbb0d74bd5 Ensure all custom event ids are processed by ACTION_MENU
Fixes: lp:1829759
* https://bugs.launchpad.net/kicad/+bug/1829759
2019-05-20 23:45:22 -04:00
Jon Evans f53c42fac9 Fix another instance of wxGTK not liking menu icons 2019-05-20 20:34:08 -04:00
Jon Evans 95a6fb6ea3 Don't set bitmaps on non-normal menu items under wxGTK
Fixes: lp:1829780
* https://bugs.launchpad.net/kicad/+bug/1829780
2019-05-20 20:11:22 -04:00
jean-pierre charras d701637eab Footprint viewer: Fix crash when truing to open the View menu. 2019-05-20 11:36:58 +02:00
jean-pierre charras c35ec8ae7c Pcbnew: fix crash when opening and closing a context menu, and then trying to open a menu from the menu bar.
Was due to the fact the EVT_MENU_CLOSE capture was missing
2019-05-20 10:56:24 +02:00
jean-pierre charras 97ddefd01a Cosmetic refinement in conditional menu: avoid adding useless separators in menu.
A useless separator is a separator added when no menuitem was previously added.
2019-05-20 10:53:32 +02:00
Jeff Young f21faceb74 A hack to work around wxWidgets failure to capture WX_MENU_OPEN events
See the comments.  It's not pretty, but it works.

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

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

Fixes: lp:1594029
* https://bugs.launchpad.net/kicad/+bug/1594029
2019-05-19 22:04:28 +01:00
Jon Evans ec39bdda77 GerbView: fix saving of canvas type and lingering legacy menu item
Fixes: lp:1829647
* https://bugs.launchpad.net/kicad/+bug/1829647

(cherry picked from commit b00e20b23f)
2019-05-19 16:17:53 -04:00
Jeff Young 7d9a0b06e0 Push help menu down into EDA_BASE_FRAME. 2019-05-18 13:14:08 +01:00
Jeff Young 13aa503614 Hack for wxWidgets failure to open menu on MSW. 2019-05-18 00:21:49 +01:00
Jeff Young 1a3d0492f5 Push polar coords down into COMMON_TOOLS. 2019-05-18 00:21:49 +01:00
Jeff Young 48fb78418c Fix merge error. 2019-05-16 20:05:45 +01:00
Jeff Young b4d4525496 Fix icon-scaling issue for ACTION_TOOLBAR.
Fixes: lp:1829291
* https://bugs.launchpad.net/kicad/+bug/1829291
2019-05-16 19:57:06 +01:00
Jeff Young fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
Seth Hillbrand ddc6079ceb Move remaining hard-coded segment counts
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)
2019-05-16 08:49:55 -07:00
John Beard 8378f97a78 Eeschema: enable grid change hotkey
Add the N/Shift+N hotkeys to the eeschema hotkey file.

Also adjust the COMMON_TOOLS::GridNext/Prev to work when
the screen's grid definitions do not have consecutive command
IDs (they do not in eeschema).

This is related to lp:1811018 (but doesn't constitute a fix).
* https://bugs.launchpad.net/kicad/+bug/1811018
2019-05-16 14:10:43 +01:00
John Beard 0eb8f92c69 Pcbnew: add a step field to the array tool
This is useful, for example, when arraying only one side
of a connector.

Fixes: lp:1809580
* https://bugs.launchpad.net/kicad/+bug/1809580
2019-05-16 11:20:52 +01:00
John Beard 2c1b970027 Arrays: isolate axis code in a new class
Remove the axis numbering code from ARRAY_OPTIONS
and place in a new class, ARRAY_AXIS. This keeps
the logic for the array item numbering separate from
the logic for the array item geometry.

This simplifies the logic in the ARRAY_OPTIONS class, which
no longer has to deal with the numbering of each axis.
2019-05-16 11:20:52 +01:00
Wayne Stambaugh f08d040c02 A better fix for commit d34433a1.
Replace INCREMENTAL_TEXT_CTRL with wxSpinCtrlDouble because it looks
and works better.

Remove INCREMENTAL_TEXT_CTRL header and source files because the only
place they were used was in GAL_OPTIONS_PANEL.
2019-05-15 18:18:01 -04:00
Seth Hillbrand 0eb391b13f plotter: We we trying to export mm but chose in
Note that the comment in line 142 where the scale factor was set had the
correct value to indicate metric (1) but in the actual boilerplate, we
set imperial (0).  This has been around for 6-8 years, so it would seem
DXF is not our most popular export.

Note, I initially tried to use '1' to specify metric units but this was
not handled by DXF readers (QCAM, Inkscape).  Instead, scaling the page
units to inches properly seems to work.
2019-05-15 14:54:25 -07:00
Seth Hillbrand a0f477cc5f Fix default button option on close
The default is meant to be "Save" but "Discard" was selected due to ID
ordering on creation.  Setting the focus before setting the default
makes the "Save" option the highlighted option that can be selected
immediately by pressing enter.
2019-05-15 12:14:20 -07:00
Wayne Stambaugh d34433a1df Fix GAL display options panel spin button layout on windows.
Fixes lp:1829224

https://bugs.launchpad.net/kicad/+bug/1829224
2019-05-15 14:59:14 -04:00
Jeff Young 69afa27a5f Implement ACTION_TOOLBAR and update some of the menus to ACTION_MENU.
This gives us better separation of MVC in line with the design of
the modern toolset.  It also reduces a whole bunch of duplicated
data.
2019-05-15 17:50:52 +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 06d64c7883 Use wxMessageBox instead of ASSERT for duplicate hotkey warnings. 2019-05-15 17:50:52 +01:00
Jeff Young e850592587 Cleanup. 2019-05-15 17:50:52 +01:00
John Beard dcd4b13104 Remove workaround for fixed issue (spaces in text crash GAL)
The spaces-crash-GAL issue (lp:1668455) was fixed by
ef8f5db024.

THis removes a work-around in the arc drawing assistant.
2019-05-14 13:29:45 +01:00
John Beard 6cf7ad68ad Pcbnew: break out preview draw helpers
The graphical drawing routines in the arc assistant can be
made more generic for re-use in similar code.
2019-05-14 13:29:45 +01:00
John Beard 041c52c369 Arc preview: Add guide circle
When drawing an arc, show a guide circle that indicates the
radius of the arc at the current cursor. This can be useful
as a guide for seeing where the arc will reach once the radius
is fixed by the second click.

Fixes lp:1796158
* https://bugs.launchpad.net/kicad/+bug/1796158
2019-05-14 13:28:55 +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
Wayne Stambaugh 3c4f8c1bf7 Fix frame name capitalization in all about dialogs.
This is a stop gap fix.  It should be possible to use the wxFrame title
string for this but some of the frame windows have appropriated the title
string for configuration file naming purposes which is less than ideal.

Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1825977
2019-05-13 15:40:44 -04:00
John Beard 18593d2dbb 3D viewer: decouple renderers from wxCursors
Provide a toolkit-agnostic interface for "busy indicators", which
allows the 3D viewer to show a busy cursor, without the canvases
having to to know how a wxCursore works.

The motivation here is to decouple the 3D renderers from the WX
GUI system, as they can then be used when when there is not an
active window (e.g. for offscreen rendering).

Otherwise, attempting to use a wxBusyCursor without a GUI
available is an instant segfault.
2019-05-12 14:19:39 +01:00
Jeff Young f8776f72ac Drop cell editor when selecting column.
Fixes: lp:1828222
* https://bugs.launchpad.net/kicad/+bug/1828222
2019-05-11 15:38:49 +01:00
Jeff Young 792c4328aa Cleanup. 2019-05-10 21:40:08 +01:00
Jeff Young e77d096412 Make setting a breakpoint easier. 2019-05-10 16:11:57 +01:00
Jeff Young ea0941cab3 Implement modern tools for LibEdit. 2019-05-10 16:11:57 +01:00
Wayne Stambaugh ae54f34392 Eeschema: fix corrupted schematic and symbol library files.
Prevent user from pasting text with carriage return and/or line feed
characters in field value edit control in the schematic symbol and symbol
library properties dialogs.

Make all objects derived from GRID_CELL_TEXT_BUTTON use validators
correctly.

Add validators to FIELDS_GRID_TABLE object for field values other than
the mandatory fields.

Create a validator to check that a string is a valid LIB_ID.

Fixes lp:1828214

https://bugs.launchpad.net/kicad/+bug/1828214
2019-05-10 08:21:37 -04:00
jean-pierre charras a155289f70 Custom pads: fix incorrect shape of masks when the shape is a polygon with holes and the mask margin is < 0.
This is mainly the solder paste layer that shows this issue.
This is due to the fact SHAPE_POLY_SET::Inflate does not work fine with polygons with linked holes.
SHAPE_POLY_SET::InflateWithLinkedHoles it added to fix this issue.

Fixes: lp:1828287
https://bugs.launchpad.net/kicad/+bug/1828287
2019-05-09 16:23:18 +02:00
Seth Hillbrand f7c042a357 pcbnew: Allow curves in custom pads
Updates custom pad functions to permit adding arbitrary curves to the
primitives
2019-05-08 15:54:26 -07:00
jean-pierre charras 533fdcf00a Cairo GAL: fix incorrect arc position in mirror mode.
the previous fix (2e43c6c64e) did not really work.
Add also comments to a few not yet documented methods.

Fixes: lp:1822772
https://bugs.launchpad.net/kicad/+bug/1822772
2019-05-08 14:24:26 +02:00
John Beard e6fe220f84 All: fix horizontal touchpad panning
Commit e10c01aaf didn't work when touchpad panning was enabled.

This commit changes it to only discard horizontal wheel events
when in "scroll mode" rather than "pan mode".

Based on a patch by Adrian Scripcă <benishor@gmail.com>.

Follow-up to fix: lp:1828080
https://bugs.launchpad.net/kicad/+bug/1828080
2019-05-08 11:06:44 +01:00
Adrian Scripca e10c01aaff All: fix spurious wheel scroll events caused when using modern mice.
Modern mice feature horizontal scrolling capabilities and those end
up being treated by KiCad as regular scroll events causing confusion
among users.

The fix works by discarding the handling of wheel events other than
the ones for the vertical axis.

Fixes: lp:1828080
https://bugs.launchpad.net/kicad/+bug/1828080
2019-05-07 17:34:51 +01:00
John Beard 4a3add7ac5 About dialog: Add mnemonics to the buttons 2019-05-07 10:27:33 +01:00
John Beard cc28fb18fd About dialog: update wxFB version
Avoid contaminating wxFB files with version fluff, which hides real
changes in the version history.
2019-05-07 10:27:33 +01:00
Jeff Young cd2bd23c37 Fix a bunch of issues with hotkeys, IDs and event processing.
Fixes: lp:1827894
* https://bugs.launchpad.net/kicad/+bug/1827894
2019-05-06 21:42:00 +01:00
Jeff Young 207900e4f9 Move libedit message panel updating to the Inspection Tool. 2019-05-06 15:31:23 +01:00
jean-pierre charras 2e43c6c64e Cairo GAL: fix incorrect arc position in mirror mode.
It happens in print mode and also when the Pcb view is flipped.

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

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

Fixes: lp:1823147
https://bugs.launchpad.net/kicad/+bug/1823147
2019-05-06 11:28:14 +02:00
Jeff Young a42a4b0b52 Implement immediate bus unfold and add bus unfold to selection context menu. 2019-05-05 17:14:30 +01:00
Jeff Young fd546da640 Homogenize hit testing and selection return types.
Prep work for sharing SCH_SELECTION_TOOL with LibEdit.
2019-05-05 17:14:30 +01:00
Jeff Young 9adf012c20 Move duplicate hotkey check so it respects AS_CONTEXT. 2019-05-05 17:14:30 +01:00
Jeff Young 6e695aac25 Move bus unfold and symbol unit selection to modern toolkit. 2019-05-05 17:14:30 +01:00
Jeff Young 423d430b58 Replace deleteNode and deleteConnection with selectNode and selectConnection. 2019-05-05 17:14:29 +01:00
Jeff Young 2244dcd567 Move show datasheet to SCH_INSPECTOR_TOOL and add show marker info. 2019-05-05 17:12:59 +01:00
Jeff Young 902be18a04 More modern toolset context menu work.
Text/label type changes and bus entry shape changes.  And some
context menu bug fixing.
2019-05-05 17:12:59 +01:00
Jeff Young b526461a8e Fix colliding hotkeys issue.
All grid commands need to be shared now as they're implemented
by a common tool.
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 1c8461bec7 Transition mirroring to modern toolset. 2019-05-05 17:12:59 +01:00
Jeff Young f200c61897 Start transitioning block operations to modern toolset. 2019-05-05 17:12:59 +01:00
Ian McInerney 9e6e9d0910 Replace remaining Boost mutexs with std::mutex
CHANGED: Replaced all MUTEX types with std::mutex
         Replaced all MUTLOCK types with std::lock_guard
2019-05-03 17:13:20 -07:00
Jeff Young 2e8d930250 Fix merge issue.
Some legacy_gal code leaked into legacy_wx.

Fixes: lp:1827270
* https://bugs.launchpad.net/kicad/+bug/1827270
2019-05-03 00:11:38 +01:00
Wayne Stambaugh 7d803437e2 Eeschema: fix broken symbol library links.
Force the symbol library links whenever the symbol library table has been
modified.  This will use the cache as a fallback when a library has been
removed that contains links in the schematic rather than display.

Fix the SCH_COMPONENT symbol resolver when falling back to the cache.  The
resolver was using the LIB_ID ':' notation which was failing.  Replacing
':' with '_' fixed this issue.  This was also an issue when generating the
symbol message panel information.

Convert wxLogDebug to wxLogTrace in symbol resolver code path.  Add new
trace type KICAD_SYM_RESOLVE.

Fixes lp:1821606

https://bugs.launchpad.net/kicad/+bug/1821606
2019-04-30 13:05:27 -04:00
Jon Evans c054944d67 Set real-time connectivity to on by default with a safety valve 2019-04-29 18:59:32 -04:00
Jon Evans 49e88b267a Fix KICAD_RUN_FROM_BUILD_DIR on MacOS 2019-04-28 21:59:51 -05:00
John Beard 10900c918f Eeschema: Fix/circumvert GTK3 tree view bug
There is a rendering bug in GTK3, which appears to be
an upstream GTK issue.

This can be worked around by, when filtering, ensuring the
*parent* item of the selected item is visible. This will
not cause the selected item to not be visible, as the selected
item will be the first shown child. So it will be visible, as long
as the list box is greater than a single row high, which it will be
in all practical scenarios.

This is done on all platforms, as it has a beneficial side-effect:
the parent library of the selection is naturally shown to the
user, so they don't need to scroll up to see what library their
current filter selection was in.

Fixes: lp:1804400
* https://bugs.launchpad.net/kicad/+bug/1804400
2019-04-28 17:12:12 +01:00
John Beard fcc4a84e0e GAL: add some trace to GAL display options config
This can be helpful when tracing where certain configurations
come from (some apps load from other apps' config basenames).
2019-04-27 14:57:14 +01:00
John Beard d89d0e6b74 SHAPE_ARC: Fix bug introduced in 5813164d1.
This fixes the bug exposed in the previous commit.
The tests which exposed it now pass and expected failures
removed.
2019-04-25 23:49:42 +01:00
Tomasz Włostowski 5813164d15 SHAPE_ARC: fixed polyline conversion bug introduced in e312e2b286
Fixes: lp:1826278
* https://bugs.launchpad.net/kicad/+bug/1826278

Fixes: lp:1826270
* https://bugs.launchpad.net/kicad/+bug/1826270
2019-04-25 15:30:27 +02:00
Jon Evans 1426a4f3cf Ensure shown text is cached at creation 2019-04-25 00:46:51 -04:00
Jon Evans 3bfe5fb84b Cache unescaped text to boost connectivity performance 2019-04-25 00:14:25 -04:00
John Beard 15bba27406 BITMAP_BASE: Add const image data accessor
This allows a const BITMAP_BASE to expose const image
data. This is currently done with const_casts, which is
"OK", only as long as the source image is not declared
const, in which case it's undefined behaviour.

Also immediately dereference the pointer to a reference
if it's not checked to make the non-null requirements
explicit at the point of access.
2019-04-24 17:31:22 +01:00
John Beard e687d14903 Remove useless const_casts
Both versions of EDA_DRAW_FRAME::isBusy have a useless const_cast.

GetScreen() const returns a non-const SCH_SCREEN already, it doesn't
need to be cast, and it's stored in const SCH_SCREEN anyway.
2019-04-24 09:46:01 +01:00
Jeff Young 1a007c3e4b Implement SCH_SELECTION_TOOL (but still with legacy semantics). 2019-04-22 22:08:18 +01:00
Jeff Young a461eae8b9 Fix 100s of usages of GetFlags() which conflated != 0 with being edited.
While this was true long ago, many flags have been added since which
have nothing to do with editing (HIGHLIGHTED, BEGIN_ONPAD, etc.)
2019-04-22 09:58:06 +01:00
Jon Evans dffd1179c5 Add a mechanism to load kifaces when run from the build directory
This is useful when working on code paths that rely on KiWay
communications, since you can run and debug the kicad application
without needing to run an install task first.
2019-04-20 15:08:34 -04:00
John Beard 6ad97e5b5b Kicad Curl: Ignore unused functions for OpenSSL >= 1.1.0
In OpenSSL 1.1.0 and newer, the locking callback macros do nothing.
This causes unused warnings for the static function lock_callback.

Ignore this function on newer OpenSSL builds, but keep
the infrastructure for now.

When OpenSSL's min version is 1.1 or greater, all the locking
infrastructure can be removed.
2019-04-18 16:24:29 +01:00
Jeff Young 0772b54845 Move eeschema zoom-selection to modern toolset.
Fixes: lp:1825164
* https://bugs.launchpad.net/kicad/+bug/1825164
2019-04-17 21:49:50 +01:00
John Beard e312e2b286 SHAPE_ARC: fix polyline conversion when radius=0
Prevent a divide-by-zero bug in SHAPE_ARC::ConvertToPolyline.

When the radius is zero, just use the initial angle (it makes
no different anyway, the result is the centre point, which is
the start point.
2019-04-17 10:52:56 +01:00
jean-pierre charras 4d3e86d795 DIALOG_CONFIGURE_PATHS: do not allow users to define the env var KIPRJMOD
It always defines the project path, and should never be defined by users.

Fixes: lp:1824912
https://bugs.launchpad.net/kicad/+bug/1824912
2019-04-16 11:41:30 +02:00
jean-pierre charras ad5a1fd963 SIM_PLOT_FRAME: cosmetic enhancement: add icons in main menu.
Fix also Upeer/lower case issues in main menu strings.
2019-04-14 15:31:46 +02:00
Jeff Young 91bf08df1a Move ZoomFitScreen from GetBoundingBox to GetDocumentExtents. 2019-04-14 01:44:47 +01:00
Jeff Young 67bdf61682 Fix extra include. 2019-04-13 20:20:02 +01:00
Jeff Young 94a948fdd1 Move grid selection for both Eeschema and Pcbnew to COMMON_TOOLS. 2019-04-13 18:43:35 +01:00
Jeff Young fc7f5630c7 Move eeschema zoom operations to modern toolset. 2019-04-13 18:43:26 +01:00
Jon Evans dec5d80180 Veto mouse warping from DRC dialog
Fixes: lp:1824630
* https://bugs.launchpad.net/kicad/+bug/1824630
2019-04-13 11:23:57 -04:00
Seth Hillbrand 822cd9c6ef eeschema: Remove UR_WIRE_IMAGE
The wire image undo/redo option required special handling and was only
used in a single location.  Replacing with single change handling
reduces the code complexity
2019-04-13 07:11:24 -07:00
John Beard 203019d959 Fix GAL option spin button layout
These need to not be wxEXPAND and to be vertically centred
to match the adjacent text controls.

Fixes: lp:1804461
* https://bugs.launchpad.net/kicad/+bug/1804461
2019-04-12 23:35:54 +01:00
Seth Hillbrand d70ae19cb8 eeschema: Move realtime connectivity to adv config
This allows realtime connectivity testing by modifying the
kicad_advanced setting rather than recompiling
2019-04-12 08:37:44 -07:00
John Beard ab2281d26f GAL opts: move config reading into GAL_DISPLAY_OPTIONS
Move repeated GAL config reading routines into GAL_DISPLAY_OPTIONS.
THe app-level config is in here already, do the same for the
common config.

This means that the configs are loaded consistently, which fixes
the symbol-chooser preview window, which previously didn't use the
same config routine as other GAL canvases.

Future work could move these functions to free functions that
act on the public interface of GAL_DISPLAY_OPTIONS to avoid
GAL_DISPLAY_OPTIONS having to know about wxConfig and wxWindow.

Fixes: lp:1824524
* https://bugs.launchpad.net/kicad/+bug/1824524
2019-04-12 16:08:11 +01:00
Jeff Young 0021ecf51e Don't double-escape netnames.
Netnames in wxChoice or wxListBox are already in internal format
and don't need escaping again.

Fixes: lp:1823863
* https://bugs.launchpad.net/kicad/+bug/1823863
2019-04-12 00:28:58 +01:00
Jeff Young 3c11b89e4c Hook up refresh buttons to library tree synchronisation.
Fixes: lp:1820057
* https://bugs.launchpad.net/kicad/+bug/1820057
2019-04-11 19:45:10 +01:00
jean-pierre charras 63db3f7c17 Disable escaping special chars in netnames because it creates much more issues than it fixes.
Especially the netnames shown on screen are not those living in netlists,
breaking net info in Spice, Gerber X2 and IPC356 for instance
2019-04-11 18:36:21 +02:00
Seth Hillbrand 8c9244e677 Revert "eeschema: Connectivity threading"
This reverts commit 1a031e771f.

Some nets broken in commit.
2019-04-10 20:08:42 -07:00
Seth Hillbrand 1a031e771f eeschema: Connectivity threading
This threads the first step (update item) in the connectivity routine.
Also eliminates the duplicate call for multiple copies of the same
sheet.
2019-04-10 15:04:22 -07:00
Seth Hillbrand 2048114512 Reduce chance for wxPoint hash collision
Hash collisions reduce the speed of unordered maps by increasing the
comparison time of underlying values.  This implements the inverse
golden ration offset into the x value to ensure that consecutive points
are far from each other in the map.
2019-04-09 20:40:04 -07:00
Seth Hillbrand 257d9b5fe9 Allow setting the kicad config dir
This allows setting the config dir at build time, providing packagers a
method of controlling where the configuration files are placed.

Fixes: lp:1780601
* https://bugs.launchpad.net/kicad/+bug/1780601
2019-04-08 12:33:49 -07:00
Jeff Young adf3637476 Allow dialogs to veto mouse-warping when called from context menu.
Fixes: lp:1745731
* https://bugs.launchpad.net/kicad/+bug/1745731
2019-04-08 20:07:40 +01:00
John Beard dd17f24c04 Libeval: consistent formatting for NaN
On some platforms like MSVC, NaN prints as "-nan(ind)". This
is a bit needlessly ugly, so print "NaN" on all platforms
consistently.

This fixes a test failure on MSVC.
2019-04-08 16:27:45 +01:00
Jeff Young 77f15eeeaf Support synchronous messaging over KIWAY EXPRESS.
This allows us to make the various netlist and pcb update routines
more atomic and less reliant on carefully sequenced asynchronous
messages.

This is also a prelude to adding support for footprint testing
without a netlist.
2019-04-08 13:26:09 +01:00
Seth Hillbrand 24bf838392 pcbnew: Allow arc editing via midpoint
This permits changing the radius of the arc by adjusting the center
point of the arc.  The arc end points are fixed in this operation.
2019-04-07 06:50:25 -07:00
Jeff Young 4a9f82109a Uniformly quote strings which may have user content.
Fixes: lp:1655193
* https://bugs.launchpad.net/kicad/+bug/1655193
2019-04-07 00:24:10 +01:00
Jeff Young 684bb62fd8 Escape slashes in labels and netnames.
Also re-allows spaces, as they can already come in through sheet
names.

Fixes: lp:1798621
* https://bugs.launchpad.net/kicad/+bug/1798621
2019-04-07 00:24:10 +01:00
Jeff Young 2aad4a5e57 Remove dead code from removal of eeschema legacy canvas. 2019-04-05 15:54:31 +01:00
Michael Kavanagh 1ccef6dc80 Invert maximum and minimum endpoints on color picker sliders
Put the maximum values at the "top" of the sliders.

Fixes: lp:1823196
* https://bugs.launchpad.net/kicad/+bug/1823196
2019-04-05 14:37:46 +01:00