Jeff Young
4cbf512461
Support synchronous move in symbol editor.
Also removes duplicate-during-move. It's not really compatibile with
a passed-in SCH_COMMIT, and it was never clear it was worth the code.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14274
2 years ago
Ian McInerney
2a940a5f70
Add COMMIT to TOOL_EVENTs instead of passing as a parameter
2 years ago
Ian McInerney
2fb6f19a84
Separate immediate and delayed action dispatch
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
2 years ago
Seth Hillbrand
62f24aca1e
Fix Connectivity Asserts in new COMMIT structure
The connection graph should only be updated within the commit structure
because this is the only time the connectivity should be changed. We
want any connectivity changes to be included in the commit as well, so
this should be stored prior to the undo/redo list mods
2 years ago
Jeff Young
8f1b9119bf
Upgrade some symbol editor stuff to SCHEMATIC_COMMIT.
Also renames SCHEMATIC_COMMIT to SCH_COMMIT since it's not schematic-specifc.
2 years ago
jean-pierre charras
7eb13c3d33
Symbol editor: clear the edit flags of a pasted pin after place it.
When pasting a single pin, its edit flags were not cleared, and create
issues when trying to edit the pasted pin.
Fixes #14188
https://gitlab.com/kicad/code/kicad/issues/14188
3 years ago
Seth Hillbrand
6fa2eedb4b
Avoid the obsolete GetNextPin() call
This iterated over all pins to find the pin after a given item. Because
out pattern is consistently to iterate in the outer loop, this means
that we were an O(n^2) loop for the pins just to find their names. This
affected very large parts (e.g. FPGAs) when switching sheets to display
3 years ago
Mike Williams
9304607624
TOOL_EVENT: make command string non-optional
We're getting segfaults in places where this isn't checked. Also, add
some asserts so we can catch bad tool push/pop.
Removes all uses of GetCommandStr() and makes it private.
3 years ago
Seth Hillbrand
b736460e71
Move optional access from value() to *operator
`value()` throws. Where we check for existence, we don't need to use
the throwing version and should just use the unprotected variant
3 years ago
Seth Hillbrand
f1261e71d4
Replace boost::optional with std::optional
3 years ago
Jeff Young
aa2ad3b44c
Move KICAD_T[] to std::initializer_list<KICAD_T>.
3 years ago
Jeff Young
bce1fd337b
Second tool hotkey accepts action (ie: acts as click).
Fixes https://gitlab.com/kicad/code/kicad/issues/11729
3 years ago
Jeff Young
23fb4c7433
Uniformly use a single facility for location-less prime events.
Also implements a uniform mechanism for avoiding auto-scroll after
a prime event or dialog which results in a mouse position at the
edge of the canvas.
Fixes https://gitlab.com/kicad/code/kicad/issues/11057
4 years ago
Jeff Young
576f3dc2fd
Keep pins aligned to grid when possible.
This uses the first pin as the anchor point in a mulitple-item
selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/11151
4 years ago
Jeff Young
b0d7c82e64
Disable grid when ctrl/cmd key is down.
Fixes https://gitlab.com/kicad/code/kicad/issues/9995
4 years ago
Marek Roszko
c4c56de708
Neurotically update position wxPoint usages
4 years ago
Roberto Fernandez Bautista
c5cdda26ae
Fix crash in libedit when moving/editing pins in synchronised mode
Unit numbers start at 1, not 0. Our vector needs to be size + 1 if we want
to use the unit number as an index.
0 is reserved for "all units"
4 years ago
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
4 years ago
Jeff Young
66eb2ddeb5
Remove auto when not needed for line length.
4 years ago
Wayne Stambaugh
ee3eac325d
Expunge the use of the word part from Eeschema code.
4 years ago
Wayne Stambaugh
71c183d7bb
Rename LIB_PART to LIB_SYMBOL.
4 years ago
Marek Roszko
4df3cb912d
Remove another leaky wx/log.h header
5 years ago
Jeff Young
0598c82972
Terminology (use present tense for flags).
5 years ago
Jeff Young
a0b9b0c3ee
Improve IsSymbolEditable to differentiate fields.
Fields are editable in Aliases, but still not in Legacy libraries,
locked libraries, etc.
Fixes https://gitlab.com/kicad/code/kicad/issues/7175
5 years ago
Wayne Stambaugh
2d64613bbb
Coverity fixes.
Reports 314745, 316271, and 316269.
5 years ago
Wayne Stambaugh
0655f2c436
Symbol editor: do not disable tools and grey symbols from schematic.
Fixes https://gitlab.com/kicad/code/kicad/issues/6968
5 years ago
Seth Hillbrand
489db6adde
Handle case where multiple pins are moved
When synchronized, if multiple pins are selected to be moved, we need to
match each to a matching pin in the new unit
Fixes https://gitlab.com/kicad/code/kicad/issues/2589
5 years ago
Seth Hillbrand
0fd920a94c
Modify Synchronize Pins behavior
Consider a pin synchronized iff the names and electrical types match in
addition to the position, orientation and demorgan variant.
Also, only modify one matching pin per unit. This prevents
moving/editing a full stack of pins on the same unit when synchonized.
Fixes https://gitlab.com/kicad/code/kicad/issues/2590
5 years ago
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
5 years ago
Jeff Young
b6e267b78d
Naming conventions.
5 years ago
Jeff Young
9c7c05c161
Mostly formatting cleanup but a few type-casting cleanups too.
5 years ago
Wayne Stambaugh
e91a5b3f81
Symbol editor: prevent derived symbol elements from being moved.
5 years ago
Jeff Young
dd60fd47b2
Cleanup and formatting.
5 years ago
Jeff Young
6e6e0aa644
Naming conventions (including some component -> symbol).
5 years ago
Jeff Young
bddc97df30
LibEdit -> SymbolEditor
5 years ago
Jeff Young
9065908859
Update SCH_SCREEN's RTree when moving items.
Or when modifying geometric shape/properties.
Fixes https://gitlab.com/kicad/code/kicad/issues/5922
5 years ago
Jeff Young
128910c602
Pass unhandled command events from Symbol Editor move tool.
Fixes https://gitlab.com/kicad/code/kicad/issues/6015
5 years ago
Marek Roszko
b2e9f6987d
Split base_struct into eda_item and eda_rect
5 years ago
Mark Roszko
d9485129c8
Implement more context specific cursors using both stock and custom cursors.
5 years ago
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.
5 years ago
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
5 years ago
Seth Hillbrand
173b4ff588
Add snapping to eeschema
This generalizes both the SetPosition() function and ORIGIN_VIEWITEM
class away from the pcbnew-centric.
5 years ago
Mark Roszko
1082402b33
Convert UNDO_REDO_T to an enum class
5 years ago
Jeff Young
1138c32bf3
Don't pass Cancel event where there was a specific action cancelled.
For instance, if during a move the user hits ESC they only want the
move cancelled, not (for instance) the selection dropped.
Fixes https://gitlab.com/kicad/code/kicad/issues/5356
5 years ago
Marek Roszko
1905a23ba1
libedit: fix double msg_panel refresh and use new move event
5 years ago
Ian McInerney
facf40d3ce
libedit: Add drag to move behavior
ADDED: Drag to move behavior in the symbol editor
Fixes https://gitlab.com/kicad/code/kicad/issues/1904
6 years ago
Jeff Young
44a1cf9f1b
Implement quiet-mode for selection clearing.
Also adds comments for exising quiet-mode calls.
Fixes: lp:1843177
* https://bugs.launchpad.net/kicad/+bug/1843177
6 years ago
Jeff Young
a5a237ac32
Improve readability of flag checking.
6 years ago
Ian McInerney
49dd5d838c
libedit: Fix inverted Y axis on move command
Also clean up some code formatting issues
6 years ago
Jeff Young
29af26565d
Fix re-entrancy issue in LibEdit move tool.
6 years ago