Commit Graph

6037 Commits

Author SHA1 Message Date
Ian McInerney 37ce9fb847 Tell wx that we really want a transparent background
Try more options for telling wxWidgets that we want the area
to have a transparent background. Also, fix some spacing issues.

Fixes https://gitlab.com/kicad/code/kicad/issues/4842
2020-07-08 16:29:04 +01:00
jean-pierre charras 55daf645b6 UNIT_BINDER::Validate(): fix incorrect display of val min and val max.
When Validate() find an out of limits user value, it displays the limits.
However, the displayed limit value was incorrectly converter to internal units,
and strange values were displayed.
2020-07-08 10:27:31 +02:00
Jon Evans 5d14dc9034 Fix assert that occasionally happened when loading file history
ClearFileHistory must be used to update the underlying data
2020-07-07 23:42:47 -04:00
Jon Evans 961fbadd23 Initial infrastructure for net/netclass colors in board 2020-07-07 22:21:45 -04:00
Ian McInerney c6eb072726 eeschema: Fix cutoff text in pinmap
Ensure the proper bounding box is used when computing the amount
of space taken by angled text in the control.

Fixes https://gitlab.com/kicad/code/kicad/issues/4761
2020-07-07 23:12:17 +01:00
Ian McInerney 0f0e845d74 Add parsing for centimeters into the numeric evaluator
ADDED: Allow cm as a unit in text field expressions

Fixes https://gitlab.com/kicad/code/kicad/issues/4797
2020-07-07 23:12:17 +01:00
Ian McInerney 4cd0ec8808 Fix library tree column widths when tree is refreshed
GTK only calculates new widths once the tree is displayed,
so calling Refresh after updating the tree but before display
will return a column width of 0. Instead, use saved column
widths if an invalid width was returned.

Fixes https://gitlab.com/kicad/code/kicad/issues/4837
2020-07-07 23:12:17 +01:00
Ian McInerney 53bbf69466 Expand choicebox to ensure GTK can display the full strings
Fixes https://gitlab.com/kicad/code/kicad/issues/4715
2020-07-07 23:12:17 +01:00
Jeff Young 77313e4398 OK, so maybe it's a WxWidgets version issue? 2020-07-07 15:28:22 +01:00
Jeff Young 3c791c1016 Fix Linux compile issue. 2020-07-07 15:16:19 +01:00
Jeff Young e66523586b Add Assign Netclass... to context menu.
ADDED Assign Netclass feature to EEschema.

Netclass assignments also now shown in status bar.

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-07 14:23:39 +01:00
Jon Evans a3655225cd Save selection filter state in project local settings 2020-07-06 21:53:12 -04:00
Jeff Young 3939b31027 Integration of netclasses into Eeschema.
This is mostly architecture, with the hookup of the Schematic Setup
dialog's Net Classes page.  Things like assigning to a net on the
canvas to follow.

Fixes https://gitlab.com/kicad/code/kicad/issues/2132

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-06 20:00:50 +01:00
Jeff Young b0ca7d5140 Netclass setup for Eeschema.
ADDED netclass panel in Schematic Setup dialog.

Fixes https://gitlab.com/kicad/code/kicad/issues/2132
2020-07-06 20:00:50 +01:00
Jeff Young 2819570d1e Push panel_setup_netclasses down into common. 2020-07-06 20:00:50 +01:00
jean-pierre charras 0d8c6d43a8 fix minor I18N issues. 2020-07-06 13:47:42 +02:00
Jon Evans 1845d3fe35 Disable broken cmake directives added in DRC merge 2020-07-05 18:16:38 -04:00
Tomasz Wlostowski 49c37014f7 Updated copyright headers in expression evaluator code 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 8ffa86a63f get it to compile after rebase 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 9d0f5c7f94 PROGRESS_REPORTER: implement SetCurrentProgress() method 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 65a1ed96e0 libeval_compiler: silence temporary debug stuff 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 3268f98fd7 libeval_compiler: support for method calls (e.g. item.onlayer('layer') ) 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 3005aab444 common: libeval_compiler :virtual method support 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski af5afb5dd7 pcbnew: initial version of PCB-specific expression evaluator 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski aaa91655aa libeval_compiler: integrated in common/ 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski 4ffb82b4e3 PROPERTY_MANAGER: added GetAllClasses and GetMatchingClasses methods 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski ba8b058c98 PROPERTY_MANAGER: don't be case-sensitive with property names 2020-07-05 22:44:38 +02:00
Tomasz Wlostowski c1d5394e46 properties: post-rebase fixes 2020-07-05 22:44:38 +02:00
Maciej Suminski f084a86601 Properties replacement method
Adds a possibility to replace properties inherited from base types with
a more specific ones. For example, such properties may have:

- different meaning which should be reflected in property name
  (e.g. TRACK::{G,S}etWidth() sets actual track width, but
  VIA::{G,S}etWidth() modifies the diameter)

- different set of possible values (e.g. BOARD_CONNECTED_ITEM::SetLayer()
  should accept any copper layer, but MODULE::SetLayer() works only with
  F.Cu and B.Cu)
2020-07-05 22:44:38 +02:00
Maciej Suminski a289056a9e Properties meta-data for pcbnew classes 2020-07-05 22:44:38 +02:00
Maciej Suminski cbd5004fd4 Properties (introspection)
Introduces classes:
- INSPECTED: base class for types taking advantage of
  generic properties system.
- PROPERTY*: meta-data storing information about properties
- PROPERTY_MANAGER: singleton class to get properties data
2020-07-05 22:44:38 +02:00
Jon Evans 6eca886292 Fix some UTF8 issues with project settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4808
2020-07-05 12:26:14 -04:00
Jon Evans baac062e30 Fix typo that prevented netclass settings from loading
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4804
2020-07-05 11:32:17 -04:00
Qbort f3f17401dc Fix OPENGL_GAL initialization sequence
- New public static function OPENGL_GAL::CheckFeatures() gets called in EDA_DRAW_PANEL_GAL::SwitchBackend() before switching to OPENGL_GAL
- Moved all OpenGL feature checks from OPENGL_GAL constructor to OPENGL_GAL::init()

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4714
2020-07-04 10:54:30 +00:00
Jon Evans a02a4ff179 Clean up worksheet draw items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/3882
2020-07-03 23:06:37 -04:00
Jon Evans d143e14694 Fix memory leaks in color theme editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4794
2020-07-03 22:34:41 -04:00
Jon Evans 3d7610d6b9 Hide PNS debug graphics behind an AC key
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4061
2020-07-03 19:33:36 -04:00
Thomas Pointhuber 7ba6a77c94 Improve arc geometry manager to choose the direction which makes more sense
As long as the arc angle stays below <60°, it will automatically choose between
clockwise and counter clockwise. This allows the user to choose the direction
with a simple mouse movement.
2020-07-03 15:05:17 +00:00
Seth Hillbrand a210fd570f Set VSYNC to adaptive (if available)
Swap syncs can limit the redraw rate as the screen waits for previously
issued syncs.  Setting this to -1 allows for adaptive swapping
(resorting to unsynced if it falls behind) if it is supported by the
card but will fall back to unsynced (0) if the adaptive is not
supported.

Fixes https://gitlab.com/kicad/code/kicad/issues/4226
2020-07-03 13:27:48 +00:00
Seth Hillbrand af064eacdd Silence boost:optional compiler warning 2020-07-02 19:23:58 -07:00
Jon Evans 4dbbe1cf68 Project settings fixes from review
- Fix file extension for new project
- Fixes for exceptions on MSW
- Fix some ASAN issues
- Allow SETTINGS_MANAGER to run headless
- Don't flag schematic as modified after schematic setup is closed
- Don't automatically unload projects when LoadProject is called
- Don't unload project if it's the same as the current one
- Make sure to properly init/de-init template field names
2020-07-02 22:08:54 -04:00
Jon Evans fe5959b625 Remove the schematic and board backup file system
Per discussion on the developers list, this old system
no longer provides much value and is seen as annoying
by many users.  The new save logic should prevent any
cases of file corruption on save, which was a major
reason for the backup file system existing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2012
2020-07-02 22:08:54 -04:00
Jon Evans b592a4169f Update project template system for new format 2020-07-02 22:08:54 -04:00
Jon Evans 12b4a55ae8 Port Eeschema to new project settings
DRC/ERC error serialization changed to use explicit tokens
Old stored severities and ignored errors are discarded
2020-07-02 22:08:54 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.

ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
2020-07-02 22:08:54 -04:00
Jon Evans 0e2f9cb1bd Migrate CvPcb project parameters 2020-07-02 22:08:54 -04:00
Jon Evans a4fadfcdf2 Begin moving project file load to new system 2020-07-02 22:08:54 -04:00
Jon Evans a5a19076fd Move PROJECT storage to SETTINGS_MANAGER 2020-07-02 22:08:54 -04:00
Jon Evans a7708fa6dc Add PROJECT_FILE and basic load/unload methods 2020-07-02 22:08:54 -04:00
Seth Hillbrand 7e3a338518 Move warning flags to proper place
Cleans unitialized warnings in wxApps
2020-07-02 12:17:45 -07:00
Jeff Young e26625fc99 Scale polygon drawing guides with zoom.
Fixes https://gitlab.com/kicad/code/kicad/issues/4769
2020-07-01 17:32:15 +01:00
jean-pierre charras 3993181de5 D_PAD::BuildEffectiveShapes(): fix incorrect rect shape size for rect pads
rotated by +-90 deg
Noticeable in PnS router.

Fixes #4771
https://gitlab.com/kicad/code/kicad/issues/4771
2020-07-01 16:06:31 +02:00
Jeff Young 4694b52e1f Lazy rebuild of color themes dropdown.
This allows you to (for instance) create a new theme in PCBNew and
then select it in Footprint Editor.
2020-06-30 18:32:31 +01:00
Jon Evans 44f3cdb31e Fix a few issues with zone islands 2020-06-29 12:16:37 -04:00
Lukas F. Hartmann f5842156a5 GAL: disable glCopyBuffer for etnaviv vendor 2020-06-28 17:01:26 +00:00
Jon Evans 1d5e4f86af ADDED: Copper zone island removal is now configurable
ADDED: Zones and keepouts can now be named (for DRC)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4392
2020-06-28 09:09:38 -04:00
Jon Evans 7532cf4ab0 Add support for data type to UNIT_BINDER 2020-06-28 08:52:37 -04:00
Jon Evans 0b34cea3d5 Add an optional name property to zones 2020-06-28 08:51:57 -04:00
Jon Evans bd19c580f4 Add configuration for cross-probing behavior
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2317
2020-06-27 22:48:48 -04:00
Jeff Young 32c3ea4edd Flags cleanup.
Remove extraneous use of FLAG0 from tracks cleaner (it was checked but
never set).

Fix issue in expand connections where two parts of it couldn't agree
on the same flag (BUSY vs SKIP_STRUCT), and where the second part was
clearing the flag instead of setting it.

Remove obsolete HIGHLIGHT infrastructure (we now use selection).

Remove extraneous use of BUSY flag in several places (it was never
set).
2020-06-27 17:53:04 +01:00
Ian McInerney fb10406e67 Add right-click context menus for toolbar items 2020-06-26 21:29:03 +00:00
Ian McInerney 52856a8ce4 Move scaled toolbar separator into ACTION_TOOLBAR
* Ensure all separators are scaled separators
* Clean up toolbar creation functions
2020-06-26 21:29:03 +00:00
Seth Hillbrand 05a89863c5 GRID_TRICKS: Ensure destinations can take value
Cut/Paste need to set values in the table.  We need to check that the
destination can take the string values before blindly setting.

Fixes https://gitlab.com/kicad/code/kicad/issues/4724
2020-06-26 09:07:28 -07:00
Seth Hillbrand 4ef02fd699 Replace TTL delauney triangulator
Removes the TTL triangulator in favor of the delaunator triangulator.
This removes the only AGPL code in the KiCad codebase and therefore
allows the full project to be licensed under the GPLv3.
2020-06-25 18:45:27 +00:00
jean-pierre charras 534bcc8db0 very minor fix: change the default value user grid size to 10mils
Previously, was 12.5 mils, acceptable for pcbnew but not for eeschema.

Now set to 10 mils.
2020-06-25 10:17:27 +02:00
Wayne Stambaugh 2078e629c5 Eeschema: allow editing of junction properties diameter and color.
Add missing plot and print changes for the new bus entry properties.

ADDED: Junction properties diameter and color can now be edited.

Fixes: https://gitlab.com/kicad/code/kicad/issues/4593
2020-06-24 13:36:17 -04:00
Jeff Young 5ee806c3a3 The dispatch-behind & whitelist stuff got broken again, so I've
retired them in favour of a much dumber hack that special-cases
only ctrl-U for units switch.
2020-06-24 12:22:42 +01:00
Jeff Young 18ab3c4714 Fix missing user grid in COMMON_TOOLS.
Fixes https://gitlab.com/kicad/code/kicad/issues/4702
2020-06-23 11:17:15 +01:00
Jon Evans 713cd4a47a Point editor: show dragged points with a highlight
Take points editor colors from color theme

Also fix an issue where the edited object sometimes didn't
update when a point is dragged.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4600
2020-06-21 14:43:41 -04:00
Ian McInerney 96a5a96037 Fix GTK window position when closed maximized
GTK only sends one maximize event, and it happens after the
window is maximized, so we shouldn't check for not being maximized.
2020-06-19 20:13:03 +01:00
Ian McInerney 5b3d947b7e Fix initialization order fiasco with colors
The legacy color refs are needed by the COLOR4D constructor
when constructing a static variable, so they can't be static
themselves.
2020-06-19 17:05:18 +01:00
Ian McInerney 5649558cff Move DPI_SCALING into the GAL from common
It should be owned by the GAL, since it is used
with the OpenGL canvas infrastructure.
2020-06-19 17:02:46 +01:00
Jeff Young a1332d76fe Remove SHAPE_EDITOR frame types before we forget about them.
They may go back at some point, or they may not....
2020-06-19 14:10:41 +01:00
Ian McInerney fe1e835471 Cleanup some unused files 2020-06-19 12:34:15 +01:00
Jon Evans aa7ce74ad5 Fix overzealous autoformatter 2020-06-18 23:26:10 -04:00
Jon Evans e91b9f6dfb Rip out the unused leftovers of the old color system 2020-06-18 22:32:14 -04:00
Jeff Young cae493fe65 More infrastructure work for shape editor. 2020-06-18 15:38:01 +01:00
Jeff Young ee9d8fcd15 Collapse Pcbnew & ModEdit display and edit settings.
(Prep work for reusing them with a custom shape editor.)
2020-06-18 15:38:01 +01:00
Jeff Young 754f958be2 Attempt to fix duplicate ID issue on MSW. 2020-06-17 18:44:39 +01:00
Jeff Young a7703d1207 Cleanup Graphics to parallel Cleanup Tracks & Vias.
This also allows for easier migration to DRAWSEGMENT::S_RECTs by
auto-converting 4 rectilinear lines to a rectangle.
2020-06-17 18:44:39 +01:00
jean-pierre charras 5db2b6ed8d Action menu: ensure a wxEVT_COMMAND_MENU_SELECTED event is sent to the menu,
when a wxTextCtrl has the focus but is read only, and cannot use a CHAR event.
It fixes an issue in Kicad manager (menus with accelerator not working) when
the wxTextCtrl window showing messages has the focus.
2020-06-17 12:00:34 +02:00
Jon Evans 0dd34d197e Ensure currentGrid is valid on startup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4666
2020-06-16 19:59:00 -04:00
Seth Hillbrand 8c57821e9b pcbnew: Move ratsnest items to separate folder 2020-06-16 11:15:14 -07:00
Jeff Young aeed8e6e2c Finish implementation of DRAWSEGMENT::C_RECT.
It's currently only supported in the Footprint Editor.  It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
2020-06-15 20:51:31 +01:00
Seth Hillbrand a18aea3a43 Fix signed/unsigned comparison 2020-06-15 12:40:02 -07:00
Ian McInerney 9d78aa604f Force OSX to automatically scale the canvas on legacy settings read
As of ab83c862, the canvas scaling setting is now used on OSX
(before it was ignored). Legacy settings would have this set to 1.0,
which would not automatically scale the canvas and break on Retina
displays. OSX auto detection works well enough in wx 3.0, so we
can use it now.
2020-06-15 00:30:52 +00:00
Jeff Young ad12c42e8b Push grid settings dialogs down into common.
This also gives support for fast grid switching and a user grid
to eeschema.

Fixes https://gitlab.com/kicad/code/kicad/issues/2200
2020-06-14 19:26:37 +01:00
Seth Hillbrand 810f668d45 Fix compile error
Reading integer config values are implicitly cast and need to be
specified.
2020-06-14 06:53:12 -07:00
Jeff Young 998fe12a5a Make sure COMMON_TOOLS initializes the grid. 2020-06-13 22:44:16 +01:00
Jeff Young c48f4272f3 Collapse a level out of the zoom settings.
The APP_SETTINGS_BASE now holds the list of zoom factors, and
the old legacy (screen-based) code has been removed.
2020-06-13 22:44:16 +01:00
Jeff Young fc44506fe1 Give up on enforcing non-defined-internal-units.
It results in trade-offs in packaging and/or conidtional compilation
which are worse than the disease.
2020-06-13 22:44:16 +01:00
Seth Hillbrand a02d8a5993 Fix a number of signed/unsigned comparisons 2020-06-13 11:55:59 -07:00
Jeff Young f84406009b Push a couple of layers of indirection out of grid settings. 2020-06-13 11:35:56 +01:00
Ian McInerney 60915fbc76 Default canvas scale setting to automatic on OSX
Fixes https://gitlab.com/kicad/code/kicad/issues/4652
2020-06-12 18:39:08 +01:00
jean-pierre charras 1973153368 Gerber plotter: ensure the gerber region for a round rect pad is always closed.
Due to rounding issues, sometimes (especially for rotated pads) the region
(4 segments+4 arcs) was incorrectly closed (1 unit (nanometer) mismatch between
start point and end point.
Although it does not create bad shape, its breaks the round rect pad identification
in CAM tools.
start point and end point are now the same.
2020-06-12 10:22:19 +02:00
Ian McInerney 4d6abfdf05 Fix DELETE in Scintilla
The previous method would act like backspace at the end
of the string
2020-06-05 14:24:26 +01:00
Jeff Young 22b8133108 Change DELETE behaviour from delete sel to delete forward.
In other words, if there's no selection delete the character in
front of the cursor.

Fixes https://gitlab.com/kicad/code/kicad/issues/4609
2020-06-05 14:09:09 +01:00
Ian McInerney 4357c1d3b3 Coverity and compiler warning fixes
* Initialize variables
* Test dynamic casts

Fixes https://gitlab.com/kicad/code/kicad/issues/4620
2020-06-05 12:50:56 +01:00
Ian McInerney ab83c86210 Remove the platform-specific GetBackendScalingFactor from HIDPI_GL_CANVAS
The scaling factor stored inside the canvas is created by a DPI_SCALING
helper, which will call the platform-specific functions if no user scaling
is specified. This change only affects OSX and Retina displays, so this
now also allows custom scaling to be used on OSX if desired (although it
shouldn't be needed, since wx has detection for it in 3.0.4).
2020-06-05 00:15:54 +00:00
Jeff Young 0ddf53397f Make sure CvPcb gets its Cancel button fixed up.
It's no longer a DIALOG_SHIM so it can't depend on its fixup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4611
2020-06-04 22:35:01 +01:00
Jeff Young b274b9f972 Fix type-checking which was too tight.
Also fixes a typo leaving the return statement in the wrong place.

Fixes https://gitlab.com/kicad/code/kicad/issues/4611
2020-06-04 22:35:01 +01:00
Johannes Pfister 8e8979e317 Fixed a memory leak in CONDITIONAL_MENU
CONDITIONAL_MENU::ENTRY now owns the wxItem object.
2020-06-04 19:08:59 +00:00
Ian McInerney d46f9a5273 Give the 3D viewer an infobar & Infobar upgrades
ADDED: Infobar warning in 3d viewer for board outline issues
2020-06-04 00:13:27 +01:00
Wayne Stambaugh 0032845f9e Fix clipped bitmap buttons with GTK on Linux.
A note to developers, please do not set the minimum and/or size of bitmap
buttons.  It causes bitmaps to get clipped using GTK on Linux.  If the
bitmap button size is not acceptable, then supply an appropriately sized
bitmap rather than attempt to force the wxWidgets sizing mechanism to do
what you want.  This almost always causes platform differences that do
not work well.
2020-06-03 14:01:44 -04:00
Ian McInerney a843c74529 Add new kiplatform library for platform-specific code
* Implement ReparentQuasiModal for OSX natively
* Implement ForceFocus of OSX natively

This change means we no longer rely on the kicad-specific functions in our osx wx fork.
2020-06-03 14:58:54 +00:00
Ian McInerney 57e35c9a60 Fix infobar bitmap size
Fixes https://gitlab.com/kicad/code/kicad/issues/4514
2020-06-02 00:20:08 +01:00
Jeff Young 7aaf72c473 Improve visuals of html error reporting. 2020-06-01 22:00:03 +01:00
jean-pierre charras 59523efc1a Eeschema: fix a crash after reopening the ERC dialog, after changes in schematic.
When the ERC is run and a component has a ERC error linked to it, if it is deleted,
when reopening the ERC dialog, the dialog crashed due to a not found item
(null pointer use)
2020-06-01 19:42:16 +02:00
Jon Evans daad2824c5 Add ability to skip JSON writes if the params aren't modified 2020-05-30 18:07:24 -04:00
Jeff Young 0741bbb1b9 Move autocomplete to the remove filtered items paradigm.
Fixes https://gitlab.com/kicad/code/kicad/issues/4190
2020-05-30 20:09:09 +01:00
Jeff Young 449c90a0ae Some more work on getting wxWidgets to stop stealing textEntry keys.
Fixes https://gitlab.com/kicad/code/kicad/issues/1941
2020-05-30 12:32:33 +01:00
Jeff Young a6eaa3257a Autocomplete for page layout editor text items. 2020-05-30 10:22:50 +01:00
Jon Evans fbef52ec33 Don't process hotkeys on text entries
Thanks @jeffyoung for the suggestion

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4463
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1941
2020-05-29 21:20:44 -04:00
Jeff Young 112316cdfb Fixup kiway by hand when dynamic_cast fails.
Also allows a shortened version of Configure Paths without the 3D
paths when Pcbnew isn't already running.

Fixes https://gitlab.com/kicad/code/kicad/issues/4568
2020-05-29 22:06:48 +01:00
Wayne Stambaugh b624c7090a Deprecate saving legacy schematic and symbol library file formats.
REMOVED: The ability to save schematics in the legacy file format.
2020-05-29 12:43:00 +00:00
Jeff Young e8524163db Another attempt to reconcile GTK and OSX slider spacing. 2020-05-28 23:07:16 +01:00
Jeff Young f4e7e201d8 Use a big hammer when beating wxWidgets over the head. 2020-05-28 22:18:30 +01:00
Jeff Young b06a454559 Try and find settings that look good on both OSX and GTK. 2020-05-28 21:41:17 +01:00
Jeff Young 8f533e1833 A bit of dialog cleanup. 2020-05-28 19:59:18 +01:00
Jeff Young 2c0f3c8088 Recurse into title block fields when resovling text vars.
Fixes https://gitlab.com/kicad/code/kicad/issues/4554
2020-05-28 17:36:22 +01:00
Jeff Young 9f2be3714f Add unresolved variable testing for worksheet items. 2020-05-28 17:36:22 +01:00
Jeff Young fe4fd19c66 Fix crash bug in unicode chars with Scintilla. 2020-05-28 00:23:18 +01:00
Jeff Young 8b084c373e Autocomplete for text variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/4190
2020-05-27 23:29:51 +01:00
Jeff Young e4f4de0221 Improve spacing in migrate settings dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/3989
2020-05-27 23:29:51 +01:00
Jon Evans 40dc7a5eef Update legacy migration of common settings for mousewheel pan 2020-05-26 21:43:59 -04:00
Jon Evans 695cdbbde8 Move bug reporting to COMMON_CONTROL; add to Help menu
Also make a shorter version of the version info string
and some other shortening edits to the issue template
to fix occasional 500 errors thrown by Cloudflare due
to excessively long URLs

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3953
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4272
2020-05-26 21:18:32 -04:00
Jon Evans c6a6c071cf PDF Plotter: avoid assert if default pen width is zero 2020-05-26 21:17:39 -04:00
jean-pierre charras 8226e5f0e2 Minor fix: add Fab layers to the assembly layers list. 2020-05-26 19:57:22 +02:00
Wayne Stambaugh f262e08d40 Symbol editor: fix crash when editing new symbol value field.
This also fixes an ASAN accessing deleted memory warning.  See the issue
tracker comments for more information.

Fixes https://gitlab.com/kicad/code/kicad/issues/4471

(cherry picked from commit a16e9ac76a)
2020-05-26 13:20:32 -04:00
Jon Evans 711fc999f2 Coverity fixes 2020-05-25 19:29:41 -04:00
Jeff Young 1db799d841 Implement "disallow" rules and integrate with keepout settings. 2020-05-25 22:51:47 +01:00
Jeff Young c415130de9 Improve parse error messages. 2020-05-25 22:51:47 +01:00
Jeff Young 160981ee71 Better error reporting for DRC rule parsing. 2020-05-25 22:51:47 +01:00
Jeff Young 416d82727f Redo DRC rules to get ready for new system. 2020-05-25 22:51:47 +01:00
jean-pierre charras 077611b8f1 BITMAP_BASE, Eeschema: fix incorrect position of the bitmap when printing.
The previous calculation was not compatible with aDC->SetTransformMatrix()
used in PrintPage in Eeschema.
2020-05-25 07:51:46 +02:00
Jon Evans 237bf35362 Fix accidental revert of touchpad to trackpad 2020-05-24 16:24:43 -04:00
Jon Evans a52435bbb0 ADDED: New mouse settings panel, expanded mouse settings
You can now choose the behavior of dragging with the
middle and right mouse buttons.

You can also choose which modifier keys to use for
panning and zooming with the scroll wheel or trackpad.

You can also customize the zoom speed, which makes
it possible to have a good zoom experience on a wider
range of input devices.

You can also now zoom by dragging with the right or
middle button if desired.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3885
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4348
2020-05-24 14:38:28 -04:00
Jon Evans c7daf8a8f3 ADDED: Cross-probe highlighting of bus members
Note: this is a basic implementation but it could be
improved once we include bus information in the netlist
and pcbnew can natively keep track of buses and nets
instead of just nets.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4158
2020-05-24 13:30:23 -04:00
Ian McInerney a6e9efbe57 Add icon for schematic reverse annotation
Fixes https://gitlab.com/kicad/code/kicad/issues/4527
2020-05-24 12:13:48 +01:00
Ian McInerney c7e512852a Fix escape key event propagation regression from bdf94916
The escape key event shouldn't be propagated after the first
tool dispatcher. Propagatint it causes it to go to parent frames,
which can mean problems arise (such as in cvpcb, where an
escape key press in the fpviewer frame was closing the main
cvpcb window when it is propagated).
2020-05-24 11:58:33 +01:00
Ian McInerney 4ecf99e7c8 Give the footprint viewer a toolbar and remove the options dialog
CHANGED: Cvpcb fpviewer and the pcbnew fpviewer no longer have an options dialog
ADDED: Add a side toolbar to the pcbnew footprint viewer (and the measure tool)

This also cleans up some of the settings structs in the viewers, since
it was somewhat confusing before.

Fixes https://gitlab.com/kicad/code/kicad/issues/2205
2020-05-24 11:58:33 +01:00
Ian McInerney 6692935808 Consolidate common viewer actions across cvpcb and pcbnew frames
* Consolidate the measure tool into one tool (this gives cvpcb
  unit changing and snapping capabilities in its measure tool)
* Transition cvpcb to use actions for the sketch modes
* Replumb how magnetic items settings are stored and used
2020-05-24 11:58:33 +01:00
Stefan 7e6b2211e0 Add Assembly pcbview to pcb_layer_widget 2020-05-22 20:40:53 +00:00
Ian McInerney fca7ade81f Move to the AUI version of the infobar
The sizer-based version had issues with the event processing
inside the GAL panel on Windows systems.

Fixes https://gitlab.com/kicad/code/kicad/issues/4501
2020-05-21 18:22:56 +01:00
Jon Evans 7c7b7f41da Move SCH_SCREEN project access to SCHEMATIC
SCH_SCREEN no longer needs to be a KIWAY_HOLDER
2020-05-20 22:27:48 -04:00
Ian McInerney a49fde5ce0 Fix the UI for the infobar
* Remove the animations on show/hide
* Give the button a small right border
2020-05-20 20:16:34 +01:00
Ian McInerney b5dc213d76 Fix infobar sizer issue for wx 3.1
On wx 3.1, the sizer was iving too much space to the infobar.

Fixes https://gitlab.com/kicad/code/kicad/issues/4501
2020-05-20 19:00:19 +01:00
Ian McInerney 73a1ce3e84 Move eeschema find notification to the infobar and improve the infobar widget
* Move it to a panel along with the canvas to have a better UI
* Allow the infobar to automatically close after a set time

CHANGED: The eeschema find notifications now use the infobar instead of
a popup window
2020-05-20 02:31:47 +01:00
Ian McInerney 2bc57ade28 Cleanup parentage inside the draw panels 2020-05-20 02:23:46 +01:00
Jeff Young 0aaccfbb28 Save hole-to-hole-min to file. 2020-05-19 20:48:47 +01:00
Ian McInerney a2f027e063 Add an infobar widget to display information above the canvas
This widget allows for non-intrusive display of text
above the editing canvas. Currently, this is used
for displaying the read only status of the files.
2020-05-19 00:46:33 +01:00
Jon Evans d7bd4c9b04 Move Eeschema globals to new SCHEMATIC object
Set up a new lineage for SCH_ITEMS to get back to the SCHEMATIC
they live on: Items will all be parented to the SCH_SCREEN that
they are added to, and each SCH_SCREEN will point back to the
SCHEMATIC that it is part of.  Note that this hierarchy is not
the same as the actual schematic hierarchy, which continues to
be managed through SCH_SHEETs and SCH_SHEET_PATHS.
2020-05-18 13:04:56 -04:00
Jeff Young c7da63151c Clamp egregiously large numbers when plotting.
This keeps some plot file viewers (such as Acrobat) from choking.

Fixes https://gitlab.com/kicad/code/kicad/issues/4408
2020-05-18 13:38:17 +01:00
Jeff Young f5bbf24047 Cleanup unused code that was masking earlier stroking bug. 2020-05-18 13:38:17 +01:00
Jeff Young 21ae7907f2 Don't stroke text. Stroking is for move/line statements. 2020-05-18 13:38:17 +01:00
Jeff Young d8a74c13b8 Fix a syntax error in the PDF generator.
The /Trapped key needs to be the name False, which is not the same
as the boolean false.  Thanks PDF, that's clear as mud.
2020-05-18 13:38:17 +01:00
Ian McInerney e662e33104 Store the current filename in the history on close 2020-05-17 00:12:49 +01:00
Ian McInerney 613c020920 Move the file history into the frames 2020-05-17 00:12:49 +01:00
Jon Evans f2e003147e ADDED: Enable color themes for PcbNew printing 2020-05-16 13:19:43 -04:00
Jon Evans d599648ec7 ADDED: Enable color themes for schematic printing 2020-05-16 13:19:43 -04:00
Jeff Young d3f017d825 DRC rules parser and engine.
Fixes https://gitlab.com/kicad/code/kicad/issues/2182

Fixes https://gitlab.com/kicad/code/kicad/issues/2116

Fixes https://gitlab.com/kicad/code/kicad/issues/1958

Fixes https://gitlab.com/kicad/code/kicad/issues/1965
2020-05-16 15:53:05 +01:00
Jon Evans 92ce7caf9a Remove extra write to common view control settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4458
2020-05-15 21:37:17 -04:00
jean-pierre charras 3f8d11144e Avoid crash when reading a json config file having an unexpected parameter value.
Now print the json path in debug mode instead of crashing.
In release mode, skip the parameter (the default value is still used)

Fixes #4451
https://gitlab.com/kicad/code/kicad/issues/4451
2020-05-15 15:02:40 +02:00
emC5RgViIK 47297402d3 #include <algorithm> so std::sort is found. 2020-05-15 10:49:43 +00:00
Jeff Young 37adf7d3d5 Add text field for color definitions.
You can enter HTML notation, CSS 3-value notation (rgb), or CSS
4-value notation (rgba).  It will always print rgba.

Fixes https://gitlab.com/kicad/code/kicad/issues/4016
2020-05-15 00:18:15 +01:00
Jeff Young 3a9746c657 Add ~ processing in env vars.
Fixes https://gitlab.com/kicad/code/kicad/issues/1829
2020-05-13 23:45:32 +01:00
Jeff Young c9bf2eaa1d Fix PDF syntax error. 2020-05-13 18:04:08 +01:00
Jeff Young bcea2019d4 Unify support for line width magic cookies.
They were added for the Gerber plotter but once there there's the
expectation by others that they'll work.
2020-05-13 17:56:47 +01:00
Jeff Young a632e5fbdb Fix same parsing issue in PCBNew.
Fixes https://gitlab.com/kicad/code/kicad/issues/4416
2020-05-12 20:38:58 +01:00
Jeff Young 301ac3461c Fix some more pen width issues from global removal.
Fixes https://gitlab.com/kicad/code/kicad/issues/4408
2020-05-12 15:20:17 +01:00
Jeff Young 06dea92bcb Fix issues with Kicad Manager frame and new kicad_sch files.
Fixes https://gitlab.com/kicad/code/kicad/issues/4410
2020-05-12 15:20:17 +01:00
Jeff Young 74ee143d45 Add via annulus minimum. 2020-05-11 22:56:09 +01:00
Jeff Young 1fb51d29ab Reverse interpretation of triple-tilde.
Fixes https://gitlab.com/kicad/code/kicad/issues/4396
2020-05-11 22:56:09 +01:00
Jon Evans 108cf23892 Restore separate libedit settings for common settings params
Be careful when calling config() in eeschema/libedit/pcbnew/modedit
It's usually not the thing you want.

A better fix for #4389
2020-05-10 18:02:58 -04:00
Simon Richter 632494cba7 Add missing includes
A few more instances of missing <algorithm> for std::max
2020-05-10 00:24:11 +02:00
Simon Richter 2341b69840 Make sure that Ninja knows the version header (fixes #4209)
This is required, because Ninja otherwise doesn't properly rebuild after
updating the version string header file.

Because BYPRODUCTS requires CMake 3.2, bump the minimum version and remove
now unused compatibility code for older CMake versions.
2020-05-09 15:25:33 +00:00
Jeff Young 3c3984a6fc Generalize default footprint fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/2289
2020-05-08 23:30:33 +01:00
Jeff Young 8efa8af8cc Add persistence of DRC error severities. 2020-05-07 17:51:27 +01:00
Jeff Young 0f8c7ffd11 Add pad keepout and footprint keepout areas.
Fixes https://gitlab.com/kicad/code/kicad/issues/2365
2020-05-07 17:51:27 +01:00
Ian McInerney 18cd0cdb58 Don't copy the items being iterated 2020-05-06 22:37:13 +01:00
Jeff Young 001a50bf14 Moved PANEL_COLOR_SETTINGS from buttons to swatches.
This allows us to correctly display non-100%-opacity colors (ie:
over the correct background color).
2020-05-06 19:02:21 +01:00
Ian McInerney c43122a45f Get the undecorated window size on GTK when saving the window config
The window decorations introduce an offset to our window size, since
they are not used when restoring the window size at startup they are
added by the window manager again.

Fixes https://gitlab.com/kicad/code/kicad/issues/4278
2020-05-06 14:53:15 +01:00
Jon Evans 9916f24fab Split out footprint editor color settings
Migrate COLOR_SETTINGS 0->1 to remove fpedit section
Migrate FOOTPRINT_EDITOR_SETTINGS 0->1 to use new theme if created
Remove COLOR_CONTEXT that is no longer needed
2020-05-05 21:46:00 -04:00
Jon Evans 66eb84097a Auto-size theme list 2020-05-05 21:46:00 -04:00
Jon Evans d00df0169f A few tweaks to settings migration infrastructure 2020-05-05 21:46:00 -04:00
Jon Evans c0a345882e Fix schema version for APP_SETTINGS_BASE derivatives 2020-05-05 21:46:00 -04:00
Ian McInerney e4b6487fca Overhaul compiler warnings infrastructure
* Track our warnings separate from normal flags
* Remove all warnings from the SWIG code
* Add more GCC warnings
2020-05-06 01:47:20 +01:00
Jeff Young 67bccaf465 Make indeterminate control states clearer for the user.
Fixes https://gitlab.com/kicad/code/kicad/issues/4313
2020-05-05 20:26:51 +01:00
Jeff Young e0da677d4d Add min clearance to DRC; rename Min Via Drill to Min Through Hole.
Also fixes a crash bug when ignoring a DRC violoation with multiple
markers.

Fixes https://gitlab.com/kicad/code/kicad/issues/2528
2020-05-04 22:08:36 +01:00
Wayne Stambaugh 169f63a6c0 Eeschema: make schematic sharing truly safe across all designs.
There has been a long standing (since the beginning of the project?)
issue with sharing schematics between projects.  It has been somewhat
supported for complex hierarchies (a sheet shared multiple times in a
single design) but it has not been well supported for simple hierarchies
(the symbol references cannot be changed in the shared schematic).  This
issue has been resolved by moving all of the symbol instance sheet paths
from the symbol definitions in the all of the project files and save all
symbol path instances in the root sheet.  This ensures that orphaned
symbol instance paths do not accumulate in shared schematic files and
that designs that reuse schematic in simple hierarchies can how have
different references.  It also allows the root schematic from one project
to be uses as a sub-sheet in another project.

When legacy schematics are loaded, all sheet and symbol UUIDs are
converted from time stamps to true UUIDs.  This is done to ensure there
are no sheet path instance clashes between projects.  That being said,
there are no checks for this.  It is assumed that the probability of
UUID clashes is so low that it doesn't make sense to test for them.
2020-05-04 12:40:03 +00:00
Jeff Young bdf9491682 Re-factor the event whitelist stuff so that it doesn't promise what it can't deliver. 2020-05-03 20:56:32 +01:00
Jeff Young a3486b7cd4 Fix ESC handling with whitelist. 2020-05-03 20:56:32 +01:00
jean-pierre charras da05b43a9f DIALOG_SHIM: fix incorrect escape key handling.
Fixes #4304
https://gitlab.com/kicad/code/kicad/issues/4304
2020-05-03 12:52:27 +02:00
Jeff Young 199bb2ffb0 Add hittesting for worksheets in Pcbnew and Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/4282
2020-05-03 00:07:38 +01:00
Wayne Stambaugh 0d1bb10771 Fix common preferences panel control padding. 2020-05-02 18:32:54 -04:00
Wayne Stambaugh 8d0b2dcfd3 Fix path configuration dialog control padding. 2020-05-02 16:48:39 -04:00
Jeff Young cf7ffda5f6 Performance improvements for Gerber loading.
The entire issue (at least on OSX) was the layers palette.  Go
figure.

Fixes https://gitlab.com/kicad/code/kicad/issues/1892
2020-05-02 21:10:40 +01:00
Jeff Young 73eda91ec7 Allow some events to run behind a modal dialog.
Right now this is just unit switching.

Fixes https://gitlab.com/kicad/code/kicad/issues/2344
2020-05-02 14:37:24 +01:00
Simon Richter 5acee1962e Add missing include
We need <algorithm> for std::max
2020-05-02 11:19:04 +00:00
jean-pierre charras 02e91807ab Avoid marking an empty string translatable (create issues with translation tools).
Fix also a minor compil warning.
2020-05-02 10:35:40 +02:00
Jeff Young 10614a9ebc Implement changes for Sketch Pads to Fab Layers.
Includes adding Fab Layers to default text & graphic settings.

Fixes https://gitlab.com/kicad/code/kicad/issues/1885

Fixes https://gitlab.com/kicad/code/kicad/issues/2274
2020-05-01 18:49:42 +01:00
Jeff Young 4a60b8a776 Improve DRC error reporting and fix some bugs. 2020-05-01 18:49:42 +01:00
Jeff Young 9d6b987ecc Fixes to map pin-to-pin erorrs to new Warning/Error strucutre. 2020-05-01 18:49:42 +01:00
Jeff Young a56191b658 Add distances to a bunch of DRC violation reports. 2020-05-01 18:49:42 +01:00
jean-pierre charras b7e7d6fd5c DIALOG_CONFIGURE_PATHS: Fix crash when deleting the last item in list.
When the list (in 3D search path list) contains only one item, when trying
to remove this last item, the crash happened.
2020-04-30 20:42:40 +02:00
jean-pierre charras 687c2f3e82 eeschema: fix a readability issue for small texts.
Texts were drawn with a minimal line thickness = GetDefaultPenWidth().
The default pen width can be to large for small texts.
So the actual text thickness is now always clamped.
2020-04-30 09:38:23 +02:00
Wayne Stambaugh b1e1e22a5e Fix minor hot key panel layout padding issue. 2020-04-27 12:57:16 -04:00
jean-pierre charras 3e287160d8 gal/opengl: better message for checkGlError() unknown error sub-type
in GL_INVALID_FRAMEBUFFER_OPERATION main error.
The returned error code is now printed in the error message.
2020-04-27 14:46:53 +02:00
Jeff Young 1daa2224d0 Tidy up the layout of the Colors Editor. 2020-04-27 11:59:57 +01:00
jean-pierre charras 5340046747 base_units.cpp: better fix for a overzealous gcc compil warning than 4f369801 fix.
(Replaced a useless break by a default case with a debug warning)
2020-04-27 10:12:01 +02:00
Ian McInerney d006acecf4 More window sizing fixes
* Push all sizing operations into EDA_BASE_FRAME
* Save the unmaximized window size when maximizing
  so that we can then save it in the config if the
  window is maximized. Otherwise the config ends up
  with the maximized size saved, and weird behavior
  occurs when unmaximizing on the next opening.
2020-04-27 00:14:12 +01:00
Marek Roszko 127df701da Remove unnecessary wxPaintEvent from SPLIT_BUTTON 2020-04-26 20:52:28 +00:00
jean-pierre charras 4f369801f2 Fix a few compil and Coverity warnings. 2020-04-25 08:49:16 +02:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Jeff Young 2fb2eac4d5 Performance enhancements. 2020-04-24 22:17:45 +01:00
Jeff Young 32db9eb0f1 Add some distances to a few DRC errors. 2020-04-24 22:17:45 +01:00
Jeff Young c67d819b17 Adjust GTK hack for wxSearchCtrl.
Fixes https://gitlab.com/kicad/code/kicad/issues/4230
2020-04-24 22:17:45 +01:00
jean-pierre charras 18150e5769 SVG plotter: fix some issues: incorrect bitmap size and missing lines in header
Fixes #4256
https://gitlab.com/kicad/code/kicad/issues/4256
2020-04-24 17:19:08 +02:00
Jeff Young b09463cc86 Improve hack for GTK wxSearchCtrl.
Fixes https://gitlab.com/kicad/code/kicad/issues/4230
2020-04-24 14:55:15 +01:00
Jeff Young 7f742ef934 Fix typo. 2020-04-24 14:46:22 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Jon Evans 69db66e1ea Fix saving of pcbnew colors when edited from layers widget 2020-04-23 22:33:02 -04:00
Jon Evans 2d95270a31 Add color theme settings to pcbnew 2020-04-23 21:55:29 -04:00
Ian McInerney 60891f0b6d Add more trace messages in the tool framework 2020-04-23 23:56:53 +01:00
jean-pierre charras fd59660ec8 Save new svg plot options in the board plot parameters section. 2020-04-23 10:02:59 +02:00
jean-pierre charras 7e0a1a16ee SVG plotter: use %f instead of %g to print floats.
Looks like scientific notation is not always accepted by Inkscape.
2020-04-23 07:59:41 +02:00
jean-pierre charras 825d202480 Fix some strings to help translation.
Remove translation mark for strings used in debug, or strings
that cannot be translated (for instance because they are char strings
instead of wide char strings)
2020-04-23 07:40:19 +02:00
Jon Evans f7ebf2af5e Add separate color setting for bus junctions
Fix plotting and printing to use bus color when
connectivity detects that the junction is on a bus.

Fixes #4098
2020-04-22 21:55:48 -04:00
Michael Kavanagh e4cbeeab4c Remove dead code in pcbnew
* Remove dead zone printer
* Remove old canvas in pad properties window
2020-04-22 21:50:15 +00:00
Jeff Young c8140ddb4a Fix a typo that was keeping units refresh from working.
Fixes https://gitlab.com/kicad/code/kicad/issues/4249
2020-04-22 22:41:00 +01:00
Jeff Young 5bc6ad9786 Make UNIT_BINDER sensitive to parent frame user unit changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/4243
2020-04-22 20:45:45 +01:00
Jeff Young fbd68722b2 Fix a couple of problems with text stroke thickness. 2020-04-21 21:17:59 +01:00
Oleg Endo 2f1d23312f add BOARD_CHANGED and UNITS_CHANGED events 2020-04-21 13:23:56 +00:00
Oleg Endo 7bf8a744f1 add support for board listeners 2020-04-21 13:23:56 +00:00
Seth Hillbrand 819f28daf5 Revert part of 9c8941e04
This accidentally changed gerber plotting behavior, resulting in invalid
aperture sizes

Fixes https://gitlab.com/kicad/code/kicad/issues/4232
2020-04-20 15:42:23 -07:00
Johannes Pfister e5042a46ba Add ability to set SVG plot units and precision
ADDED: Ability to set SVG to metric or imperial units
and made it possible to change the size of a step
2020-04-20 22:02:03 +00:00
Jeff Young 10684e9961 Attempt to work around clipping bug on GTK wxSearchCtrl. 2020-04-20 21:49:32 +01:00
Jeff Young db9fd3be21 Minor cleanup. 2020-04-20 21:49:32 +01:00
Seth Hillbrand 1770a1ea21 Prevent invalid decrement in tool manager
Iterating over the tool stack, we potentially remove the current
iterator.  If this removal happens at the beginning of the toolstack, we
cannot decrement the iterator to a position before the stack without
creating an invalid state.
2020-04-20 11:50:45 -07:00
Jeff Young 94e2690fed Fix compile issue on clang. 2020-04-20 17:19:29 +01:00
Jon Evans 3ff3d2cb14 Fix errant $ 2020-04-19 19:13:24 -04:00
Jon Evans b802a3e776 Add command-line option to generate netlist and exit 2020-04-19 19:13:24 -04:00
Jeff Young c977addfa2 Fix conflict between special char escaper and super/subscript.
Fixes https://gitlab.com/kicad/code/kicad/issues/4227
2020-04-19 21:16:22 +01:00
Jeff Young c08a6adb2a Implement GUI and file R/W for 3D model opacity.
Fixes https://gitlab.com/kicad/code/kicad/issues/2087
2020-04-19 18:24:39 +01:00
Jeff Young 71fd560735 Add "Export to other sheets" to paper settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/2177
2020-04-19 18:24:39 +01:00
Ian McInerney e528769637 Move TOOLS_HOLDER into tools/ folder
Also clean up some compiler warnings
2020-04-19 01:51:49 +01:00
Ian McInerney 7bda8178d1 Move library includes to main CMake file
Placing them behind the SYSTEM directive tells CMake to tell
the compiler they are system libraries, so it shouldn't show
warnings created from them.
2020-04-19 01:11:56 +01:00
Jeff Young 2b6089240a Change super/subscript syntax to ^{foo} and _{foo}. 2020-04-18 21:04:41 +01:00
Jeff Young d7d1cb6f78 A bunch of fixes to Eeschema Find/Replace. 2020-04-18 14:43:08 +01:00
jean-pierre charras 56c31e65f6 Fix a compil issue: Try a better fix than commit 8f0449c. 2020-04-18 12:36:05 +02:00
jean-pierre charras 8f0449cbab Fix a compil issue. 2020-04-18 09:02:51 +02:00
Ian McInerney 3b67e3d0a4 Rewrite window positioning logic
Now only reposition a window if it is completely on a
disconnected display or if only one corner is on screen
and it is within a region close to the screen border.

CHANGED: Window position on startup should be preserved more
2020-04-18 00:47:38 +01:00
Ian McInerney b8d2802cfe Add missing cases to silence compiler warnings 2020-04-18 00:47:35 +01:00
Jeff Young 919a66a703 Remove side-effect from finishTool().
It belongs out in the calling loop so that if someone else uses
finishTool() later they won't get bit by it.

This also fixes a crash bug where we weren't deactivating all tools
because we couldn't back up at the beginning of the stack (and the
loop increment therefore went past the first element).

Fixes https://gitlab.com/kicad/code/kicad/issues/4206
2020-04-16 21:58:45 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
Tomasz Wlostowski ee70c6dd5b NESTED_SETTINGS: allow to create/load without a parent settings object. Used for test/mocking 2020-04-15 13:00:48 +02:00
jean-pierre charras 04ea20dd44 Eeschema, SCH_PAINTER: fix max text thickness issue, to have small texts readable. 2020-04-14 11:08:42 +02:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
Jeff Young 122b1ddaae Unwrap an unnecessary layer now that we have new config stuff. 2020-04-13 20:58:12 +01:00
jean-pierre charras bdada70ee7 Cosmetic enhancements: add bitmaps to a few context menus.
Fix also a minor compil warning.
2020-04-12 10:29:28 +02:00
Jeff Young 84944524cc Fix crash on OSX when page was changed before hack array was alloc'ed. 2020-04-10 22:49:56 +01:00
Jeff Young b067e441c7 Show/hide sheet colors when flipping override flag. 2020-04-10 00:35:17 +01:00
Jeff Young f4e22a9264 Add ability to override individual item colors.
Fixes https://gitlab.com/kicad/code/kicad/issues/4167
2020-04-09 17:17:27 +01:00
Jeff Young 317e98b344 Simplify user model for editing color themes. 2020-04-08 22:34:56 +01:00
Jeff Young 8eb15fe911 Tidy up some Coverity issues. 2020-04-07 17:29:58 +01:00
Jeff Young 76bbb71402 Correct some formatting issues. 2020-04-07 17:29:58 +01:00
Jeff Young 5b70856a85 Change default sheet background color to transparent.
Fixes https://gitlab.com/kicad/code/kicad/issues/4166
2020-04-06 12:31:59 +01:00
Jeff Young 322ab60cc5 Fix some Coverity issues. 2020-04-06 12:31:59 +01:00
Ian McInerney cb380cda0c Fix some build warnings 2020-04-06 00:31:45 +01:00
Jeff Young b13559c926 Add envVar and text variable resolution to plot directory paths.
Fixes https://gitlab.com/kicad/code/kicad/issues/3808
2020-04-05 23:56:24 +01:00
Jeff Young cc9ac37a0e Add text variable support to envVar processing. 2020-04-05 20:52:26 +01:00
Ian McInerney c0b03a043e Force menubar update when file history is changed
Fixes https://gitlab.com/kicad/code/kicad/issues/4137
2020-04-05 18:05:43 +01:00
Jeff Young 591428b0d9 Remove some problematic global variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/4121
2020-04-05 16:17:04 +01:00
Ian McInerney 306ebb0e89 Cleanup dynamic casts in unit binder 2020-04-04 12:24:54 +01:00
Thomas Pointhuber b707c84b62 Use Record handling for parsing
Now, we know how big a record is, and should be able to parse all boards without missing bytes?
2020-04-03 23:22:24 +00:00
Jeff Young 78dfbca9a3 Save pre-eval values for Move Exactly dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/4088
2020-04-03 21:47:47 +01:00
Wayne Stambaugh 082944ad06 Minor build warning fixes. 2020-04-03 13:03:23 -04:00
jean-pierre charras b1b8a32078 fix a few Coverity warnings and compil minor warnings. 2020-04-03 09:54:47 +02:00
Jon Evans 23c1baae8e Defer image surface destruction until next paint
Fixes #4043

(cherry picked from commit dbf786e456f2792476791caf9dadfeb43e9ab383)
2020-04-02 14:36:57 -04:00
jean-pierre charras 161b73e55b Enable storing pin function (pin name) in pads.
This is useful in board routing.
It is plotted in pad attribute TO.P in Gerber files.
2020-04-02 20:14:45 +02:00
Jeff Young a76ddb52a0 Add sheet borders and backgrounds to Edit Text & Graphics.
Also moves sheet border and sheet background colours to preferences
so it's clearer they're just for newly-created items.

Fixes https://gitlab.com/kicad/code/kicad/issues/4144
2020-04-02 14:01:30 +01:00
Jeff Young 811968716c Add OSX layout hack to PAGED_DIALOG for preferences. 2020-04-02 14:01:30 +01:00
Jeff Young 4966ab802e Support single-click colour editing in dialogs. 2020-04-02 14:01:30 +01:00
Jeff Young 13d3f57fce Implement a different solution to refreshing lib trees.
Fixes https://gitlab.com/kicad/code/kicad/issues/4110
2020-03-31 02:09:31 +01:00
Jeff Young eb855d40bb Restore lib tree refreshing, but don't attempt to refresh tree root. 2020-03-30 17:30:26 +01:00
jean-pierre charras 58e03be23c Fix a compil issue. 2020-03-30 17:38:19 +02:00
Jeff Young a1d62e0622 Improve some comments. 2020-03-30 14:15:59 +01:00
Jeff Young 41b5872f12 Add ERC & DRC checks for unresolved variables. 2020-03-30 14:15:59 +01:00
Jeff Young 4990d1e7b2 Variable substitution framework.
This implements editing of variables and moving SCH_FIELDs,
TEXTE_MODULEs, TEXTE_PCB and worksheet items over to the new
framework.
2020-03-30 14:15:59 +01:00
jean-pierre charras 9d2712a824 Fix a few Coverity warnings.
It also fix:

Fixes #4082
https://gitlab.com/kicad/code/kicad/issues/4082
2020-03-29 18:42:24 +02:00
Ian McInerney c29c3d9cc1 Diferentiate action types in the tool trace 2020-03-28 22:01:35 +00:00
Jeff Young 88c4254bb5 Discourage use of wxDataViews. WX_GRID is much less problematic. 2020-03-28 16:09:40 +00:00
jean-pierre charras c41199f048 lib_tree.cpp: Fix a lot of wxWidgets alerts on Windows.
On Windows calling m_adapter->RefreshTree() to refresh the tree does not work fine.
Just calling Refresh() is enough.
2020-03-28 11:00:54 +01:00
jean-pierre charras aebfbda183 DRC dialog: fix a crash when clicking on a item in Footprint Warning panel:
if the warning is a missing footprint, obviously there is no marker associated.
It creates a crash due to a null pointer.

Fixes #4114
https://gitlab.com/kicad/code/kicad/issues/4114
2020-03-28 11:00:54 +01:00
jean-pierre charras 53a98b45f0 DIALOG_ABOUT_BASE: fix a minor wxWidgets alert 2020-03-28 11:00:54 +01:00
jean-pierre charras de7154e8e9 Gerber plotter: Non horiz or vertical oval pads: better plot output:
These pads were plotted as a segment. This is not the right way.
Pads must be flashed or plotted as regions, not painted.
They are now plotted as Gerber regions round rectangle pads.
These regions are similar to flashed pads.
2020-03-27 10:34:41 +01:00
Jeff Young d69ebfae49 Push tool framework base down into TOOL_HOLDER.
This allows us to use it outside of EDA_BASE_FRAMEs (in this case, in
PANEL_PREVIEW_3D.)
2020-03-24 19:00:25 +00:00
Jeff Young 14788eec94 Performance improvement in wx_grid column label height calc.
Don't call GetColLabelValue() repeatedly.  It's expensive as it doesn't
cache the string translations.
2020-03-24 19:00:25 +00:00
Jeff Young c4aed3a8de Add user-configurability of the LibEdit axes color. 2020-03-24 19:00:25 +00:00
jean-pierre charras 4d9d1a5380 Fix a few compil minor warnings and Coverity minor issues 2020-03-22 09:45:51 +01:00
Jeff Young d25a63cd02 Don't allow selection flags to leak in to the libmanager cache.
Fixes https://gitlab.com/kicad/code/kicad/issues/4021
2020-03-21 23:25:08 +00:00
jean-pierre charras 9cb3333d05 Gerber plotter: plot round rectangle pads using a region with arcs.
Previously, the region was a usual polygon with arc approximated by segment.
Using a region with arcs is a better way because it allows CAM tools to
identify this region as a round-rect pad.

A side effect is a better shape and smaller files, however not really noticeable in fact.
2020-03-20 19:45:05 +01:00
Jeff Young e9cd9ee8ff Actionize the rest of the 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/issues/2228
2020-03-19 15:10:32 +00:00
jean-pierre charras 04e4599989 PANEL_SETUP_SEVERITIES: skip non existing error codes in TransferDataFrom/ToWindow
Fixes #4066
https://gitlab.com/kicad/code/kicad/issues/4066
2020-03-18 09:17:43 +01:00
Wayne Stambaugh 7dc64f08b7 Eeschema: implement s-expression schematic file formatter.
Please note that the symbol cache is not embedded in the schematic file
to allow for round robin testing with the existing file format.  Once
the parser round robin testing is complete, the symbol cache will be
embedded in the schematic file.
2020-03-16 09:05:16 -04:00
Jeff Young cee973dc04 Move ERC error reporting over to the new framework.
Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-16 11:06:15 +00:00
Jeff Young 085d80e3f3 Remove duplicated settings from preferences.
These have now moved to project-specific settings.
2020-03-13 17:28:53 +00:00
jean-pierre charras 08f0e8d6e8 Pcbnew, Gerber output: always generates Aperture Attributes.
Previously, for historical reasons, they were added only if
Include Netlist Attributes option was on.

But Aperture Attributes have nothing to do with Netlist Attributes, and good
Gerber files must include them.
2020-03-12 16:57:13 +01:00
Jeff Young c699fb9e39 Move pin-to-pin errors to Setup Schematic. 2020-03-11 21:43:55 +00:00
Jeff Young 437f888c25 Schematic Setup dialog.
Includes:
- moving some of the project settings from the Preferences dialog
- ERC severites
- project-specific field-name templates

Fixes https://gitlab.com/kicad/code/kicad/issues/2145
2020-03-10 18:54:17 +00:00
Jeff Young bbf5ad6160 Improve dialog spacing and remove 'auto' type decls.
Also fixes a couple more coding style issues.
2020-03-10 18:54:17 +00:00
Jeff Young becc66b583 Change some layer names for better grouping when alphabeticized. 2020-03-10 18:54:17 +00:00
Jeff Young d875d5850e Update library trees when their items change.
Fixes https://gitlab.com/kicad/code/kicad/issues/4019
2020-03-08 15:18:19 +00:00
Jeff Young 3e34c1783f Added sheet border width, border color and background color.
Fixes https://gitlab.com/kicad/code/kicad/issues/2216
2020-03-08 15:18:19 +00:00
Jon Evans 8cb8d55843 Remove unnecessary exception handling in settings
Use optionals instead where a value can be absent

Fixes #4024
2020-03-07 16:06:33 -05:00
Jeff Young fb00ca12d6 Performance enhancements for stroke font initialisation. 2020-03-07 18:52:30 +00:00
Jeff Young 535033c5c9 Enable editing of sheet fields. 2020-03-07 18:52:30 +00:00
Ian McInerney a2ad9d67ba Expose more version strings from CMake
Let cmake generate the needed version strings, so we don't
have to spend program time doing it. This simplifies the
settings manager versioning.

Also, convert some file line endings to UNIX from Windows.

A more robust fix for https://gitlab.com/kicad/code/kicad/-/issues/4015.
2020-03-07 18:43:24 +00:00
Jon Evans 01a6d0067b Add missing layer name for sheet fields
Fixes #4018
2020-03-07 09:44:06 -05:00
Jon Evans 1e61668cee Make GetSettingsVersion handle extra version appends better
Fixes #4015
2020-03-07 09:33:35 -05:00
Jeff Young fe3e0307d8 Move sheet name and filename to SCH_FIELD architecture.
Only internal storage architecture has changed (so far).
2020-03-06 16:23:44 +00:00
Jon Evans dd56f6f8e2 Increase width of bitmap button on settings migration dialog 2020-03-06 08:15:14 -05:00
Jon Evans 643c97a2f4 ADDED: Schematic plotting can use a dedicated color theme
ADDED: PDF, PS, and SVG plots can optionally include the page background color

Fixes #1830
2020-03-06 00:01:02 -05:00
Jon Evans 8660b4c144 ADDED: New color theme editor and multi-theme support 2020-03-06 00:01:03 -05:00
Jon Evans ca1ab0af16 Set expand flags and minimum button size on migration dialog
Hopefully fixes #3989
2020-03-04 21:47:28 -05:00
Seth Hillbrand e38ab6c699 Treat 0-length ovals as circles
Some buggy SVG interpreters can't handle 0-length ovals.  In this case,
they are meant to be circles, so we can export as circles in our
plotter.

Fixes https://gitlab.com/kicad/code/kicad/issues/3995
2020-03-04 18:03:20 -06:00
Seth Hillbrand ecbfea68dd ADDED: Allow creation of nets in pcbnew
When editing pcb items, the creation of a new net to connect existing
pads or traces can be a useful shortcut.  This inserts the ability to
optionally create a new net from the Net Selector dropdown menu.
2020-03-04 16:11:47 -06:00
Seth Hillbrand 12088f240d Fix a couple crashes with small canvases
The canvas size is not guaranteed to be strictly > 0, so we need to
enforce a minimum returned size before dividing by it or passing to GAL
initialization
2020-03-04 14:33:42 -06:00
jean-pierre charras b7cd0c54c2 Fix compil issues, especially on Windows:
Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
2020-03-04 10:48:18 +01:00
Jeff Young 21469efa63 Make sure EESCHEMA definition gets passed into common.cpp.
Also includes a fix to seed timestamps that got incorrectly
written out as '00000000' because of the above.

Fixes https://gitlab.com/kicad/code/kicad/issues/3977
2020-03-04 02:04:18 +00:00
Jeff Young 85c2e0d23a Add user-defined severities, exclusions and colors to DRC markers.
Exclusions are currently persisted in the project file.

Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-04 00:39:28 +00:00
Marcus Comstedt 349c0e1a14 gal/opengl: Fix shader link state check
The old code caused a bool (size 1) to be overwritten by a GLint (size
4) causing undefined behaviour.

Fixes https://gitlab.com/kicad/code/kicad/issues/3981
2020-03-03 21:47:43 +00:00
Marcus Comstedt 55ac575a88 Cairo GAL: fix incorrect use of pixman formats
Fixes https://gitlab.com/kicad/code/kicad/issues/3970
2020-03-03 18:07:30 +00:00
Wayne Stambaugh e1900161a7 Eeschema: implement new symbol library file s-expression formatter.
CHANGES: Symbol library file format has been converted to s-expressions.

Add support code for picking apart symbols at some future junction that
will allow full inheritance conversion of existing symbol libraries.  For
now, symbols arranged by unit and body style numbers are nested for round
robin testing of symbol libraries once the parser is complete.
2020-03-03 08:06:22 -05:00
Jon Evans 08ef7de493 Use STL replace instead of Boost in JSON_SETTINGS 2020-03-02 19:18:52 -05:00
jean-pierre charras 911c6eb781 Pcbnew, DIALOG_NETLIST: fix incorrect storage of wx_MessageWindow options.
Config values were not stored into the right variables.

Make also an option persistent during the session
in DIALOG_UPDATE_PCB and DIALOG_NETLIST

DIALOG_UPDATE_PCB and DIALOG_NETLIST match options: use same order in dialogs.
2020-03-01 20:49:56 +01:00
Simon Richter 0f105c4c9a Fix preprocessor expression
The "and" and "or" keywords are only defined if <iso646.h> is included.

This fixes the C4067 warnings.
2020-03-01 00:33:45 +00:00
Andrew Downing 2f7ac2b5b4 Don't truncate polar coordinates in position relative dialog/move exact dialog 2020-02-29 02:21:18 +00:00
Jon Evans 72a6963e9e Free some memory that asan was complaining about 2020-02-27 22:58:33 -05:00
Jon Evans 9cc5b4b3f9 Fix management of nested settings for PNS 2020-02-27 22:53:00 -05:00
Jeff Young 3860ab9f0c Fix issue returning pointers to items inside std::vector.
(When the vector is re-allocated your pointers become bogus.)
2020-02-27 22:00:51 +00:00
Tomasz Wlostowski ce683c403a genral: always link libcurl to avoid unresolved symbols in pcbnew 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 6673554866 common: prevent segfault with no edit frame in TOOL_MANAGER 2020-02-27 22:02:56 +01:00
Tomasz Wlostowski 33f9843fb7 ACTION_MANAGER: prevent null object call when used without a host frame 2020-02-27 22:02:56 +01:00
Jon Evans b1fd931251 Use grid color for worksheet page borders 2020-02-25 20:36:27 -05:00
Jon Evans 009641d151 Make libcurl a required dependency and always build KICAD_CURL 2020-02-26 01:03:07 +00:00
Ian McInerney 879a8f4efb Rework the file history menus to not need references to the file history
Keeping a pointer to the actual file history inside a special
file history menu led to many cases of use after free crashes,
so instead rework the actual file history to add the menu
items.

Fixes https://gitlab.com/kicad/code/kicad/issues/3741
2020-02-25 16:18:10 +00:00
Ian McInerney cc588471ca Hardcode the minimum window size
For some reason, OSX won't return the minimum window size properly
using GetMinWidth/GetMinHeight, so it would not properly adjust
windows with saved size (0,0).
2020-02-25 01:14:06 +00:00
Jeff Young c7ec110fba Only center focused items when they're not visible.
This includes outside the window and behind an occluding dialog.
This keeps the view from jumping around when focusing on nearby
objects.
2020-02-24 23:19:17 +00:00
Jon Evans d3d74b36bd Allow version selection; make buttons the same size 2020-02-22 11:23:47 -05:00
Jon Evans 80233aece9 Fix URL launching on MacOS 2020-02-22 09:47:51 -05:00
Jon Evans 712ae5a953 Check if scaling factor has changed when top-level window is moved
Fixes #2592
2020-02-22 01:25:08 +00:00
Jon Evans 96da45f12f Rework window size and position fixing code
Fixes #2624
Fixes #3888
2020-02-22 01:25:08 +00:00
Seth Hillbrand 3af868e3d1 Adding Arcs to TRACKS
This expands the TRACKS class to also include ARCS
2020-02-21 23:51:58 +00:00
Jeff Young ea025a35e5 Change KUUID to KIID. 2020-02-21 22:20:42 +00:00
Jon Evans a533748796 Cleanup 2020-02-21 09:30:08 -05:00
Jon Evans ad3e99f933 Fix file history save order 2020-02-21 08:12:53 -05:00
Jon Evans fcdf2bac0b Remove dead code 2020-02-21 08:07:15 -05:00
jean-pierre charras 6d44a93eaf Linking, mingw: Add bcrypt to libraries linked to libcommon.
It is already added with MSVC, and must be added with gcc/mingw

However, the cmake option:
add_definitions( -DBOOST_UUID_FORCE_AUTO_LINK )
does not work on msys2 (at least with my cmake version), so another syntax is used.
2020-02-21 10:37:59 +01:00
Jon Evans ea733639ff Rearrange about dialog; add easy bug report button
Fixes #3871
2020-02-20 22:20:34 -05:00
Jon Evans da1ba54188 Expose curl_easy_escape via KICAD_CURL_EASY 2020-02-20 22:07:17 -05:00
Jon Evans dc75c2b800 Factor out utility to launch a given file or folder 2020-02-20 22:07:17 -05:00
Jon Evans e8e3b4f11e Rename UUID to KUUID to fix MSVC build
Also add another newly-required boost flag
2020-02-20 22:07:17 -05:00
Jeff Young e69c82f45f Back out changes which updated the eeschema file format.
We'll wait until we have the new eeschema format to turn on UUID
generation for Eeschema.  Right now only Pcnbew generates full UUIDs.
2020-02-20 23:40:30 +00:00
Jeff Young 48874a7f19 Fix mis-match between color defaults in old and new systems. 2020-02-20 21:29:52 +00:00
Jeff Young 81dd1d7a68 Timestamp-based paths were ugly. UUID-based ones are worse.
Show a human-readable path in the Edit Footprint dialog.
2020-02-20 21:29:52 +00:00
Jeff Young 129042f8a6 Convert timestamps to UUIDs. 2020-02-20 21:29:52 +00:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
jean-pierre charras 625249322e Pcbnew: regroup drc files to the already existing drc folder. 2020-02-19 10:31:32 +01:00
jean-pierre charras 021eb2f3a8 Fix incorrect usage of a UTF8 char in a C string in code.
Using a UTF8 char inside a C string can work on unix, but not on Windows.
It must be explicitly converted in a unicode value inside a wide string
(like a wxString)
2020-02-16 10:21:36 +01:00
Ian McInerney 43514a18bb Test every environment variable when doing substitution to remove more directories
CHANGED: Use the environment variable that removes the most directories

Fixes https://gitlab.com/kicad/code/kicad/issues/2500
2020-02-14 22:59:18 +00:00
Ian McInerney 36de20a0a7 Allow space to toggle all selected entries in a grid
CHANGED: Space now toggles all selected checkboxes in a grid

Fixes https://gitlab.com/kicad/code/kicad/issues/2252
2020-02-14 19:28:18 +00:00
Ian McInerney 4fef513a3f Fix library table panel path adding and cleanup duplicate dialog
When adding a .pretty library, if the actual .pretty folder were
selected then no folder would be added to the list of libraries.
This led to an assert when normalizing paths, and the library
not being added.
2020-02-14 19:07:27 +00:00
Jeff Young 3ec360f15c Save pinned libraries in project.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 14:22:54 +00:00
jean-pierre charras f17f10d2a6 Eeschema, DIALOG_UPDATE_FIELDS: ensure mandatory fields are put in list.
Add also a comment in common.cpp about using wxLocale instead of setlocale.

DIALOG_UPDATE_FIELDS has issues in non English languages, due to its design.
The fix for mandatory fields is only a partial fix that avoid major issues.
2020-02-14 13:07:13 +01:00
Ian McInerney 25b3cce474 Fix build error and cleanup overzealous refactor changes 2020-02-14 00:56:41 +00:00
Jeff Young 2017389f2d Pinning for library trees in FPEditor and SymbolEditor.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 00:10:40 +00:00
Seth Hillbrand 39a45f2a81 Correct cyrillic 'f' in newstroke
The lowercase greek phi had been used which did not match the cyrillic
f.  We use the variant of phi that includes the full strokes instead.

Fixes #3898 | https://gitlab.com/kicad/code/kicad/issues/3898
2020-02-12 14:08:02 -08:00
Seth Hillbrand 03f74c87a1 Update immediate mode location and restart wires
The immediate action option clears (or not) the position of the events.
We use this to determine if the command should start at the given
position or merely activate the tool.  This was being checked in the
menu options, which only activated for tool commands in the context
menu.  Moving to the process event, we catch hotkeys as well.

This also restores the previous logic in eeschema that used a static
variable for storing wires rather than the private class variable.
Starting the draw event now picks up from the existing wires when
activated in immediate mode.

Fixes #3891 | https://gitlab.com/kicad/code/kicad/issues/3891
2020-02-11 09:12:36 -08:00
jean-pierre charras feab56f6e7 LOCALE_IO: replace the call to setlocale by a call to wxLocale to switch to "C" locale.
Previously we call only setlocale( xx, "C" ), but it was not enough on Windows.
Now we call wxLocale("C")
wxLocale calls setlocale, but also make some others initialization in wxWidgets.
It fixes some issues related to comma versus point as fp separator.
Especially wxWidgets warnings are no longer thrown, and a one case of incorrect
conversion is fixed.
2020-02-11 16:19:00 +01:00
Wayne Stambaugh e933045663 Fix build issue exposed by commit b824051a.
The combination of left over test code in lib_id.h/cpp and the changes
to handle the DEBUG compiler flag correctly on all platforms exposed a
swig issue on debug builds.  Removing the offending test from lib_id.h
resolved the issue.
2020-02-07 15:29:03 -05:00
jean-pierre charras 46b72d807b Kicad manager: Avoid crash when calling configure paths or libraries from main menu,
when _eeschema.kiface or _pcbnew.kiface is not found.
Happen mainly when running Kicad from build tree.

Now a suitable error message is displayed.

Fixes #3868
https://gitlab.com/kicad/code/kicad/issues/3868
2020-02-06 11:41:21 +01:00
Ian McInerney b1240b5b1e Gracefully shutdown tools when frames are closed
If the tools are not gracefully exited, then the stack variables are
never destroyed, so variable lifetime issues can occur.

Fixes https://gitlab.com/kicad/code/kicad/issues/1753
2020-02-05 22:23:24 +00:00
Jon Evans fe375b4419 Allow sheet pins to be strong drivers if they don't conflict with anything
Also try harder to match bus members in case one was renamed by a higher
priority label.

Fixes https://gitlab.com/kicad/code/kicad/issues/3797
2020-02-05 14:23:55 +00:00
Jon Evans 8fb72d8290 ADDED: Expose GetBuildVersion and GetBuildDate to Python 2020-02-05 13:28:44 +01:00
Simon Richter 48ce1239a2 Remove unused LIB_TABLE_ROW::Parse 2020-02-05 09:56:41 +00:00
Ian McInerney 6b8d81e95d Add zone area to message panel
ADDED: Area of zone fill is displayed in the message panel

Fixes https://gitlab.com/kicad/code/kicad/issues/2412
2020-02-05 09:44:53 +00:00
Drew Fustini f359892de3 Update copyright year in About dialog to 2020 2020-02-03 22:56:42 +00:00
Jeff Young a1c2abaff5 Get rid of line-weight component of overbar height.
It's not really necessary and it messes up text highlighting.

Fixes https://gitlab.com/kicad/code/kicad/issues/3680
2020-02-03 19:35:48 +00:00
jean-pierre charras 465ffff162 Gerber plots: Add initial G01 command to the header,
to ensure linear interpolation mode.
To avoid issues, an interpolation mode must be set before first D01 command.
2020-02-03 17:55:19 +01:00
Jeff Young a04fdf64da Improve directory handling for Project Save As.
1) don't change directory names that we don't recognize
2) when we do, make sure the child files get copied to the
changed name.

Fixes https://gitlab.com/kicad/code/kicad/issues/3834
2020-02-03 15:08:01 +00:00
Ian McInerney 4f82939384 Fix layout in color dialog on GTK
Don't initially set the minimum widget size, and instead let it be
computed at launch.

Fixes https://gitlab.com/kicad/code/kicad/issues/2617
2020-02-02 15:28:21 +00:00
jean-pierre charras 79e7a27492 Fix a few Coverity warnings. 2020-02-02 08:55:24 +01:00
jean-pierre charras ad3c4b37ab Fix a few coverity warnings 2020-02-01 15:15:51 +01:00
Alexander Shuklin 3d0b3a51f3 Eeschema: Adding back annotation
ADDED: Back annotation algorithm,
eeschema back annotation dialog

CHANGED: added some minor helper methods to SCH_REFERENCE_LIST and SCH_REFERENCE,
split SCH_REFERENCE_LIST::CheckAnnotation on 2 parts to reuse code
2020-01-29 16:33:57 +00:00
jean-pierre charras 460060a694 page layout editor: fix incorrect bitmaps bounding box size.
Bitmap size is using Eeschema units.
So the size was incorrectly calculated for pl_editor.
2020-01-24 11:52:41 +01:00
Ian McInerney 06c979dfaa Convert all CMake paths to absolute instead of relative
It is cleaner and safer to handle the include and source paths
as absolute from the source directory instead of relative to every
path.
2020-01-22 23:27:20 +00:00
Alexander Stock 974f84a5a6 Use proper encoding in UnescapeString() to speed up processing
Use the proper encoding to prevent extraneous conversion encoding conversion inside UnescapeString(). This change reduces the eeschema symbol library loading time (ubuntu and windows build) from 2700ms to 1700ms.

See merge request https://gitlab.com/kicad/code/kicad/merge_requests/70
2020-01-20 10:51:20 +00:00
Mark Roszko 8ac0d84f45 Fix invalid std::array constructor causing MSVC illegal indirection error 2020-01-20 01:30:26 +00:00
Ian McInerney c4277409d7 Add missing header that broke compilation 2020-01-19 11:52:34 +00:00
Seth Hillbrand 7c296fbcb7 GRID_HELPER: Provide alignment axes from snap points
ADDED: alignment lines from item snap points

Alignment lines are shown when moving the cursor horizontally or
vertically from a possible snap point.
2020-01-18 20:43:40 -08:00
jean-pierre charras d714773c22 Fix a minor compil warning. Add a wxASSERT in hierarch.cpp. 2020-01-18 18:23:21 +01:00
Ian McInerney 39b1f0e1ff Replace wxCriticalSection with std::mutex 2020-01-15 23:42:16 +00:00
Ian McInerney 415aaabc29 Fix return type in KIDIALOG
It was returned as a bool for some reason...
2020-01-15 18:29:15 +00:00
Mark Roszko a80b2b7e39 KIDIALOG should ignore "cancel" for the do not show again option.
Fix #3734
2020-01-15 18:23:07 +00:00
Jeff Young 0f4c56cbbd Also catch null dereference in case wxASSERT was skipped. 2020-01-15 17:51:48 +00:00
Jeff Young 1bdcb33f75 Handle error returns from lstat. 2020-01-13 20:16:42 +00:00
Jeff Young 9df2cfb328 More uninitialized variables. 2020-01-13 20:16:40 +00:00
Jeff Young 91d1508c16 Fix some Coverity identified issues. 2020-01-13 20:16:40 +00:00
Jeff Young aeba5c005f Many callers of uni_forward are not expecting an exception.
Remove the throw and used a different mechanism to detect non-unicode.
2020-01-13 15:40:32 +00:00
Ian McInerney e2853862e5 Cleanup redundant type casting 2020-01-13 14:00:45 +00:00
Ian McInerney 8fc434be19 Formatting change for dynamic cast tests 2020-01-13 01:48:57 +00:00
Ian McInerney 36f6b4a9b4 Clean up redundant dynamic casts 2020-01-13 01:39:08 +00:00
Jeff Young 836c1ea56e Fix a bunch of un-caught boost::bad_pointer exceptions.
This also removes vector cover types which do nothing except obfuscate
the underlying implementation.

Mainly changes SCH_SHEET_PINS and CONFIG_PARAM_ARRAY (which will soon
be replaced by Jon's new stuff).
2020-01-12 19:55:00 +00:00
Ian McInerney b445ce6632 Clean up pointer casting
* Make note of when dynamic cast is actually needed
* Convert some to static cast when we know the type for sure
2020-01-12 19:45:37 +00:00
Ian McInerney 00e58cd974 Fix unintialized values (from coverity scan) 2020-01-12 13:00:42 +00:00
Jeff Young b343391723 Code cleanup for readibility. 2020-01-11 21:30:48 +00:00
Ian McInerney f896043067 Fix comments for switch statement fall throughs
This cleans up all GCC warnings (-Wimplicit-fallthrough=2) about
implicitly falling through switch cases.
2020-01-11 19:16:32 +00:00
Seth Hillbrand 4ebb87d1c1 Fix Eeschema BW printing
Checks forced state when printing to convert images to grayscale.
2020-01-11 09:55:30 -08:00
Seth Hillbrand 195c3d074b Fix bitmap clipping
When printing (using DC context) the bitmap will clear the full screen
unless the clipping region is set to the image itself.

Addresses KSC ticket 126

Fixes #1877 | https://gitlab.com/kicad/code/kicad/issues/1877
2020-01-11 09:47:19 -08:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Seth Hillbrand 2a780dba0e Initialize view variable
Sets known initialization value to the last keyboard command
2020-01-10 16:43:01 -08:00
Seth Hillbrand d1a0102e84 eeschema: Fix print order between worksheet and screen
The worksheet should be drawn behind the screen.
2020-01-10 16:33:53 -08:00
Seth Hillbrand a35db35029 eeschema: Fix bitmap scaling when printing
Bitmaps scale internally to 100nm instead of 1mil.  There is a better
way to do this but I think we'll be adjusting it again when Cairo
printing in finished.
2020-01-10 16:33:53 -08:00
Jeff Young 0fd68dad62 Fix freed pointer access issue (from Coverity scan). 2020-01-11 00:09:08 +00:00
Jeff Young 7bb9551801 Handle boost exceptions. (From Coverity scan.) 2020-01-11 00:04:01 +00:00
Jeff Young c27e278e58 Fix uninitialized variable (from Coverity scan). 2020-01-10 22:32:50 +00:00
Jeff Young 5e5edd03f6 Implement super- and subscript printing and plotting for eeschema. 2020-01-10 22:32:49 +00:00
Jeff Young 65c88ba2c3 Reduce the auto-panning margin and implement acceleration. 2020-01-10 22:32:49 +00:00
Seth Hillbrand 77c60d9655 Remove the last vestiges of dlist
It served us (mostly) well for more than a decade.  It helped KiCad grow
before the std:: came into decent shape or speed.  It was a good little
list.

RIP DLIST 2008-2020
2020-01-10 06:37:08 -08:00
Seth Hillbrand 6e5e453d0d Replace EESchema DLIST
This moves EESchema DLIST structures to rtree.  These changes are more
fundamental than the pcbnew changes from 9163ac543 888c01d11 d1877d7c1
and 961b22d60 as eeschema operations were more dependent on passing
drawing list references around with SCH_ITEM* objects.
2020-01-10 06:37:08 -08:00
Ian McInerney a8d9fcb4e0 Fix event handler type casting
The old methods were very clunky and not recommended (and didn't
properly cast the function types). This changes to useing the
recommended way of declaring events and casting the event handlers.
2020-01-09 18:08:49 +00:00
jean-pierre charras d587bd5bca SVG plotter: fix an issue with mirrored texts.
Mirrored texts have a size < 0.
Of course, the actual value for the plotter is the absolute value.
2020-01-09 18:07:56 +01:00
Mark Roszko ca34ade00c Make global labels have the same spin style as net/hierarchical labels
For legacy reasons, it stored left and right "spin" as flipped integers in the file format.
But the code handled the flip in multiple locations rather than just doing it on file io.
This change unifies the internal code and does the mapping in the file I/O.
2020-01-08 19:07:55 +00:00
Ian McInerney 9e5d52f92d Cleanup 2020-01-08 01:49:51 +00:00
Ian McInerney 9dff31c2ac Remove unused DIALOG_FILE_DIR_PICKER
This class was replaced with native dialogs for choosing
the files and directories
2020-01-07 23:40:00 +00:00
Jonatan Liljedahl f433037dcd Eeschema: simulator: allow dotted traces for current and phase.
ADD: Allow drawing of current and phase traces with dotted style
for easier differentiation from voltage and magnitude. The option
is available in the View menu of the simulator.
2020-01-07 19:45:44 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Simon Richter 270aaec443 Rewrite FBP files generated with unreleased wxFB
These use a few features that are too new, causing errors when trying to
edit with a released version of wxFormBuilder.
2020-01-07 13:32:33 +00:00
jean-pierre charras a46abcd2dc FILENAME_RESOLVER: fix missing conversion from UTF8 to wide chars.
Fixes #3742
https://gitlab.com/kicad/code/kicad/issues/3742
2020-01-07 13:35:37 +01:00
jean-pierre charras 86f9ed1dd9 Allows pad property only by the kicad_advanced feature.
pad property is allowed if "UsePadProperty=1" is found in kicad_advanced.
2020-01-06 18:11:01 +01:00
jean-pierre charras f2518a5120 ADDED: pad fabrication property, as required in latest Gerber file specification.
Property is a pad info used mainly for fabrication or test.
Currently, supported properties are:
BGA property (variant of SMD pad)
Fiducial (global to the board or local to the footprint)
Test Point
Heat sink
Castellated.
And are used in Gerber files (copper layers and drill files)

Increment BOARD_FILE_VERSION  to 20200104
2020-01-06 16:37:35 +01:00
Seth Hillbrand 49e3542662 Remove unused common defines 2020-01-06 05:55:06 -08:00
Seth Hillbrand 850ca98e7b Remove outdated RoundTo0
With internal units in 100nm, there are no rounding errors when
representing mm coordinates in eeschema.
2020-01-06 05:15:14 -08:00
Jon Evans 21d577e638 Implement Gerber job file writing using nlohmann/json 2020-01-04 10:46:50 -05:00
jean-pierre charras 5707e6eac8 Fix QA arc test according to the new arc bounding box calculation.
Previously, the arc center was included in the bounding box,
but this is incorrect.
In many cases it is not in the bbox, and can be very far away.
2020-01-04 10:16:30 +01:00
Ian McInerney 20e7fc8a0e Properly escape spaces when opening PDFs on windows
Fixes https://gitlab.com/kicad/code/kicad/issues/2625
2020-01-03 19:06:49 +00:00
Ian McInerney 2f75dfb09c Fix symbol editor column widths
102b5301 introduced an issue on GTK where the column width was
incorrect when read, then was set incorrectly (a known problem
on GTK tree views). We should only apply that fix on OSX.

Fixes https://gitlab.com/kicad/code/kicad/issues/3720
2020-01-03 17:04:18 +00:00
Ian McInerney 5d46e721e5 pcbnew: Cleanup includes of pcbnew_id.h
* Remove unused IDs from the enum
* Remove the include statements from files that no longer need it
2020-01-03 15:39:05 +00:00
Mark Roszko 49db816c82 Pcbnew: improve add existing footprint library browser and button
CHANGED: Modify Add Existing Footprint Library button to us OS file/directory browsers
2020-01-03 15:09:26 +00:00
jean-pierre charras baa1db031e Fix incorrect arc bounding box calculation.
add comments to SHAPE_ARC ctor.
2020-01-03 14:27:00 +01:00
jean-pierre charras 3543de039b More about code cleaning.
Remove useless includes and dead code
2019-12-31 13:08:50 +01:00
jean-pierre charras 2999bcb721 Try to fix SEG::PointCloserThan(), not working for quasi H or V segments.
Quasi H or V segments are segments having the same x value or y value
(with a + or -1 max diff) for end points coordinates.
The change is a workaround, not really a fix.

Fixes #3711
https://gitlab.com/kicad/code/kicad/issues/3711
2019-12-29 18:24:17 +01:00
Ian McInerney 5c0656d97f Move potrace and libcontext into thirdparty directory
Part of the cleanup in #3637
2019-12-28 18:17:55 +00:00
Ian McInerney 6faa2188ed Silence warnings on MacOS about OpenGL deprecation
Apple has apparently deprecated OpenGL and replaced it with
their Metal API. It still works for now though.
2019-12-28 16:05:03 +00:00
jean-pierre charras d5b8e4928c Gerber P&P files: escape the double quote char inside user strings.
This is a reserved char, used to quote user strings
2019-12-28 13:27:31 +01:00
jean-pierre charras 7241247fbc Pcbnew: add missing storage of dimension units and dimension precision in pcb files.
https://gitlab.com/kicad/code/kicad/issues/3712
2019-12-28 13:27:31 +01:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Mark Roszko d4dee3c5a0 Inner loop iterator should be size_t as well 2019-12-26 13:10:18 +00:00
Mark Roszko a418242ca7 Prevent oob on LSET::FmtHex call when BITSET size is not a multiple of 4 (which it isn't usually) 2019-12-26 13:10:18 +00:00
Jon Evans 2ea565473f LSET: Prevent assertion in MSW when size is not a multiple of 4 2019-12-25 11:34:12 -05:00
jean-pierre charras 60dd1cd5c7 Gerber files: update unicode coding to the 2019 06 Gerber specifications.
In gbr files, not allowed chars are coded using a 16 bit (4 hexa digits) unicode sequence.
Previously, it was \XXXX and now is \uXXXX escape sequence.
2019-12-21 11:15:57 +01:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Ian McInerney b9d8849b28 Unify unsaved changes detection logic in all frames
Create an IsContentModified() function in each frame
that provides if the content has been modified, and
use that instead of always copying the checks.
2019-12-19 15:34:01 +00:00
Mark Roszko 686b768a3d Add shutdown blocking on Windows for pcbnew, eeschema and pleditor
ADDED: Block shutdown/logoff on Windows when contents have been modified
2019-12-19 14:11:11 +00:00
Jonatan Liljedahl 1e42d6abeb symbol-editor: Fix MacOS segfault in lib_tree_model_adapter
In LIB_TREE_MODEL_ADAPTER::UpdateSearchString(), don't call
AttachTo() on MacOS.

Fixes https://gitlab.com/kicad/code/kicad/issues/3653 and
https://gitlab.com/kicad/code/kicad/issues/3666
2019-12-19 14:01:35 +00:00
Ian McInerney 3370e89967 Update Linux appdata file and CMake version strings
CHANGED: Update the Linux appdata file to include new tags

* Include version tags (and others) in the appdata file
* Refactor the version string generation to clean it up
2019-12-18 17:24:07 +00:00
jean-pierre charras 24cd80ef3e Gerber plotter: modify G02 and G03 commands.
They are now in a specific block and no longer combined with an other command.
(combining these commands with an other command (D01 or D02) is deprecated)

Fixes #3677 | https://gitlab.com/kicad/code/kicad/issues/3677
2019-12-18 11:35:28 +01:00
Ian McInerney c31c99abd1 Update about dialog link to GitLab
Fixes #3687
2019-12-17 20:17:03 +00:00
Ian McInerney 0259e0ba07 Cleanup struct initialization and formatting 2019-12-17 16:09:32 +00:00
Ian McInerney 18dbe51d66 Remove WINCE check
We don't actually support Win CE
2019-12-17 15:38:38 +00:00
Mark Roszko bf32122134 common: Remove out of bounds and erroenous array access 2019-12-17 14:10:52 +00:00
Jeff Young 1f07505b27 Fix long-standing issue with arrow keys moving in both axes. 2019-12-15 14:29:47 +00:00
Wayne Stambaugh 1abb198fb4 Minor UI improvement.
Use wxMessageDialog instead of wxRichMessageDialog in DisplayErrorMessage
so the platform specific message dialog is used.  wxRichMessageDialog
looks different than the stock message dialog on every platform so only
use it when a checkbox is required.
2019-12-14 12:29:38 -05:00
Mark Roszko ae785194ce Silence/fix double to float conversion warnings 2019-12-12 21:51:21 +00:00
Seth Hillbrand eb3d32f967 SHAPE_LINE_CHAIN: Unify constructors
Keeps the multi element SHAPE_LINE_CHAIN constructors in a single
routine using std::vector and implicit construction.
2019-12-12 13:54:48 +00:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00:00
Seth Hillbrand 7d6665c313 Simplify to merge sequential, parallel segments
The Simplify() routine can take multiple segments that are in a single
line and merge them into a single segment, reducing the line complexity.
2019-12-12 13:54:48 +00:00
Ian McInerney 179f31d377 Add a minimum size to the part column in the lib trees
When the column has 0 width, it becomes hidden and users don't
know where it went or how to get it back.

Fixes https://gitlab.com/kicad/code/kicad/issues/3656
2019-12-10 23:26:07 +00:00
Seth Hillbrand fa133f3f5c Plot SVG embedded
ADDED: embedded image support for SVG files

Fixes #3643 | https://gitlab.com/kicad/code/kicad/issues/3643
2019-12-08 08:57:33 -08:00
Wayne Stambaugh 54f066fed7 Implement simple inheritance for library symbols.
This change completely removes the LIB_ALIAS design pattern an replaces
it by allowing LIB_PART objects to inherit from other LIB_PART objects.
The initial implementation only allows for single inheritance and only
supports the mandatory fields in the derived part because that is all
that the current symbol library file format will support.  Once the new
file format is implemented and saving to the old file format is deprecated,
more complex inheritance will be added.  The LIB_ALIAS information saved
in the document files was move into the LIB_PART object.  This change
impacts virtually every part of the schematic and symbol library editor
code so this commit message is woefully incomplete.

REMOVE: Removed the symbol aliases concept from the schematic and symbol
editors and the symbol viewer.

NEW: Replace the symbol alias concept with simple inheritance that allows
a library symbol to be derived from another library symbol.
2019-12-06 11:33:52 -05:00
Seth Hillbrand 4f4bb96f2b Suppress false warning of uninit var 2019-12-06 06:27:47 -08:00
Seth Hillbrand df75167e14 Fix ordering warning and init error for clang
The glyphs and bb pointers were reversed.
2019-12-06 04:33:50 -08:00
jean-pierre charras 52db6acb86 Fix a compil issue on Windows.
A wxString was defined as const, but on Windows it is modified.
2019-12-06 08:40:58 +01:00
Seth Hillbrand ac92afcf13 Clean up compile warnings
Ratsnest did not need a reserve and then iterative emplace.  Instead, we
use resize().  Stroke font gets private vars initialized and kiway
variables that are only used in debug builds are properly scoped for
releases as well
2019-12-05 20:05:21 -08:00
Seth Hillbrand 6983c56cf8 Use const references where possible
This avoids copy cost on local vars where we only read.
2019-12-05 14:40:22 -08:00
Seth Hillbrand c6f5df134c Minor speed cleanup
This adjusts iterators to use const reference when only used for
copy.  It also ensures pre-allocation of vectors when size is known
ahead of time.
2019-12-05 14:20:59 -08:00
Seth Hillbrand b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
Seth Hillbrand 6f8b399c5f Replace unused resize() call
Calling resize(size()) will only zero out elements that exist above the
vector size().  The memory is not freed in this case.  shrink_to_fit()
will accomplish this action (at the discretion of the library)
2019-12-05 13:21:48 -08:00
Seth Hillbrand 4d2e953f42 Cleanup: Replace C-only deprecated headers
This replaces headers deprecated by C++14 with their equivalent
replacement
2019-12-05 11:03:15 -08:00
Seth Hillbrand a2edf9c442 Unified update to C++14 std::make_unique
This update replaces the existing uses of unique pointer creation with
the C++14 std::make_unique call that provides proper memory release in
event of an exception.
2019-12-05 10:43:55 -08:00
Seth Hillbrand 65ef8c1894 StrokeFont: Reserve rather than resize
Minor speedup by not double-initializing the stroke font vector.
2019-12-04 16:36:06 -08:00
Jeff Young 581dc81358 Performance optimizations for the stroke font. 2019-12-03 17:45:26 +00:00
Jeff Young 089ce90de3 Fix some issues with the previous commit. 2019-12-02 23:35:19 +00:00
Jeff Young 9b36489270 Make sure that libraries are always sorted consistently.
Fixes #1847481 | https://gitlab.com/kicad/code/kicad/issues/1847481
2019-12-02 21:52:50 +00:00
Jeff Young 102b530162 Fix library tree updating bug present at least on OSX. 2019-11-29 17:55:01 +00:00
Jonatan Liljedahl 7c7d9c3e3f Eeschema: simulator plot: allow standard mac pan and pinch to zoom 2019-11-25 09:24:31 -05:00
jean-pierre charras a6566b9b53 Fix a crash in some languages when loading a dynamic library.
The crash is inside wxDynamicLibrary::Load() when loading Eeschema,
and hard to find on Windows (gdb shows nothing).
Perhaps due to some issue with a specific string.

The fix is to switch to "C" locale with LC_COLLATE option to load the dll.

Fixes: lp:1853681
https://bugs.launchpad.net/kicad/+bug/1853681
2019-11-24 11:56:02 +01:00
Ian McInerney 99b9354a51 Add clear recent files action to the menus
ADDED: Menu item to allow the recent file lists in each program to be
cleared

Fixes: lp:1821685
* https://bugs.launchpad.net/kicad/+bug/1821685
2019-11-23 23:35:21 +00:00
jean-pierre charras f7159e4692 Make pin function in pads an advanced feature.
Mainly because it creates a new keyword a new keyword in *.kicad_pcb files,
and needs some tests, this is currently a advanced feature.
Enable it by adding "UsePinFunction=1" in "kicad_advanced" config file.

Note also "UsePinFunction=1" only enable saving this info in *.kicad_pcb
and kicad_mod files.
2019-11-23 09:12:44 +01:00
jean-pierre charras 71cd8c57bf ADDED: Pcbnew, add "pin function" (pin name in eeschema) to pads.
The pin name defined in Eeschema is now available as pad info.
Useful for the board designer (the pin function is displayed in the message panel).
Needed for the Gerber P&P files.
2019-11-23 09:12:43 +01:00
jean-pierre charras 767d7f2009 Fix bug (typo?) in gestfich.cpp.
Minor enhancement in treeproject_item.cpp
2019-11-19 16:11:56 +01:00
Jeff Young 89ace3b0d0 Apply the overbar fixes from the stroke font to bitmap text.
Fixes: lp:1852037
* https://bugs.launchpad.net/kicad/+bug/1852037
2019-11-18 11:36:30 +00:00
jean-pierre charras c1f88b2d9c Gerber P&P file: remove BGA option from TO.CMnt attribute. 2019-11-17 20:34:28 +01:00
jean-pierre charras 6f2cbe5982 Pcbnew: housekeeping: move netlist code to netlist_reader sub directory. 2019-11-17 13:58:38 +01:00
jean-pierre charras c5290de6ec housekeeping:
Remove not used files:
- markdown2html is not used (we are using "Sundown" tool)
- newstroke_font_without_CJK.cpp is removed.
Due to code optimization the full font works fine without memory issues
-fix also a few very minor compil warnings
2019-11-16 09:39:36 +01:00
jean-pierre charras 544867cf2a ADD: layer stack manager: support of multilayer dielectric between 2 copper layers
This feature is useful for advanced microwave applications.
This is the last missing feature in the board stackup management.
2019-11-15 14:33:10 +01:00
Ian McInerney 88e55bbf2d Recursively delete directories in the project tree
Ensure we iterate over all the sub directories and files inside of them
when deleting a directory from the project tree.

Fixes: lp:1852357
* https://bugs.launchpad.net/kicad/+bug/1852357
2019-11-15 00:26:52 +00:00
jean-pierre charras de2818c113 Fix a few I18n minor issues. 2019-11-12 13:47:35 +01:00
qu1ck 695caa7dfa Make stroke font bbox calculation consistent with rendering
When rendering tabs we count them as 4 + 1 space but when calculating
bbox it is 4 spaces + '?' width, which is a bit wider.
2019-11-11 20:16:59 -08:00
Seth Hillbrand ed77f522dd Align text to 4th column correctly
Text mod calculation was off by one in alignment
2019-11-11 20:16:59 -08:00
Jeff Young 04b0feb365 Fix a couple of issues in new Save As command.
Handle symbols as well as strings in the "source" lists of
netlist files.

Handle Protex gerber file extensions.

Check for project_name-whatever pattern for files that we
don't recognize (such as project_name-NPTH-drl_map.ps)
2019-11-11 20:36:48 +00:00
Ian McInerney 122ec64c02 Make build date update whenever build version does
Previously, the build version would only update if the dialog_about.cpp
file were modified. This moves the date generation into the same file
as the build version, so it will be updated whenever a new version
is made.
2019-11-11 18:01:38 +00:00
Jeff Young 55432d9685 Fix issue with overbar processing.
Fixes: lp:1852037
* https://bugs.launchpad.net/kicad/+bug/1852037
2019-11-11 13:05:56 +00:00
jean-pierre charras 4de6ed6206 Fix issues created by Adds Save As... to the Kicad manger.
Mainly replacing std::string by wxString to manage filenames.
On Windows, a sdt::string cannot manage a filename, unless using
in many places TO_UTF8 and FROM_UTF8.
So the best way is to use a wxString for filenames and error messages.
2019-11-10 09:37:39 +01:00
Jeff Young b5904b0401 Installment one of project Save As... feature.
ADD: Adds Save As... to the File menu for the project window.

Fixes: lp:594051
* https://bugs.launchpad.net/kicad/+bug/594051
2019-11-09 20:22:44 +00:00
Jeff Young d6e0ec2f24 Fix a couple of edge cases in text drawing.
Don't accidentally flip the x-axis glyph size when resetting after
a sub- or superscript.

Special-case three tildes in a row.  (We could also do this for
sub- and superscript, but does anyone really need a superscript
^ or a subscript?

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

Fixes: lp:1851880
* https://bugs.launchpad.net/kicad/+bug/1851880
2019-11-09 20:22:44 +00:00
jean-pierre charras 5833392689 FIX: Pcbnew plot BezierCurve: add missing line thickness initialization. 2019-11-09 14:02:41 +01:00
jean-pierre charras 01553a6bd1 FIX: add parameter to GAL::DrawCurve to control the curve to polyline conversion. Cairo supports curves, but not Opengl, that needs a conversion to polyline. This control allows optimization in conversion 2019-11-09 11:41:29 +01:00
jean-pierre charras 943858fd67 FIX: Bezier curves: replace previous algorithm to convert the curve to segments. In some cases it was not working well. Opengl was using an other algo (using the curve properties to create segments) Now only the OpenGL algo is used, with optimization to reduce the number of segments. 2019-11-09 11:41:29 +01:00
Jeff Young 4662205ecb Fix compiler warnings. 2019-11-05 17:22:51 +00:00
Jeff Young 35c8d64f98 Add super- and subscript support to Eeschema.
Note that since the markup might exist for other reasons, it has
to be turned on with a preference setting.  (It goes through a set
of bitflags so the same architecture can be used for other markup
structures that we might want to support in the future.)

Note also that this is more about engineering nomenclature than
visual formatting.  In that respect it's more similar to overbar
than italic or bold.
2019-11-05 17:22:51 +00:00
jean-pierre charras 5f3353cad1 Add native Bezier curve plot in SVG plotter. 2019-11-05 14:27:07 +01:00
jean-pierre charras 8621a1cf3a Fix a wxWidgets alert (on wxWidgets 3.1.3) 2019-11-04 17:30:50 +01:00
jean-pierre charras 51ed01d765 GERBER_PLOTTER: small change in code to manage the current selected aperture.
Avoid using an iterator to store this aperture because iterators can be invalided
when modifying a list.
Enhancements in gerber_placefile_writer.
2019-11-04 14:33:10 +01:00
Seth Hillbrand cbb88ce609 tool manager: Don't adjust the iterator to invalid
When finishing the first tool, we don't want to return an invalid
iterator
2019-11-03 10:15:21 -08:00
jean-pierre charras 65bf669387 Refinements in gerber placefile writer: allows adding board edge cuts in file.
Use a pad bounding box for footprints having no valid courtyard defined.
Refinement also in Gerber files when plotting oval pads.
2019-11-01 18:12:26 +01:00
jean-pierre charras c59fa1b672 Gerbview: Fix outdated warning message about missing D-Codes and old RS274D files.
RS274X Gerber files using only regions (polygons) can be valid, and are not old RS274D files
Now a warning is raised only if there are some missing D codes definitions
(RS274D file or broken RS274X file)

Remove unused var and add comments

Fixes: lp:1850821
https://bugs.launchpad.net/kicad/+bug/1850821
2019-11-01 08:34:24 +01:00
jean-pierre charras 4a0bd46ed6 More work on Gerber pick and place files
In P&P files, user strings are now quoted, and use UTF8 encoding
2019-11-01 08:34:24 +01:00
Seth Hillbrand 43768b71c0 Unify string lists of forbidden footprint chars
We have forbidden lists maintained in 3 separate locations.  This causes
a bit of confusion as to which is correct.

This makes the list uniform but remains to place the character set in a
single location.
2019-10-29 13:31:11 -07:00
jean-pierre charras bc5dcf182f keepout in footprint: fix some crashes and issues. Create a specific type (PCB_MODULE_ZONE_AREA_T) for zones in footprint. The new class (MODULE_ZONE_CONTAINER) is the same as ZONE_CONTAINER, but the type ID is PCB_MODULE_ZONE_AREA_T instead of PCB_ZONE_AREA_T.
This is mandatory because these zones must be handled differently in many functions.
2019-10-29 11:24:57 +01:00
Seth Hillbrand bae50fab9f pcbnew: Fix 45° snapping polygons
The constrained draw was constraining the polygon size to fit the
existing points rather than extending the existing points to fit the
user's intent.

This adds a 90° double-joint for the completion polygon that allows the
user to complete common constrained polygons visually based on the
preview with a double-click to finish.
2019-10-24 16:01:14 -07:00
Seth Hillbrand ea1c8525ce Increase visibility of polygon preview
This set the polygon preview item to wider size and adjusts the draw
order to ensure it remains visible even when antialiasing
2019-10-24 16:00:01 -07:00
Seth Hillbrand a934fa49aa Check for tool manager before dereference
Changing common settings in EDA_BASE_FRAME may segfault for frames that
don't implement tool manager yet (simulator)

Fixes: lp:1849492
* https://bugs.launchpad.net/kicad/+bug/1849492
2019-10-23 06:45:33 -07:00
jean-pierre charras 10d23ad82d PROGRESS_REPORTER: fix serious bug in its DTOR: the DTOR was calling Destroy. But Destroy() in wxWidgets calls the DTOR.
It can create recursive calls of the DTOR.
2019-10-23 11:28:15 +02:00
jean-pierre charras 8a4ba87fba Gerber output: Fix incorrect zones outline thickness in filled areas.
Fixes: lp:1848929
https://bugs.launchpad.net/kicad/+bug/1848929
2019-10-20 21:15:31 +02:00
Seth Hillbrand 2e1af66a2b pcbnew: Commit polygon points to new constrained zone
Adds leader points if they are not already existing in the zone

Fixes: lp:1846028
* https://bugs.launchpad.net/kicad/+bug/1846028
2019-10-20 09:29:35 -07:00
Seth Hillbrand 70c64d93e4 pcbnew: prevent assert with first pt
Finding the pt-to-end intersection requires a segment, so check for
multiple points.

Fixes: lp:1846431
* https://bugs.launchpad.net/kicad/+bug/1846431
2019-10-20 07:39:48 -07:00
jean-pierre charras 846397c692 Fix compil warning 2019-10-19 15:44:40 +02:00
jean-pierre charras f892ebbb49 Fix issues in Gerber attributes 2019-10-19 11:26:29 +02:00
jean-pierre charras b9202e81bc Fix Gerber plot pad oval for pad orientation not n*90 degrees.
Use now a Gerber region that support TO attributes like flashed pads.
2019-10-19 11:26:29 +02:00
jean-pierre charras 47f9c505c5 Gerber plot: better handling of polygonal pad shapes plotting
update GBR_CMP_PNP_METADATA.
2019-10-19 11:26:29 +02:00
jean-pierre charras 36253450e7 Pcbnew: Add experimental place file (P&P) export in Gerber format. 2019-10-19 11:26:28 +02:00
Seth Hillbrand 6084614371 GAL: Use vector for stroke elements
deque structures have higher overhead than vectors.  Not usually
problematic, but with hundreds of thousands of characters each with only
a few strokes, the overhead becomes dominant.
2019-10-18 21:48:58 -07:00
Seth Hillbrand 132adf8ac3 Remove Yahoo Groups link
Yahoo has discontinued its groups.

See https://help.yahoo.com/kb/groups/SLN31010.html

(cherry picked from commit 1161562bc8)
2019-10-17 16:00:46 -07:00
Seth Hillbrand 5b8661f2ab view: Check for viewData in IsVisible()
viewData can be NULL, make sure we verify it before dereferencing.
2019-10-15 09:44:16 -07:00
jean-pierre charras 23e09d3de7 some other WXDEBUG replacement 2019-10-14 12:38:52 +02:00
jean-pierre charras d77ba30a95 Replace __WXDEBUG__ (improperly used) by DEBUG in some #define.
__WXDEBUG__ comes from a build option of wxWidgets,
and is not related to a Debug versus Release Kicad build.
2019-10-14 11:17:38 +02:00
jean-pierre charras 4b2d801fec Gerber file export: avoid duplicate corner when creating polygons (regions in Gerber dialect)
Fixes: lp:1847714
https://bugs.launchpad.net/kicad/+bug/1847714
2019-10-11 20:59:23 +02:00
jean-pierre charras 967b9d4a97 Gencad export: fix an issue in hash_eda calculation, that can generate the same hash for 2 different footprints.
Therefore, for some footprints, the right footprint was not associated to the component.
The hash calculation was using a XOR to combine 2 sub hash values.
This is not a strong way to combine these hash values.
They are now added. Looks better to identify similar and different footprints.

Fixes: lp:1847575
https://bugs.launchpad.net/kicad/+bug/1847575
2019-10-10 20:18:48 +02:00
jean-pierre charras c7d636d560 Gerber file generation: fix incorrect aperFunction attribute for graphic items on edge cut layer.
Was NonConductor. Must be Profile.
2019-10-09 15:46:35 +02:00
jean-pierre charras 34b26a0ac7 Add KICAD_USE_FONT_REDUCED_SET (default OFF) to build options.
It allow using the previous font set without CJK.
The new font (with CJK) is very large (10x), and can create (on Opengl) out of memory issues
with some graphic cards.
2019-10-07 09:50:24 +02:00
Ian McInerney 027658d3da Fix invalid cursor position access in tool manager
Fixes: lp:1846923
* https://bugs.launchpad.net/kicad/+bug/1846923
2019-10-06 13:26:07 +02:00
Seth Hillbrand 8c2ee6c025 Rescale and flip Chinese characters
Characters now scale similar to capital latin letters and are correctly
oriented.

Fixes: lp:1846846
* https://bugs.launchpad.net/kicad/+bug/1846846
2019-10-05 07:42:15 -07:00
Ian McInerney b33c3a5ad8 pcbnew: Clean up extension handling in graphics plugins
* Fix wildcard display in the file selector dialog (on GTK
  it would show the regex to the user)
* Move the file extension comparison into a common function
2019-10-04 15:43:29 -04:00
Seth Hillbrand 4302bc2562 Fix segfault when getting mouse position 2019-10-04 08:58:32 -07:00
Jeff Young d22ea0e201 Safety for frames which don't have an m_viewControls. 2019-10-03 22:23:35 +01:00
Ian McInerney 3a2dbf7786 Update pleditor path for run from build directory 2019-10-03 15:00:01 -04:00
Ian McInerney 5862b1559f Cleanup position handling for TOOL_EVENTs
* Make the events generated by the selection of context menu items
  have the position where the menu was opened
* Ensure that TC_COMMAND type events have their position set to
  be the cursor position where the event originated
2019-10-03 19:04:33 +01:00
jean-pierre charras ac2373ae16 Gerber plotter: add support of standard aperture regular polygon as flashed shape.
Standard apertures are circle, rect, oblong and polygon (regular polygonal shapes with 3 to 12 vertices)
The support of the standard aperture type polygon was missing in Gerber plotter.
2019-10-02 17:33:06 +02:00
jean-pierre charras 49dbc37277 Fix a few issues related to help files in html or markdown.
Fix *.cmake scripts that dropped the semicolon in strings during conversion.
Move markdown2html in a separate library.
2019-10-01 17:11:39 +02:00
Jeff Young 58b9d5f69e Map orientation when converting text types.
Also fixes up dangling state when converting.

Fixes: lp:1844716
* https://bugs.launchpad.net/kicad/+bug/1844716
2019-10-01 15:16:43 +01:00
Seth Hillbrand aad28a3d3c Adding standard library CJK strokes
This also cleans a few strokes that were not up to par in the previous
iteration.
2019-09-30 17:27:03 -07:00
Seth Hillbrand 3a35c75d09 Add CJK ideographs
This adds the 20975 ideographs from Open Han Source mapping to the
standard CJK code unicode block.

Fixes: lp:594064
* https://bugs.launchpad.net/kicad/+bug/594064
2019-09-29 12:44:57 -07:00
jean-pierre charras 8ed49b3f68 Add a Markdown to Html converted, to display help written in markdown in a wxHtmlWindow.
The help file bridget_tee_formula.md can be displayed in pcb_calculator.
For Help messages, a markdown text (with some basic html tags) is often enough
and is more easy to translate than full html texts.
2019-09-29 17:25:56 +02:00
jean-pierre charras ce62941bb8 Minor fix: fix misplaced include 2019-09-28 13:46:12 +02:00
Jeff Young 4bf2b6a9f7 Performance enhancements for cross-probing.
While found when profiling cross-probing, many of these will also
improve other things.
2019-09-27 19:58:16 +01:00
jean-pierre charras 25dee38f70 DIALOG_ABOUT: add compil date to version info. 2019-09-27 18:15:35 +02:00
Konstantin Baranovskiy e57c13c2bd Grid Control: Cells selecting fix.
If *editable* cells had been selected by holding and dragging the mouse's left
button, the previous selection were not clearing.
2019-09-26 07:42:42 -07:00
jean-pierre charras 19cf78f802 simulator: plot curves: fix incorrect draw area limits calculation when zooming.
Fixes: lp:1674132
https://bugs.launchpad.net/kicad/+bug/1674132
2019-09-26 16:29:52 +02:00
jean-pierre charras 281d77f6b3 Cairo print, on GTK: use a better DPI definition to avoid artifacts rendering (GTK specific)
Previously, a 600 DPI was used to set device scale (can create minor visible rounding issues).
Using now 4800 DPI to reduce these rounding artifacts.

Fixes: lp:1845229
https://bugs.launchpad.net/kicad/+bug/1845229
2019-09-25 18:36:38 +02:00
Jakub Kozdon 11f1ce14d1 Eeschema: Option to use also .mod files as a simulation model
Fixes: lp:1844718
* https://bugs.launchpad.net/kicad/+bug/1844718
2019-09-20 09:40:55 -07:00
jean-pierre charras 16f4958430 Pcbnew: avoid crash when closing pcbnew if the DRC dialog is open.
Cvpcb: change from commit 9ceca583:
the root class close event that save settings is now seeing the close event.
2019-09-19 09:16:12 +02:00
Ian McInerney bb596ebdaf Fix width of part selector columns
* Move column width manipulation into the lib tree adapter
* Fix issue with GTK where if someone types too fast, the part
  column gets 0 width.

Fixes: lp:1841584
* https://bugs.launchpad.net/kicad/+bug/1841584
2019-09-18 16:12:45 -07:00
Ian McInerney a37d8f2859 Remove unneeded wxWidgets version checks in the code
Now that the minimum version is 3.0.0, we don't need to actually
check if the version is greater than 3.0.0 inside the code.
2019-09-18 10:03:53 -04:00
Ian McInerney d68dd09f63 Run all matching global actions for a hotkey
Fixes lp:1834547

https://bugs.launchpad.net/kicad/+bug/1834547
2019-09-18 09:21:43 -04:00
jean-pierre charras a1fe8cfa5a Minor changes: cleanup code and prepare code to add more attributes to Object Attributes (.TO) 2019-09-18 11:48:49 +02:00
jean-pierre charras 64b5e8bee2 Minor fix and enhancement code. 2019-09-15 11:10:53 +02:00
Seth Hillbrand f2bf9fa534 eeschema: Prevent crash on move/drag re-entry
Restarting a move/drag operation breaks the stack by starting the tool
without popping it on exit.

TODO: implement RAII for these stack push/pop
2019-09-11 17:01:16 -07:00
Jeff Young 25fa2131d2 Restore PointCloserThan() behaviour to really be "closer than".
Change calls which really want it to be "closer than or equal" to
distance + 1.

Fixes: lp:1843329
* https://bugs.launchpad.net/kicad/+bug/1843329
2019-09-10 11:07:47 +01:00
Jeff Young 90fd58871d Fix zero failure in SEG::PointCloserThan().
Fixes: lp:1843329
* https://bugs.launchpad.net/kicad/+bug/1843329
2019-09-09 23:23:43 +01:00
Ian McInerney 2b387f4b4d Manually put the UNIT_BINDER text on the primary selection clipboard
The OnKillFocus handler of the UNIT_BINDER replaces the text in the
control with the evaluated string, which removes the selection. To
get the original text on the primary selection clipboard, we must
add it ourselves.

Fixes: lp:1794623
* https://bugs.launchpad.net/kicad/+bug/1794623
2019-09-09 09:00:59 -07:00
Jeff Young 8dd8740fa3 Performance enhancement for pad drawing.
Fixes: lp:1843065
* https://bugs.launchpad.net/kicad/+bug/1843065
2019-09-09 13:45:06 +01:00
Jeff Young 2ac270ce8e Fix bug with high-frequency plots.
Fixes: lp:1839712
* https://bugs.launchpad.net/kicad/+bug/1839712
2019-09-08 01:11:51 +01:00
Jeff Young 6f0d8c3eac Replace buggy code in TestSegmentHit() with call to SEG::PointCloserThan()
Fixes: lp:1843101
* https://bugs.launchpad.net/kicad/+bug/1843101
2019-09-07 23:18:19 +01:00
Jeff Young 14c4175040 Tighten up the board setup dialog layout a bit. 2019-09-07 13:57:38 +01:00
Jeff Young a612fb690b Cherry pick of line-ending-safety fix from 5.1.
Fixes: lp:1842943
* https://bugs.launchpad.net/kicad/+bug/1842943
2019-09-07 03:14:03 +01:00
Jeff Young 1ac6cbc4a6 A bit more safety around control characters in strings. 2019-09-07 01:08:22 +01:00
Jeff Young d55f4d05b4 Workaround wxWidgets inability to find the default PDF viewer.
Fixes: lp:1843061
* https://bugs.launchpad.net/kicad/+bug/1843061
2019-09-06 23:38:20 +01:00
Jeff Young 2553dd2942 Bail on our custom dockart provider.
It appears that it was causing some crashes, and it was never clear
that it looked better anyway.
2019-09-06 23:38:20 +01:00
Jeff Young 10c25a2290 Update frame type enum to match current class names. 2019-09-06 23:38:20 +01:00
Seth Hillbrand 37b3c698c8 fixing comparison warning 2019-09-06 13:17:06 -07:00
Wayne Stambaugh 24454f5105 Pcbnew: fix size of graphics import warning dialog.
Use the HTML_MESSAGE_BOX window to present the warning messages rather
than wxMessageBox which would overflow the display when there were a lot
of graphic items that could not be parsed.

Fixes lp:1839565

https://bugs.launchpad.net/kicad/+bug/1839565
2019-09-06 14:57:04 -04:00
jean-pierre charras bd34348068 Pcbnew: allows using filled polygons in zones with no outline thickness.
This option was only available if advanced config "ForceThickZones" was set.
2019-09-06 16:13:41 +02:00
Jeff Young 3bd38ec245 Improve zoom-to-extents for footprints with long text.
Fixes: lp:1820540
* https://bugs.launchpad.net/kicad/+bug/1820540
2019-09-05 21:02:29 +01:00
jean-pierre charras f3f0e20a67 Pcbnew: add a board layer stack manager
This is a new feature.
2019-09-05 18:51:18 +02:00
Ian McInerney 8d86d94a4d wxWidgets compatibility fixes
* Remove unneeded check
* Fix WX_GRID since upstream renamed a variable in 3.1.3
2019-09-05 08:11:44 -04:00
Ian McInerney e675a93b92 Switch preview items to use abstract render settings 2019-09-05 08:11:44 -04:00
Seth Hillbrand c8a6878eb8 pcbnew: Allow tuning length to be longer than INT_MAX
The INT_MAX limit for most elements makes sense only for single-segment,
straight line elements.  For elements that accumulate lengths, we should
utilize the long long int (64 bits) to allow for greater lengths.

Fixes: lp:1842367
* https://bugs.launchpad.net/kicad/+bug/1842367
2019-09-03 16:41:09 -07:00
Jeff Young 54255cffeb Cleanup to make implementation names consistent with what they now do.
Fixes: lp:1842477
* https://bugs.launchpad.net/kicad/+bug/1842477
2019-09-03 19:29:30 +01:00
Jeff Young fc50ddda64 Implement Paste Special for eeschema.
Also changes the normal paste behaviour to only clear annotations
when a collision is found.

Fixes: lp:1837002
* https://bugs.launchpad.net/kicad/+bug/1837002
2019-09-02 19:24:29 +01:00
Jeff Young e269b5d1b9 Workaround an issue where a throw terminates (even when there's a catch for it).
You can trigger it before this fix by running Cvpcb when a .kicad_mod file is
incorrectly set as "Legacy" in your footprint table.
2019-08-31 15:18:27 +01:00
Seth Hillbrand ccc3b812b8 Make dialogs look more like frames
We use DIALOG_SHIM to display many items that should behave more like
frames with the ability to min/max/resize.  This changes the default
custom dialog behavior to the frame-type.

Fixes: lp:1829950
* https://bugs.launchpad.net/kicad/+bug/1829950
2019-08-30 09:24:50 -07:00
Jeff Young 79d062aefc Don't allow selection dragging when a picker tool is running.
Fixes: lp:1841691
* https://bugs.launchpad.net/kicad/+bug/1841691
2019-08-30 10:33:34 +01:00
jean-pierre charras 7ed415cab3 Gerbview: fix bug: did not store the current selected GAL engine in config.
Was due to recent changes in config handling.
2019-08-30 09:02:53 +02:00
Jeff Young 2274895acf Add print preflight so the menu item is only shown when we can print.
Fixes: lp:1836473
* https://bugs.launchpad.net/kicad/+bug/1836473
2019-08-29 23:56:16 +01:00
Seth Hillbrand c3274e15f2 cairo: Minor fixup in delete call 2019-08-28 20:25:27 -07:00
Seth Hillbrand c3e07a5886 Cleaning Cairo GAL
Removed extra allocations that were not used.
Removed unneeded shared pointer
Corrected storage type from RGB to ARGB
2019-08-28 19:29:47 -07:00
Jeff Young 678294b8a6 Try harder to find a viable print solution on GTK.
Fixes: lp:1836473
* https://bugs.launchpad.net/kicad/+bug/1836473
2019-08-28 20:04:35 +01:00
Jeff Young 360a52399a Add printing to RMB project items.
Fixes: lp:1836473
* https://bugs.launchpad.net/kicad/+bug/1836473
2019-08-28 17:32:08 +01:00
jean-pierre charras 37b166348a Fix compil error and minor compil warnings 2019-08-27 09:13:07 +02:00
Seth Hillbrand b3615b36bb pcbnew: Retain 45° constraint
This also finishes the polygon with 45° lines when chosen as a create
option.

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

(cherry picked from commit fccce265aa)
2019-08-26 14:36:23 -07:00
Jeff Young bc0e67579c Change OK/Cancel to MSW order and move some other dialogs to new system.
(There's no point in following the OSX OK/Cancel order as you can't
tab to buttons on OSX anyway.)
2019-08-26 18:36:35 +01:00
Jeff Young 6b6e9eddee Return control of Symbol and Footprint chooser col widths to user.
The auto-calculation wasn't working out and even with it some users
wanted control.

Fixes: lp:1796774
* https://bugs.launchpad.net/kicad/+bug/1796774
2019-08-26 18:27:49 +01:00
Jeff Young 92330b9c93 Sort modules and pads in Footprint Report file.
Fixes: lp:1793764
* https://bugs.launchpad.net/kicad/+bug/1793764
2019-08-26 18:27:49 +01:00
Jeff Young 8d31c9a6c1 Save values of Page Settings Export buttons in project.
Fixes: lp:1791431
* https://bugs.launchpad.net/kicad/+bug/1791431
2019-08-26 18:27:49 +01:00
Ian McInerney 1bbd944277 pcbnew: Add ability to reset layer/item colors to defaults 2019-08-26 09:20:08 -04:00
Jeff Young de8f97be6b Don't apply GTK fix to OSX as it causes a hang.
Fixes: lp:1841379
* https://bugs.launchpad.net/kicad/+bug/1841379
2019-08-25 20:48:47 +01:00
Jeff Young f21467e340 Support tabbing to non-text controls on non-Mac platforms.
Fixes: lp:1840991
* https://bugs.launchpad.net/kicad/+bug/1840991
2019-08-23 22:14:37 +01:00
Jeff Young c85d1fa00c Try out our own tabbing logic.
Fixes: lp:1840991
* https://bugs.launchpad.net/kicad/+bug/1840991
2019-08-22 21:18:24 +01:00
Seth Hillbrand 85df994eda Handle wx scrollbar thumbs in system-independent way
The thumb size changes between system versions and (on GTK) render
managers, so hard-coded wasn't working.  This gets the actual value from
the system and uses to adjust the range.  Changes in the range can also
trigger the refresh.

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

Fixes: lp:1816749
* https://bugs.launchpad.net/kicad/+bug/1816749
2019-08-22 10:07:34 -07:00
Jeff Young 23fd4b64dd Remove curly braces from netname escaping context.
They're now used for bus definition control characters.
Also fixes the sheet pin edit dialog to correctly escape/unescape
netnames.

Fixes: lp:1840834
* https://bugs.launchpad.net/kicad/+bug/1840834
2019-08-22 10:53:39 +01:00
Jeff Young a6b7d4f7f6 Support 9 comments in the page setting GUI.
Fixes: lp:1793148
* https://bugs.launchpad.net/kicad/+bug/1793148
2019-08-21 20:34:01 +01:00
Jeff Young bfb8806682 Upgrade Cvpcb filtering to use a multi-term combined matcher.
Fixes: lp:1827135
* https://bugs.launchpad.net/kicad/+bug/1827135
2019-08-21 15:35:02 +01:00
Seth Hillbrand 53989e3bdc SVG: Correct plot fills for arcs/polylines
When plotting in Eeschema, various elements may be filled with either
the foreground or background colors.  The fill mode is rather unique,
requiring un-stroked pie wedges for arcs and both closed and open filled
polylines.

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

(cherry picked from commit 213547f545)
2019-08-20 12:03:56 -07:00
Jeff Young a25368cc6b Improve spelling.
The groundwork here is thanks to kunda1.

Fixes: lp:1831510
* https://bugs.launchpad.net/kicad/+bug/1831510
2019-08-20 19:14:05 +01:00
Jeff Young bb8096497a Allow pageLayout files to have no graphic items.
Fixes: lp:1486031
* https://bugs.launchpad.net/kicad/+bug/1486031
2019-08-20 16:39:40 +01:00
Seth Hillbrand 0ba0c17245 Alphabetize Library Table returns
KiCad is case sensitive but we need to be consistent in displaying sort
order as case insensitive (same as file systems)

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

(cherry picked from commit ebba15fe67)
2019-08-19 16:07:13 -07:00
Jeff Young 0d90fab01b Add display setting preference pane for PLEditor.
Fixes: lp:1839187
* https://bugs.launchpad.net/kicad/+bug/1839187
2019-08-19 00:06:22 +01:00
Jeff Young d094934cf4 Put Place & Inspect menus in standard order. 2019-08-17 12:23:19 +01:00
Seth Hillbrand 46feb76aba Allow EDA_RECT to properly be uninitialized
The base initialization of EDA_RECT sets a 0/0/0/0 rectangle that
prevents merging properly with valid EDA_RECT.  This sets the default to
be uninitialized until the internal data are set.
2019-08-16 10:54:16 -07:00
Simon Schubert 176fe80425 SVG plot: output invisible text in addition to plotting
Fixes: lp:1544918
* https://bugs.launchpad.net/kicad/+bug/1544918
2019-08-15 13:39:38 -07:00
Seth Hillbrand fbc19ab893 Make coroutines stack size configurable
This allows rapid debugging of the coroutine memory issues.  It moves
the default stack size to 256 * 4096 = 2^20, which will utilize full
pages on all architectures.
2019-08-15 09:25:13 -07:00
Jeff Young 8ba7d4570c Move warp-mouse-on-move setting from Eeschema settings to common settings.
It's also used by the Symbol Editor, and will likely be used by
Pcbnew and friends in the future.
2019-08-15 12:53:04 +01:00
Jeff Young 206b40621e Fix bugs in Eeschema paste.
1) don't ASSERT; use exceptions (which can be caught) instead.
2) clean up LIB_LOGGER so it's only used during sync
3) fix typos in wxLogMessage() calls so they produce output.
4) throw on unrecognized token in loadContent().
5) if clipboard can't be pasted as content then paste as text.

Fixes: lp:1840172
* https://bugs.launchpad.net/kicad/+bug/1840172
2019-08-15 10:00:23 +01:00
Shawn Anastasio 3e22b75948 Fix libcontext on PPC64 ELFv2
libcontext currently restores and saves the FPSCR register
on ppc64. This behavior is fine (though unnecessary) on the
ELFv1 ABI which designates the register as volatile, but has
been observed to cause crashes on ELFv2 systems.

The ELFv2 ABI designates the FPSCR register as Limited-access
and specifies specific conditions that must be met to clobber
it. It does not seem that a context swap function meets these
conditions (and indeed, the save/restore register example in the
ABI document does not modify FPSCR).

This patch fixes ELFv2 ABI compliance by removing the FPSCR
save/restore code in libcontext entirely. This fixes observed
crashes on the platform and should have no consequence for
ELFv1 support.

Fixes: lp:1840088
* https://bugs.launchpad.net/kicad/+bug/1840088
2019-08-14 11:16:40 -07:00
Jeff Young 3cdf88f2c6 CERN copyrights for work packages. 2019-08-14 09:35:15 +01:00
Ian McInerney 8493daf9ff Unify menu item creation for closing a window
* Push a function into CONDITIONAL_MENU that adds the item
* Modify the tooltip for close and exit items to have the
  program name

Fixes: lp:1835454
* https://bugs.launchpad.net/kicad/+bug/1835454
2019-08-14 09:35:15 +01:00
Jeff Young c2d77a7300 Add some defensive code to prevent re-entrant printing.
Fixes: lp:1765965
* https://bugs.launchpad.net/kicad/+bug/1765965
2019-08-13 18:00:09 +01:00
Jeff Young a33d67f6b4 Push shift/cmd+<enter> processing down into dialog shim.
This will make them more uniform rather than only supported when
something else is using <enter>.

Fixes: lp:1838353
* https://bugs.launchpad.net/kicad/+bug/1838353
2019-08-13 16:53:40 +01:00
Ian McInerney 9fda86e261 cvpcb: Move file extension to common and deprecate a header 2019-08-12 14:19:01 -04:00
Michael Kavanagh 79b2ff7551 Refactor deleteTool ACTION removing duplicates 2019-08-12 13:49:55 -04:00
Seth Hillbrand c9d65c5324 Adding contributors 2019-08-10 14:22:27 -07:00
Jeff Young 3a2c39b0f8 Remove disappearing-preferences hack in favour of fix in wxWidgets.
This has been patched in our local OSX wxWidgets branch.
2019-08-10 11:58:05 +01:00
Jeff Young 17b5a3750b Move preferences-lost hack down into EDA_DRAW_FRAME.
I've now seen it in Eeschema as well as Pcbnew.

Fixes: lp:1839148
* https://bugs.launchpad.net/kicad/+bug/1839148
2019-08-09 21:22:56 +01:00
Jeff Young 4d53ff9811 Grid dropdown doesn't always live in the same toolbar.
Also fixes typo in grid properties dialog.

Fixes: lp:1839224
* https://bugs.launchpad.net/kicad/+bug/1839224
2019-08-08 13:51:23 +01:00
Jeff Young 8db8119564 Redraw selection halos after zooming.
Fixes: lp:1838869
* https://bugs.launchpad.net/kicad/+bug/1838869
2019-08-08 13:51:23 +01:00
Seth Hillbrand 5151cd0bfe C++14: Remove unused make_unique.h
Also removes header references now that we are in C++14, this is
built-in to the std
2019-08-07 09:27:31 -07:00
jean-pierre charras 38fc51c3b6 CMakeLists.txt: add compil option KICAD_STDLIB_LIGHT_DEBUG, useful when KICAD_STDLIB_DEBUG cannot be used.
KICAD_STDLIB_DEBUG option generate intrusive tests and asserts, and on Windows, generate crashed not captured by GDB.
KICAD_STDLIB_LIGHT_DEBUG generate less intrusive tests and asserts.
it adds only -Wp,-D_GLIBCXX_ASSERTIONS and that generate less asserts.

Add also the new build options in dialog about.
2019-08-07 14:51:28 +02:00
Seth Hillbrand 5facd37376 GAL: Use cursor enum
Not all platforms define the WXWIN_COMPATIBILITY_2_8 so an int isn't
properly cast.
2019-08-06 18:33:42 -07:00
Ian McInerney 920120864f Fix initialization of COLOR4D statics
Just declaring as static const would give an initialization order
fiasco since they were being used to initialize other statics.
2019-08-06 10:06:10 -07:00
Ian McInerney b6f6fc3d65 Return handled status for actions run from hotkeys 2019-08-05 20:46:05 -06:00
Jeff Young 1a68d7c200 Cleanup no-longer-used variable. 2019-08-05 16:48:18 -06:00
Jeff Young 97d70d7844 Fix cursor bugs in simulation.
1) cancel simProbe or simTune when simulator window closed
2) handle non-stock cursors through SetCurrentCursor()

Fixes: lp:1833583
* https://bugs.launchpad.net/kicad/+bug/1833583
2019-08-04 16:25:36 -06:00
Jeff Young 5503727d3d Fix some placement bugs with selection haloes on text.
Fixes: lp:1838841
* https://bugs.launchpad.net/kicad/+bug/1838841
2019-08-03 17:20:54 -06:00
Jeff Young cc82e59003 Push the Quit/Close menu logic down into common. 2019-08-02 14:32:49 -06:00
Ian McInerney 05429bc39c Recursively call evaluate on submenus of conditional menus
There seems to be a bug with certain GTK setups that prevents the
submenus from getting sized correctly unless the elements are added
when the main menu is displayed.

Fixes: lp:1835460
* https://bugs.launchpad.net/kicad/+bug/1835460
2019-08-02 14:32:49 -06:00
Jeff Young 937e3c2d48 Make m_Text private so we don't keep getting bugs where m_shown_text fails to get updated.
Fixes: lp:1838655
* https://bugs.launchpad.net/kicad/+bug/1838655
2019-08-01 20:36:59 -06:00
Ian McInerney bea74c27e5 Add log trace for tool handling 2019-07-31 21:56:53 -06:00
jean-pierre charras 9b6c8c885b 3D viewer: fix preferences/grid issues: grid menuitems always disabled. 2019-07-30 19:12:34 +02:00
Jeff Young 6bf1ac45e3 New selection highlighting model for eeschema. 2019-07-29 19:57:41 -06:00
Jeff Young 3904d7ccfc Push some search stuff down into EDA_DRAW_FRAME so it can be shared.
Also rewrites the PCBNew Find dialog to make use of the above, including:
1) searching in user-defined footprint fields
2) searching in pcb text
3) a history list in the search popup
4) case sensitive searching
5) word sensitive searching
6) the ability to turn wildcard searching on/off
7) better placement of the result when the dialog obscures part of the
window

Fixes: lp:1838006
* https://bugs.launchpad.net/kicad/+bug/1838006
2019-07-26 17:53:32 -06:00
Jeff Young 460b03372d Implement preference for immediate actions.
Also pushes prefer-selection-to-dragging to common.
2019-07-25 20:41:22 -06:00
Stefan Hamminga e58d9606dd Rebased LTO fix for coroutines
Fixes: lp:1793329
* https://bugs.launchpad.net/kicad/+bug/1793329
2019-07-25 12:16:17 -07:00
jean-pierre charras bd8721d6b9 Python scripting: fix missing definition of uint32_t (and some other similar defs).
Fixes: lp:1837867
https://bugs.launchpad.net/kicad/+bug/1837867
2019-07-25 20:53:26 +02:00
jean-pierre charras 9e90cb9572 Kicad manager: fix incorrect handling of disabled state of tools in launcher toolbar 2019-07-24 18:04:04 +02:00
Seth Hillbrand 7759ad7e27 eeschema: Clean up backup name
This fixes the last suffix that was missed by 168fa09f5.  The schematic
backup files should have the suffix .sch-bak to distinguish from
.kicad_pcb-bak or other backups.

(cherry picked from commit b6fe4ff637)
2019-07-23 16:15:04 -07:00
jean-pierre charras 858db3c104 Synchronize toolbars state with current options after rebuilding them.
Previously, for instance after modifying preferences or language,
they were rebuilt but the tools state was not set due to a missing call to SyncToolbars() after rebuilding.
2019-07-20 18:16:35 +02:00
jean-pierre charras b428d74281 Fix incorrect size of the displayed worksheet when starting eeschema or gerbview without file loaded.
It was due to not fully initialized VIEW parameters the first time COMMON_TOOLS::ZoomFitScreen() is called.
2019-07-20 11:53:53 +02:00
Jeff Young 43be58a1ea Fix bug in occulted centering logic. 2019-07-19 19:06:09 -06:00
jean-pierre charras 6577309de4 DIALOG_PRINT_GENERIC: more easy to use user scale option. (not actual change for printing)
- fix an issue when trying to enter a scale < 1.0: such a scale starts by 0, that was rejected by the filter)
- automatic clamp to user scale limits, to avoid many warnings to users.
- if the user scale is out of bounds, warn the user before trying to print, not when opening the dialog.
2019-07-18 13:14:42 +02:00
jean-pierre charras c84c10fa06 PAGED_DIALOG: fix an issue related to TransferDataFromWindow and TransferDataToWindow, on wxWidgets 3.0
On wxWidgets 3.1 they are called recursively but not on on wxWidgets 3.0.
We call now TransferDataToWindow and TransferDataFromWindow only once,
but ensure it is called for all pages.

Fixes: lp:1836901
https://bugs.launchpad.net/kicad/+bug/1836901
2019-07-17 16:47:48 +02:00
Tomasz Wlostowski 6cab769f41 MSVC support for libcontext
This uses the Windows native Fiber API.
2019-07-17 08:10:47 -04:00
Simon Richter 884ae5a7ff Work around missing min/max in Windows headers
Windows headers assume min/max to be macros, but we set NOMINMAX to hide
the macro definitions. This pulls in an alternative implementation.
2019-07-17 08:10:47 -04:00
Seth Hillbrand f2db7ecbe4 Partial revert of 1a7cef2950
The referenced commit broke the unit tests, creating invalid
connectivity for polygon fills.
2019-07-16 11:08:29 -07:00
jean-pierre charras 6388189f48 Preferences, Hotkey list: Avoid list to be shown twice.
The bug was due to the fact TransferDataToWindow was called twice, and the hotkey list was not cleared before rebuild it
2019-07-16 18:30:14 +02:00
Jeff Young 2c5876ee8c Add more control over how corners are handled when inflating polygons. 2019-07-16 16:41:21 +01:00
Jeff Young e816a0c29d Push Eeschema & PLEditor PICKER_TOOLs down into common.
Also implements a more robust push/pop tool strategy for pickers.
2019-07-16 00:44:01 +01:00
Jeff Young 16f672a9bd Fix signed/unsigned mismatch.
Fixes: lp:1836626
* https://bugs.launchpad.net/kicad/+bug/1836626
2019-07-15 20:01:28 +01:00
Jeff Young 58ca5b71a9 A more robust fix for 36f1d023f0.
This one also handles when the events get out-of-order due to them
starting out in the Simulation window and not getting dispatched until
the mouse goes over the Schematic window.

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

Fixes: lp:1836544
* https://bugs.launchpad.net/kicad/+bug/1836544
2019-07-15 14:15:24 +01:00
Jeff Young a3c74051c2 Allow edits to self-intersecting polygons.
1) Intermediate states might be self-intersecting, and we shouldn't
be policing our users on what order to do things in
2) The polygon might already be self-intersecting, at which point we're
preventing the user from fixing it.

Also includes better const management for SHAPE_POLY_SET API.

Fixes: lp:1833831
* https://bugs.launchpad.net/kicad/+bug/1833831
2019-07-14 18:18:48 +01:00
Jeff Young 928d6c5dff Implement preserved-corners to prevent divots when filling adjacent zones.
Fixes: lp:1460787
* https://bugs.launchpad.net/kicad/+bug/1460787
2019-07-14 18:18:48 +01:00
Jeff Young 1a7cef2950 Improve performance, commenting and API of some polygon classes. 2019-07-14 10:39:38 +01:00
Jeff Young 1dbaa89f95 Fix a bug in tool activation/deactivation and another illegal static_cast.
Fixes: lp:1836419
* https://bugs.launchpad.net/kicad/+bug/1836419
2019-07-14 10:39:38 +01:00
Jeff Young a3855cb4f2 Allow thermal spokes to be same width as minimum width.
Also some changes for readability and clarity, both in the code
and in the Feature Constraints panel.

Fixes: lp:1835674
* https://bugs.launchpad.net/kicad/+bug/1835674
2019-07-14 10:36:48 +01:00
Jeff Young 20036f8105 Add FootprintExists() which can be more careful about FS differences.
(And in particular, MSW's case-insensitive FS.)

Fixes: lp:1835999
* https://bugs.launchpad.net/kicad/+bug/1835999
2019-07-11 23:00:01 +01:00
Jeff Young 7159f6e48a MRU for page size and orientation, and clearer info that this is all preview data only.
Fixes: lp:1662239
* https://bugs.launchpad.net/kicad/+bug/1662239
2019-07-10 23:17:50 +01:00
Ian McInerney ff9d899ae0 pcbnew: Clean up warnings with unit handling in the DXF export 2019-07-10 12:21:01 -04:00
Jeff Young 30ec895c96 Cleanup event processing stuff to keep better track of "handled".
See: https://lists.launchpad.net/kicad-developers/msg41471.html .
2019-07-09 21:59:46 +01:00
Jeff Young 483dc24e87 Homogenize selection tools around our HIG.
In particular make addative and exclusive-or selections work the
same way.

Also give Highlight Net a hotkey now that it can't use ctrl-click
anymore.
2019-07-09 21:59:46 +01:00
jean-pierre charras 1633068920 tool_dispatcher.cpp: fix incorrect handling of ESC key on Linux and Windows.
m_toolMgr->ProcessEvent() returns false when a ESC key is handled. It should return true.
So we force the handled flag to true for a ESC key event to avoid skipping this event.
Otherwise the ESC key event is handled twice.
2019-07-08 16:28:45 +02:00
jean-pierre charras 269cd11b5a tool_dispatcher.cpp: fix incorrect char event filtering, that created issues on Windows.
At the beginning of tool dispatcher, the ProcessEvent did not return the fact a key event was captured or not.
Now this is the case, and the old char event filtering was no longer correctly working,
and some events were not fired, especially on Windows.
2019-07-08 13:51:10 +02:00
Jeff Young 4852c91b42 Possible fix for GTK bug differentiating hotkeys from menu picks.
Fixes: lp:1835672
* https://bugs.launchpad.net/kicad/+bug/1835672
2019-07-08 10:51:45 +01:00
Jeff Young a11f3a0b80 Make <esc> unhighlight nets, but only after all tools have been cleared.
Also moves the Highlight Net hotkey from activating the tool to just doing
a one-shot highlight.

Fixes: lp:1835658
* https://bugs.launchpad.net/kicad/+bug/1835658
2019-07-08 00:02:25 +01:00
Jeff Young b029e4e44a Add a few more actions to the hotkeys list and add hotkeys to tooltips.
Fixes: lp:1792159
* https://bugs.launchpad.net/kicad/+bug/1792159
2019-07-07 22:30:18 +01:00
Jeff Young a3b855ac6c Massage an earlier fix so that mouse-clicks in tools update the highlighting. 2019-07-06 17:50:35 +01:00
jean-pierre charras 39c830435c Fix a bug created by commit ea0edaba. 2019-07-06 14:48:53 +02:00
Thomas Figueroa ea0edaba21 Fix cursor lag in canvases on Windows.
Fixes: lp:1831541
* https://bugs.launchpad.net/kicad/+bug/1831541
2019-07-06 00:04:54 +01:00
Jeff Young 7ee6afeace Performance improvement for zone filling. 2019-07-06 00:04:54 +01:00
Jeff Young 562ab0bdea Move layer defaults and diff-pair dimensions to board file. 2019-07-06 00:04:54 +01:00
Seth Hillbrand 541d4358b8 Handle tabs to align text visually
This processes the \t character to place the next character aligned with
the next 4-space visual column.

Fixes: lp:1769193
* https://bugs.launchpad.net/kicad/+bug/1769193
2019-07-05 12:44:21 -07:00
Jeff Young a9c66e15ea Common-ize EE_ACTIONS::refreshPreview and use it after cursor actions.
Fixes: lp:1818667
* https://bugs.launchpad.net/kicad/+bug/1818667
2019-07-05 14:45:15 +01:00
Jeff Young 29df4f809e Better safety around boost::optional.
I'm not sure these are necessary but I got a crash when checking one
as a boolean instead of calling is_initialized().  Sadly, my debugger
doesn't like boost, so I didn't get much more info.
2019-07-05 14:45:15 +01:00
Jeff Young eeae94b4b6 This doesn't appear to be needed anymore (and causes crashes). 2019-07-05 14:45:15 +01:00
jean-pierre charras 18995a1527 page layout draw function: fix a rounding issue.
For items defined by 2 point, the ending point coordinates are rounded to the near integer,
but the starting point coordinates were just truncated instead of being rounding,
creating sometimes an error for horizontal or vertical lines.

Fixes: lp:1835211
https://bugs.launchpad.net/kicad/+bug/1835211
2019-07-03 16:03:45 +02:00
Simon Richter c8c3e1f96a Fix build order for generated headers and sources
This changes make_lexer() so that it no longer generates a custom target
but instead attaches the generated files to an existing one (so the first
argument now is the name of an existing library or executable, and it needs
to come after the add_library/add_executable call).

The generated source is no longer listed in the project sources, as it is
added by the function. The files are generated in the build tree rather
than the source tree, and the directory is added to the include path for
the respective project as well as exported to projects linking against it.

Generated files in subdirectories are somewhat supported, but need to be
referenced with the same name as they were generated (i.e. including the
subdirectory name).

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

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

Fixes: lp:1833851
* https://bugs.launchpad.net/kicad/+bug/1833851
2019-07-03 09:36:40 -04:00
Seth Hillbrand 69b31eb88d Corrects test for return case in tool event 2019-07-02 10:32:49 -07:00
Seth Hillbrand d65ad38e3f Fix missing PERCENT handle in preview items 2019-07-02 10:32:49 -07:00
jean-pierre charras 527d9509d3 Messure tool: Minot fix: display dimension mantissa with 3 digits (microns) in mm. 2019-07-02 18:39:01 +02:00
jean-pierre charras 081842dff0 DIALOG_PAGES_SETTINGS: better visibility of the preview. 2019-07-02 10:28:01 +02:00
Jeff Young 9effd24f3a Allow move tool to run on top of other tools.
Fixes: lp:1784480
* https://bugs.launchpad.net/kicad/+bug/1784480
2019-07-01 22:15:25 +01:00
Jeff Young ad26ece8d4 Add Global Edit Text and Graphics Properties to Eeschema.
Fixes: lp:1801150
* https://bugs.launchpad.net/kicad/+bug/1801150
2019-07-01 22:15:25 +01:00
Seth Hillbrand d650cca088 Enforcing rational limits on length tuner
The length tuning dialog needed validators on close to prevent negative
and percentages >100%

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

(cherry picked from commit 3974c6fd89)
2019-06-29 09:38:27 -07:00
Jeff Young 16cf1a4d09 Output text content as a description of the stroked path.
Fixes: lp:1544918
* https://bugs.launchpad.net/kicad/+bug/1544918
2019-06-28 22:18:30 +01:00
Jeff Young 981072598b Overhaul cursor code for new tool/action framework.
Includes the addition of an onSetCursor() handler which must be called
from both the GAL canvas AND the GAL backend (at least on OSX) to prevent
cursor flickering between (for instance) pencil and arrow.

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

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

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

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

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

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

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

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

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

Fixes: lp:1833005
https://bugs.launchpad.net/kicad/+bug/1833005
2019-06-17 17:26:15 +02:00
Jeff Young 1f35ec5521 Beware of copying events and losing the m_passEvent flag.
Fixes: lp:1833031
* https://bugs.launchpad.net/kicad/+bug/1833031
2019-06-17 14:44:39 +01:00
Jeff Young 666705c1f8 Fix compiler warning. 2019-06-17 14:44:38 +01:00
Jeff Young 5d7739a662 Handle '&'s in menu labels.
Fixes: lp:1832904
* https://bugs.launchpad.net/kicad/+bug/1832904
2019-06-17 10:45:23 +01:00
Jeff Young e6d5110ccf Implement I18N for ACTIONs.
It's a bit of a hack because they're statically initialized and
so we can't make use of the _() macro.  We do still want it in the
code, however, because the string harvesting is based off of it.

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

Remove DIALOG_EXIT_BASE as it is no longer required.

Fixes lp:1832899

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

Fixes: lp:1832930
* https://bugs.launchpad.net/kicad/+bug/1832930
2019-06-15 17:49:15 -07:00
Jeff Young 18ebced8f4 Code hygiene. 2019-06-15 20:43:52 +01:00
Jeff Young 19aba615c2 Remove selection condition from conditional menu separators.
We don't allow duplicate separators anyway so all they really do
is complicate the code.
2019-06-15 20:43:51 +01:00
Jeff Young 5610261dce Immediate-action hotkeys (and context menu actions) for eeschema. 2019-06-15 20:43:51 +01:00
jean-pierre charras 12a4a38507 pl_editor:make the option "show formatted texts" working. 2019-06-15 19:54:05 +02:00
Seth Hillbrand 79e2000af4 Fix case-sensitive import using KiCad std
Fixes: lp:1832853
* https://bugs.launchpad.net/kicad/+bug/1832853
2019-06-15 08:08:41 -07:00
jean-pierre charras 96935e0a7e Pl_editor rework: refinements in Design inspector. 2019-06-15 09:58:23 +02:00
jean-pierre charras f550ecaf1f Better tooltip and fix a typo. 2019-06-14 20:50:46 +02:00
Jeff Young e90cfa1d40 Improve gesture lables for better consistency with key labels. 2019-06-14 16:54:46 +01:00
Jeff Young 3d9690302c Only show gestures in List HotKeys (and not in Preferences / HotKeys). 2019-06-14 16:54:46 +01:00
Jeff Young b429dbfb88 Fix bugs with ACTIONs not being "honest" singletons.
Delete the copy ctor and assignment operator to start with, but
even then the separate apps each have their own statically allocated
copy of the common actions.  So we need to update all of them, which
also means having the kicad manager frame's set of actions on hand).

This changelist also adds a Clear Hotkey Assignment function since
the hotkeys set is now likely to be sparse with respect to the
actions.
2019-06-14 16:54:46 +01:00
Jeff Young 21ac28a1ec Add a few more gestures to the hotkeys list.
Fixes: lp:1778437
* https://bugs.launchpad.net/kicad/+bug/1778437
2019-06-14 16:54:46 +01:00
Ian McInerney dc56678289 Make DXF monochrome output only contain Black layer
Fixes: lp:1832359
* https://bugs.launchpad.net/kicad/+bug/1832359
2019-06-13 15:18:30 -07:00
Ian McInerney d5f680ecd2 Allow DXF to be exported in either inches or millimeters
Fixes: lp:1832188
* https://bugs.launchpad.net/kicad/+bug/1832188
2019-06-13 15:18:20 -07:00
Jeff Young 8f84c3ec4f Grid rid of GetCanvas/GetGalCanvas distinction now that there's only gal. 2019-06-13 19:58:37 +01:00
Steven A. Falco 1edeba7fb4 Show the current grid setting. 2019-06-13 14:34:39 -04:00
Jeff Young f0cd7a5fd9 Clean up duplicted Find action processing. 2019-06-13 15:51:32 +01:00
Jeff Young ce1f35a1be Cleanup some left-over vestiages of the legacy canvas architecture. 2019-06-13 15:51:32 +01:00
Jeff Young 158e05adea Add mouse gestures to List Hotkeys.
Fixes: lp:1778437
* https://bugs.launchpad.net/kicad/+bug/1778437
2019-06-13 15:51:32 +01:00
Seth Hillbrand 8112a8ade1 cmake: Further petting dependencies
eeschema cpp files consume generated header files that have targets in
the common directory, so no dependencies get created from eeschema.  We
add the dependencies in common to force the setting through libraries.

Fixes: lp:1831643
* https://bugs.launchpad.net/kicad/+bug/1831643
2019-06-13 06:51:52 -07:00
jean-pierre charras 19de0ae55d remove a printf used for debug. 2019-06-13 14:07:34 +02:00
jean-pierre charras a41ff7b924 pl_editor: fix move functions for WS_DRAW_ITEM_POLYPOLYGONS 2019-06-13 14:02:18 +02:00
jean-pierre charras b9eb627bc3 Remove a trace used for debug. 2019-06-13 13:35:28 +02:00
jean-pierre charras f135ec47fa Page layout: rework and fix a few issues.
* rename WS_DRAW_ITEM_POLYGON to WS_DRAW_ITEM_POLYPOLYGONS (better name)
* use SHAPE_POLY_SET instead of std::vector(<wxPoint> to manage the set of polygons.
It also remove duplicate code related to HitTest and bounding box.
* fix HitTest and WS_DRAW_ITEM_POLYGON highlight.
2019-06-13 13:23:39 +02:00
Seth Hillbrand e52afd93a3 Remove Legacy options for overlay/context
These options were used to support the legacy canvas when drawing on
MacOS and GTK3.  With the move to 100% GAL, they are extraneous.  This
moves all DC over to "COPY" as we only use this for printing support in
Eeschema at the moment, so there is a single draw command (no erasing)
for the canvas.
2019-06-12 06:01:03 -07:00
Jeff Young 36f09cb29b Allow Kicad Manager frame to particapate in Preferences architecture. 2019-06-12 13:44:16 +01:00
Jeff Young 97d2800f16 Update hotkey maps when the hotkeys are edited.
Also removes some legacy code dealing with conflicts.
Also disambiguates zoom in/out commands for hotkey list.
2019-06-12 12:43:12 +01:00
Jeff Young 2d29f76c49 Fix incorrect control-key map for hotkeys.
Fixes: lp:1832431
* https://bugs.launchpad.net/kicad/+bug/1832431
2019-06-12 10:08:23 +01:00
Seth Hillbrand 06d2170501 Fix default User Template location
When we assign a string to the wxFilename, it takes the last section as
the filename (unless there is a trailing '/').  So on Linux, we got
/home/user for the Documents dir and /home/ was the directory while
'user' was the filename.  Appending directories 'kicad/templates' made
the final directory '/home/kicad/templates'.  Forcing this to be a
directory restores correct behavior.

(cherry picked from commit 0ee38653f7)
2019-06-11 17:11:27 -07:00
Jeff Young 7726b039b2 Re-jigger standard submenus so they both link AND work. 2019-06-11 18:03:16 +01:00
John Beard 9625cea57f Fix hotkey debug spew
Two issues:

* Unassigned hotkeys were being passed to WX in the menu strings as
  "<unassigned>". WX doesn't recognise this, and prints debug each time.
  Unassigned hotkeys are no longer rare or naughty, so we shouldn't provoke
  debug spew. Suppress by not appending hotkey strings for actions with 0
  (i.e. unassigned) hotkey IDs.
* The zone cutout tool uses GR_KB_SHIFT, not MD_SHIFT. This causes
  "unknown hotkey" spew from WX.
2019-06-11 14:40:57 +01:00
Jeff Young b9e07f2a70 Attempt to fix un-resolved sub-menus.
While I'm pretty sure this will work, the issues don't appear on OSX
so I can't be positive.

Fixes: lp:1832049
* https://bugs.launchpad.net/kicad/+bug/1832049
2019-06-11 10:04:21 +01:00
Jeff Young a91934c7b3 Don't update toolbars on mouse-move events.
It produces cursor-lag in some instances, and none of our state changes
currently rely on mouse position.

Fixes: lp:1831541
* https://bugs.launchpad.net/kicad/+bug/1831541
2019-06-11 09:52:01 +01:00
Jeff Young 9f427da56f Use the ACTION_ID offset when updating the layer pair bitmap. 2019-06-11 09:13:56 +01:00
Jeff Young a3f3fb39de Convert 3DViewer to new hotkey architecture. 2019-06-10 23:46:01 +01:00
Jeff Young aeadc768f6 Add import of hotkeys and fix bugs in reanding and writing hotkeys. 2019-06-10 23:46:01 +01:00
Jeff Young b0e8443383 Sync-ing of menu has been done in CONDITIONAL_MENU for some time now. 2019-06-10 23:46:01 +01:00
Jeff Young 620395608c Move Kicad Manager launch bar to ACTIONs.
Also fixes a bug where hotkeys weren't getting put in menus.
2019-06-10 23:46:01 +01:00
Jeff Young a568e70b99 Follow naming conventions. 2019-06-10 23:46:01 +01:00
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
Jeff Young c13ef839c1 Tool framework for Kicad Manager frame. 2019-06-10 23:46:00 +01:00
Jeff Young 16cb1e731d Finish moving TOOL_MANAGER down to the EDA_BASE_FRAME level. 2019-06-10 23:46:00 +01:00
Jeff Young c3cc85eb1c A little bit of cleanup. 2019-06-10 23:46:00 +01:00
Jeff Young 6025256e07 Push KIWAY_HOLDER down a level so we can move a bunch of stuff that doesn't belong there out. 2019-06-10 23:46:00 +01:00
Jeff Young d323fb57a7 Give KIWAY_HOLDER its own header file. 2019-06-10 23:46:00 +01:00
Jeff Young e606587ff6 Move remaining Symbol Tree ctx menu cmds to ACTIONS.
Also moves the various Player instantiators down into COMMON_TOOLS
for better sharing.
2019-06-10 23:46:00 +01:00
John Beard 7ebda0247f Common: Remove legacy_gal library, fold into common
Return the EDA_DRAW_FRAME class back to common, whence it came (before it was
duplicated into legacy_wx and legacy_gal). Now there is only one
implementation (the GAL one), it doesn't need to be in a separate library.

This simplifies the dependencies for common lib users.
2019-06-10 18:56:57 +01:00
jean-pierre charras 074ebe0e2b Pl_editor: fix missing switch to "C" locale when saving selected items in clipboard.
It was only noticeable in countries using a comma as floating point separator.

Fixes: lp:1832211
https://bugs.launchpad.net/kicad/+bug/1832211
2019-06-10 11:55:52 +02:00
Seth Hillbrand 4a52062a54 GAL: Make high-contrast meld into background
This mixes the de-emphasized layers into the background color rather
than merely a black color.  This also keeps some of the original layer
color.

Fixes: lp:1831316
* https://bugs.launchpad.net/kicad/+bug/1831316
2019-06-09 08:16:58 -07:00
jean-pierre charras 63eb552e0a Fix issue in cairo_gal when drawing a 360 deg arc (in fact a circle).
It was due to a angle normalization between -360 and 360 degrees.
So, in arcs, if the start angle and end angle diff is n*360 deg,
this normalization gives start angle = end angle.
The fix forces end angle = start angle+360deg in this case.

Fixes: lp:1832096
https://bugs.launchpad.net/kicad/+bug/1832096
2019-06-09 11:06:00 +02:00
Seth Hillbrand 1a3b129d1e pcbnew: Don't reset triangular points for intersection
We prevent the creation of invalid polygons by keeping the converging
lines from intersecting.  This test doesn't make sense for triangular
polygons as they always intersect and we want to allow them to move
outside of the singular point.

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

(cherry picked from commit 966173c129)
2019-06-07 21:35:29 -07:00
jean-pierre charras dfbe02c8c2 pl_editor: show the page limits and the coord reference corner position. 2019-06-07 12:42:28 +02:00
jean-pierre charras ce9b1e3da5 Pl_editor: add missing HitTest() for WS_DRAW_ITEM_BITMAP item. 2019-06-06 11:13:10 +02:00
Jon Evans 27a5ed1a9f Mathplot: properly set foreground color when saving screenshots
Fixes: lp:1810914
* https://bugs.launchpad.net/kicad/+bug/1810914
2019-06-05 22:43:50 -04:00
Seth Hillbrand c6af38477d CMake: Handle custom_target indirection
Building custom targets that depend on custom commands such as our
keyword lexer requires two layers of indirection to pick up changes
properly and not overwrite the same file in parallel builds.

Fixes: lp:1831643
* https://bugs.launchpad.net/kicad/+bug/1831643
2019-06-05 13:05:43 -07:00
Jeff Young 2d40425e4d Move footprint & symbol tree context menus to tool infrastructure.
Fixes: lp:1831692
* https://bugs.launchpad.net/kicad/+bug/1831692
2019-06-05 20:16:48 +01:00
jean-pierre charras 6f8a0a4eed pcbnew: Fix launching of action plugins from an action menu
The action menu handler was capturing too many menuitem events.
Only context menuitem highlight events and some popup menu events need to be captured
Any id < 0 (like automatically assigned menuitem id) is no longer captured.

Fixes: lp:1831669
https://bugs.launchpad.net/kicad/+bug/1831669
2019-06-05 11:14:31 +02:00
Jeff Young 1ea5b04e22 More ACTIONS work. Nearly done now. 2019-06-04 22:31:42 +01:00
jean-pierre charras eb1faebf1f Pcbnew: prepare the new zone filling algo (filled polygons with no thickness). Work in progress. 2019-06-04 21:24:24 +02:00
Jeff Young 568c8c336b Move DRC control to a tool; move assorted commands to ACTIONS. 2019-06-03 21:08:30 +01:00
Jeff Young 9f1e2e34b7 Move some dupicated tools to common tools. 2019-06-03 21:08:30 +01:00
Jeff Young e517199794 Move ConfigurePaths and LibTable management to common ACTIONs. 2019-06-03 21:08:30 +01:00
Seth Hillbrand 1f30d0c803 pcbnew: remove the last dlist components from pcbnew 2019-06-02 20:06:11 -07:00
Jeff Young 33773bad4d Yet more command conversions to ACTIONs. 2019-06-02 21:10:56 +01:00
Jeff Young 6ac273264d Move Show3DViewer to common action. 2019-06-02 16:21:44 +01:00
Jon Evans 374a3feb3e Fix message panel update 2019-06-02 11:20:28 -04:00
Jeff Young 45a9544726 Instantate a default menu from no selection when menu is first built.
This might resolve some of the GTK menu anomalies.
2019-06-02 12:58:08 +01:00
jean-pierre charras b7f4113f96 Some minor fixes to prepare the new zone filling algo (no filled polygon thickness) 2019-06-02 11:51:47 +02:00
Seth Hillbrand 6a45446496 pcbnew: Remove the last dlist from modules/pcbnew 2019-06-01 20:55:32 -07:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Jeff Young 3e655801b5 Fix bug in selecting grid size in Pcbnew.
Fixes: lp:1831337
* https://bugs.launchpad.net/kicad/+bug/1831337
2019-06-01 23:03:24 +01:00
Jeff Young 7f1ed30ff5 Move DeMorgan handling to ACTIONs. 2019-06-01 23:03:24 +01:00
Seth Hillbrand 888c01d11b pcbnew: Move tracks to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand 961b22d603 pcbnew: Changing drawings from dlist to std::deque 2019-06-01 09:51:57 -07:00
Jeff Young 296ec66796 Cosmetic cleanup in preference panels. 2019-06-01 16:29:12 +01:00
Jeff Young 74e10791ff Fix some Mac-specific issues with the Preferences... menu item. 2019-06-01 16:29:12 +01:00
Jeff Young f67df4bf11 Collapse ARRAY_CREATOR into single class now that legacy instance is gone.
Also removes AllowLegacyCanvas ADVANCED_CONFIG option.
2019-06-01 16:29:12 +01:00
Jon Evans b578f8b362 Fix infinite loop in grid initialization, Cairo edition 2019-05-31 20:51:23 -04:00
Jeff Young 7553cc2651 Clean up some dangling legacy odds and ends. 2019-06-01 01:17:46 +01:00
Jeff Young c71c1d4d1a Prevent infinite loop when grid size not defined. 2019-06-01 00:17:04 +01:00
Jeff Young ed9153a786 Fix assert launching PCBNew. 2019-06-01 00:06:25 +01:00
Jeff Young c2662b0e11 Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. 2019-05-31 21:55:30 +01:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jeff Young 03bab2f4a9 Remove some more legacy drawing stuff. 2019-05-31 21:54:22 +01:00
Jeff Young d2daab808c Remove some legacy cursor handling stuff. 2019-05-31 21:54:22 +01:00
Jeff Young edc8438ef0 Start the process of removing the legacy draw panel. 2019-05-31 21:54:21 +01:00
jean-pierre charras 4842c73530 Fix minor compil warnings. 2019-05-31 21:38:30 +02:00
Jon Evans 9094a17795 Zoom to fit: only consider worksheet if there are no other items 2019-05-29 21:27:59 -04:00
Seth Hillbrand 87d997704f Enable cairo switch
Hooks up the action to the event.

Fixes: lp:1830976
* https://bugs.launchpad.net/kicad/+bug/1830976
2019-05-29 15:21:21 -07:00
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