Commit Graph

116 Commits

Author SHA1 Message Date
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
Jeff Young 102b530162 Fix library tree updating bug present at least on OSX. 2019-11-29 17:55:01 +00:00
Seth Hillbrand 548dbb7c29 eeschema: Add highlight color to configurable list
The highlight color chosen from the system highlight doesn't always show
against the schematic sheet background color.  Allowing the user to
customize with their KiCad theme makes it configurable on par with other
colors.  This is stop-gap until we get full color schemes from
lp:1678345
2019-08-27 10:43:59 -07: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 469fc3b572 Finish moving symbol editor tree context menu to ACTIONs. 2019-06-05 23:29:59 +01: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
Jeff Young da4fe27447 More ACTIONS work. 2019-06-02 21:10:56 +01:00
Jeff Young 33773bad4d Yet more command conversions to ACTIONs. 2019-06-02 21:10:56 +01:00
John Beard 33fe9a2761 Eeschema: Symbol preview widget needs common config for Hi-DPI
Currently, this widget doesn't read the common library settings.
This means it doesn't use the configured DPI scaling or anti-aliasing
settings.

Use the ReadConfig method on the GAL options to fix (rather than
only ReadAppConfig).

Fixes: lp:1825913
* https://bugs.launchpad.net/kicad/+bug/1825913
2019-04-27 14:57:09 +01:00
John Beard ab2281d26f GAL opts: move config reading into GAL_DISPLAY_OPTIONS
Move repeated GAL config reading routines into GAL_DISPLAY_OPTIONS.
THe app-level config is in here already, do the same for the
common config.

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

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

Fixes: lp:1824524
* https://bugs.launchpad.net/kicad/+bug/1824524
2019-04-12 16:08:11 +01:00
jean-pierre charras 4cd41e3941 Eeschema: avoid using a incorrect background color the first time a SCH_DRAW_PANEL is displayed
When starting Eeschema, or a frame/dialog using a SCH_DRAW_PANEL, the bg color was initialized too late,
thus creating a flicker or an annoying draw artifact (in SYMBOL_PREVIEW_WIDGET for instance) if a Paint event
is fired before the right bg color is initialized.
Initializing the bg color earlier fix this issue.

Fixes: lp:1797203
https://bugs.launchpad.net/kicad/+bug/1797203
2019-01-25 20:32:46 +01:00
Maciej Suminski 24f9bfa13b Fixed memory leaks
This is commit a9efbf47 with a fix for SWIG to deal with unique_ptr.
2018-12-20 10:05:58 +01:00
Seth Hillbrand e307d9318b Revert "Fixed memory leaks"
This reverts commit a9efbf4716.

The commit broke compiles with scripting
2018-12-11 10:12:44 -08:00
Maciej Suminski a9efbf4716 Fixed memory leaks 2018-12-11 16:21:43 +01:00
Jeff Young d2756bedf1 Keep state except when the filter changed.
(Used to be "except when filtering".)

Fixes: lp:1804293
* https://bugs.launchpad.net/kicad/+bug/1804293
2018-11-25 01:51:45 +00:00
jean-pierre charras 0a71212929 Fix a few minor issues in SYMBOL_PREVIEW_WIDGET.
Fixes: lp:1802808
https://bugs.launchpad.net/kicad/+bug/1802808
2018-11-12 20:40:41 +01:00
Jeff Young 69952a7b9f Improve updating of symbol and footprint trees.
In particular, update highlighting when changing footprints.
2018-11-02 19:55:30 +00:00
jean-pierre charras 7985234556 Eeschema: Fix a subtle bug in SYMBOL_PREVIEW_WIDGET.
The dialog was using a LIB_ALIAS from library cache to show the symbol to the canvas without making a local copy.
Unfortunately, the library viewer is doing the same thing.

Now the GAL is used in Eeschema, a link to the VIEW used by the GAL canvas is stored in this class.
When The selector symbol dialog is used to choose a symbol to display in the Library viewer,
a race condition between the Library viewer GAL canvas and the dtor dialog that destroyed this link in the same instancied class.

Now, the SYMBOL_PREVIEW_WIDGET used in the dialog works on a local copy of the symbol to display.
2018-10-31 15:52:35 +01:00
Jeff Young 924c0fa9ed Fetch symbol chooser grid settings from the right place. 2018-10-17 11:14:01 +01:00
Jeff Young 06e63c3073 Add control over worksheet colour in eeschema. 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 929786ce50 Fixes to grid color and some more CLangTidy fixes. 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 e45e3b3640 Fix bug with Preferences turning hidden items to black. 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 1c52824913 Rewrite unit/convert handling so it also works for LibEdit. 2018-10-09 11:08:55 +01:00
Jeff Young 6eafb9a2fd Convert Rescue Symbols dialog previews to GAL. 2018-10-09 11:08:55 +01:00
Jeff Young 538a5d49ee Fix up GAL version of Symbol Viewer.
Also includes some preliminary work for supporting hidden pins,
pin electrical names, and other preferences.
2018-10-09 11:08:55 +01:00
Jeff Young da4fb4ae3a Move galDisplayOptions access from pcbnew to common. 2018-10-09 11:08:55 +01:00
Jeff Young a03dc577f8 Add support for units. 2018-10-09 11:08:55 +01:00
Jeff Young 7cbfa08ddd Move symbol chooser dialog preview to GAL. 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski d8b9899516 eeschema-gal: configurable worksheet & grid colors 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski 90c7c60471 eeschema-gal: initial GALified version. Lots of stuff still to do! 2018-10-09 11:08:52 +01:00
Jeff Young c9ca1013b2 Make ModEdit and LibEdit library tree actions more consistent.
Adds Cut/Copy/Paste and Revert for footprints; introduces a new
shared Revert Changes? dialog; hooks up Add Library for footprints,
standardizes the Save As terminology.
2018-10-03 22:46:41 +01:00
Jeff Young 5974899fa5 Clean up file locations and names. 2018-09-22 16:23:13 +01:00
Jeff Young 270f81f03d Make fill colour terminology more consistent.
Fixes: lp:1789855
* https://bugs.launchpad.net/kicad/+bug/1789855
2018-09-01 14:05:16 +01:00
Jeff Young 12213d994a Re-instate LibEdit cut/copy/paste of symbols.
Fixes: lp:1788975
* https://bugs.launchpad.net/kicad/+bug/1788975
2018-08-29 21:53:59 +01:00
Jeff Young 97f7bd4cb9 Push component tree down into common.
Precondition to reusing component tree for footprints.
2018-08-01 09:35:45 +01:00
jean-pierre charras 3e5cd86288 Fix a few wxWidgets minor asserts. Fix a compil warning 2018-07-28 10:31:04 +02:00
Jeff Young 4dfae16c1b Consolidate to single menu actions for save, revert, etc.
There's no point in having both Save Symbol and Save Library when
only one can be selected at a time.

Also cleans up a bunch of extraneous icons, and fixes a few
copy/paste errors in menus and toolbars.
2018-07-27 14:58:19 +01:00
Jeff Young b5634b1d08 Dialog spacing cleanup. 2018-07-26 15:43:53 +01:00
Jeff Young 822ebf6955 Move symbol management to a standard Save As... model.
Also brings horizontal toolbar in line with Pcbnew and Eeschema.
And updates the EDA_LIST_DIALOG to current practices.

This finishes the removal of the active library concept from the
Symbol Editor (started with the new component tree in 5.0).

Fixes: lp:1740717
* https://bugs.launchpad.net/kicad/+bug/1740717
2018-07-25 14:41:20 +01:00
Jeff Young 977f27f3c4 Adjust spacing on preference panels.
Giving them the correct parent changed the spacing.

(cherry picked from commit 7f602f3)

(cherry picked from commit 718db46)
2018-07-17 15:14:25 +01:00
Jeff Young 7841f8a466 Unified preferences dialog framework.
(cherry picked from commit 8ee3e77)
2018-07-17 15:11:17 +01:00
Jeff Young 9edfd25b95 Select best-matching component when filtering.
This also fixes the old bug of scrolling to the selected best
match.

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

Fixes: lp:1744703
* https://bugs.launchpad.net/kicad/+bug/1744703
2018-06-10 23:21:05 +01:00
Jeff Young b9874da3a6 Remove background fp loading from Choose Symbol dlg.
There are a bunch of problems with event processing and closing
documents, etc., when enabled.  See the bug report for more
info.

Fixes: lp:1774777
* https://bugs.launchpad.net/kicad/+bug/1774777
2018-06-09 00:51:39 +01:00
Maciej Suminski 64e98c8e54 Fixed Symbol Library editor crash on start
Added a null pointer check missing in 51c7381f

Fixes: lp:1775414
* https://bugs.launchpad.net/kicad/+bug/1775414
2018-06-06 17:01:06 +02:00
Maciej Suminski 51c7381fd5 Fix Choose Symbol dialog freezes in eeschema
Scrollbars are always enabled to prevent an infinite event loop caused
by alternating CreateLayout() and OnSize event handler.
More details: http://trac.wxwidgets.org/ticket/18141

Fixes: lp:1767848
* https://bugs.launchpad.net/kicad/+bug/1767848
2018-06-06 09:11:15 +02:00