Commit Graph

878 Commits

Author SHA1 Message Date
Roberto Fernandez Bautista 5822cd85c4 Fix eeschema copy/paste: save and load sheet and symbol instances
Save sheet and symbol instance information to the clipboard on copy

Load sheet and symbol instance information from the clipboard on paste
and renumber page numbers after loading.

Correctly handle pasting in a multiple hierarchy by ensuring symbol and
sheet instances are updated for all instances of the destination sheet.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8207
2021-05-03 19:38:31 +01:00
jean-pierre charras 0427bda768 Remove useless wx/wx.h include, that create sometimes compil warnings on msys.
wx/wx.h includes all wxWidgets .h files, and sometimes creates collision
names in #define between kicad and windows headers
Moreover, blindly including a lot of useless files is compil time consuming
2021-05-01 19:32:15 +02:00
Jeff Young 1ed54d2314 Make sure find/replace respects different values in the hierarchy.
Fixes https://gitlab.com/kicad/code/kicad/issues/8328
2021-04-30 18:39:21 +01:00
Roberto Fernandez Bautista 9b35757e18 Refactor AppendSymbol and AppendMultiUnitSymbol 2021-04-30 11:03:21 +00:00
Roberto Fernandez Bautista 0c91bea751 Fix eeschema reannotation: ensure no duplicate references are created
Also implements reannotation of a selection

ADDED: Ability to reannotate a selection in eeschema

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2209
2021-04-30 11:03:21 +00:00
Wayne Stambaugh 54e18f6b1f Pcbnew: remove update schematic option for geographical annotation dialog.
REMOVED: Update schematic option from geographical annotation dialog due
to potential issues with incomplete and/or broken updates.  Use "Update
Schematic from PCB" tool to update reference designation changes.

Forcing the footprint reference designator changes back to the schematic
without checking any other board changes in the schematic could leave the
schematic in a undefined state.  The update schematic from board tool is
the correct method to sync any changes from the board.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8042
2021-04-22 12:45:59 -04:00
Jeff Young 620aa315f6 Show infobar error when asking for empty datasheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/8260
2021-04-21 15:40:59 +01:00
Jon Evans afe0c79a1e Sheet pins need new UUIDs, too 2021-04-18 22:14:15 -04:00
Jon Evans 1e52f0a180 Make sure pasted symbols get new pin UUIDs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8218
2021-04-18 21:53:38 -04:00
jean-pierre charras 15353e3c33 Eeschema: when placing a new symbol or image, avoid starting the autopan.
When activate the new symbol placement, the mouse cursor is outside the canvas.
Therefore a autopan was started and not so easy to stop.
Now the mouse cursor (and the graphic cursor) are moved to a better location inside the canvas.
Fixes #8156
https://gitlab.com/kicad/code/kicad/issues/8156
2021-04-11 18:01:25 +02:00
Jeff Young cc956695ae Hit test for worksheet before adding Properties to menu.
Fixes https://gitlab.com/kicad/code/kicad/issues/8171
2021-04-11 14:18:35 +01:00
Jeff Young 21d4197eab Apply SPECIAL_CASE_LABEL_INFO architecture to one-ended-drag.
We've been doing this for some time to wires that are attached to
the moving block (and therefore have the other end anchored).  However
we also need to apply it when dragging a single end of a wire.

Fixes https://gitlab.com/kicad/code/kicad/issues/7807
2021-04-07 14:40:07 +01:00
Jeff Young 30a073c2bb Cleanup. 2021-04-07 14:40:07 +01:00
Jeff Young 895f3de455 Formatting. 2021-04-07 14:40:07 +01:00
Wayne Stambaugh 2b86b34124 Eeschema: split out SCH_SHEET_PIN declarations into separate header. 2021-04-06 17:15:49 -04:00
Roberto Fernandez Bautista 7d9ee76f64 Don't iterate through m_selection if deleting items from it
Use the copied container saved_selection instead

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8126
2021-04-05 18:40:40 +00:00
Ian McInerney e08387ce3d Make the GAL responsible for the native cursor management
The native cursor must be set on the GAL canvas wx object,
not its frame (otherwise on GTK the cursor is only set
when we get a request for it from the WM and not immediately).

Fixes https://gitlab.com/kicad/code/kicad/issues/6421
2021-04-05 02:36:12 +01:00
Jeff Young 329577cc5c Add new text items/labels to the selection so rotate/mirror/etc. work.
Also clears the selection after finding the sheet in the sheet pin
case so that the sheet itself doesn't get rotated/mirrored/etc.

Fixes https://gitlab.com/kicad/code/kicad/issues/8108
2021-04-03 19:41:24 +01:00
Jeff Young 32e8a17cc0 Fix nullptr error.
Fixes https://gitlab.com/kicad/code/kicad/issues/8102
2021-04-03 11:15:11 +01:00
Ian McInerney bb95761642 Remove unused variable
item is already an SCH_ITEM, so the static cast is pointless.
2021-04-02 19:26:22 +01:00
Jeff Young c7d689a022 Show field children when creating new labels.
And in particular, show reasonable intersheet reference facsimiles.
2021-04-02 15:15:07 +01:00
Ian McInerney 0a0935e0f3 Remove ACTIONS::TranslateLegacyId and TOOL_DISPATCHER::DispatchWxCommand
After commit 9535153f9e there were no more IDs inside the legacy ID
system. Therefore the entire system for dispatching and looking up
the legacy ideas and handling those events can now be removed and
the tool dispatcher simplified (it no longer needs to know about
the ACTIONS class).
2021-03-30 23:20:22 +00:00
Jeff Young f2e68e68d0 Add "Hide Tree" context menu options when tree has no selection.
Also cleans up some other code to be more consistent between symbol
editor and footprint editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/8052
2021-03-29 12:02:00 +01:00
Jeff Young 14e73d24dc Naming conventions. 2021-03-29 11:46:05 +01:00
Jeff Young 455e7dc3a8 Reorder for better readability and consistency. 2021-03-29 11:04:06 +01:00
Jeff Young 1b163c5dd3 Don't eat delete event when there's no item being drawn.
Fixes https://gitlab.com/kicad/code/kicad/issues/8061
2021-03-29 10:59:45 +01:00
Jeff Young 0561ce903e Don't remove IS_MOVED flag too early.
Fixes https://gitlab.com/kicad/code/kicad/issues/8056
2021-03-28 20:05:41 +01:00
Jeff Young c32932a311 Naming conventions. 2021-03-28 20:05:41 +01:00
Ian McInerney 42c6af4bd8 Cleanup ACTION_MENU creation in some places
The ACTION_MENU constructor now takes the tool as an argument,
so the call to SetTool() immediately following it can be removed
and the tool just passed into the constructor.
2021-03-27 19:16:58 +00:00
jean-pierre charras bbd7b4ca8c Eeschema, selection tool: uniformize the cursor shape and the actual modifiers.
SHIFT, CTRL, ALT modifier keys were handled in 2 different codes, one for
the selection tool and another to modify the mouse cursor shape, with 2
different configs.
Now the modifiers are managed from only one function.
Pcbnew: group also SHIFT, CTRL, ALT modifier keys management to a specific function.
Fixes #8021
https://gitlab.com/kicad/code/kicad/issues/8021
2021-03-25 10:28:20 +01:00
Wayne Stambaugh b37b7d53b4 Fix geographic annotation bug when back annotating to schematic.
For some reason, the footprint UUID was being prefixed to the sheet path
which caused the symbol look up by sheet path to fail.  An option was
added to not do this when the geographical back annotation to the schematic
is performed.
2021-03-24 09:57:36 -04:00
Roberto Fernandez Bautista be51be22a7 Update Page Number when Duplicating or Pasting sheets
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7872

Also, update hierarchy before renaming pasted sheets
Avoids duplicate sheet names when pasting multiple sheets
2021-03-23 02:48:07 +00:00
Jeff Young cf4cbea8a1 Use a more robust storage of items added to drag.
We kept having various issues of the pointer list going stale.  This
will prevent all permutations of that.

Also while I was in there I fixed the double-move thing (see bug
number).

Fixes https://gitlab.com/kicad/code/kicad/issues/7910
2021-03-22 13:51:10 +00:00
Jon Evans c5c348538e Fix some STL asserts in EE_SELECTION_TOOL 2021-03-21 22:01:45 -04:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Jeff Young f0e6f812ff Edit One Field improvements.
1) Accept <enter> as OK if the multiline textbox isn't shown.
2) Focus and select all in first control if multiline textbox isn't shown.
3) Make title be title caps ("Edit Sheet name Field" looked dorky).

Fixes https://gitlab.com/kicad/code/kicad/issues/7940
2021-03-20 00:41:09 +00:00
Jeff Young 2e129d9b47 Naming conventions and other cleanup. 2021-03-19 23:06:19 +00:00
Jon Evans 4b46c0c954 Make sure nested settings get released in dtor
Also fix a crash if sim window can't be created because
ngspice shared library could not be found

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7969
2021-03-19 19:04:27 -04:00
Jeff Young e206a9d39a Naming conventions. 2021-03-18 12:28:24 +00:00
Jeff Young cc70a9fa98 New components must be added to the screen.
Fixes https://gitlab.com/kicad/code/kicad/issues/7952
2021-03-18 12:28:24 +00:00
Jeff Young 35d17929ff Add specific warning for no symbol library selected.
Fixes https://gitlab.com/kicad/code/kicad/issues/7954
2021-03-18 12:28:24 +00:00
Jeff Young 7e682e9948 Don't allow pins on corners.
Fixes https://gitlab.com/kicad/code/kicad/issues/7917
2021-03-16 22:03:08 +00:00
Jeff Young 30fdba4cbb Finish grid-snapping impl. 2021-03-16 22:03:08 +00:00
Mikolaj Wielgus ee4bc8b1d0 Fix default line width for symbol editor graphic items, add validation
There was a mils to iu conversion missing for line width (the default
values are in mils).

Fixes https://gitlab.com/kicad/code/kicad/issues/7813
2021-03-16 13:50:41 +00:00
Jeff Young 2bafc1af00 Give up on using preview layer for PlaceComponent.
1) Cloning the component fails to select all its pins.
2) Something about the layer compositing causes light selection shadows
to get even lighter.  The default pretty much disappears.

Fixes https://gitlab.com/kicad/code/kicad/issues/7908
2021-03-15 19:04:59 +00:00
Jeff Young 573dd36515 Handle <delete> in move and drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/7924
2021-03-15 14:23:54 +00:00
Jeff Young afab60ae06 Fixes for autoplace fields.
1) Don't factor in pin names when computing symbol body boundingbox.
2) Grid-snap only in the axis corresponding to the layout side.
3) We only need interline spacing *between* lines, not for each line.
4) Also cleans up the unit checking logic as the unit can't be more
than 0 unless it's a multi-unit symbol.

Fixes https://gitlab.com/kicad/code/kicad/issues/7907
2021-03-15 02:23:29 +00:00
Jeff Young 7415bf0c62 Don't hide (or disable) options if it's not obvious why.
It deprives us of the opportunity to inform the user what the conditions
are.
2021-03-15 02:23:29 +00:00
Jeff Young e34734c230 Make sure pasted sheet instances get added.
Fixes https://gitlab.com/kicad/code/kicad/issues/7872
2021-03-13 16:34:30 +00:00
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.

Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz

The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.

Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.

Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
2021-03-11 08:37:35 -05:00