Commit Graph

4105 Commits

Author SHA1 Message Date
Seth Hillbrand de22148b44 Move env var substitution into GetAssociatedDocument
We always want the documents to have their variables replaced when
opening the associated file.

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

(cherry picked from commit 9bfce26ce7)
2019-03-10 10:44:23 -07:00
jean-pierre charras 26acd39129 Fix a few Coverity warnings. 2019-03-07 20:01:47 +01:00
Jeff Young 69f003ba4a Remove previous cell selection fixes in favour of slow-click hack.
wxWidgets has several bugs that result in cell editors being closed
right after they're opened.  There are two wxWidgets hacks to
partially address this: the SetInSetFocus() hack, and a slow-click
hack.  We used to try and work-around these bugs ourselves for
single-click access, but this changelist moves those over to
wxWidget's slow-click hack.

Fixes: lp:1817965
* https://bugs.launchpad.net/kicad/+bug/1817965
2019-03-04 11:09:33 +00:00
jean-pierre charras a128ffdea6 DIALOG_LIB_NEW_COMPONENT_BASE: fix minor issues.
Fixes: lp:1818471
https://bugs.launchpad.net/kicad/+bug/1818471
2019-03-04 08:27:00 +01:00
Seth Hillbrand 38be0fccb7 Symlib table: Need button handler for files
The folder button handler works will for footprint libraries but we
needed a specific class for the schematic libraries as well.

Fixes: lp:1818346
* https://bugs.launchpad.net/kicad/+bug/1818346
2019-03-02 20:05:28 -08:00
Seth Hillbrand db31b7902a libedit: Resolve path substitutions
Fixes: lp:1818220
* https://bugs.launchpad.net/kicad/+bug/1818220
2019-03-02 08:00:54 -08:00
Seth Hillbrand 84a1772e66 libedit: Control resize requests
Another GTK3 dialog with excessive resize requests.  Control the number
for re-draws based on grid size.

Fixes: lp:1818325
* https://bugs.launchpad.net/kicad/+bug/1818325
2019-03-02 05:49:18 -08:00
jean-pierre charras c2a7e5536e Eeschema: fix regression: set the max number of units per package to 64.
64 is the max number of units per package in 5.0.x

Fixes: lp:1818061
https://bugs.launchpad.net/kicad/+bug/1818061
2019-03-01 16:47:31 +01:00
Frank Severinsen 71a62bb782 Change pin on grid test in symbol editor.
The pin on grid test always used a fixed grid spacing of 25 mils.  The
change uses the current grid setting for the on grid test.  Grid sizes
below 25 mils are clamped to 25 mils to prevent issues when connecting
wires to pins in the schematic editor.

Fixes lp:1817896

https://bugs.launchpad.net/kicad/+bug/1817896
2019-02-28 09:46:57 -05:00
Seth Hillbrand 13249b723b Handle excessive resize requests
For unknown reasons, GTK3 may send resize events when editing grid
fields.  This can cause the grid editor to exit, losing the focus and
overwritting the characters at the next input.

We avoid this by filtering the size events when the size doesn't change.

Fixes: lp:1817810
* https://bugs.launchpad.net/kicad/+bug/1817810
2019-02-27 11:32:30 -08:00
Jeff Young 22229fbba4 Re-parent items being copied from the clipboard.
Their original parent might have been freed by now if they came
from a different symbol.

Fixes: lp:1815525
* https://bugs.launchpad.net/kicad/+bug/1815525
2019-02-27 19:09:45 +00:00
Jeff Young f494a24404 Resync lib_tree after editing aliases.
This also fixes an unrelated bug where the current part highlighting
would get lost after a rename.

Fixes: lp:1817639
* https://bugs.launchpad.net/kicad/+bug/1817639
2019-02-27 18:13:49 +00:00
Wayne Stambaugh 5315d1be22 Eeschema: fix an option toolbar refresh bug.
For some reason, changing languages was causing the options (left) toolbar
to get redrawn with some of the main toolbar entries.  Changing the window
size causes the toolbar to be redrawn correctly.  The normal call to
function wxWindow::Refresh() does not.

Fixes lp:1816492

https://bugs.launchpad.net/kicad/+bug/1816492
2019-02-25 13:26:14 -05:00
jean-pierre charras 8ad15b1d66 Symbol editor: fix issues related to axis not shown.
In Symbol editor, axis are always shown. However after switching the backend, axis were no longer drawn.
In Cairo engine, fix a bug preventing axis to be shown.
2019-02-24 12:56:17 +01:00
Seth Hillbrand 643d9901c7 eeschema: Refresh canvas after clearing
Forces a canvas update to change the highlighting after clearing the
selected item.

Fixes: lp:1809731
* https://bugs.launchpad.net/kicad/+bug/1809731
2019-02-23 11:07:00 -08:00
Seth Hillbrand f002382b4a eeschema: Set modifying transparency on edits
While modifying elements in eeschema/libedit, they are overdrawn on the
rest of the schematic.  This prevents alignment with existing elements
as the underlying elements are not visible.  We set a slight
transparency on elements while being modified to allow the user to view
existing elements at the same time.

Fixes: lp:1817233
* https://bugs.launchpad.net/kicad/+bug/1817233
2019-02-23 08:19:50 -08:00
John Beard 82734e7116 Adjust tab ordering in some dialogs
Introduce a shortcut method to set tab ordering and use it in
the dialogs that override the tab traversal orders:

* Eeschema sheet properties
* Pcbnew Move exact
* Pcbnew Move relative

Also set some initial focus fields in the same dialogs.

Tidy a few includes.

Fixes: lp:1816009
* https://bugs.launchpad.net/kicad/+bug/1816009
2019-02-23 14:49:38 +00:00
John Beard 29c8f92c27 Eeschema: move EDIT_COMPONENT_IN_SCHEMATIC to own header
Move the class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC to its own
header, and move the SCH_EDIT_FRAME::EditComponent out of the
dialog implementation file. Thus, users of the dialog are
coupled only by the dialog header, as usual.

Also tidy some includes and comments.
2019-02-21 10:04:29 +00:00
John Beard 75406e2742 Libedit: Fix cancel button in symbol edit dialog
In DIALOG_EDIT_COMPONENT_IN_SCHEMATIC, the Cancel button is
connected to a dedicated handler to deal with the footprint
browser widget. DIALOG_EDIT_COMPONENT_IN_LIBRARY should have
the same logic.

Fixes: lp:1816636
* https://bugs.launchpad.net/kicad/+bug/1816636
2019-02-20 23:00:22 +00:00
Seth Hillbrand f40dfa2765 eeschema: Refresh canvas when the options change
Windows doesn't appear to properly re-paint after an options change.
This forces the repaint when setting options

Fixes: lp:1816506
* https://bugs.launchpad.net/kicad/+bug/1816506
2019-02-19 17:04:51 -08:00
Seth Hillbrand b4c0af021e eeschema: Handle Windows click ordering
Click to add/edit footprint filters under MSW requires handling the
listbox double click first before the item is handled.

Fixes: lp:1816182
* https://bugs.launchpad.net/kicad/+bug/1816182
2019-02-19 12:51:40 -08:00
Seth Hillbrand d1c9dd67ac eeschema: Clean up last RefreshRect
Unimplemented call in GAL canvas.
2019-02-19 10:52:38 -08:00
Tomasz Włostowski 9a8afdf6fd eeschema: SCH_PAINTER should draw LIB_BEZIERs too! 2019-02-19 10:42:23 +01:00
Seth Hillbrand ef60e523a1 libedit: Fix missing canvas selection
Analogous to fp editor, libedit needs the ability to switch between
fallback and accelerated while running.
2019-02-18 18:26:03 -08:00
Jeff Young 23aa838a03 Mark block for AppendUndo when a command is executed.
This (aside from getting both parts into a single undo stack item)
will ensure that we clean up both parts on an abort.

Fixes: lp:1816284
* https://bugs.launchpad.net/kicad/+bug/1816284
2019-02-17 10:38:06 +00:00
Jeff Young d751fecd8a Tooltip and error message improvements. 2019-02-17 10:20:29 +00:00
Tomasz Włostowski bbee30671a gal: pixel alignment hacks, works for Retina display too now.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL

Cleanup of pixel alignment patches

gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends

GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing

Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use).  Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.

gal: further cleanup
gal: removed unused shader parameter
2019-02-16 20:03:13 +01:00
Seth Hillbrand 813578eba6 Fix a few coverity errors 2019-02-15 20:15:04 -08:00
Seth Hillbrand bf814b25da eeschema: Update pin cache after conversion
Pin caches need to be updated when the unit is converted as the pin
location may have changed in conversion.

Fixes: lp:1816207
* https://bugs.launchpad.net/kicad/+bug/1816207
2019-02-15 18:30:45 -08:00
Seth Hillbrand 6de8997624 libedit: Connect click actions to add/edit
Connects standard add/edit actions to mouse events in the footprint
filter listbox

Fixes: lp:1816182
* https://bugs.launchpad.net/kicad/+bug/1816182
2019-02-15 16:52:28 -08:00
Seth Hillbrand c37aac56e6 libedit: Set initial pin properties when editing
This allows the invisible pins to be drawn as grey

Fixes: lp:1816178
* https://bugs.launchpad.net/kicad/+bug/1816178
2019-02-15 16:00:39 -08:00
jean-pierre charras 24185f45f2 Symbol editor: fix bug: Italic style ignored when drawing fields.
Fixes: lp:1815997
https://bugs.launchpad.net/kicad/+bug/1815997
2019-02-15 15:56:41 +01:00
jean-pierre charras e6a200b09e Pcbnew: avoid integer overflow when displaying local coordinates.
Minor cleanup in code.
2019-02-14 10:57:22 +01:00
Seth Hillbrand a246d905fb libedit: Add appropriate view menu subitems
This synchronizes the view menu options in libedit with the options in
eeschema.

Fixes: lp:1815789
* https://bugs.launchpad.net/kicad/+bug/1815789
2019-02-13 10:27:23 -08:00
Seth Hillbrand 3524bed75a libtree: Remember pane width
Stores the library pane width in settings to keep user preferences
2019-02-12 10:06:36 -08:00
Seth Hillbrand ea84020b1f eeschema: Recache bitmaps when changing
Clearing the cache removes all items from screen until the cache is
refreshed.  Instead, we wanted to re-cache the items to take into
account the bitmap changes.

Fixes: lp:1815443
* https://bugs.launchpad.net/kicad/+bug/1815443
2019-02-12 08:16:23 -08:00
jean-pierre charras 869bdc2b3c Eeschema: regression fix: re-enable hold down control+shift to disable grid snapping when moving the mouse.
Fixes: lp:1815487
https://bugs.launchpad.net/kicad/+bug/1815487
2019-02-12 13:12:06 +01:00
Seth Hillbrand 6a4d700dc8 eeschema: Show ERC buttons in all pages
This places the Delete markers/Run/Close buttons at the bottom of the
form rather that inside the panel.  Allows the user to access the
functions even when on a different panel.

Fixes: lp:1815102
* https://bugs.launchpad.net/kicad/+bug/1815102
2019-02-09 19:17:53 -08:00
Seth Hillbrand 191679676d eeschema: Export coupling constants to netlist
Patch suggested by Holger Vogt.  Exports text lines following the SPICE
K### <inductor1> <inductor2> format.

Fixes: lp:1815281
* https://bugs.launchpad.net/kicad/+bug/1815281
2019-02-09 18:58:33 -08:00
John Beard d06f0de1eb Libedit: transfer current screen settings on part load
When loading a part in libedit, also transfer certain screen
settings to the incoming SCH_SCREEN, from the current
SCH_SCREEN.

Currently, the grid settings are transferred, but this could
also do other settings if needed.

Also remove some duplicate commentary and mention why the
grid is set in a SCH_SCREEN even though the BASE_SCREEN ctor
sets the same default.

Fixes: lp:1815108
* https://bugs.launchpad.net/kicad/+bug/1815108
2019-02-08 22:56:05 +00:00
Seth Hillbrand 5da4e18664 bitmaps: Handle mask colors
Some transparent bitmaps use masking colors to show the binary
opaque/transparent.

Fixes: lp:1814893
* https://bugs.launchpad.net/kicad/+bug/1814893
2019-02-07 21:27:43 -08:00
Wayne Stambaugh 7789ec4bf1 Eeschema: fix highlight hierarchical pin name in properties dialog.
Fixes lp:1785840

https://bugs.launchpad.net/kicad/+bug/1785840
2019-02-07 13:03:38 -05:00
Wayne Stambaugh 6bb8fde48a Eeschema: fix broken modified flag handling. 2019-02-06 13:20:34 -05:00
Wayne Stambaugh 44cb979e91 Decouple SCH_EDIT_FRAME from symbol rescue and remap dialogs.
Do not keep pointer to SCH_EDIT_FRAME in the rescuer object to prevent
it from creating dialogs with itself as the parent when call from the
rescue dialog which is itself a grandchild of the frame window.
2019-02-05 12:43:46 -05:00
John Beard 0c6ec7dbb3 LIB_TABLE_BASE: Const and unsigned fixes
* Make LIB_TABLE_BASE::GetCount() return unsigned. This is more
  consistent with the behaviour of STL containers (especially the
  boost::ptr_vector this is really accessing). Sadly
  wxGridTableBase() forces an int, so a cast is still required
  at the WX interface.
* Make LIB_TABLE_BASE::At() return a reference. First, this is more
  consistent with normal STL indexing operator[]'s, and secondly, it
  allows an idiomatic const index method (so you can access const
  LIB_TABLE_ROWs from a const LIB_TABLE_BASE).

The motivation is to allow use of this class and LIB_TABLE_ROW
in a test program, where the LIB_TABLE_BASE is const.
2019-02-05 08:49:52 -08:00
John Beard e6a6266f3d Build: libpolygon provides its own includes
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.

As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.

This resolves a circular dependency previously detected and also
simplifies CMakeLists.
2019-02-04 19:29:31 -08:00
John Beard bb2ae8e13b Bitmaps: move bitmap defs to bitmaps library
The bitmap definitions (BITMAP_DEF and so on) do not
have any dependencies on other libs, including WX. This
means the bitmaps library can be isolated from the other
dependencies.

Common now depends on bitmaps, and libraries that depend
on common can pick it up from the common target_link_libraries,
as it is PUBLIC. This means a lot of targets no longer
need manual bitmap linkage.

This avoids a circular dependency that was previously reported
by static analysis.

Avoiding pulling in WX and other headers into the include
tree of each bitmap .cpp is a huge speed up (around 10x) in
compilation, and the generated static library is also 10x
smaller (20MB vs 200MB)

Add common as a link library to pnsrouter,connectivity.
THese library do still use common code (including bitmaps,
via base_screen.h) and this allows them to pick up the libcommon
includes correctly.
2019-02-04 19:29:31 -08:00
Jeff Young 8ca76177c0 Prevent hiding of reference column.
Using the quantity column for the collapse/expand controls feels too odd
when you expand and everything under the parent is a '1'.

Fixes: lp:1780847
* https://bugs.launchpad.net/kicad/+bug/1780847
2019-02-03 23:38:02 +00:00
jean-pierre charras 5edf3503ca Symbol Editor: Switching from a multi unit symbol to a single unit symbol do not reset the unit selection.
Thus creating issue if the unit selection is not the first unit.

Fixes: lp:1814441
https://bugs.launchpad.net/kicad/+bug/1814441
2019-02-03 15:29:41 +01:00
Seth Hillbrand c08736e245 Assign stack pointer to lib table
When creating new lib table rows, the pointer becomes managed by the new
table through the boost::ptr_vector.  The row is non-copyable, however,
so we lose the reference as soon as it goes out of scope. Creating a
clone provides a new pointer that is moved into the table on creation.

Fixes: lp:1792456
* https://bugs.launchpad.net/kicad/+bug/1792456
2019-02-03 05:20:50 +01:00