Commit Graph

221 Commits

Author SHA1 Message Date
Jeff Young 05bca282f7 Re-entrancy blocker for line/wire/bus tool.
Also clear infobar messages after a cancelInteractive.

Fixes https://gitlab.com/kicad/code/kicad/issues/11155
2022-03-17 15:27:33 +00:00
Jeff Young e68e2e973e Separate Line Properties dialog from Bus/Wire, and handle Junctions in Bus/Wire.
Fixes https://gitlab.com/kicad/code/kicad/issues/9979
2022-03-16 14:56:32 +00:00
Jeff Young 1f745b000d Special-case synthetic click after tool selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/11057
2022-03-07 20:30:50 +00:00
Seth Hillbrand faa3829ad4 Add MRU to image placement tools 2022-02-25 13:18:43 -08:00
Seth Hillbrand 24ac516135 Trim wires based on how many pins they intersect
If a wire intersects more than 2 pins from the same symbol, we don't
trim connections.  If the wire intersects exactly two pins from a single
symbol, we remove the wire between the pins.

We avoided doing this before because we didn't have a good metric for
trimming vs. not.  But the per-symbol calculation feels like the least
surprising option.

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

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

(cherry picked from commit 75a4036e45)
2022-02-19 16:54:45 -08:00
Wayne Stambaugh b36e31c49f Factor out common and remove dead legacy symbol library code. 2022-01-29 14:13:00 -05:00
Jeff Young c6a8100d46 Schematic and symbol text boxes.
Also fixes some plot bugs with arcs.

Also moves polygonization of arcs (when required) in plotting code
from 5 degrees to calculated based on ARC_HIGH_DEF.

Fixes https://gitlab.com/kicad/code/kicad/issues/5017
2022-01-28 21:38:15 +00:00
Jeff Young 3409783d9f Break sch_text.h/.cpp into sch_text and sch_label.
Also moves SCH_NETCLASS_FLAG to SCH_DIRECTIVE_LABEL, and remaps Altium
harnesses from SCH_TEXT to SCH_DIRECTIVE_LABEL.
2022-01-28 21:38:15 +00:00
Marek Roszko d1552c3fec Some more wxPoint removal 2022-01-01 12:11:21 -05:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Jeff Young 889970a449 SCH_NETCLASS_FLAGs and SCH_FIELDs for labels.
ADDED: a new label type for netclass flags.
ADDED: the ability to define fields on labels.
2021-12-24 16:13:27 +00:00
Jeff Young 2bc86fa0a8 Shapes for schematic.
ADDED arc, circle and rectangle shapes for schematic.  Shapes support
line styles and fill colors.

CHANGED sheet background color in Edit Text & Graphics Properties to
fill color (and it now affects shapes).

Pushed STROKE_PARAMS down into common and moved all shapes to using it
for stroke descriptions.
2021-12-23 20:36:07 +00:00
Wayne Stambaugh b7af66e3f9 Eeschema: fix broken page numbers when renaming a sheet file name.
Always use full sheet paths when storing sheet instances.  Partial sheet
paths cannot be full resolved resulting in lost page numbers when renaming
sheet file name.

Fixes #9782
2021-12-09 12:56:03 +00:00
Wayne Stambaugh a03e6e4926 Revert "Eeschema: fix broken page numbers when renaming a sheet file name."
This reverts commit a468a79948.
2021-12-06 07:47:18 -05:00
Wayne Stambaugh a468a79948 Eeschema: fix broken page numbers when renaming a sheet file name.
Remove duplicate instance data saved in both root SCH_SCREEN and SCH_SHEET
objects that was causing them to be out of sync.  All sheet instance data
is stored in the SCH_SHEET object itself and rebuilt on the fly so it is
always current.

Remove Get/SetPageNumber from SCH_SHEET_PATH object so it doesn't obfuscate
where the actual sheet page number information exists.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9782
2021-11-30 08:11:24 -05:00
Jeff Young 996a5b85a6 Overhaul IsJunctionNeeded logic to support all the different cases.
Several clients were using this with different needs.  The API is
now more explicit (and there are more options under the hood).

Fixes https://gitlab.com/kicad/code/kicad/issues/9518
2021-11-04 12:57:16 +00:00
Jeff Young 1fa9ad227a Repair new junction logic for crossing wires.
Fixes https://gitlab.com/kicad/code/kicad/issues/9484
2021-10-29 19:09:02 +01:00
Jeff Young fdfecf5932 Don't push view control settings to the previous active tool.
See further comments in bug report.

Fixes https://gitlab.com/kicad/code/kicad/issues/9147
2021-09-13 13:28:05 +01:00
Jeff Young fc4d748bdc Fix bugs in sheets.
1) Default_line_width is in mils, not IU.
2) Plot sheet fields.

Fixes https://gitlab.com/kicad/code/kicad/issues/8984
2021-08-17 13:21:52 +01:00
Jeff Young 6eb59b9d9e Dialog naming conventions. 2021-08-06 20:54:26 +01:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Jeff Young dd5676f4bc Implement a safer (RAII) tool re-entrancy guard.
Fixes https://gitlab.com/kicad/code/kicad/issues/8873
2021-07-27 16:37:34 +01:00
Wayne Stambaugh 78e5e98ea0 Pass VECTOR2I objects by reference instead of on the stack. 2021-07-27 08:41:27 -04:00
Wayne Stambaugh cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00
Jeff Young 0b4bb9378b Use consistent terminology.
Fixes https://gitlab.com/kicad/code/kicad/issues/8777
2021-07-12 11:59:07 +01:00
Jeff Young a1dfc36233 More error message regularization. 2021-06-29 01:08:26 +01:00
Jeff Young b72545a432 Implement more aggressive re-entrancy blocking for drawing tools.
A similar strategy was already implemented in Eeschema.

Also adds some safety around clearing of autopan and mouse capture.

Fixes https://gitlab.com/kicad/code/kicad/issues/6909
2021-06-20 11:09:55 +01:00
Jeff Young 389287e942 A bit more Part -> Symbol. 2021-06-17 22:24:41 +01:00
Wayne Stambaugh ff099453c8 Rename class_library.[h|cpp] to symbol_library.[h|cpp]. 2021-06-15 09:24:55 -04:00
Wayne Stambaugh ee3eac325d Expunge the use of the word part from Eeschema code. 2021-06-15 08:32:11 -04:00
Wayne Stambaugh 71c183d7bb Rename LIB_PART to LIB_SYMBOL. 2021-06-14 07:11:17 -04:00
Wayne Stambaugh fbc135e69f Rename SCH_COMPONENT to SCH_SYMBOL. 2021-06-10 10:34:49 -04:00
Jeff Young 0598c82972 Terminology (use present tense for flags). 2021-05-31 12:26:44 +01:00
Jeff Young 1be2c8cc40 More trouble with the IS_MOVED flag.
We moved it earlier because AddItemToScreenAndUndoList() was clearing
it, but it needs to be set for AddItemToScreenAndUndoList() too.

Fixes https://gitlab.com/kicad/code/kicad/issues/8289
2021-05-31 12:26:44 +01:00
Jeff Young 45ba067642 Update SCH_SCREENs RTree after placing new symbol.
Fixes https://gitlab.com/kicad/code/kicad/issues/8451
2021-05-25 15:10:10 +01:00
Roberto Fernandez Bautista 6b764f893a Assign a page number to all sheet instances when adding a sheet
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8208
2021-05-21 22:52:40 +01:00
Wayne Stambaugh ebd53cd45c Eeschema: fix text justification terminology.
Use justification instead of orientation relative to the anchor point when
describing text direction and alignment.  This seems to be the preferred
method by most users so hopefully this will eliminate some confusion.

Fix a bug in the s-expression schematic parser that failed to take into
account how graphical text alignment is defined for graphic text objects
compared to label text objects.

Fixes https://gitlab.com/kicad/code/kicad/issues/6489
2021-05-14 13:44:17 -04:00
Jeff Young 7356f9568d Move grid disable modifier from ALT to CTRL.
Also had to move the H/V/45 disable modifier from CTRL to SHIFT.

Fixes https://gitlab.com/kicad/code/kicad/issues/8124
2021-05-09 20:17:40 +01:00
Jeff Young f03152a548 Add some more tools to the "don't allow tool loop interruption" set.
See also b78ba12739.

Fixes https://gitlab.com/kicad/code/kicad/issues/8071
2021-05-09 17:30:32 +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
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
Wayne Stambaugh 2b86b34124 Eeschema: split out SCH_SHEET_PIN declarations into separate header. 2021-04-06 17:15:49 -04: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
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
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 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
Jon Evans 4ddb942ec0 Do not allow drag selection or drag move when already moving something
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7800
2021-03-04 19:01:31 -05:00
Jon Evans 1fc399fa31 Fix a few more cases of picking up wrong mouse positions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7745
2021-03-03 20:09:24 -05:00
Ian McInerney 908de37e7c Don't hardcode the file extensions where possible 2021-03-03 01:13:59 +00:00
Seth Hillbrand 0bab025832 Fixup toolchaining for immediate mode
The move tool can stack on others, so when we re-enter the previous tool
this caused another immediate action.  We flag re-entry in the tool
stack to check for this and avoid unexpected tool starts
2021-02-24 10:44:54 -08:00
Wayne Stambaugh 1786ae8773 Eeschema: use symbol nomenclature for object file naming. 2021-02-24 08:48:02 -05:00
Seth Hillbrand 0518d9c546 Add more force-immediate tools 2021-02-23 17:05:03 -08:00
Seth Hillbrand 005622027f Add component/footprint is always immediate
When a user clicks on the "Add Component", "Add Power" or "Add Footprint"
icon, they want to add the item.  Requiring an extra click on the screen
before selecting the component/footprint is not needed.
2021-02-23 16:15:31 -08:00
Jeff Young c0487e5c87 Don't leave the cursor position forced.
Fixes https://gitlab.com/kicad/code/kicad/issues/7665
2021-02-23 21:43:41 +00:00
Jeff Young 8755f55956 Fix copy-paste error.
Fixes https://gitlab.com/kicad/code/kicad/issues/7674
2021-02-23 17:50:11 +00:00
Jeff Young a9ea617069 Add some defensive code for double-moves.
Fixes https://gitlab.com/kicad/code/kicad/issues/7665

Fixes https://gitlab.com/kicad/code/kicad/issues/7502
2021-02-23 16:38:18 +00:00
Jeff Young 9eb2113a50 Make TwoClickPlace cursor handling match SingleClickPlace. 2021-02-23 15:28:45 +00:00
Jeff Young d7b6d4a541 Warn user when placing a junction is just going to remove it again.
Also removes a duplicate call to SaveCopyForRepeatItem (which has
already been done in AddItemToScreenAndUndoList).

Fixes https://gitlab.com/kicad/code/kicad/issues/7651
2021-02-23 12:51:15 +00:00
Jeff Young 09d3667bce Fix bone-headed mess up of two-click-place.
Original architecture was to pass KICAD_T in to specify what kind of
object you wanted.  That didn't work well with things like cursor
shape so it was moved to setting booleans based on the ACTION.  When
I cleared out the old KICAD_T stuff I missed one case where it was
still used.  That is now corrected as well.

Fixes https://gitlab.com/kicad/code/kicad/issues/7651
2021-02-22 11:54:03 +00:00
Jeff Young 18d4d517b0 Implement RMB Import Sheet Pin as a single-shot.
Fixes https://gitlab.com/kicad/code/kicad/issues/7638
2021-02-21 15:46:53 +00:00
Jeff Young 2a7e60960a Use standard mirror icons & terminology.
Also use standard group icons.

Also put both (and rotate commands) in toolbar.

Fixes https://gitlab.com/kicad/code/kicad/issues/7504
2021-02-16 21:11:36 +00:00
Seth Hillbrand ae5d2efe07 Snap common single-click tools
Fixes https://gitlab.com/kicad/code/kicad/issues/7362

Fixes https://gitlab.com/kicad/code/kicad/issues/7363
2021-01-31 15:17:24 -08:00
Jeff Young 7d6a749285 Implement a more aggressive re-entrancy check for SCH drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/7259
2021-01-27 19:51:11 +00:00
david-beinder 1598e870b6 Insert the same unit on all sheet instances when adding a symbol
Fixes https://gitlab.com/kicad/code/kicad/issues/5898 (C)
2021-01-26 18:12:49 +00:00
Jeff Young 22a6b36257 Don't allow dbl-click to leak through to other tools.
This only applies if the tool doesn't handle properties (which also
handles double-click events).

Fixes https://gitlab.com/kicad/code/kicad/issues/6735
2020-12-14 22:15:43 +00:00
Jeff Young e882753ebf Grid snapping fixes.
1) Uniformly honour the GAL grid snap settings
2) Make more uniform use of GRID_HELPERs
3) Smarten EDIT_LINE for mid-point snapping

Fixes https://gitlab.com/kicad/code/kicad/issues/6558
2020-12-03 19:55:58 +00:00
Jeff Young a19028a396 Hook up EE_GRID_HELPER to some more tools.
Also implements EE_GRID_HELPER layers so that connectable things
snap to connectable things and graphics snap to graphics.

Fixes https://gitlab.com/kicad/code/kicad/issues/5641
2020-12-03 15:16:34 +00:00
Jeff Young 3c521942ed Smarten isEmpty checks to include nothing-but-whitespace.
Fixes https://gitlab.com/kicad/code/kicad/issues/6567
2020-12-01 16:39:06 +00:00
Jeff Young dd60fd47b2 Cleanup and formatting. 2020-11-23 01:10:08 +00:00
Jeff Young 9e9946628a Go back to arrow cursor on a cancel (or finish).
Fixes https://gitlab.com/kicad/code/kicad/issues/6421
2020-11-19 20:09:28 +00:00
Jeff Young 8c5c902fa3 Re-write IntersheetRefs on top of SCH_FIELDs and textVars.
1) Generalize SCH_ITEM owners (SCH_COMPONENT, SCH_SHEET, and now
SCH_GLOBALLABEL)
2) Generalize hypertext items
3) Use SCH_FIELD autoplace infrastructure for placing intersheet
references
4) Use textVar infrastructure for buildin intersheet references.

As an important side-effect this also fixes the undo issues with
intersheet refs.
2020-11-17 16:05:49 +00:00
Jeff Young 522d64968e Yet more module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young bfd8a62852 Formatting and naming conventions. 2020-11-07 18:50:30 +00:00
Jeff Young 0d8789935d Refactoring. Push editing code to toolset. 2020-10-31 10:28:21 +00:00
Jeff Young e5089d783d Remove multi-label entry feature.
It was causing problems with surprising behaviour and issues with
allowing spaces in existing labels.  We'll work on something better
for 7.0....

Fixes https://gitlab.com/kicad/code/kicad/issues/6073
2020-10-20 22:53:44 +01:00
Jeff Young 83890f8d3a Move label editors to QuasiModal so the Syntax Help window can be shown.
Fixes https://gitlab.com/kicad/code/kicad/issues/5437
2020-10-20 22:26:47 +01:00
Seth Hillbrand 4085757aeb Remove beginning/ending spaces in translations
Adding space padding makes translations more difficult by increasing
string counts
2020-10-20 12:08:04 -07:00
Marek Roszko 558f4b4b51 Add new place cursor, fix cursor hotpoints again 2020-10-10 23:45:21 -04:00
Marek Roszko 310786333d Add missing cursors for bus, graphic lines, and hier labels
Fix #5949
2020-10-10 18:25:44 -04:00
Ian McInerney 5aa796b5fe Cleanup compiler warnings 2020-10-10 15:24:35 +01:00
Marek Roszko f238d05ead Add COMPONENT cursor 2020-10-08 20:52:58 -04:00
Marek Roszko 6cf4016a64 Add net and global label cursors 2020-10-08 20:52:58 -04:00
Jeff Young fd22fe8e37 Show preview item in drawing tool before mouse is moved.
Fixes https://gitlab.com/kicad/code/kicad/issues/5922
2020-10-08 19:56:09 +01:00
Jeff Young 4095edda07 Add Properties support to Junction and Bus Entry tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/5907
2020-10-08 18:11:06 +01:00
Ian McInerney 2b839c6c9c Ensure command events are passed when placing junctions
We only handle specific command events in the handler, so we
must pass the rest to allow other tools to work.

Fixes https://gitlab.com/kicad/code/kicad/issues/5922
2020-10-08 17:58:06 +01:00
Marek Roszko f5e0754f65 Use the setCursor lambda pattern and fix up the initial cursor states 2020-10-07 23:26:14 -04:00
Mark Roszko d9485129c8 Implement more context specific cursors using both stock and custom cursors. 2020-10-08 00:50:28 +00:00
Jeff Young 809f4c2ffb Finish single-click-place drawing tool on double-click.
Fixes https://gitlab.com/kicad/code/kicad/issues/5907
2020-10-07 18:30:55 +01:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Seth Hillbrand 4026904cc4 Make grid snapping depend on grid visibility
Turning the grid view on enables snapping to the grid.  Turning it off
removes the snap and allows free draw
2020-09-09 10:18:15 -07:00
Seth Hillbrand 173b4ff588 Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
2020-09-09 10:18:15 -07:00