76 Commits

Author SHA1 Message Date
Mike Williams
40058ebe80 actions: move all basic selection operations to common actions 2025-04-02 12:02:01 -04:00
Jeff Young
629a12ab2e Don't obliterate user data when syncing copper layer count.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20484
2025-03-28 19:24:58 +00:00
dsa-t
71fdc9b199 Simplify layer list update in PANEL_SETUP_LAYERS.
(cherry picked from commit bdd4a8812747a1ad23390263862b7871a88f3f7e)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-02-25 20:44:07 +00:00
dsa-t
62b208e0a5 Fix scrollbars not appearing initially in PANEL_SETUP_LAYERS.
(cherry picked from commit a4e2d54221317e52cdd7d9d281c5c878f77ecf6b)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-02-25 20:23:27 +00:00
John Beard
f24c8d7410 Pcbnew: add a tooltop for always-on layers 2025-02-06 22:45:32 +08:00
John Beard
466ee6fac8 Pcbnew: keep alway-on layer checkboxes visible but disabled
THese layers can't be disabled, but hiding the checkboxes
can be misunderstood as the layers are missing, rather than forced on.

E.g.: https://gitlab.com/kicad/code/kicad/-/issues/18756#note_2315214661
2025-02-05 22:01:46 +08:00
Ian McInerney
59a4cc2e4b Default to 4 user defined layers 2025-02-02 23:09:08 +00:00
Seth Hillbrand
6c2a559cbe Set base user layer count
Default colors cycle through repetition for unknown layers.  Allows
importing from complex Altium/CADSTAR boards with more than 10
documentation layers
2025-01-28 12:22:39 -08:00
jean-pierre charras
0748a1ca34 PANEL_SETUP_LAYERS: fix broken init of copper layer types.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19715
2025-01-22 18:59:15 +01:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Jeff Young
9231516238 Lower case the "to" in infinitives.
(See Chicago Manual of Style.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18925
2024-10-27 15:56:40 +00:00
jean-pierre charras
d4909f59fa PANEL_SETUP_LAYERS: fix issues for VIAs when reducing the copper layer count. 2024-09-17 17:52:52 +02:00
jean-pierre charras
3ac29eba83 PANEL_SETUP_LAYERS: ensure testLayerNames() test only layers that exist in dialog
Previously, all possible layers were tested, but some are not existing in dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18680
2024-09-11 11:40:26 +02:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing

Non-copper layers are odd and incrementing.

This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )

Similarly, gt/lt tests should not refer to the integer value of the
layer.  We have functions such as IsCopperLayer to test whether a layer
is copper or not.

When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified.  There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS

Similarly, PNS layers remain unchanged and sequential.  A set of
interface functions is provided to map PNS layers to Board layers and
back.  This allows the PNS_LAYER_RANGE to function as expected
2024-09-06 23:07:58 +00:00
Jeff Young
94f995c49e Reduce dependency on dynamic_cast.
(Especially where it is no-worky on MacOS.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17245
2024-09-04 17:24:49 +01:00
Seth Hillbrand
3ebca155a6 Fix missing copperCount dec
Was accidentally removed in LSET cleanup
2024-07-09 21:10:01 -07:00
Seth Hillbrand
293075426b Clean up some LSEQ functions
We are derived from std::vector now.  We don't need our own prima donna
increment and dereference overload as these just create bloat and
non-standard coding practices
2024-07-08 20:59:46 -07:00
Jeff Young
aa5a370b3a ADDED: user layer types.
This allows a user to define user layers to be front
or back (and therefore to flip with the board view).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8455
2024-07-03 13:32:44 +01:00
Jeff Young
5d62345cbd ADDED checkbox to turn Margin layer on/off.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12493
2024-05-31 22:08:40 +01:00
Jon Evans
90ee5e097a Clear undo/redo lists when removing board layers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17613
2024-05-18 18:16:07 -04:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
jean-pierre charras
01327b24b4 PANEL_SETUP_LAYERS: when removing a layer, do not delete items owned by footprints.
Items owned by footprints are allowed to be on non existing layers on board.
Moreover, items owned by footprint cannot be deleted by the board editor.
Fixes #17038
https://gitlab.com/kicad/code/kicad/-/issues/17038
2024-02-20 18:38:48 +01:00
Wayne Stambaugh
92c2ddf77a Do not parent dialogs to non top level windows in panels or widgets. 2024-02-03 10:40:28 -05:00
jean-pierre charras
805f1dfbc5 Pcbnew: when adding layers, do not change via layers.
Via layers are not defined by a LSET, and the code that used the new LSET
broke the Via start and/or end layers (for blind/buried vias)
Fixes #15856
https://gitlab.com/kicad/code/kicad/-/issues/15856
2023-10-14 08:48:22 +02:00
Jeff Young
8d3047d6eb Clear selection before deleting board layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15866
2023-10-13 18:20:33 +01:00
Jeff Young
5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00
Jeff Young
03c9b1c202 Move remainder of Board Setup to lazy loading. 2023-05-11 11:43:10 +01:00
Jon Evans
595bf70d5d Do not try to read from UI elements that haven't been initialized yet
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13480
2023-01-12 09:16:22 -05:00
Jeff Young
3f63f9fc57 Don't prune inner layers of through-hole parts.
For historical reasons we've always included ALL inner layers in these
items and changing that has uncovered several latent bugs.  Rather
than find all the rest this late in the game, I went back to storing
all inner layers, even those the board doesn't currently have.

Fixes https://gitlab.com/kicad/code/kicad/issues/12863
2022-11-09 15:58:14 +00:00
Jeff Young
d67437a2aa Move ratsnest exclusion processing to a post-pass.
Also fixes a few cases where we were unnecessarily rebuilding
connectivity more than once for an operation.
2022-09-29 17:08:49 +01:00
Seth Hillbrand
35ac39844f Clean up some auto usage
Don't make new copies of shared_ptr if we can use references.  Keep auto
usage down to hard-to-type-out sequences
2022-08-15 11:29:45 -07:00
jean-pierre charras
4d48376eae Fix some warnings detected by PVS-STUDIO (not used vars) 2022-07-26 16:00:14 +02:00
Jon Evans
dc6c27b686 Don't wipe out visibility state when changing layer count
(cherry picked from commit 7053981835101e8740a0a880bc29c83a4ab651bd)
2022-06-08 03:01:02 +00:00
Jeff Young
7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00
Jeff Young
e26341d424 Cleanup. 2021-12-23 20:36:18 +00:00
jean-pierre charras
a0bcde088e Use ChangeValue() instead of SetValue() in some wxTextCtrl
(It avoids generating unused events)
2021-12-23 17:58:50 +01:00
Jon Evans
a7bd621419 Remove checkboxes that can't be unchecked (part 1)
The checkboxes for copper layers should probably also be removed
but leaving them for now since they direct the user to the right
place to disable copper layers.
2021-08-24 20:29:03 -04:00
Jeff Young
95b87ba29a Freshen microwave polygon dialog and remove a bunch of dead code. 2021-08-03 01:11:11 +01:00
Jeff Young
a1dfc36233 More error message regularization. 2021-06-29 01:08:26 +01:00
Jeff Young
0f27618125 Use a list dialog that can be parented by the Board Setup dialog.
(The current one keeps pulling the Kicad Manager window to the front
on OSX.)

I also removed the UpdateUI stuff which was probably causing:

Fixes https://gitlab.com/kicad/code/kicad/issues/5049
2021-06-27 01:41:35 +01:00
Wayne Stambaugh
7c14e4e967 Common widget header housekeeping. 2021-06-03 12:02:45 -04:00
Jeff Young
52aea0a2c9 Consistent terminology. 2021-04-03 11:15:11 +01:00
Jon Evans
bba7fae104 Coverity fixes 2021-02-24 22:55:11 -05:00
Jon Evans
887ad1c30d CHANGED: Copper layer count is now set on physical stackup page
REMOVED: Board layer stackup presets that were not very useful

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6765
2021-02-23 21:31:12 -05:00
jean-pierre charras
96af236493 Code cleanup: remove include wx.h from pcb_plot_params.h.
including wx.h is useless for this file, and include wx.h in a lot of other files.
Include wx.h must be made only when needed in a given file, because on Windows
it include some headers that frequently create collision with kicad declarations
2021-01-25 16:18:46 +01:00
jean-pierre charras
dd3b5512ee PANEL_SETUP_LAYERS:do not disable the button "Add User Defined Layer".
For boards having 2 or 4 layers this button was disabled, that make no sense.
2020-12-14 17:47:55 +01:00
Marek Roszko
16e3e59495 Split out arrayDim and MIRROR templates from macros.h
These were not macros
2020-11-17 20:21:04 -05:00
Jeff Young
666c11965a Clean up some more MODULE terms. 2020-11-14 19:56:06 +00:00
Jeff Young
84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Marek Roszko
81a7afc76e Use kicad_algo directly rather than common.h 2020-10-24 08:53:11 -04:00