Commit Graph

3988 Commits

Author SHA1 Message Date
Maciej Suminski d3ea63e133 Removed a redundant parameter from BOARD_PRINTOUT constructor 2018-10-31 19:17:30 +01:00
Maciej Suminski dea778842b Grand printing dialogs refactor
Patch introduces a generic printing settings window that is customized by pcbnew and gerbview.
2018-10-31 19:17:30 +01:00
Maciej Suminski e81c3a59a2 Refactored and unified board editor and footprint editor print dialogs 2018-10-31 19:17:30 +01:00
Maciej Suminski 562b8d7948 Printing code clean-up 2018-10-31 19:17:30 +01:00
Maciej Suminski 92c5cb288e Fixed scale in Gerbview printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 8cb464b725 Handle drill mark options in pcbnew printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 3e5ee254cf Fix for 'fit to page' scaled printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 347e21daaa Handle printout settings: line width, color/mono, mirror 2018-10-31 19:17:30 +01:00
Maciej Suminski 47d0eaa2c6 GAL: changed line width setting to float type 2018-10-31 19:17:30 +01:00
Maciej Suminski 1cce194c8a Handle layer settings in printouts 2018-10-31 19:17:30 +01:00
Maciej Suminski 5b94f20e6f Adapted printout controllers to the new printing routines 2018-10-31 19:17:30 +01:00
Maciej Suminski 6c689305a6 Decouple GAL printing interface and its Cairo-based implementation 2018-10-31 19:17:30 +01:00
Maciej Suminski e36f6b476d Changed the CAIRO_GAL class hierarchy
There is a dedicated class for display (CAIRO_GAL) and another one
for printing. The common part has been moved to CAIRO_GAL_BASE.
2018-10-31 19:17:30 +01:00
Maciej Suminski 5a64343fb4 CAIRO_PRINT_CTX class
CAIRO_PRINT_CTX provides a Cairo context created from wxPrintDC.
It allows one to prepare printouts using the Cairo library and
let wxWidgets handle the rest.
2018-10-31 19:17:29 +01:00
Maciej Suminski f948e46330 VIEW: changed wxASSERTs to wxCHECKs 2018-10-31 19:17:29 +01:00
Maciej Suminski 17205b4599 Added VIEW::DataReference() for sharing data with another VIEW instance 2018-10-31 19:17:29 +01:00
Maciej Suminski 1411e1f73a GAL: added methods to modify rotation in the transformation matrix 2018-10-31 19:17:29 +01:00
Jeff Young de971df4c6 Don't put up error dialogs after a Cancel of a dialog.
Fixes: lp:1800711
* https://bugs.launchpad.net/kicad/+bug/1800711
2018-10-30 23:13:32 +00:00
Jeff Young f660ec7cf8 Eval when needed, but only replace text when killing focus.
Fixes: lp:1800718
* https://bugs.launchpad.net/kicad/+bug/1800718

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

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

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

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

Fixes lp:1797095

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

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

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

Add new trace flags for locale and screen object tracing.

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

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

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

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

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

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

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

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

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

Implement OnSelectGrid and hookup GAL canvas refresh to
SetPresetGrid.

Add Grid Settings... to View menu and move Show Grid from
preferences to View Menu to match Pcbnew.
2018-10-09 11:08:55 +01:00
Jeff Young c5330ac0bf Implement zoom for GAL canvas. 2018-10-09 11:08:55 +01:00
Jeff Young a67d8c60df Fix text size measurement.
5.0 doesn't set the GAL's line width.  It gets away with this since
it's using the same GAL to measure as to set up the drawing, so
the width happens to be set correctly for other reasons.  5.1 uses
a separate GAL and so isn't so lucky.
2018-10-09 11:08:55 +01:00
Jeff Young b002b96db6 Fix a crash when aborting a block command. 2018-10-09 11:08:55 +01:00
Jeff Young 515135579b UseGalCanvas() no longer means ToolManager() exists. 2018-10-09 11:08:55 +01:00