Commit Graph

4345 Commits

Author SHA1 Message Date
John Beard dd313d4d47 Wildcards: use vectors instead of varargs + tests
Varargs make it very hard to pass strings in flexibly
when they (and the number of them) are not known
at compile time.

For example, this allows up to now amalgamate the "single
ext" and "multiple ext" unit tests.
2019-01-09 08:57:35 -05:00
Fabián Inostroza 7f6b35c6bc Don't start autopan if the cursor was warped
The application warps the cursor when initiating some actions (dragging,
selecting modules or Find and Move).  This warping should not also
trigger the autopan action.

Fixes: lp:1810787
* https://bugs.launchpad.net/kicad/+bug/1810787
2019-01-08 12:15:33 -08:00
Seth Hillbrand 90ad240660 units: Move common units and add tests
Centralizing duplicate code from Eeschema and pcbnew and adding unit
tests
2019-01-08 09:29:32 -08:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
John Beard cec97ebfa6 Remove unused VIRT_MIN/MAX from legacy_gal 2019-01-06 08:16:29 -08:00
John Beard 5e705347bb Libeval: Use add_custom_target so grammar.c won't be cleaned
If you use add_custom_command to generate the grammar file,
it can be removed by "make clean". This then means the user will
need to get it back from Git, or regenerate it with Lemon.

Changing to add_custom_command removes the output file
from the clean list. The incantation to rebuild the grammar
remains the same: "make libeval_grammar", and it is still not
required to have lemon installed for a normal build.

Fixes: lp:1809610
* https://bugs.launchpad.net/kicad/+bug/1809610
2019-01-05 07:44:06 -08:00
Seth Hillbrand 30521f0c57 gal: Fix zoom extents for large screens
When at small zoom levels, the integer bbox can overflow, preventing
redraw.  We fix this by redrawing the full tree when this happens

Fixes: lp:1733067
* https://bugs.launchpad.net/kicad/+bug/1733067
2019-01-04 16:00:31 -08:00
Seth Hillbrand 3a3bbbb545 GAL: Add transparency for bitmaps and Cairo draw
Bitmaps loaded via wx can contain alpha channels.  We utilize underlying
routines to correctly map the alpha.  This also standardizes the Cairo
alpha calls to ensure correct display in Fallback for partially
transparent highlights

    Fixes: lp:1809845
    * https://bugs.launchpad.net/kicad/+bug/1809845
2019-01-04 13:40:19 -08:00
Seth Hillbrand e8333633fe GAL: Add antialiasing options to Cairo
Cairo supports antialiasing when rendering but can be slow when set to
sub-pixel mode.  This bumps the minimum version of Cairo to 1.12
(available in 14.04 LTS as well as mingw) to support three antialias
settings (fast, good, best) that offer speed/appearance tradeoffs.

This can provide a higher-quality eeschema render as it works on a
per-element basis as opposed to the OpenGL per-screen antialias.
2019-01-04 13:39:56 -08:00
John Beard b743c39ed8 On start without config, start pcbnew in Cairo GAL
Currently, GAL is initialised to NONE (i.e. off). This causes
issues when Legacy canvas is broken (i.e. GTK3).

This changes the default to GAL Cairo, both in PCB_EDIT_FRAME
init, and in the config load.

Now, when the user starts with no config, they are prompted for
a choice: OpenGL or Cairo, and one of them will be set up, with
Cairo as fall back.

Users on platforms that still support legacy can go to it as normal
from the menu, but it will not be the default in any circumstance.

Fixes: lp:1809997
* https://bugs.launchpad.net/kicad/+bug/1809997
2019-01-04 15:22:34 -05:00
jean-pierre charras 56e0031e03 Fix incorrect onScroll handler on GAL mode.
If a Scroll event is skipped, a default handler is fired by wxWidgets.
This default default handler fires 3 wxEVT_SCROLLWIN_LINEUP or wxEVT_SCROLLWIN_LINEDOWN events.

This is not wanted now in eeschema (and pcbnew) because they add extra (unwanted) scrolling.

Fixes: lp:1810403
https://bugs.launchpad.net/kicad/+bug/1810403
2019-01-04 13:10:34 +01:00
jean-pierre charras db7dba96ad Fix a few Coverity warnings.
Mainly not initialized members, and replace not tested dynamic_cast by static_cast.
2019-01-04 09:49:21 +01:00
Seth Hillbrand 7d06651a10 Change top selection drop-down to combobox
wxChoice centers the selection on GTK.  So when switching from a
mid-list item to an item at the top, the list is always cut off for
choice lists located on the top toolbar.  Using a combobox provides a
drop-down that allows easier access to all elements in the box.

Fixes: lp:1808569
* https://bugs.launchpad.net/kicad/+bug/1808569
2019-01-03 14:48:28 -08:00
Seth Hillbrand 9f8f938660 view: Initialize keyboard local var 2019-01-02 19:45:09 -08:00
jean-pierre charras 4b7ef22ec4 Fix wildcard list when built on GTK 2019-01-01 17:04:40 +01:00
jean-pierre charras 14ede151cc Add a helper function FileExtListToFilter() to build the wildcard filter used in File Dialog.
It avoid including these extensions in a translatable string, thus avoid breaking filter
if the translation is incorrect (It happens sometimes).
See wildcards_and_files_ext.cpp for use.
2019-01-01 15:38:57 +01:00
jean-pierre charras 26a337db18 Opengl engine: temporary disable bitmaps cache, because it creates serious issues in cross-probing in hierarchies.
If a page layout contains bitmaps and is used in all sheets of a hierarchy, and in the board editor,
the cross-probing from pcbnew to eeschema invalidate textures associated to these shared bitmaps,
when switching active sheets.
Usually a crash happens after switching or when closing editors.

As a workaround, I disabled bitmaps (therefore associated textures) cache.
Not optimal, but at least it avoid crashes.
2018-12-30 20:30:43 +01:00
Maciej Suminski ad07b4a251 Added an explanation for using wxFileConfig in GetNewConfig() 2018-12-29 19:22:07 +01:00
John Beard e919ded35f Use wxFileConfig, not wxConfig
The wrong class is called for the ctor of the wxConfigBase - this should
be a wxFileConfig, just like the bare new used to be.

Fixes: lp:1810002
* https://bugs.launchpad.net/kicad/+bug/1810002
2018-12-29 08:16:40 -05:00
John Beard e856a7a09c Disable legacy canvas on GTK3
This make the use of legacy canvas on GTK3 a default-off
advanced config. Legacy is substantially broken on GTK3
and is of basically no use at all to general users on this
platform.

If the program starts with legacy canvas in the config,
it is forced into a GAL mode, as otherwise it could happen
that the user is stuck and unable to get into pcbnew to change
the setting.

Fixes: lp:1803156
* https://bugs.launchpad.net/kicad/+bug/1803156
2018-12-28 11:36:09 -05:00
John Beard 892f7cf8ff Make SVG import an advanced config, not a compile option.
This demos the advanced config and allows no-recompile switching
of the SVG importer. It also allows the import manager to be
tested more completely.
2018-12-28 11:36:09 -05:00
John Beard a33a8292a4 Run-time config for advanced options
This can be used for "advanced" options which are for developers
to use for feature-flags and other configuration. Run time config
has some advantages over preprocessor defines:

* Can be changed without recompilation
   * Sensitive to XDG_CONFIG_DIR, so flipping configs is easy
* Better compiler coverage (less conditionally compiled code means
  less chance to break a different configuration). Also better
  analysis coverage.
* Type safe config params
* Centralised documentation: it's in doxygen, in one place

No advanced config should be required by a general users. If a general
user does use one of these configs, it's probably because:

* There is a bug and one of these configs is a workaround
* A config in here is generally useful and should be moved into the
  relevant application config and given UI.

For now, the config is read-only, and is read from the
"kicad_advanced" config file in the normal config dir.
2018-12-28 11:36:08 -05:00
jean-pierre charras 9f21d32563 Fix a compatibility issue with wxWidgets 3.1.2 (MSW specific) 2018-12-28 15:30:22 +01:00
jean-pierre charras 8cc3912b6c Zoom context menu: minor enhancement (gal mode). 2018-12-28 14:08:01 +01:00
Jeff Young f6e6ac3162 Don't issue errors for externally-defined env variables.
Fixes: lp:1809300
* https://bugs.launchpad.net/kicad/+bug/1809300
2018-12-26 21:36:04 +00:00
Tomasz Włostowski 5b4e6b21f2 SELECTION_AREA: ensure single-pixel-wide selection rectangle border
Fixes: lp:1801558
* https://bugs.launchpad.net/kicad/+bug/1801558
2018-12-24 15:35:25 +01:00
Tomasz Włostowski 3adb8d56c5 OPENGL_GAL: no need to draw line caps when drawing a polyline, the shader takes care of them already 2018-12-24 15:35:25 +01:00
Tomasz Włostowski 029fdaccc0 gal: re-enable scrolbar arrow buttons
Fixes: lp:1690780
* https://bugs.launchpad.net/kicad/+bug/1690780
2018-12-24 15:35:25 +01:00
Tomasz Włostowski bebbe6ed22 pcbnew: disable autopanning when cursor entered auto-pan margin following a keyboard cursor move command
Fixes: lp:1803523
* https://bugs.launchpad.net/kicad/+bug/1803523
2018-12-23 18:58:12 +01:00
jean-pierre charras dde933ba08 When printing, pads are not always printed (especially on tech layers)
A printing mode is added, to force ViewGetLOD() to return 0 in printing mode (pads are always drawn)

Fixes: lp:1809528
https://bugs.launchpad.net/kicad/+bug/1809528
2018-12-22 13:44:49 +01:00
Jeff Young 4c184f07a6 Clean up undo when cancelling block operation.
Fixes: lp:1809444
* https://bugs.launchpad.net/kicad/+bug/1809444
2018-12-21 22:45:57 +00:00
Seth Hillbrand db43ed72fe swig: clear up some warnings 2018-12-20 11:04:55 -08:00
Maciej Suminski 24f9bfa13b Fixed memory leaks
This is commit a9efbf47 with a fix for SWIG to deal with unique_ptr.
2018-12-20 10:05:58 +01:00
jean-pierre charras 83d851956c classes MARKER rework: remove duplicate code. Better HitTest code (HitTest takes in account the actual shape) 2018-12-19 19:53:27 +01:00
jean-pierre charras 15843ae01a class MARKER rework: fix a few minor issues, remove duplicate code and add comments. 2018-12-19 15:13:31 +01:00
Seth Hillbrand 64f1fb9e79 tesselation: Re-check polygon count after fracturing
The fracture() call may result in zero polygons remaining, which will
cause failure in our tesselation routine, so we need to check whether
this is a valid POLYGON before re-tesselating.
2018-12-18 13:49:13 -08:00
Seth Hillbrand 2498da2745 Tesselation: Only set valid when successful
Tesselation can fail for a number of reasons.  When this happens, we set
the triangulationValid flag to false to prevent using the broken
triangulation.  This will fall back to the slow OpenGL triangulation
when DrawPolygon is called.
2018-12-18 09:16:16 -08:00
jean-pierre charras 388397f97d Protect TesselatePolygon() against degenerated polygons (less than 3 corners) to avoid crashes.
Use TesselatePolygon() to draw polygons in Gerbview instead of GLU tesselation, much slower.
Add helper methods in GAL to know if the current GAL engine is Cairo, OpenGL or something else,
useful to optimize drawing code.
2018-12-18 12:49:14 +01:00
Seth Hillbrand 657bf2b53e tesselation: In case of failure, re-fracture
Simplification with clipper can produce a polygon with holes.  We need
to re-call simplify followed by fracture to ensure valid triangulation
2018-12-17 17:02:32 -08:00
jean-pierre charras f452eafcd6 Eeschema: Be sure the screen is refreshed when changing the zoom level.
Fixes: lp:1802302
https://bugs.launchpad.net/kicad/+bug/1802302
2018-12-14 12:51:30 +01:00
Seth Hillbrand 9ef3997e1e status_popup: Allow VECTOR2I input
Convenience overload for VECTOR2I input to the popup placement.

Also adjust the default foreground color to use system coloring
2018-12-13 12:32:58 -08:00
jean-pierre charras 04aeec1223 Remove useless includes 2018-12-12 15:28:59 +01:00
Seth Hillbrand e307d9318b Revert "Fixed memory leaks"
This reverts commit a9efbf4716.

The commit broke compiles with scripting
2018-12-11 10:12:44 -08:00
Maciej Suminski 63d4afb3ee Support autopanning in GALified eeschema
Fixes: lp:1807234
* https://bugs.launchpad.net/kicad/+bug/1807234
2018-12-11 17:49:34 +01:00
Maciej Suminski a9efbf4716 Fixed memory leaks 2018-12-11 16:21:43 +01:00
jean-pierre charras 253b14b871 VIEW_OVERLAY: add missing code and missing poly graphic overloaded primitives.
Some graphic primitives were already in VIEW_OVERLAY, without code.
A few graphic overloaded primitives (Polygon and Polyline) where missing.
2018-12-11 11:42:39 +01:00
Jeff Young 7d6081d329 Use default grid if none is found in preferences.
Fixes: lp:1807541
* https://bugs.launchpad.net/kicad/+bug/1807541
2018-12-09 23:12:26 +00:00
Seth Hillbrand dfe4b3412a pcbnew: Fix bug in adding new zone/poly
The next point wasn't updated unless the line was in 45-degree mode.

Fixes: lp:1807591
* https://bugs.launchpad.net/kicad/+bug/1807591
2018-12-09 07:28:41 -08:00
jean-pierre charras f6aed7c99a Gerber plotter: rename UseX2Attributes() to UseX2format, and fix incorrect/outdated comments. 2018-12-09 10:23:07 +01:00
jean-pierre charras 7f20c55ed6 Pcbnew, Plot dialog, Gerber format: Enable or disable adding net metadata both in X1 and X2 format. Previously, this option was existing only in X2 format. Should be existing in both formats.
A bit of cleaning code related to this option.
2018-12-09 08:38:23 +01:00
Seth Hillbrand 4fc81bb923 pcbnew: Graphic lines snap as single segments
Graphic lines and polygons are drawn to fit specific areas for which it
is helpful to have the endpoint controlled by the cursor even when
constraining the angle.

Fixes: lp:1805502
* https://bugs.launchpad.net/kicad/+bug/1805502
2018-12-08 07:26:58 -08:00
Wayne Stambaugh c7998cfc23 3D Viewer: fix screenshot file extension bug with GTK+
Append the appropriate file extension to the file name if the file name
does not have a file extension.  This is a know issue with the GTK+ file
dialog.

Make the last 3D viewer screenshot last file used code more coherent.

Add the 3D viewer main frame trace string to the trace environment
variables doxygen group.

Doxygen comment and other minor code cleaning.

Fixes lp:1804980

https://bugs.launchpad.net/bugs/1804980
2018-12-08 08:20:32 -05:00
jean-pierre charras d546fce7c4 Gerbview: drill file dialog selector: add .nc and .xnc to drill file extension list.
Therefore file extension list is ".drl .nc .xnc" for NC (Excellon) drill files.
2018-12-07 11:25:30 +01:00
Jeff Young 78daaa8825 Allow cancel, delete or rescue when opening pcbs with undefined layers.
Fixes: lp:1796596
* https://bugs.launchpad.net/kicad/+bug/1796596
2018-12-07 00:26:10 +00:00
Seth Hillbrand db43bd82a7 gtk3: Remove scrollbars
Under GTK3, the scrollbars fade in and out, causing a cascade of
re-paint events.  These cause KiCad to be unresponsive while the repaint
events occur.  By default this is 1s fade in 1s fade out but can be
configured by the user/wm.

Area mapping the repaint events to just scrollbar areas will be a good
solution but until/unless that happens the scrollbars in GTK3 are
problematic.
2018-12-06 13:46:52 -08:00
John Beard 4475c2008c Zooming: handle smaller, faster, events on GTK+3
On GTK+3, the zoom events are smaller and faster, so
the trigger the zoom acceleration.

A simple fix is to use the non-accelerated Mac-style
zooming and an appropriate constant. This can be tweaked
further as needed.

Fixes: lp:1786515
* https://bugs.launchpad.net/kicad/+bug/1786515
2018-12-06 13:46:52 -08:00
Seth Hillbrand 1f62a2d784 gtk3: prevent double scroll events
GTK3 smooth scrolling is enabled by wxWidgets but not to the exclusion
of normal scroll up/down events.  wxWidgets maps these both to the same
scroll handler and will fire them both if they are not handled before
being queued.  Testing timestamps allows us to mark and ignore the
dupes.

This is set to GTK3 only for now as it isn't listed as a problem for
other platforms.  But it shouldn't cause issues if it is enabled
elsewhere in the future.
2018-12-06 13:46:52 -08:00
John Beard 157519d722 Libeval: leading + is a sign, not an operator
Due to (presumably) a different lemon version,
there are some formatting changes in the grammar,
and some manual debug left in has been removed.
2018-12-03 08:39:30 +01:00
John Beard f30f5b3249 Build: Add a CMake target libeval lemon grammar
The libeval grammar can now be rebuilt with "make libeval_grammar".
This is only possible when lemon is installed.

Also a couple of modifications to the lemon grammar to
account for external changes since the grammer was last generated.

Also move the grammar defines into grammar.h - this is how
Lemon produces them, and by manually copying into the target .cpp,
it make automated regeneration impossible.
2018-12-03 08:39:27 +01:00
John Beard 49c723fc83 QA: Add numeric evaluator tests
Remove obsolete and unbuildable common/libeval/main.cpp
test program.
2018-12-03 08:39:21 +01:00
Seth Hillbrand 26765161c1 drc: Add board outline and edge crossing
This adds a check for contiguous board outlines to the DRC.  It also
uses the calculated outline to ensure that traces are not crossing the
outlines.

Fixes: lp:1648055
* https://bugs.launchpad.net/kicad/+bug/1648055
2018-12-02 07:54:52 -08:00
jean-pierre charras 79e784455c Gerber plotter: remove a G01 useless command, and ensure this command exists in plot polygon. 2018-12-01 18:52:27 +01:00
Jeff Young ff6a3482ec Remove on-kill-focus-validation.
Fixes: lp:1805361
* https://bugs.launchpad.net/kicad/+bug/1805361
2018-11-29 19:00:21 +00:00
Jeff Young 72f17ad7f0 Attempt to fix MSW Cancel-still-validates bug.
Fixes: lp:1805361
* https://bugs.launchpad.net/kicad/+bug/1805361
2018-11-27 17:09:09 +00:00
jean-pierre charras 8cf9ab5a4c Fix a wxwidgets alert. 2018-11-27 16:45:46 +01:00
John Beard 1eb0f70de5 Zoom: Use std::chrono for the timestamping
The reduces a little bit of WX dependency, and makes
the timing code a bit more type-safe.

Also adds a more testable interface for the accelerated
zoom controller.
2018-11-26 14:40:23 -05:00
John Beard 5a0318968f Break zoom control into a self-contained controller
This is done to avoid a big chunk of conditionally-compiled code
in the middle of the event function.

Also separates the zoom logic from the WX_VIEW_CONTROLS object
and isolates it in a separate class behind a clearer interface.

Add some simple tests for sane steps on GTK+3-sized scroll
steps.
2018-11-26 14:40:09 -05:00
Jeff Young d2756bedf1 Keep state except when the filter changed.
(Used to be "except when filtering".)

Fixes: lp:1804293
* https://bugs.launchpad.net/kicad/+bug/1804293
2018-11-25 01:51:45 +00:00
Jeff Young 05d9f49d25 Init icon scale when reading it from PCB prefs.
Fixes: lp:1804926
* https://bugs.launchpad.net/kicad/+bug/1804926
2018-11-24 16:19:38 +00:00
jean-pierre charras 0b890b4d1d Drill files generation: add 3 structured comments in NC (Excellon) drill files and remove duplicate code. 2018-11-24 08:51:58 +01:00
Seth Hillbrand 106eaaade6 HTML_REPORT: RPT_ALL as sum of individual options
This syncs the "All" checkbox with the state of the report options such
that selecting "All" automatically selects the other boxes and
deselecting a box results in the "All" box also being unselected.  This
allows a single click filtering of report messages.

Fixes: lp:1796992
* https://bugs.launchpad.net/kicad/+bug/1796992
2018-11-23 20:31:27 -08:00
Seth Hillbrand 327942affb GAL: Fallback to CAIRO on OpenGL error
When the error switching to OpenGL is triggered by the requested switch,
we want to fallback to the cairo GAL renderer instead of the
GAL_TYPE_NONE, which defaults to legacy.

Fixes: lp:1799017
* https://bugs.launchpad.net/kicad/+bug/1799017
2018-11-23 19:52:07 -08:00
Maciej Suminski 056114a15d Fix an outburst of error messages in UNIT_BINDER
Fixes: lp:1804834
* https://bugs.launchpad.net/kicad/+bug/1804834
2018-11-23 16:00:24 +01:00
jean-pierre charras 37f062d325 Make Ctrl+'A' to Ctrl+'Z' working again (Issue specific to Windows and Linux)
Fixes: lp:1804326
https://bugs.launchpad.net/kicad/+bug/1804326
2018-11-23 09:04:21 +01:00
jean-pierre charras d03e82602e PANEL_COMMON_SETTINGS: minor fixes, mainly cosmetic. 2018-11-22 17:11:49 +01:00
Jeff Young 82f657ed03 Replace some accidentally deleted code.
Fixes: lp:1804526
* https://bugs.launchpad.net/kicad/+bug/1804526
2018-11-22 01:10:18 +00:00
jean-pierre charras ab3ff61faa Eeschema: adjust the working/drawing area size on the page size.
This makes using Scrollbars more easy to use, especially for "small" page sizes like A or B.
Note also the working/drawing area size is bigger than the page size (3 times)
2018-11-20 15:11:22 +01:00
jean-pierre charras 73b52f2e23 Gerbview: fix incorrect initialization of WorldUnitLength.
Fix incorrect min zoom level to show D Code texts.
2018-11-20 10:27:59 +01:00
Jeff Young bd85421daa Don't map low-order keyCodes unless they really are Ctrl-Letter codes.
Fixes: lp:1803730
* https://bugs.launchpad.net/kicad/+bug/1803730
2018-11-19 16:03:30 +00:00
jean-pierre charras c539d6e0be fix incorrect initialization of VIEW::m_boundary.
This parameter defines the working area (full page) size.

The fix is not perfect, because it does not take in account the page size.
However it is similar to the "old" initialization, before Eeschema GAL.
In Eeschema, a reasonable boundary size is used.
2018-11-18 20:04:17 +01:00
jean-pierre charras 2fdf13ab79 Fix minor compil warnings. 2018-11-18 10:12:34 +01:00
Jeff Young 0de9cb345c Add shortcuts to setting dialogs for track widths, via sizes and grid sizes.
Fixes: lp:1803671
* https://bugs.launchpad.net/kicad/+bug/1803671
2018-11-17 00:35:06 +00:00
jean-pierre charras f90ca7408d Legacy canvas: fix missing code to draw block outline.
Due to recent changes in legacy canvas code, when starting a block command,
the block outline was not drawn in pcbnew and pl_editor during block definition.

Fixes: lp:1803668
https://bugs.launchpad.net/kicad/+bug/1803668
2018-11-16 21:03:04 +01:00
Jeff Young 4050991d28 Move ERC marker focusing to GAL architecture.
Fixes: lp:1802537
* https://bugs.launchpad.net/kicad/+bug/1802537
2018-11-16 10:38:44 +00:00
jean-pierre charras ffe4b745dd Opengl gal: Fix bug: segments with 0 length are not drawn. However the are equivalent to circles.
Using 0 length segments happen with oval pads having the same X and Y size, and in some other cases.

Fixes: lp:1801923
https://bugs.launchpad.net/kicad/+bug/1801923
2018-11-15 13:10:42 +01:00
jean-pierre charras 7783290161 Add a tooltip 2018-11-11 08:29:13 +01:00
Wayne Stambaugh f1f4473d8b Footprint editor: add save view to PNG file.
Factor out save current canvas view to image file code from symbol editor
code so it can be used anywhere.

Add ability to save to any image format supported by wxBitmapType.  See
https://docs.wxwidgets.org/3.0/gdicmn_8h.html#a90a1eb6d85b5044a99b706fd979f27f5.
Currently only PNG output is implemented.

Please note that there is a minor bug that appears to be due to the
scroll bars which causes unfilled areas on the right and bottom edges
of the image.  This always existed in the save symbol editor view
image but it was not as noticeable because by default the background
color is white.  It is very noticeable in the footprint editor with
a black background.

The usual smattering of coding policy and comment fixes.

Fixes lp:1802127

https://bugs.launchpad.net/kicad/+bug/1802127
2018-11-09 08:32:36 -05:00
John Beard 4c355c32d3 Fix rounding in COLOR4D::ToColour
Due to the implicit floor of the cast from double to unsigned char,
there was a small rounding error in COLOUR4D's WX conversion function.

This fixes the failing tests.

Also make the cast to unsigned char explicit.
2018-11-08 14:40:42 -05:00
John Beard 075f428aca Include directories are implied by legacy_gal linkage
This avoids having to manually specify include/legacy_gal
in and legacy GAL targets, and harominizes with legacy_wx.

This also means .cpp files in common/legacy_gal do not
need to specify the legacy_gal subdirectory, so they
will continue to work as needed when legacy_wx is removed.
2018-11-08 07:52:36 -05:00
Maciej Suminski 3e8b3e535a Added a comment for close event handlers in DIALOG_PRINT_GENERIC 2018-11-07 09:31:40 +01:00
qu1ck e789542ba4 Fix warning in dialog_print_generic.cpp 2018-11-07 09:26:47 +01:00
jean-pierre charras 238abad004 Gerber job file: fix incorrect GUID.
Fixes: lp:1801696
https://bugs.launchpad.net/kicad/+bug/1801696
2018-11-06 08:16:07 +01:00
Jeff Young fec8ab372e Don't set the viewport when switching screens.
That's the job of ZoomAutomatique().

Fixes: lp:1799436
* https://bugs.launchpad.net/kicad/+bug/1799436
2018-11-04 19:17:53 +00:00
Jeff Young 589e1f6a96 MSW and GTK need a separate dialog for opening/saving directories.
Fixes: lp:1801528
* https://bugs.launchpad.net/kicad/+bug/1801528
2018-11-04 12:35:01 +00:00
Jeff Young 3bfd32cdc5 Inherit grid settings from PCBNew.
Fixes: lp:1801428
* https://bugs.launchpad.net/kicad/+bug/1801428
2018-11-04 12:35:01 +00:00
Jeff Young d7ff3f8af5 Allow text on margin layer. 2018-11-02 19:55:30 +00:00
jean-pierre charras a55950bd68 DIALOG_COLOR_PICKER_BASE: fix a minor wxWidgets alert. 2018-11-01 16:51:14 +01:00
Maciej Suminski 08814b0512 Small layout adjustments in DIALOG_PRINT_GENERIC 2018-10-31 19:17:30 +01:00
Maciej Suminski ca1687d7ce Fixed disabling the block title for footprint editor printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski afda69c9cc Removed default line width setting from the printing dialog 2018-10-31 19:17:30 +01:00
Maciej Suminski cbf7d708b2 pcbnew: Draw title block normally even when the view is flipped 2018-10-31 19:17:30 +01:00
Maciej Suminski 64da77538f Fix bitmap scale in printouts
Display GALs had an incorrect world unit value set. Now the world unit
value says how many internal units are in an inch, in accord with the comments
in the GAL header. Bitmap drawing code relied on the information about DPI,
so scaling worked differently for display and print GALs.
2018-10-31 19:17:30 +01:00
Maciej Suminski 7ab8171422 Disabled translucency in printouts as it is not supported by cairo 2018-10-31 19:17:30 +01:00
Maciej Suminski 42c5fc0ef8 Link GDI+ library when building libgal 2018-10-31 19:17:30 +01:00
Maciej Suminski 3d15092643 Fixed loading layer visibility setting for printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 90b6156448 Store line width setting for printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski b727b310b4 Fix 'fit to page' for print outs 2018-10-31 19:17:30 +01:00
Maciej Suminski d3ea63e133 Removed a redundant parameter from BOARD_PRINTOUT constructor 2018-10-31 19:17:30 +01:00
Maciej Suminski dea778842b Grand printing dialogs refactor
Patch introduces a generic printing settings window that is customized by pcbnew and gerbview.
2018-10-31 19:17:30 +01:00
Maciej Suminski e81c3a59a2 Refactored and unified board editor and footprint editor print dialogs 2018-10-31 19:17:30 +01:00
Maciej Suminski 562b8d7948 Printing code clean-up 2018-10-31 19:17:30 +01:00
Maciej Suminski 92c5cb288e Fixed scale in Gerbview printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 8cb464b725 Handle drill mark options in pcbnew printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 3e5ee254cf Fix for 'fit to page' scaled printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 347e21daaa Handle printout settings: line width, color/mono, mirror 2018-10-31 19:17:30 +01:00
Maciej Suminski 47d0eaa2c6 GAL: changed line width setting to float type 2018-10-31 19:17:30 +01:00
Maciej Suminski 1cce194c8a Handle layer settings in printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 5b94f20e6f Adapted printout controllers to the new printing routines 2018-10-31 19:17:30 +01:00
Maciej Suminski 6c689305a6 Decouple GAL printing interface and its Cairo-based implementation 2018-10-31 19:17:30 +01:00
Maciej Suminski e36f6b476d Changed the CAIRO_GAL class hierarchy
There is a dedicated class for display (CAIRO_GAL) and another one
for printing. The common part has been moved to CAIRO_GAL_BASE.
2018-10-31 19:17:30 +01:00
Maciej Suminski 5a64343fb4 CAIRO_PRINT_CTX class
CAIRO_PRINT_CTX provides a Cairo context created from wxPrintDC.
It allows one to prepare printouts using the Cairo library and
let wxWidgets handle the rest.
2018-10-31 19:17:29 +01:00
Maciej Suminski f948e46330 VIEW: changed wxASSERTs to wxCHECKs 2018-10-31 19:17:29 +01:00
Maciej Suminski 17205b4599 Added VIEW::DataReference() for sharing data with another VIEW instance 2018-10-31 19:17:29 +01:00
Maciej Suminski 1411e1f73a GAL: added methods to modify rotation in the transformation matrix 2018-10-31 19:17:29 +01:00
Jeff Young de971df4c6 Don't put up error dialogs after a Cancel of a dialog.
Fixes: lp:1800711
* https://bugs.launchpad.net/kicad/+bug/1800711
2018-10-30 23:13:32 +00:00
Jeff Young f660ec7cf8 Eval when needed, but only replace text when killing focus.
Fixes: lp:1800718
* https://bugs.launchpad.net/kicad/+bug/1800718

Fixes: lp:1800476
* https://bugs.launchpad.net/kicad/+bug/1800476
2018-10-30 22:58:22 +00:00
jean-pierre charras 4b44cbe695 Kicad, Windows specific: disable a overzealous wxWidgets assert when reading a file.
When reading (and writing) a file, we must switch the current locale to "C" for LC_NUMERIC.
Unfortunately, on Windows, a wxWidgets assert was shown when reading some items (bitmaps images).
This wxWidgets assert (related to decimal separator) is overzealous and is now hidden only when reading/writing files.
2018-10-27 19:59:18 +02:00
jean-pierre charras 3dddca767e fix a minor wxWidgets alert. 2018-10-27 13:40:52 +02:00
Jeff Young 16925cc74e Implement RAII locking for GAL updating.
Fixes a crash when typing fast in the place footprint filter box.

Also adds a bunch more checking to GAL locking, including making
sure the same person unlocks as locked, and preventing piece-meal
calls (the RAII objects must be used).
2018-10-26 23:02:05 +01:00
Thomas Pointhuber 0e0b4d52a2 Add initial support for Phoenix (new wxPython binding)
Based on the work of @mmccoo:
https://kicad.mmccoo.com/2017/11/23/learnings-from-moving-kicad-to-wxpython-4-0/
and this additional patchset to remove wxpy_api.h dependency:
http://mmccoo.com/random/0001-Remove-dependence-on-pywx_api.h.patch

Please note CreatePythonShellWindow changed quite a lot. Throughful testing
should be made for the old as well as new wxPython version on all platforms
2018-10-26 13:21:11 +02:00
Wayne Stambaugh 2a170c9847 Update license to AGPL due to TTL license.
The decision to include the TTL library make KiCad a derivative work
under the terms of the AGPL version 3 or later license.

Add both the GPL3 and AGPL3 license text files and add a readme file
about the KiCad licensing.  Contributing to KiCad still falls under
the GPL3+ license.

Fixes lp:1797095

https://bugs.launchpad.net/kicad/+bug/1797095
2018-10-22 12:28:48 -04:00
Maciej Suminski f1b2855e80 Fix ENV_VAR_NAME_VALIDATOR typing characters backwards
Fixes: lp:1798869
* https://bugs.launchpad.net/kicad/+bug/1798869
2018-10-22 15:07:44 +02:00
Seth Hillbrand 44d416cafc Move cursor in increments off grid
When the cursor starts off grid, we avoid snapping to the nearest grid
point to prevent movement in an unintended direction.
2018-10-21 14:28:33 -07:00
jean-pierre charras f183b4f526 GAL, Opengl: Draw Arc: fix draw layer depth (previously, set to 0.0, which is not always the case) 2018-10-21 19:53:36 +02:00
jean-pierre charras dafeb96765 Page layout bitmap size wrong in modern/GAL canvases.
The image scale set by pl_editor was not taken in account when drawing the page layout.

Fixes: lp:1798685
https://bugs.launchpad.net/kicad/+bug/1798685
2018-10-20 18:24:22 +02:00
jean-pierre charras 7be215249d OPENGL_GAL: avoid crash when esotheric unicode chars are used in netnames/pad names in Debug mode.
It happens when the char is not found in the font used to display netnames/pad names.
When happens, a wxASSERT is raised.
Unfortunately it can crash the application if it is during a paint event or some critical time.
2018-10-20 18:08:36 +02:00
jean-pierre charras 1116acd74b Libedit: Fix broken handling of "common to all bodu style" property of lib draw items.
Fix a minor wxWidgets assert.
2018-10-20 12:38:36 +02:00
Simon Richter abe1ffabda Replace WIN32 preprocessor symbol by the official symbol _WIN32, used almost everywhere 2018-10-20 09:22:24 +02:00
Thomas Pointhuber f316b98f45 Fix conversation of Python 3 str -> wxString
Conversation of a NoneType for example failed before
2018-10-19 09:59:06 +02:00
Thomas Pointhuber 88d04f3bcb Get Action Plugins working with Python 3, fix some unicode string errors 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 8805706ccb Fix incompatibilites between Python 2 and Python 3 2018-10-19 09:59:05 +02:00
Thomas Pointhuber 7548a3b1bf Add KICAD_SCRIPTING_PYTHON3 flag to about dialog and doc 2018-10-19 09:59:05 +02:00
Thomas Pointhuber 284904b72c Rewrite C extensions to also support Python 3 2018-10-19 09:59:05 +02:00
Seth Hillbrand 6d8a759c75 UTF8: Fix MSVC builds
MSVC does not support variable length arrays.  Substitute a std::vector
instead.
2018-10-18 11:35:45 -07:00
Jeff Young ff992f4a64 Keep track of which nets are currently in use.
Fixes: lp:1798006
* https://bugs.launchpad.net/kicad/+bug/1798006
2018-10-18 12:14:23 +01:00
Seth Hillbrand 441cac9f1b UTF8: Correct MSW issue with previous commit
Linux does not handle the resize command with wide-character extended
table UTF-8.  The solution did not work for W7-32bit.  This is a
compromise, attempting first the preferred, previous solution and
falling back to the secondary solution.

(cherry picked from commit 6106210c87)
2018-10-17 12:40:28 -07:00
Wayne Stambaugh f584b30c73 Replace log debugging output with tracing.
Replace all instances of wxLogDebug with wxLogTrace in the common and
kicad folders to prevent unwanted debugging output.

Add new trace flags for locale and screen object tracing.

The usual smattering of code policy fixes.
2018-10-17 15:03:33 -04:00
Jeff Young c22a247dbc Fix undo issue primarily with libedit.
Fixes: lp:1797900
* https://bugs.launchpad.net/kicad/+bug/1797900
2018-10-17 13:10:36 +01:00
Jeff Young e9a80a5d7f Some minor dialog layout fixups. 2018-10-17 11:23:02 +01:00
Seth Hillbrand 594c1bded1 UTF8: Utilize the safe conversion from wchar
Invalid wchar characters would throw an exception.  We need a defined
output from the += operator, even for unknown character.

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

(cherry picked from commit b37bc69476)
2018-10-16 16:37:48 -07:00
jean-pierre charras 61f2dd21b1 Eeschema gal: fix some redraw issues for bitmap images and worksheet.
After edition, the worksheet was not updated on screen.
Bitmap images were not shown in opengl mode due to the fact all gal layers were cached.
2018-10-16 14:20:09 +02:00
Seth Hillbrand bf164f7c4b GAL: Lock context when triggering resize
This action adjusts the compositor, so it must have exclusive access to
the context.
2018-10-15 09:55:53 -07:00
Tomasz Włostowski d66e0d4f7a eeschema-gal: implemented EnableDepthTest() in GAL, fixed drawing order in eeschema 2018-10-15 00:09:59 +02:00
Jeff Young 0bd0558833 Auto-select reference numbers in PcbNew like we do in Eeschema. 2018-10-14 00:06:41 +01:00
Jeff Young 6a5744adb1 Show compile errors and go back to GLSL V120. 2018-10-13 12:39:53 +01:00
jean-pierre charras 7df4ddc74d Use our DIALOG_COLOR_PICKER in 3D viewer to set a color.
the wxWidgets color picker is not the best for the 3D viewer that does not use transparency color.
2018-10-13 08:23:14 +02:00
Seth Hillbrand cfaf7c1f23 pcbnew: re-organizing connectivity
The connectivity files were unwieldy.  This separates them logically
into data, algo and items where the items classes are those that hold,
surprise, surprise, the items, lists and clusters.
2018-10-12 16:31:09 -07:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Jeff Young 6c34fdefd7 Better exception handling and context locking for GAL.
This prevents deadlocks when exceptions are thrown and the context
ends up not getting unlocked.

It also removes an earlier hack to try and minimize this which
didn't work anyway.
2018-10-12 23:44:49 +01:00
Tomasz Włostowski a676034e36 OPENGL_GAL::DrawGrid(): flush drawing buffer after drawing small crosses grid so that it's correctly composited
Fixes: lp:1797642
* https://bugs.launchpad.net/kicad/+bug/1797642
2018-10-12 23:52:35 +02:00
Tomasz Włostowski 22300e4f02 Null pointer check in FOOTPRINT_LIST::GetInstance() 2018-10-12 23:51:31 +02:00
Tomasz Włostowski 7f132ca261 EDA_DRAW_FRAME: avoid cursor flickering in GAL when changing cursor size
Fixes: lp:1797437
2018-10-12 23:20:28 +02:00
Tomasz Włostowski 711b278248 gal/opengl: handle single-pixel line width clamping in hardware (new shader). Correct grid rendering in GAL for pixel-sized lines 2018-10-12 19:13:54 +02:00
Seth Hillbrand 4f672f0d39 Fixing a number of dynamic_casts
Dynamic casts should only be used when we explicitly check for the
resulting pointer to be NULL.  Where we know the class is castable we
can use static_cast, save on overhead and ensure our resulting pointer
is non-null.
2018-10-11 15:24:12 -07:00
Seth Hillbrand a16e21665a view_layers: Initialize variables
Fixes a couple spots where uninitialized variables cause unknown results.
2018-10-11 14:08:35 -07:00
Jeff Young a69635f539 Adjustment to net selector list sizing for GTK.
Thanks to John Beard.
2018-10-11 18:53:00 +01:00
Jeff Young 9f7bc6a9f9 A bit of a hack to keep OpenGL from puking. 2018-10-11 18:53:00 +01:00
Jeff Young 94cc1efbcc Clear filter when poping up net selector.
Even when useful it's unexpected, and GTK has issues with focus
and selection inside the control, making it hard to clear.
2018-10-11 11:58:39 +01:00
Jeff Young ff85798918 Increase list-item padding for GTK net selector. 2018-10-11 11:58:39 +01:00
jean-pierre charras 0dfd0c5f52 Minot cosmetic enhancement 2018-10-11 11:26:59 +02:00
Ronnie Gaensli ab1f016132 Fix assert freeze of eeschema when ToHSV, h is Nan
Fixes: lp:1797006
* https://bugs.launchpad.net/kicad/+bug/1797006
2018-10-10 21:22:26 +02:00
Jeff Young a0b8755f47 Filter <space> out of net filter box. 2018-10-10 19:49:06 +01:00
Jeff Young 01843290fc Exclude space from net filter. 2018-10-10 19:49:06 +01:00
Jeff Young 609d497870 Remember settings in Global Track & Via Properties dialog. 2018-10-10 19:49:06 +01:00
Jeff Young 14721829d7 Hook up keyboard events to parent combobox of net selector. 2018-10-10 14:02:25 +01:00
Jeff Young 779ef044b7 Fix wxGrid column dragging bugs.
Close an open editor when dragging (as wxWidgets won't move it).

Make sure native column headers aren't in use where we need dragging:
their interaction with wxWidgets' dragging is buggy.

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

Fixes: lp:1796396
* https://bugs.launchpad.net/kicad/+bug/1796396
2018-10-09 21:33:43 +01:00
jean-pierre charras 37c2743fec Fix a minor compil warning. 2018-10-09 17:03:43 +02:00
Jeff Young bc69330fe0 Make sure filter text goes at the end.
Some platforms select-all on focus, meaning each character would
replace the pre-existing string.
2018-10-09 14:56:29 +01:00
Seth Hillbrand 81483a9670 ARC_ASSIST: Fix return type in bool check
The return for special angle check is boolean.
2018-10-09 05:37:48 -07:00
John Beard c75d4b9ba1 Fix -Wreorder warning in common view-overlay.cpp
Simple fix - m_radius comes after m_{start,end}Angle in the class member list.
2018-10-09 11:08:56 +01:00
Jeff Young 9dfcc839a4 Fix color issues with cursor and sheet pins. 2018-10-09 11:08:56 +01:00
jean-pierre charras 4a92a5e628 Fix a Eeschema crash when using a SYMBOL_PREVIEW_WIDGET. Fix also a few draw artifacts. 2018-10-09 11:08:56 +01:00
jean-pierre charras a6d014d959 Fix some artifacts when drawing items, both on Cairo and Opengl.
Fix also incorrect selection of De Morgan style selection in SYMBOL_PREVIEW_WIDGET.
2018-10-09 11:08:56 +01:00
Jeff Young 2d5baac77d Fix up zoom and pan issues entering/leaving sheets. 2018-10-09 11:08:56 +01:00
jean-pierre charras b42f94e27b Eeschema, Cairo backend: fix a minor but annoying render issue. 2018-10-09 11:08:56 +01:00
jean-pierre charras 88cdce8d62 Make SYMBOL_PREVIEW_WIDGET working, and using the canvas type of the caller. Fix an issue with F3 zoom key in libedit. 2018-10-09 11:08:56 +01:00
Jeff Young 6f89b41f18 Cleanup. 2018-10-09 11:08:56 +01:00
jean-pierre charras 33386ec980 Fix zoom issues in Eeschema (F1 to F4 and popup zoom commands) Fix also not saving the Gal Canvas type on eeschema exit. 2018-10-09 11:08:56 +01:00
jean-pierre charras f283667fb0 add option to switch between opengl and cairo in eeschema (step 1) 2018-10-09 11:08:56 +01:00
jean-pierre charras 58916a200e Eeschema: Fix a crash at start in Debug mode 2018-10-09 11:08:56 +01:00
Jeff Young e2ea9b772a Fix offset issue when moving text. 2018-10-09 11:08:56 +01:00
jean-pierre charras e55763947e Set the reight grid visibility at start. Display axis in libedit and viewlib. 2018-10-09 11:08:56 +01:00
Jeff Young fee52e127f Add line style drawing. 2018-10-09 11:08:56 +01:00
Jeff Young 1e3a5c1b21 Fixup of last commit. 2018-10-09 11:08:55 +01:00
Jeff Young 0063f2c12d Stroke rectangles after filling so fill doesn't cover 1/2 of stroke. 2018-10-09 11:08:55 +01:00
Jeff Young 3c82ad3220 Finish up the block rotate/mirror fixes.
Block rotate and mirror now work like they do in Pcbnew (that is
they're treated as part of the block move/duplicate/whatever
rather than finishing it).

Fixes: lp:1780794
* https://bugs.launchpad.net/kicad/+bug/1780794
2018-10-09 11:08:55 +01:00
Jeff Young 7216eda202 Fix bugs in block operations.
1) when duplicating don’t keep original hidden until end of drag
2) reset selectionArea when showing it so it doesn’t flash in its previous location
3) center a pasted block on the cursor
4) don’t draw the source selectionArea when pasting a block
5) implement selection-style highlighting for contents of blocks
6) add pasted items to view so they don’t disappear when the block is placed

Fixes: lp:1747197
* https://bugs.launchpad.net/kicad/+bug/1747197
2018-10-09 11:08:55 +01:00
Jeff Young cb8e6c0df5 Handle GAL view refresh for breaking wires. 2018-10-09 11:08:55 +01:00
Jeff Young 38f38b16c0 Fix dissappearance of moved items. 2018-10-09 11:08:55 +01:00
Jeff Young 5fd20ee786 Implementation of ERC markers. 2018-10-09 11:08:55 +01:00
Jeff Young 58100b62e6 Legacy colors are not stored under a "4D" name. 2018-10-09 11:08:55 +01:00
Jeff Young d7178c7833 Implement GAL refresh for a bunch of operations. 2018-10-09 11:08:55 +01:00
Jeff Young afeebc8944 Grid settings for Eeschema GAL.
Split antialiasing options out from display options.  Move
antialiasing to common.  Duplicate the rest of display options
for Eeschema.

Implement OnSelectGrid and hookup GAL canvas refresh to
SetPresetGrid.

Add Grid Settings... to View menu and move Show Grid from
preferences to View Menu to match Pcbnew.
2018-10-09 11:08:55 +01:00
Jeff Young c5330ac0bf Implement zoom for GAL canvas. 2018-10-09 11:08:55 +01:00
Jeff Young a67d8c60df Fix text size measurement.
5.0 doesn't set the GAL's line width.  It gets away with this since
it's using the same GAL to measure as to set up the drawing, so
the width happens to be set correctly for other reasons.  5.1 uses
a separate GAL and so isn't so lucky.
2018-10-09 11:08:55 +01:00
Jeff Young b002b96db6 Fix a crash when aborting a block command. 2018-10-09 11:08:55 +01:00
Jeff Young 515135579b UseGalCanvas() no longer means ToolManager() exists. 2018-10-09 11:08:55 +01:00
Jeff Young da4fb4ae3a Move galDisplayOptions access from pcbnew to common. 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski 48d36f854e eeschema-gal: fix cursor shape switching 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski ccb594f599 eeschema-gal: support for global labels and bitmaps 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski d9f0dc63a5 eeschema-gal: temporarily disable scrollbar code (causes crashes after Jeff's changes) 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski b604f007d7 eeschema-gal: don't use kiROUND in the geometry library as it brings in a s*****load of wx dependencies due to #include <base_units.h> 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski 5f7c923b8b eeschema-gal: post-rebase fixes 2018-10-09 11:08:52 +01:00
Tomasz Wlostowski 9ab79daf74 SELECTION_AREA: use abstract render settings object 2018-10-09 11:08:52 +01:00
Tomasz Wlostowski ef1f01a8bd VIEW: use BOX2D for view boundary 2018-10-09 11:08:52 +01:00
Tomasz Wlostowski 26177efba0 VIEW_GROUP: correctly calculate group extents 2018-10-09 11:08:52 +01:00
Tomasz Wlostowski 838458bc3a eeschema-gal: Base refactoring before GALification of the eeschema legacy canvas.
Note: it's only the renderer that is changed from wxDC to GAL. Tools stay the same, consider this a temporary hack.

This commit splits the EDA_DRAW_FRAME, EDA_DRAW_PANEL and BLOCK_SELECTOR classes into two variants, each independently compiled into a static library.
- "legacy_wx" for PCBnew/Gerbview - wxDC-based legacy canvas. We have full GAL support there anyway so it makes no sense to introduce GAL rendering API to the legacy tools.
- "legacy_gal" for EEschema and the rest - GAL-based legacy canvas, using legacy tools but with a GAL renderer.
Such split ensures only a small part of the common library and eeschema is affected, without messing around with already GALified tools.

The commit also removes some header dependencies on class_drawpanel.h
2018-10-09 11:08:52 +01:00
Tomasz Wlostowski f82f310dd5 eeschema-gal: added EnableDepthTest() feature in GAL 2018-10-09 11:08:52 +01:00
Tomasz Wlostowski 0d720fdeff eeschema-gal: factor out EDA_DRAW_PANEL from BITMAP_BASE, remove some unnecessary includes of class_drawpanel.h 2018-10-09 11:08:52 +01:00
jean-pierre charras 82cb61b8af dialog_page_settings: avoid useless confirmation dialog after changing the page layout file. 2018-10-09 11:29:48 +02:00
Jeff Young 3024ded91e Improve robustness of numeric evaluation.
It would appear that some platforms process the KILL_FOCUS event
after running TransferDataFromWindow().  This change makes sure
that the evaluation is done no matter the order.

Fixes: lp:1793911
* https://bugs.launchpad.net/kicad/+bug/1793911
2018-10-08 12:59:40 +01:00
Jeff Young d1a679e496 Save original_text before obliterating it.
Fixes: lp:1793911
* https://bugs.launchpad.net/kicad/+bug/1793911
2018-10-07 23:37:16 +01:00
jean-pierre charras de793aa43d Fix a side effect of our LOCALE_IO by using setlocale( LC_NUMERIC, "C" ) instead of setlocale( LC_ALL, "C" )
LC_NUMERIC is the right option to use in LOCALE_IO because only the floating point separator must be modified
When using LC_ALL, the Env var expansion wxGetEnv() was not working when the env var contains non ascii7 codes after a call to LOCALE_IO.
When using setlocale( LC_NUMERIC, "C" ) in LOCALE_IO, wxGetEnv() works fine.

Fixes: lp:1795990
https://bugs.launchpad.net/kicad/+bug/1795990
2018-10-07 16:26:10 +02:00
Wayne Stambaugh 34ea79eddb Fix LIB_ID illegal character tests.
The '/' and ':' are reserved and cannot be used in symbol or footprint
names.  They will cause the LIB_ID parser and formatter to fail.  While
it seems like they should be legal in symbol alias names, they will
trigger a symbol rescue the next time the schematic is loaded.

Use ID_SCH as in the Eagle schematic plugin rather than ID_ALIAS to
ensure symbol names do not need rescued the next time the schematic is
opened.

Remove ID_ALIAS since the rules for alias names are the same as the
rules for symbol names.  Otherwise, allowing '/' and ':' in alias names
will force a symbol rescue on the next schematic load.

Fixes lp:1795600

https://bugs.launchpad.net/kicad/+bug/1795600
2018-10-07 09:09:27 -04:00
Seth Hillbrand ceca3e526c view: Do not include hidden items in query
When querying the view, we do not want to including items that are not
on layers that are currently visible.  This routine is currently only
used by the selection tool (pcbnew and gerbview) and the grid helper.
Both expected this logic but were indifferent to the additional items.

Fixes: lp:1796403
* https://bugs.launchpad.net/kicad/+bug/1796403
2018-10-05 16:45:38 -07:00
Jeff Young 5ce14dad2a Flush out whatever the dialog-is-closing guard was for.
The guard isn't working on GTK (causing eval not to happen on
a kill focus), and I can't remember what issue I put it in to
solve.  I've done a bunch of testing and it appears that we
don't need it, although I'm sure I put it in for something....

Fixes: lp:1793911
* https://bugs.launchpad.net/kicad/+bug/1793911
2018-10-05 20:19:16 +01:00
Hal Gentz 416e64a334 Spice plot widget: more accurate rendering
Patch modifies the way graphs are displayed: instead of drawing one
point for each X coordinate, there is a line segment joining min and max
values for continuous graphs and all unique points are displayed for
discrete graphs.

Fixes: lp:1674143
* https://bugs.launchpad.net/kicad/+bug/1674143
2018-10-04 22:49:41 +02:00
Maciej Suminski 70c1de3275 Spice simulator: faster graph rendering
Graph rendering takes a lot of time, especially when there is a high number
of points to be drawn. The initial implementation drew all points/lines
even if the the coordinates were duplicates, in the new version duplicated
coordinates are skipped.

Fixes: lp:1674143
* https://bugs.launchpad.net/kicad/+bug/1674143
2018-10-04 22:39:38 +02:00
John Beard 3a9e7a496a Centralise some UI constants, use in hotkey lists
There are lot of places where constants are used in the KiCad UI
as "magic numbers". The most common one is "5", used in many
wxFormBuilder and manual UI constructions as the margin.

This commit provides a place for all UI to look up shared
constants and other functions, to help create a consistent UI using
functions that provide meaning and intent to these magic numbers.
2018-10-04 07:47:21 -04:00
John Beard 0be9667c96 Add read-only option for hotkey list, use for list dialog
This replaces the flat HTML list dialog with a read-only
version of the editor dialog in a pared-down dialog.

Fixes: lp:1778374
* https://bugs.launchpad.net/kicad/+bug/1778374
2018-10-04 07:47:21 -04:00
John Beard 7c2c8d307e Add tooltips to hotkey dialog buttons
THis is done in the generic widget, so other users can
benefit from it.
2018-10-04 07:47:21 -04:00
John Beard 23038b1550 Simplify hotkey editor widget
This is in preparation for making this widget optionally read-only.

Major changes:

* Construct panel in code, not with wxFormBuilder. This make's it
  easier to conditionally construct elements that won't be used
  in a read-only mode (e.g. the buttons).
* Use a generic "button row panel" widget for the buttons, as the
  sizing and layout logic is reusable in nearly all dialogs, and
  it's simplifies layout in the higher-level dialog widget. This
  widget is one example of many possible "reuable widgets".
2018-10-04 07:47:21 -04:00
John Beard 445a9fa963 Put cursor and pan control in libcommon/tool, enable in Gerbview
Put the cursor and pan control TOOL_ACTIONs in ACTION,
and refer to them in that way.

The handlers are currently identical in Pcbnew and Cvpcb,
and Gerbview (and all canvases) can benefit from them as well
if they are in libcommon. Also saves duplicated code.

Fixes: lp:1795855
* https://bugs.launchpad.net/kicad/+bug/1795855
2018-10-04 11:41:06 +02:00
Jeff Young c9ca1013b2 Make ModEdit and LibEdit library tree actions more consistent.
Adds Cut/Copy/Paste and Revert for footprints; introduces a new
shared Revert Changes? dialog; hooks up Add Library for footprints,
standardizes the Save As terminology.
2018-10-03 22:46:41 +01:00
John Beard 3da0d03c36 Centralise utilities for env variables.
This puts generic logic for KiCad environment vars in
one place.

Also updates the DIALOG_CONFIGURE_PATHS help to document
the new KICAD_USER_TEMPLATE_DIR and KICAD_TEMPLATE_DIR.
2018-10-03 11:53:10 -04:00
Jeff Young b5fd9e830f A bit more safety around disabling the event handler. 2018-09-29 23:05:43 +01:00
Jeff Young 2eea45b50c Go back to earlier strategy for net selector popup.
This version makes use of lots of things learned going down the
other rat hole.  Avoiding the wxComboFocusHandler is key, as well
as specifying using the AltPopupWindow.

The key handler is still tricky with respect to those platforms
that use native controls, but the starting-key strategy is similar
to the one used with wxGrid text editors.
2018-09-29 22:07:31 +01:00
Jeff Young 3c2aafd7b7 Move Edit Symbol References to standard text/button control. 2018-09-29 22:07:31 +01:00
jean-pierre charras 26838c6800 Pcbnew: Crash after running external plugin
Happens only in Opengl mode.
So enforce controls in 3 group function: DrawGroup, ChangeGroupColor, ChangeGroupDepth.

Fixes: lp:1795044
https://bugs.launchpad.net/kicad/+bug/1795044
2018-09-29 12:58:47 +02:00
Jeff Young 5843b1a6a1 Possible solutions to <enter> and keyboard activation on GTK. 2018-09-29 10:28:19 +01:00
Jeff Young 3f6819e592 Improve visiblity of net selector popup. 2018-09-28 22:39:42 +01:00
Jeff Young 0a43584c5c Another attempt to catch enter on GTK, and better button processing. 2018-09-28 19:36:50 +01:00
John Beard 704615721f Prevent segfault when undoing or resetting non-hotkey rows
This is caused by:

* Not checking the hotkey data is not null when performing a
  hotkey action
* Allowing hotkey actions on non-hotkey rows.

This fixes both of these, and adds an assert to warn if someone
does manage to fire a hotkey action on a non-hotkey row (but it
won't crash).

Fixes: lp:1794756
* https://bugs.launchpad.net/kicad/+bug/1794756
2018-09-28 08:28:30 -04:00
John Beard a294e8d6c4 Check for conflicts when reseting/undoing hotkey changes
It was possible to get conflicting hotkeys when undoing and resetting hotkeys
to defaults.

This uses the same logic as when setting hotkeys to avoid conflcits in these
other two cases.

Fixes: lp:1794730
* https://bugs.launchpad.net/kicad/+bug/1794730
2018-09-28 08:28:22 -04:00
John Beard 3283bd9fdc Mark modified hotkeys in the hotkey editor
THis uses a simple " *" suffix, as the wxTreeListCtrl-derivative
widget doesn't allow easy access to things like font style.
2018-09-28 08:28:16 -04:00
John Beard 9f38b70491 Add a filter box to hotkey dialog and filter using it
This uses a simple case-insensitive partial match, which is
a good start for the relatively limited number of hotkeys
generally present.
2018-09-28 08:28:04 -04:00
John Beard 4f0166e064 Add some hotkey store tests
This also adds some mocks to the libcommon test executable, which
hopefully will allow it to work with more of libcommon.
2018-09-28 08:27:57 -04:00
John Beard 1f2c8fa698 Separate storage at iteration of hotkeys from the HK list widget
This separates the "ground truth" store of hotkeys from what is shown
in the dialog. This will allow us to filter the displayed hotkeys
while keeping the same underlying data structures.

Now, the UI data items interact with an intermediate set of data, which
represents the "original" hotkey data, and the "changed" data. The
ultimate aim here is to allow UI elements to come and go, but the
hotkeys that are "in-edit" are preserved.

This also allows us to abstract some bookkeeping complexity
out of the WIDGET_HOTKEY_LIST class into a separate non-GUI
class.
2018-09-28 08:27:51 -04:00
Jeff Young 3927dc5820 More fixes for event handling in net selector. 2018-09-28 00:23:22 +01:00
Jeff Young 453dadbc3c Use EventFilter strategy on GTK; leave FocusLost for MSW & OSX. 2018-09-27 20:42:59 +01:00
Jeff Young 136525b870 Decrease list-item padding for GTK. 2018-09-27 18:58:32 +01:00
Jeff Young 5703060d87 Turn off escaping names for now.
Fixes: lp:1794816
* https://bugs.launchpad.net/kicad/+bug/1794816
2018-09-27 17:21:49 +01:00
Jeff Young 50b96b406f More net selector fixes. 2018-09-27 16:58:12 +01:00
Jeff Young 3ae049c729 Address some MSW issues in net selector. 2018-09-27 14:44:42 +01:00
Jeff Young f10635e8be More work on arbitrary characters in references, etc. 2018-09-27 14:44:42 +01:00
jean-pierre charras 4a553b6423 NET_SELECTOR fix: remove SetHint() because it does not work on Windows, that prevents filtering.
Replaced by a wxStaticText
Minor cosmetic fixes (on Windows)
2018-09-27 13:19:09 +02:00
Jeff Young 521183a587 Work in progress to allow arbitrary chars in references, etc. 2018-09-27 11:56:51 +01:00
Jeff Young eaf3d48260 Simplification of the net selector code to fix GTK issues. 2018-09-27 11:52:58 +01:00
Jeff Young d1e64919a7 Fix for GTK net selector popup border. 2018-09-26 22:50:27 +01:00
Jeff Young f7ffbb17bb Another try at the net selector popup. 2018-09-26 21:57:35 +01:00
John Beard 04a1084549 QA: Place UTF8 tests under Boost unit tests
This transfers the old #if'd-out tests in utf8.cpp into a
proper Boost unit test in /qa (run on `make test`).
2018-09-26 09:32:26 -04:00
Jeff Young 86b654e493 Hook up 3D viewer to common preferences.
Also removes nanny limits on text sizes.

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

Fixes: lp:1794345
* https://bugs.launchpad.net/kicad/+bug/1794345
2018-09-25 20:47:03 +01:00
Jeff Young 3cc6e0cf02 Fixes to NET_SELECTOR event loop for non-OSX platforms.
Don't assume events are always Pending().  Other platforms handle
idle events differently.
2018-09-25 17:56:38 +01:00
Jeff Young 37f7faf433 Move lock checks to CLIENT_SELECTION_FILTER.
Also checks render item visibility as well as layer visibility
when making selections.

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

Fixes: lp:1541756
* https://bugs.launchpad.net/kicad/+bug/1541756
2018-09-25 17:56:38 +01:00
Jeff Young 66848b9334 Show pads when parent footprint is selected.
Fixes: lp:1670090
* https://bugs.launchpad.net/kicad/+bug/1670090
2018-09-23 23:51:13 +01:00
Seth Hillbrand ae13e441af pcbnew: Yield in GTK for redraw
GTK uses a level of cooperative multitasking when dealing with
secondary event loops.  This gives the wm enough leeway to process the
redraw before returning to the secondary loop
2018-09-22 19:38:42 -07:00
Jeff Young cbce4d7663 Work around a stupid assert in GTK wxGUIEventLoop::Dispatch() 2018-09-22 19:38:42 -07:00
Jeff Young 0309228276 Don't allow drawing to a zero-height or zero-width GAL canvas.
Fixes: lp:1793913
* https://bugs.launchpad.net/kicad/+bug/1793913
2018-09-22 22:06:40 +01:00
Jeff Young 458af25282 Turn problematic code off for now.... 2018-09-22 17:54:59 +01:00
Jeff Young 4edf18b023 Attempt to fix Linux build issue. 2018-09-22 17:41:52 +01:00
Jeff Young 5974899fa5 Clean up file locations and names. 2018-09-22 16:23:13 +01:00
Jeff Young 666da3849b Make esc dismiss net and layer selector popups. 2018-09-22 16:23:13 +01:00
Seth Hillbrand f8784f30a8 Removing OpenMP
This commit finishes the removal of OpenMP from the KiCad codebase.
Removed in this commit are the OpenMP calls in 3d-viewer and
qa/polygon_triangulation as well as all references in CMakeLists.txt

std::thread is used instead for multithreaded computation
2018-09-21 12:44:20 -07:00
Fabio Rossi 21485e6f24 kicad_curl should be built only with BUILD_GITHUB_PLUGIN enabled 2018-09-21 12:44:20 -07:00
Jeff Young 42ab116bc2 Rewrite the NET_SELECTOR combobox in the hopes of better platform support. 2018-09-21 20:40:04 +01:00
Simon Richter e985f797c3 Return reference to current object from operator= 2018-09-21 05:03:30 -07:00
Seth Hillbrand 8c3a82e526 Code cleanup: Fixing assignment operators 2018-09-20 20:15:47 -07:00
Maciej Suminski cd5b1c2885 set_wxMenuIcon: prevent null pointer dereference 2018-09-19 14:07:50 +02:00
Jeff Young e485cee384 Honour ModEdit layer colors in browser and previews.
Fixes: lp:1793141
* https://bugs.launchpad.net/kicad/+bug/1793141
2018-09-18 19:14:35 +01:00
Seth Hillbrand 9e33d38cd5 unit_binder: allow updates without triggers
Adds a helper function to allow unit binder calls that change a value
but shouldn't trigger wxevents
2018-09-17 15:55:22 -07:00
Wayne Stambaugh aacb3f9075 Update translators list to include simplified Chinese translator. 2018-09-17 10:12:03 -04:00
Jeff Young e45afdb912 Revert absolute-path asserts and fix off-by-one bug.
Fixes: lp:1767582
* https://bugs.launchpad.net/kicad/+bug/1767582
2018-09-15 22:36:09 +01:00
Jeff Young 02a3f83040 Implement poor-man's RTTI for use over KiWAY.
Fixes: lp:1777883
* https://bugs.launchpad.net/kicad/+bug/1777883
2018-09-15 20:06:42 +01:00
Jeff Young 872e1e6532 Remove asserts for absolute paths.
You can, for instance, specify relative paths via the command
line.

Fixes: lp:1767582
* https://bugs.launchpad.net/kicad/+bug/1767582
2018-09-15 20:06:42 +01:00
Wayne Stambaugh af2dcd61bb Fix build error against head of wxWidgets master branch.
The wxTreeCtrl header file wx/treectrl.h needs to be included in
common/widgets/paged_dialog.cpp.
2018-09-14 10:49:54 -04:00
jean-pierre charras 271fb7fed4 Make the color picker dialog translatable
Fixes: lp:1792556
https://bugs.launchpad.net/kicad/+bug/1792556
2018-09-14 13:34:53 +02:00
Maciej Suminski b39bde0f0c Specify string size when creating wxString from const char*
wxString constructor will determine string length using strlen() when it
is not explicitly specified, but there is no termination byte added when
reading file contents to 'buffer' variable.
2018-09-14 10:13:45 +02:00
Seth Hillbrand 3ebba6cbe1 pcbnew: Limit zone simplification
Commit 73c229714 was a bit of a sledgehammer for the associated problem
of degenerate points.  This commit replaces that one by only performing
additional simplification of the zone polygons on those polygons that
fail our initial triangulation attempt.
2018-09-12 15:28:13 -07:00
Jeff Young 23726116ee Revert code that got accidentally committed.
(This didn't fix the problem anyway; I had to fix it in our OSX
wxWidgets branch.)

Fixes: lp:1792196
* https://bugs.launchpad.net/kicad/+bug/1792196
2018-09-12 19:34:55 +01:00
Jeff Young 9b50b94069 Move OnUpdateUI event to dialog.
Fixes: lp:1792096
* https://bugs.launchpad.net/kicad/+bug/1792096
2018-09-12 14:01:36 +01:00
Jeff Young 806b1fc63d Fix bugs to enable read-only grid cells to be copied.
Fixes: lp:1791129
* https://bugs.launchpad.net/kicad/+bug/1791129
2018-09-12 14:01:36 +01:00
Jeff Young cbb3492d98 Standardize Footprint Viewer and Footprint Browser.
Add Display Settings to Footprint Browser.
Make each of them OpenGL on OSX and Cairo on other platforms.
Allow auto-zoom to be turned off and save last zoom setting.
Make ordering of tools in htoolbar consistent.
Standardize grid and zoom drop-downs.

Fixes: lp:1791667
* https://bugs.launchpad.net/kicad/+bug/1791667
2018-09-12 14:01:35 +01:00
Maciej Suminski f5de8cd3e1 Fix a possible out-of-bounds access in WX_GRID::SetTable() 2018-09-12 10:53:16 +02:00
Alexey Chernov 3ad1cd8d57 Adding OpenSSL include directory explicitly
Fixes: lp:1791164
* https://bugs.launchpad.net/kicad/+bug/1791164
2018-09-10 07:14:37 -07:00
Seth Hillbrand 4eece522df kicad: keep KIDIALOG boxes above other windows
Until answered, dialog boxes should remain at the front.  This flag only
works for MSW and GTK.
2018-09-08 21:24:29 -07:00
Seth Hillbrand ec33381064 pcbnew: Keep Yes/No dialogs above the windows
Modal yes/no questions should not be allowed to fall behind other
windows.  They need to be answered before the program continues and
clicking outside of the dialog should not hide dialog itself.

Fixes: lp:1790640
* https://bugs.launchpad.net/kicad/+bug/1790640
2018-09-08 21:09:57 -07:00
qu1ck c68ad411ff pcbnew: add 3d models properties to swig
Fixes: lp:1758858

https://bugs.launchpad.net/kicad/+bug/1758858
2018-09-08 10:28:55 -04:00
jean-pierre charras 80b25aa601 Fix incorrect calculations in WORKSHEET_DATAITEM::GetMarkerSizeUi()
It creates a lot of integer overflow in Pcbnew in Debug mode (Legacy mode), although it ha meaning onlt for the Page Layout Editor.
This function should be deprecated when the GAL canvas is used in Page Layout Editor.
2018-09-06 11:48:53 +02:00
Seth Hillbrand 73c2297144 triangulation: Fracture/Simplify all polygons
Calls the simplify/fracture polygon code on any polygon prior to
tesselation.  This avoids issues with degenerate polygons where the
degenerate points are not sequential.

Fixes: lp:1790534
* https://bugs.launchpad.net/kicad/+bug/1790534
2018-09-05 15:11:13 -07:00
Thomas Pointhuber c170e8930b Fix focus bug and possible race-condition for path deletion dialog
Fixes: lp:1788873
* https://bugs.launchpad.net/kicad/+bug/1788873
2018-09-04 08:52:51 +02:00
Seth Hillbrand a6325aab29 Replacing Tesselation
Replaces Poly2Tri with updated code to process polygons faster and more
robustly.  Notably, we can now handle overlapping holes in the polygons,
allowing us to cache the triangulation of complex boards
2018-09-01 19:30:50 -07:00
jean-pierre charras 23ec0cda31 Fix use of a deprecated wxGrid function. 2018-08-30 09:07:33 +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 f470132862 Fix fast grid switching for OSX and Footprint Editor.
Fixes: lp:1787066
* https://bugs.launchpad.net/kicad/+bug/1787066
2018-08-29 20:08:01 +01:00
Jeff Young 21eea1f567 Remove HasFocus() checks (which don't work on all platforms) in favour of row highlighting which is visible without focus.
Fixes: lp:1788873
* https://bugs.launchpad.net/kicad/+bug/1788873
2018-08-29 20:08:01 +01:00
Jeff Young 895fc0b536 Add a cell editor for paths and use it in Configure Paths. 2018-08-29 20:08:01 +01:00
Jeff Young f9412f0fd4 Implement double-click for other filetypes in project tree.
Fixes: lp:1787207
* https://bugs.launchpad.net/kicad/+bug/1787207
2018-08-29 19:59:02 +01:00
Jeff Young 45bc1b1aff Add single-click editing to grid cells. (Experimental.) 2018-08-29 19:59:02 +01:00
Jeff Young b90a261d5c More safety fixes for uncommitted grid changes. 2018-08-29 19:59:01 +01:00
Seth Hillbrand dc4125206b GAL: Add a selected item layer
The selected items should be displayed above the rest of the items but
below informational overlays.

Fixes: lp:1789505
* https://bugs.launchpad.net/kicad/+bug/1789505
2018-08-28 15:00:05 -07:00
Wayne Stambaugh 089f27f485 Remove more dialog control borders. 2018-08-27 15:11:27 -04:00
Jeff Young a860a8db54 Enable user layers in footprint editor.
Fixes: lp:1746279
* https://bugs.launchpad.net/kicad/+bug/1746279
2018-08-27 18:38:56 +01:00
jean-pierre charras a330eb1575 Add Chinese traditional in language list. 2018-08-27 18:30:49 +02:00
Seth Hillbrand cc26da394a Code formatting and fix ordering warning 2018-08-27 08:38:58 -07:00
Oliver e95b2872f6 Add x/y dimensions to PCB ruler
- Display dx and dy in addition to euclidian distance and angle
2018-08-27 09:29:30 -04:00
qu1ck 72f87861bb pcbnew: Add toolbar buttons for action plugins
Allows optional toolbar buttons for action plugins.
2018-08-26 19:39:27 -07:00
Tomasz Wlostowski 2186db976b VIEW: added support for VIEW_OVERLAYS (temporary overlays for drawing debug graphics)
x
2018-08-24 14:42:49 +02:00
Jeff Young d10bfb13d6 Re-enable text layers now that DRC & zone fills are fixed.
Fixes: lp:1788268
* https://bugs.launchpad.net/kicad/+bug/1788268
2018-08-24 10:56:13 +01:00
Jeff Young ec9d38e21f Add filter to net selector widget.
Also fixes a bug where nets wouldn't get changed because the
pads weren't changed and so the pad nets would propagate and
wipe out the changed nets on the tracks.

Also includes warning dialogs that pad nets will be changed if the
track nets are.

Fixes: lp:1779854
* https://bugs.launchpad.net/kicad/+bug/1779854
2018-08-24 10:56:13 +01:00
Jeff Young 8957008c2a Adjust grid cols for large fonts and/or long translations.
Fixes: lp:1788495
* https://bugs.launchpad.net/kicad/+bug/1788495
2018-08-24 10:56:13 +01:00
Jeff Young 30bb911154 Bring PICKER_TOOL in line with other tools.
Use standard Magnetize() to handle grid and magnetic pads.

Use the standard menu from PCB_TOOL.  Delegating the menu to
the SELECTION_TOOL just caused grief.

Also brings clients (such as Position Relative To) into line,
and implements better Cancel behaviour.

Also improves visibility of modal status messages:
- moves Select Anchor message from status bar to popup
- moves Select Reference message from dialog to popup

Fixes: lp:1786727
* https://bugs.launchpad.net/kicad/+bug/1786727
2018-08-23 00:58:01 +01:00
Andrew Zonenberg 60a55d75fa Split prohibited text layers for footprints and the rest of the PCB
Fixes: lp:1788268
* https://bugs.launchpad.net/kicad/+bug/1788268
2018-08-21 16:34:53 -07:00
Jeff Young bc2481a9be Don't leak file descriptors. 2018-08-21 19:44:42 +01:00
jean-pierre charras 0305d9143d key event in draw_panel.cpp: fix incorrect behavior for the escape key (the key was handled but the evnent was skipped).
This create an incorrect behavior because the event key was resend because
the primary event was seen as not handled by the drawpanel.
2018-08-21 20:05:09 +02:00
Jeff Young dbd3900e28 Add comments and show recently used even when empty. 2018-08-21 11:20:17 +01:00
Jeff Young 2e5d8061aa Run CommonSettingsChanged after all panels have been committed.
Fixes: lp:1787377
* https://bugs.launchpad.net/kicad/+bug/1787377
2018-08-21 10:34:41 +01:00
Jeff Young 779398891d Follow HIG guidelines for destructive button separation. 2018-08-21 10:34:41 +01:00
Jeff Young 65f62f93ef Fix MSW spacing issues. 2018-08-21 10:34:41 +01:00
Jeff Young a6d10d6e28 Constant-size page layout object handles w/respect to zoom.
Fixes: lp:1787491
* https://bugs.launchpad.net/kicad/+bug/1787491
2018-08-21 10:34:41 +01:00
Jeff Young 86a801aabc Allow updating of file history size on the fly.
Also updates the file menu IDs so that we can actually handle
more than 9 items in the file history.

Also adds configurable file history length to the other gerber
files (zip, drill and job).

Fixes: lp:1745729
* https://bugs.launchpad.net/kicad/+bug/1745729
2018-08-21 10:34:41 +01:00
José Jorge Enríquez 8d625854b8 Allows custom number of entries in recently opened files menu.
NEW: Adds a configuration option to set number of entries in the "Open Recent" menu.

Fixes: lp:1745729
* https://bugs.launchpad.net/kicad/+bug/1745729
2018-08-21 10:34:41 +01:00
Jeff Young e47351d1a6 Highlight only leaf nodes when filtering lib tree.
Fixes: lp:1787709
* https://bugs.launchpad.net/kicad/+bug/1787709
2018-08-19 17:59:32 +01:00
Jeff Young 53cd923305 Minor fix to tooltip and comment. 2018-08-19 17:02:47 +01:00
Jeff Young c5781105ee Fix layout and grouping issues in color picker. 2018-08-19 16:10:41 +01:00
jean-pierre charras 6fdc5972f8 Better fix for accelerator menus using "Back" (previously named "BkSp") key
Use the wxWidgets official accelerator key string for WXK_BACK (this is "Back") in menuitems instead of "BkSp"
Also when reading the hotkey config file, avoid to set a hotkey to unassigned when its name is not found in list.
The default value is used.
Unassigned hotkey use <unassigned> as key name (and 0 as key code) in file.
2018-08-16 15:56:13 +02:00
Tomasz Wlostowski aab40ee9e8 OPENGL_GAL: don't use glCopyBuffer() on faulty Intel GL drivers
Fixes: lp:1787221
* https://bugs.launchpad.net/kicad/+bug/1787221
2018-08-16 14:34:36 +02:00
Jeff Young 8db361882b Fix compile error on Linux. 2018-08-14 14:57:42 +01:00
Jeff Young 122d7ed3b3 Improve document file handling.
Fixes: lp:1779512
* https://bugs.launchpad.net/kicad/+bug/1779512
2018-08-14 13:54:04 +01:00
Jeff Young d72fdaed29 Rewrite Library Symbol Properties dialog.
Fix the user-model issues around aliases and alias selection.
Fold Library Symbol Fields into Library Symbol Properties.
Update to the new look.

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

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

Fixes: lp:1786339
* https://bugs.launchpad.net/kicad/+bug/1786339
2018-08-14 13:54:04 +01:00
Jeff Young 01882d3103 Add more/better error messages for file i/o problems. 2018-08-14 13:54:04 +01:00
Jeff Young 4b1a31ffad Regularize save-changes dialogs. 2018-08-12 00:02:37 +01:00
Jeff Young d81faa72c9 Overhaul border drawing in all the Kicad frames.
Primary change is to replace most control/window borders with
AUI pane borders.  We implement our own AUI border drawing
routine which avoids the ugly one-pixel white frames around
dark canvasses.

Also increases the signal-to-noise ratio of all the pane
creation code in the various frames.
2018-08-11 17:25:38 +01:00
Jeff Young 68bd1abf78 Fix nullptr access on 2nd launch of eeschema. 2018-08-11 17:14:27 +01:00
Jeff Young 38464827fc Fix some issues with zooming.
Don't process zoom both in Legacy code and Modern code; one of
them will decide the zoom has already changed and do odd things.

Make sure the view is updated after zooming, otherwise you have
to move the mouse over the canvas before seeing the new zoom.
2018-08-11 17:14:27 +01:00
jean-pierre charras 78ab5c3f07 Fix ASCII code used in accelerator menus for BkSp key (Linux only)
On Linux (GTK?) the accelerator key BkSp, when used in menus must be coded as "\t\b" and not "\tBkSp".
However, On Windows, it must be "\tBkSp".
Joys of multi-platform development.
2018-08-09 17:55:08 +02:00
jean-pierre charras 3eb3db02c3 Cvpcb, DISPLAY_FOOTPRINTS_FRAME: add measurement and zoom to selection tools. 2018-08-09 11:15:43 +02:00
Jeff Young f6f1c1e944 Performance optimization for MSW directory time-stamping. 2018-08-08 20:07:26 +02:00
Jeff Young 80f713f366 Revert accidental commit. 2018-08-08 12:51:31 +01:00
Jeff Young d63d0c40ef Performance optimisation for MSW direcotry timestamping. 2018-08-07 20:16:25 +01:00
Jeff Young 7c04d8be1c Double opening speed of PCBs with ground and/or power planes.
(Or any other boards with complicated zones.)
2018-08-07 17:01:44 +01:00