Compare commits

...

974 Commits

Author SHA1 Message Date
Adam Feuer
f089e33544 Merge branch 'fix/issue-17429-drc-exclusion-instability-8.0' into 'master'
Draft: fix for issue 17429 - DRC exclusions change in project file when no changes are made to board  - backported from master

See merge request kicad/code/kicad!2123
2025-09-11 16:03:30 +00:00
Jeff Young
18b56539a6 Keep Board Setup in front when called from DRC dialog. 2025-09-11 15:47:13 +01:00
Jeff Young
9b006c4f3b Formatting. 2025-09-11 15:47:13 +01:00
Jeff Young
8035a66152 Flag non-compiling rule conditions when running DRC.
Also, clear custom rules after an error before
trying to reload just implicit rules.
2025-09-11 15:47:13 +01:00
jean-pierre charras
45166bf5c3 Gerbview: fix broken behavior for deprecated command IPPOS and IPNEG
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21715
2025-09-11 14:30:50 +02:00
Jeff Young
6ab6283e2e LIBEVAL::CONTEXT manages its own local VALUEs.
Don't use std::unique_ptr as we'll just free the
value right after storing it.

Also, don't try to execute a non-existent function.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21697
2025-09-11 12:49:41 +01:00
Seth Hillbrand
fc7d91214d Make pasting in lib tables easier
You generally copy/paste whole rows in lib tables, so make this workflow
easier.  Allows pasting rows as new data.  Prevent overwriting existing
data and don't force pasting from the first column
2025-09-11 02:30:49 -07:00
Seth Hillbrand
dcbadb5857 Allow drag-drop for schematic elements
Dragging screen elements over a subsheet allows moving elements into a
subsheet
2025-09-11 02:16:47 -07:00
jean-pierre charras
3b97804cb6 DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR: add missing layers to always allowed list 2025-09-11 11:07:16 +02:00
Mark Roszko
e72def55a9 Remove moronic pybind forcing expectation of python release builds 2025-09-11 07:16:52 +00:00
Seth Hillbrand
fcf40deae2 Scale down icons that are too big
In template view, if the icon is too big, try to fit to our size
2025-09-10 21:58:02 -07:00
Seth Hillbrand
ef602be91f Allow drawing subsheet with click+drag
Interestingly, the majority of people in a KiCad training course wanted
to draw subsheets this way.  There is no real reason to keep the
existing select behavior, so this greases some skids
2025-09-10 21:55:31 -07:00
Seth Hillbrand
bd5cb76fcd Sync pin shape between sheet/hier labels 2025-09-10 21:47:09 -07:00
Seth Hillbrand
de26550b5a Add stubs for compiling 2025-09-10 21:23:37 -07:00
Seth Hillbrand
7deff606be Update Pybind11 to 3.0.1 2025-09-10 13:02:24 -07:00
Seth Hillbrand
6e2b20ed0e Update BS Threadpool to 5.0 2025-09-10 13:02:24 -07:00
Jeff Young
2f1a91279f Make sure DRC inspection dialogs come up in front
of DRC dialog.
2025-09-10 17:52:09 +01:00
Jeff Young
6e316d9faa ADDED: menu items to control cross-probing from ERC
dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17916
2025-09-10 17:52:09 +01:00
Jeff Young
3c5fb9d90d CHANGED: progressive disclosure in DRC dialog.
CHANGED: moved Report All Track Errors to config menu.

ADDED: menu items to control cross-probing from DRC
dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17916
2025-09-10 17:52:09 +01:00
jean-pierre charras
11cc86e586 Hotkey handling: disable usage of keyboard modifier flag wxMOD_ALTGR.
The flag wxMOD_ALTGR is defined in wxWidgets as wxMOD_CONTROL|wxMOD_ALT
So AltGr key cannot used as modifier key because it is the same as
Alt key + Ctrl key that is already handled.
So the previous code did not work with modifiers Alt key, Ctrl key and Altgr key

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21696
2025-09-10 18:10:43 +02:00
Roberto Fernandez Bautista
5e2fd084b9 Disable vcpkg compiler tracking 2025-09-10 09:48:50 +00:00
Seth Hillbrand
a1f816e8be Add additional modifies to hotkeys
Allows (depending on system) AltGr, Meta, Win, Super in combination with
other keys

Fixes https://gitlab.com/kicad/code/kicad/issues/1908
2025-09-09 13:30:01 -07:00
Seth Hillbrand
abf3438ed6 Remove noise from orthographic projection raytracing
We generally add some jitter to the raytracing lines in order to smooth
out over multiple iterations some of the imperfections.  However, when
we do this to an orthographic projection (where all lines are parallel
to start, we don't average and just introduce noticeable noise in the
render

Fixes https://gitlab.com/kicad/code/kicad/issues/8863
2025-09-09 13:16:57 -07:00
Seth Hillbrand
cb4c8e6647 Make global delete tracks remove tuning patterns
If we are removing the generated item, we should remove the generator as
well

Fixes https://gitlab.com/kicad/code/kicad/issues/21572
2025-09-09 13:06:52 -07:00
Seth Hillbrand
d356073798 ADDED: synthetic parameters for graphics
Allows editing start/end/radius instead of underlying properties

Fixes https://gitlab.com/kicad/code/kicad/issues/16279
2025-09-09 12:58:43 -07:00
Mark Roszko
b38d9d7f81 Edit Windows-CI.yml, remove after_script 2025-09-09 15:47:03 +00:00
Mark Roszko
297ca1bb7b Fix windows builds with a temporary hackfix for now 2025-09-09 11:12:39 -04:00
Seth Hillbrand
f9e25c2e06 ADDED: Cross-probing from 3d-viewer
Send cross-probe messages to pcb and schematic editors to highlight
objects when clicked in the 3d viewer
2025-09-09 07:50:51 -07:00
Seth Hillbrand
b0a6dc4acf Use actual value for symbol chooser options
When we moved to the single element, the pointer always resolved to
true, which was sometimes not what we wanted
2025-09-09 07:16:28 -07:00
Seth Hillbrand
59dcdb4a4f ADDED: proper icons for datasheet and fp in props
The properties panel needs to look like the data fields for user
experience.  In wx3.3 we get a helpful action button but until then, we
need to make our own
2025-09-09 07:12:27 -07:00
jean-pierre charras
39889f8446 fix a compil issue. 2025-09-09 15:41:28 +02:00
Seth Hillbrand
3f8abe3744 Update properties to show units
The function duplicated our built-in funcitonality and did not properly
handly outputs

Fixes https://gitlab.com/kicad/code/kicad/issues/21685
2025-09-09 06:39:39 -07:00
Seth Hillbrand
0acc659676 Try to fix MSW build error 2025-09-09 06:15:30 -07:00
Jeff Young
78c93ee0fb Clear stale local ratsnest flags when performing undo/redo.
Also removes some dangerous C-style casts.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17894
2025-09-09 14:09:19 +01:00
jean-pierre charras
9622cf8ff1 SCH_BITMAP, SCH_TABLE: add missing HitTest(SHAPE_LINE_CHAIN& aPoly, ...)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21669
2025-09-09 09:45:46 +02:00
jean-pierre charras
3cca1e87d8 French translation update 2025-09-09 09:45:46 +02:00
Seth Hillbrand
aac15f4596 Encapsulate libgit commands into single backend
Sets stage for allowing alternate backends for version control
2025-09-08 21:04:31 -07:00
Seth Hillbrand
ceed9ca5f8 ADDED: Place missing units
Adds a contextual menu for symbols that will look for units that are not
currently instantiated and offer to place them
2025-09-08 16:38:49 -07:00
Alex Shvartzkop
6c4edd178e Update translations 2025-09-09 01:19:11 +03:00
dsa-t
cfa87cfc2c
Translated using Weblate (Hungarian)
Currently translated at 34.7% (3659 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-09-09 00:18:30 +02:00
CloverGit
b3b75270ce
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 97.4% (10247 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-09-09 00:16:20 +02:00
KB
f1db857804
Translated using Weblate (Hungarian)
Currently translated at 34.7% (3658 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-09-09 00:16:20 +02:00
Frank Sonnenberg
cdd43fe5fa
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:20 +02:00
Frank Sonnenberg
836b3267bb
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:20 +02:00
Nguyễn Ngọc Khánh
66930ea703
Translated using Weblate (Vietnamese)
Currently translated at 21.7% (2284 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/vi/
2025-09-09 00:16:20 +02:00
ZbeeGin
0e60722c4b
Translated using Weblate (Polish)
Currently translated at 97.9% (10305 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-09-09 00:16:20 +02:00
Frank Sonnenberg
2b3f21b9ff
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:20 +02:00
ssantos
dd8a059925
Translated using Weblate (Portuguese)
Currently translated at 93.6% (9851 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt/
2025-09-09 00:16:20 +02:00
Frank Sonnenberg
63fe36847e
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:19 +02:00
CloverGit
99a16e4306
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 97.4% (10247 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-09-09 00:16:19 +02:00
Frank Sonnenberg
5ca8fdb7cd
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:19 +02:00
Frank Sonnenberg
88ee07e910
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:19 +02:00
Pferd O
71907f0888
Translated using Weblate (German)
Currently translated at 99.9% (10517 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:19 +02:00
Frank Sonnenberg
6397b6d3c6
Translated using Weblate (German)
Currently translated at 99.9% (10517 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:19 +02:00
Hesham Eina Abdalla
d1356140fa
Translated using Weblate (Arabic)
Currently translated at 1.0% (115 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ar/
2025-09-09 00:16:19 +02:00
Frank Sonnenberg
30d158a60f
Translated using Weblate (German)
Currently translated at 100.0% (10519 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:19 +02:00
Ivan Chuba
c674e1749e
Translated using Weblate (Estonian)
Currently translated at 3.3% (350 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/et/
2025-09-09 00:16:19 +02:00
Frank Sonnenberg
c783218f93
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:19 +02:00
Frank Sonnenberg
07885145b3
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:18 +02:00
Frank Sonnenberg
500da3c15d
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:18 +02:00
Frank Sonnenberg
fbd2e36b79
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:18 +02:00
Frank Sonnenberg
61fd5e7413
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:18 +02:00
Frank Sonnenberg
bf8d2d7bf6
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:18 +02:00
Pferd O
2a93e1bfb1
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:18 +02:00
ZbeeGin
9f097d5ae8
Translated using Weblate (Polish)
Currently translated at 97.9% (10305 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-09-09 00:16:18 +02:00
2tama3
80996e70f8
Translated using Weblate (Japanese)
Currently translated at 100.0% (10519 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-09-09 00:16:18 +02:00
Frank Sonnenberg
ec8131c7bf
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:18 +02:00
Sárkány Lőrinc
2ad7c345ec
Translated using Weblate (Hungarian)
Currently translated at 34.6% (3648 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-09-09 00:16:17 +02:00
Pferd O
a2e0d07c87
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:17 +02:00
Frank Sonnenberg
4e1dd875ae
Translated using Weblate (German)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:17 +02:00
CloverGit
c737e0b360
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 97.4% (10247 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-09-09 00:16:17 +02:00
Sárkány Lőrinc
c29aa7643c
Translated using Weblate (Hungarian)
Currently translated at 34.6% (3641 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-09-09 00:16:17 +02:00
Pferd O
58b2ccb3d5
Translated using Weblate (German)
Currently translated at 99.6% (10484 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:17 +02:00
Pferd O
a05f8b9e36
Translated using Weblate (German)
Currently translated at 99.4% (10458 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:17 +02:00
CloverGit
9f2b84ba52
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 97.3% (10245 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-09-09 00:16:17 +02:00
Sárkány Lőrinc
b345e34423
Translated using Weblate (Hungarian)
Currently translated at 33.0% (3480 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-09-09 00:16:17 +02:00
Frank Sonnenberg
081b414ad5
Translated using Weblate (German)
Currently translated at 99.1% (10429 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:17 +02:00
Pferd O
58caa5c496
Translated using Weblate (German)
Currently translated at 99.1% (10429 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:17 +02:00
Frank Sonnenberg
f0f5472e4d
Translated using Weblate (German)
Currently translated at 99.1% (10429 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:17 +02:00
CloverGit
0b174b5227
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 97.0% (10210 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-09-09 00:16:17 +02:00
2tama3
765838ecf7
Translated using Weblate (Japanese)
Currently translated at 99.9% (10518 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-09-09 00:16:16 +02:00
Sárkány Lőrinc
2276ae05e3
Translated using Weblate (Hungarian)
Currently translated at 32.9% (3465 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-09-09 00:16:16 +02:00
Frank Sonnenberg
6838d55051
Translated using Weblate (German)
Currently translated at 98.9% (10405 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:16 +02:00
Максим Горпиніч
95abb3be8b
Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10519 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2025-09-09 00:16:16 +02:00
CloverGit
41425ac32d
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 96.8% (10185 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-09-09 00:16:16 +02:00
Henrik Kauhanen
0b47169387
Translated using Weblate (Swedish)
Currently translated at 99.8% (10501 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-09-09 00:16:16 +02:00
dsa-t
7b98a8d697
Translated using Weblate (Russian)
Currently translated at 92.9% (9778 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-09-09 00:16:16 +02:00
2tama3
4184e60e24
Translated using Weblate (Japanese)
Currently translated at 99.9% (10517 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-09-09 00:16:16 +02:00
Sárkány Lőrinc
36eb0e4a11
Translated using Weblate (Hungarian)
Currently translated at 32.9% (3464 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-09-09 00:16:16 +02:00
Frank Sonnenberg
49c7f62548
Translated using Weblate (German)
Currently translated at 98.9% (10405 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:15 +02:00
Pferd O
35f0213011
Translated using Weblate (German)
Currently translated at 98.9% (10405 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:15 +02:00
Frank Sonnenberg
cb87f83dfc
Translated using Weblate (German)
Currently translated at 98.9% (10405 of 10519 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-09-09 00:16:15 +02:00
Jeff Young
ead7de69ca Fix periods in ERC gold files. 2025-09-08 20:44:32 +01:00
Jeff Young
dedc10a163 The Include "Exclude from BOM" setting is for editing, not exporting.
There's no reason to put items marked "Exclude
from BOM" into the BOM.
2025-09-08 20:44:32 +01:00
Jeff Young
330361d0cb Fix typo. 2025-09-08 20:44:32 +01:00
Jeff Young
01d32211ba Corner radius not supported on tablecells. 2025-09-08 20:44:32 +01:00
Seth Hillbrand
09c40a0e0f Make KiCad default template the default
Should clear up new project questions

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21651

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21675
2025-09-08 12:16:59 -07:00
Jeff Young
fdbf740ee2 Corner radius not yet supported on textboxes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21598
2025-09-08 19:54:59 +01:00
Jeff Young
93b0004175 Go back to checking points from the front.
We want to prefer a primary point (ie: a rectangle
corner) to a secondary point (ie: a rounded-rect
radius adjuster).
2025-09-08 18:37:47 +01:00
Jeff Young
0a162ded84 Go back to checking points from the front.
We want to prefer a primary point (ie: a rectangle
corner) to a secondary point (ie: a rounded-rect
radius adjuster).
2025-09-08 18:37:47 +01:00
Jeff Young
01f6776226 Fix hit-testing for rounded corner rectangles. 2025-09-08 18:37:47 +01:00
Jeff Young
adbc80aade Tighten corner radius value clearing.
Move loading of values outside of c'tor (where
they get stomped on my dialog restore code).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21677
2025-09-08 18:37:47 +01:00
Jeff Young
0b102fc085 Use WX_GRID::ClearRows() to avoid assertions.
Fixes KICAD-VM1.
2025-09-08 18:37:47 +01:00
Mark Roszko
22288e02a2 Fix cairo rendering on windows under wx 3.3 2025-09-08 12:32:12 -04:00
jean-pierre charras
58f4ca7ed6 FOOTPRINT_WIZARD_FRAME: Use the drawing engine selected in Preferences.
The FOOTPRINT_WIZARD_FRAME canvas used previously the Cairo engine,
regardless the drawing engine selected for all other canvases. It uses now
the selected engine.
2025-09-08 18:19:48 +02:00
Jeff Young
8ae2ad3586 Only test parameters under the same conditions as we'd write them to the file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21520
2025-09-08 12:55:22 +01:00
Mark Roszko
0f97f51ba1 Fix unit binder dropdown not working on windows
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20626
2025-09-08 06:36:20 -04:00
Seth Hillbrand
0c35068e8d ADDED: Optional flashing with cross-probing
Sometimes it is hard to find an element especially if we do not zoom to
the part.  The flash should help draw your eye to the relevant part

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19842
2025-09-07 18:08:04 -07:00
Seth Hillbrand
f66cbaf43a ADDED: Stacked pin notation support
Implement bracket notation for stacked pins ([1,2,3], [1-4], [1,3,5-7]).
Automatic net naming proceeds based on the smallest logical pin number
in stacked groups.

Provide explode/reform commands in symbol editor for conversion.
Supports arbitrary ranges including BGA alphanum ranges like
[AA1-AA3,CD14-CD22]

Adds some additional QA and trace logging

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2004
2025-09-07 14:59:51 -07:00
Seth Hillbrand
ac1b44715b Only dogbone inside corners
Fixes https://gitlab.com/kicad/code/kicad/issues/18880
2025-09-07 13:02:44 -07:00
Jeff Young
b98621c8c8 Formatting. 2025-09-07 20:43:04 +01:00
Jeff Young
28141ed350 Be more consistent with periods at the end of sentences.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21614
2025-09-07 17:54:22 +01:00
Jeff Young
c33da162d6 Be more consistent with periods at the end of sentences.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21614
2025-09-07 17:51:52 +01:00
jean-pierre charras
288c93198a Fix compatibility with wxWidgets 3.3.1 2025-09-07 18:46:54 +02:00
jean-pierre charras
46c8a6ee95 DIALOG_LIB_FIELDS_TABLE & DIALOG_SYMBOL_FIELDS_TABLE: avoid empty m_viewControlsGrid.
The fix is more a workaround: if all columns of m_viewControlsGrid are removed by
the right click menu and the grid is empty, there are no way to re-add a column.
When happens, this workaround re-add a column when reopening the dialog to avoid
a empty grid.
2025-09-07 18:26:48 +02:00
Mark Roszko
bbecc4eaa8 Add UUID to PCB tables to ensure stable file sort 2025-09-07 09:56:12 -04:00
Jeff Young
fef84a2c6a Dirty symbols when modified.
Also show changes in library tree and canvas when
"Apply" button is clicked.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21659
2025-09-07 13:49:59 +01:00
Mark Roszko
963ec84587 Edit Windows-CI.yml 2025-09-07 01:33:01 +00:00
Mark Roszko
4a87dbe472 Edit Windows-CI.yml 2025-09-06 21:24:53 +00:00
Mark Roszko
7d67f82217 Add use of gitlab nuget feed as binary cache 2025-09-06 21:21:41 +00:00
Jeff Young
b7fee045e3 Performance tweak. 2025-09-06 21:50:03 +01:00
Jeff Young
0e5a87546b More consistent action on Show search panel hypertext link.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21665
2025-09-06 21:29:41 +01:00
Jeff Young
5489daf279 ADDED: collapse/expand for view controls in SYMBOL_FIELDS_TABLE...
... and LIB_FIELDS_TABLE.
2025-09-06 19:06:49 +01:00
Mark Roszko
922699f388 Update ngspice to 45.2 2025-09-06 13:35:28 -04:00
Jeff Young
702f774a1f Bring DIALOG_LIB_FIELDS into line with DIALOG_SYMBOL_FIELDS_TABLE. 2025-09-06 15:10:30 +01:00
Mark Roszko
264029c8e9 Update kicad-vcpkg and ngspice 2025-09-06 08:46:34 -04:00
jean-pierre charras
c889a7fa16 DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE: fix a incorrect widgets type
Fix also a minor issue in DIALOG_FOOTPRINT_PROPERTIES_BASE

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21662
2025-09-06 13:09:39 +02:00
Adrián García
fb558eee3c Fix crash in LIB_SYMBOL::SetUnitCount when reducing unit count
When decreasing the number of units in a symbol, the previous code erased
items directly from m_drawings using a single iterator. Because m_drawings
is a MULTIVECTOR, this could invalidate iterators and attempt to erase
from the wrong bucket, leading to segmentation faults.

This patch iterates bucket by bucket and erases items belonging to units
greater than the requested count. This ensures iterator safety and avoids
accessing invalid memory.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21631
2025-09-05 12:35:54 -07:00
Wayne Stambaugh
6f352ccd96 Improve symbol fields table editor undo/redo memory usage.
- Do not add a modify action to commit for symbols that have no changes.
- Do not add a modify action to commit for each instance of shared symbols.
2025-09-05 11:46:05 -04:00
Jeff Young
c163f0a24c CHANGED: better real-estate usage in Edit Symbol Fields dialog.
1) Moved view controls list to a wx_grid.
2) Allow show/hide of columns in view controls.
3) Allow editing of BOM Names in grid without long-click on Mac.
3) Added column show/hide states and sash pos to prefs.
4) Decreased mininum sash pane width to allow wider main grid.
5) Simplified presentation by moving "include" and "cross-probe"
   settings to config menu.
2025-09-05 13:00:50 +01:00
Jeff Young
fd7da138fd Cleanup dead code. 2025-09-05 13:00:50 +01:00
jean-pierre charras
3bdf44d4a4 PCB_DIM_CENTER: fix incorrect bounding box size for 90deg cross.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21643
2025-09-05 09:40:33 +02:00
jean-pierre charras
168975b0a8 Fix a compil warning on MSYS2 (POINTS collide with a Windows header define)
POINTS is renamed LY_POINT. no actual code change
2025-09-05 09:34:49 +02:00
Mark Roszko
03b3b642b0 Another qa header fix 2025-09-04 21:33:27 -04:00
Seth Hillbrand
f9f5bb9ed1 Consider keywords as required
Because they actually are

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21635
2025-09-04 16:54:53 -07:00
Mark Roszko
4254673be5 Fix windows build, missing wx header 2025-09-04 19:54:21 -04:00
Mark Roszko
0ce952e705 Fix windows build, IN conflicts with windows header 2025-09-04 19:52:34 -04:00
Seth Hillbrand
9ffb0c8b96 wxString explicit conv 2025-09-04 14:57:16 -07:00
Seth Hillbrand
44cc5b8e93 Move to fmt 2025-09-04 14:57:16 -07:00
Seth Hillbrand
a857ea77d9 ADDED: Text expression evaluation
Arbitrary text strings now support full evaluation with a rich
functional language

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6643
2025-09-04 14:57:16 -07:00
Seth Hillbrand
bae5d43c45 Sadly, msys2 doesn't like condition variables 2025-09-04 13:58:38 -07:00
Seth Hillbrand
2cbd441042 Simplify font locking 2025-09-04 10:55:38 -07:00
jean-pierre charras
9a7088c03c French translation update 2025-09-04 18:15:56 +02:00
Mike Williams
7a09960b46 PCB search: add Drills column
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1982
2025-09-04 10:04:37 -04:00
Seth Hillbrand
05d04e665a Fix lib_fields column attributes
Need to properly display footprint selector and datasheet globe
2025-09-04 06:59:35 -07:00
Mark Roszko
9f1aa612ec Fix position of package properties that must follow packages 2025-09-04 07:16:02 -04:00
Mark Roszko
9de2548064 Fix typo in allegro output for nets 2025-09-04 07:09:12 -04:00
Graham Keeth
825585847b Fix typo in DRC rules help 2025-09-03 20:53:26 -07:00
Graham Keeth
6c8f25b418 Add DRC syntax help for via_dangling 2025-09-03 20:52:33 -07:00
Mark Roszko
a899da7cb7 Fix double quoting tol for some reason 2025-09-03 22:59:37 -04:00
Mark Roszko
a49e3b9cc5 Fix build 2025-09-03 22:59:21 -04:00
Mark Roszko
9bc1cf006f Fix the allegro netlist export and move mostly to {fmt}
Weirdly $PACKAGES header got shifted out of position.
Drop generating empty references.
2025-09-03 22:54:00 -04:00
Seth Hillbrand
dc7e0665c3 Prevent GTK from providing stale position
When the library name and symbol/footprint name both match the filter,
we try to display both but ensure visible can move things to the wrong
place.  We need to ensure the filtered list is up to date prior to
moving by ensureVisible

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18000
2025-09-03 16:58:38 -07:00
Seth Hillbrand
344fab5741 Prompt for unsaved changes in the lib fields table editor 2025-09-03 15:54:29 -07:00
Seth Hillbrand
9342aea7fa Move new project to templates
If the baseline default project doesn't exist on disk, create it and use
that as an empty project.  Allows the designer to modify the default new
project used or select from existing templates
2025-09-03 15:52:05 -07:00
Seth Hillbrand
11c5e03890 Update Font widget
Now displays the font next to its name

Also keeps a static version of itself for rapid display
2025-09-03 15:48:15 -07:00
Seth Hillbrand
3deb06bf82 Expand the custom fields properties to pcbnew
Allows editing/reviewing custom fields for a set of selected footprints
in pcbnew

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16703
2025-09-03 13:10:22 -07:00
Seth Hillbrand
5c865cab36 Allow full-field filtering in lib_fields_table_editor 2025-09-03 11:47:22 -07:00
Mike Williams
f7fd832c67 design blocks: add routing to exinst group when applying layout 2025-09-03 13:49:55 -04:00
Seth Hillbrand
62e220a8db Reverse cell painting for Windows
Apparently Windows might not respect painting with a transparent alpha,
so reverse the paint order

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21635
2025-09-03 10:35:59 -07:00
jean-pierre charras
622ddd3a37 3D viewer: fix a minor issue, clean code and and a few comments.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21629
2025-09-03 18:24:56 +02:00
Seth Hillbrand
9f06d1f66b Fix image pasting for MacOS
Apparently, GetImage() on MacOS does not always convert the image
properly.  So do a two-step here to get the Bitmap first, forcing the
conversion and then going back to an image
2025-09-03 09:18:07 -07:00
Seth Hillbrand
f84ba3004d Properly append corners to created poly
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21633
2025-09-03 06:59:59 -07:00
Seth Hillbrand
e85a8056f5 Don't convert URI slashes on Windows
We auto-convert paths for windows boxes but this should not happen for
uri schemes that have the form <URI>://<path>

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20381
2025-09-03 06:56:28 -07:00
Seth Hillbrand
173e02eff7 ADDED: Lasso support to Schematic Editor 2025-09-03 06:45:49 -07:00
jean-pierre charras
876c905e2b DRAWING_TOOL: change POINT to MD_POINT, to avoid colliding with a Windows header define 2025-09-03 11:40:05 +02:00
jean-pierre charras
5914b5aaa8 gendrill_Excellon_writer.cpp: convert fprintf and fputs to fmt::print
It allows write issues to be handled more  easily.
2025-09-03 09:48:09 +02:00
jean-pierre charras
2346be9768 Fix compil warnings 2025-09-03 09:43:41 +02:00
Seth Hillbrand
d4b08f0a8a When unarchiving a project, open it also
Just a little convenience for getting projects open
2025-09-02 21:11:54 -07:00
Seth Hillbrand
f18c4a05fd Don't push names we don't have
Fixes https://gitlab.com/kicad/code/kicad/issues/21628
2025-09-02 20:49:39 -07:00
Seth Hillbrand
ad80113f47 Prevent modifying teardrops on lock/unlock
This action doesn't affect geometry, so don't dirty the teardrops

Fixes https://gitlab.com/kicad/code/kicad/issues/21342
2025-09-02 20:35:59 -07:00
Seth Hillbrand
8f0b3b59f0 Offer to create missing plugin directory 2025-09-02 20:32:14 -07:00
Mark Roszko
bf82217217 Fix leftover printf float in gencad writer 2025-09-02 22:58:43 -04:00
Seth Hillbrand
d9741fd46a Consider visibility when colliding in DRC
Most places we check this but we should also check it in physical
clearance

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21625
2025-09-02 19:24:55 -07:00
Seth Hillbrand
826f15a103 Prevent crash in nettie
We need to avoid collecting invalid layers in the net ties regardless of
their origins
2025-09-02 19:18:58 -07:00
Seth Hillbrand
edf8f45351 Add user fields to editable properties
Fixes https://gitlab.com/kicad/code/kicad/issues/21622
2025-09-02 18:29:59 -07:00
Mike Williams
202619cd43 design blocks: fix PADs getting copied in routing, enable by default 2025-09-02 13:58:18 -04:00
John Beard
8709f73b98 Symbol editor: simplify root symbol-finding 2025-09-03 00:30:56 +08:00
John Beard
e76b2089bb Symbol edit: add symbol flatten action
This removes inheritance from the symbol.

This doesn't play well with undo, but then again, neither does symbol
deletion, so that seems like a higher-level symbol editor issue.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/8895
2025-09-03 00:24:32 +08:00
John Beard
2e0088593e Symbol editor: fix flattening during save-as to the same library 2025-09-03 00:24:24 +08:00
John Beard
b34746e06b Symbol editor: allow editing all related symbols from the treeview
This makes it more straightforward to edit a group of related symbols
(related = all derived from the same parent, including the parent).

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/21067
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/9742
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/11506
2025-09-03 00:24:18 +08:00
John Beard
9b14434fc3 Symbol editor: allow to inject the symbol list into DIALOG_LIB_FIELDS
This will permit editing fields for subsets (e.g. only symbols in
a certain inheritance hierarchy)
2025-09-03 00:24:12 +08:00
Seth Hillbrand
1f1f8699e0 Prevent pads from moving inappropriately
Free pads is a setting unless we are in the footprint editor and needs
to be respected by the alignmen tool

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21626
2025-09-02 09:11:31 -07:00
John Beard
0ede830f54 LIB_SYMBOL: When assigning, clear the parent if needed
This allows assigning a symbol with no parent to a symbol with
a parent to work more as expected.
2025-09-02 23:50:17 +08:00
Seth Hillbrand
de8c4d4b01 ADDED: via_dangling constraint
Allows programmatic suppression of this error if you don't care about it

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18058
2025-09-02 08:26:18 -07:00
jean-pierre charras
e01dfd3158 gendrill_Excellon_writer: remove use of LOCALE_IO 2025-09-02 16:18:09 +02:00
Jeff Young
cff261ce2e Don't allow stack addresses to escape via long-life handlers. 2025-09-02 14:19:17 +01:00
Jeff Young
6a171e11fb Clang got cranky on the emplace_back call. 2025-09-02 12:17:07 +01:00
John Beard
1e272ca21b Geom: use SHAPE_SEGMENT for OVAL
OVAL didn't do anything SHAPE_SEGMENT couldn't already do.
2025-09-02 17:38:26 +08:00
jean-pierre charras
60a5c8b742 WX_INFOBAR: Better calculation of the minimal height.
The height was sometimes to big (case of multi-line text or small initial
size of the parent frame).
The height is now calculated from the height of one line of text, even for
multi-line text.
2025-09-02 07:50:50 +02:00
Seth Hillbrand
9cba910d53 ADDED: Library Table Editor
Edits all symbols in a library at once.  Supports copy/paste, multiple
field assignment and selective coloration based on existing data

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11506
2025-09-01 21:47:14 -07:00
Mark Roszko
35ffb28335 Remove the GetCommonSettings mock
There's some sort of internal issue in boost::test and the turtle mocks that causes test crashes
2025-09-01 22:13:36 -04:00
Jeff Young
98b63389c1 Give Mac dock icon menu a kick.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17596
2025-09-01 22:04:59 +01:00
Jeff Young
ce140d8dfc Formatting. 2025-09-01 22:04:59 +01:00
Mark Roszko
5e2ec53165 Use ADDR2LINE for linux qa for now 2025-09-01 13:57:45 -04:00
Mark Roszko
d5e342b64d Updated turtle mocks to 2.0.0 properly (it was already mostly there being off-tag instead of the mentioned tag) 2025-09-01 13:49:28 -04:00
John Beard
eedfb7a573 Pcbnew: pickup footprints by points, add a selection filter 2025-09-02 01:24:14 +08:00
Ian McInerney
c95c15dd4e Don't throw away old hidden text that was converted to fields 2025-09-01 18:19:46 +01:00
Mark Roszko
4a4725c906 Avoid shadowed variable warning 2025-09-01 12:24:35 -04:00
Mark Roszko
667dccb163 Add rdynamic to QABUILD executables. 2025-09-01 12:20:22 -04:00
Mark Roszko
4fb76404bc Try and disable boost's signal handler 2025-09-01 16:07:03 +00:00
Mark Roszko
267ee811a7 Try and suppress gcc warning 2025-09-01 11:58:13 -04:00
John Beard
e016dc52fd Pcbnew: Add concept of a 'point'
This is a zero-dimensional object that can be used for snapping
and documentation of useful, but non-physical features on a
board or footprint. They do not correspond to any physical
output in exports or plots.

Points do have a "size", but this is a graphical property only
and determines how large they are drawn on the board.

They also have a layer, which allows them to be selected and
made visible according to layer filters.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/4691
2025-09-01 23:44:21 +08:00
John Beard
c4d9338097 Pcbnew: sort sexpr text items stably
Currently all texts on the same layer do not sort stably in the file
format. Add sorting criteria to sort by position, angle, size
and so on and finally by string.
2025-09-01 23:44:21 +08:00
John Beard
5d967289ee Eeschema: order pins by number, not position
Also use StrNumCmp, then the pin numbers are ordered exactly the
same way as pads in footprints.
2025-09-01 23:44:21 +08:00
John Beard
262f1fdabb Pcbnew: add layer mode/stackup checks to library parity DRC 2025-09-01 23:44:21 +08:00
Mark Roszko
c9476caebf Fix macOS build 2025-09-01 11:31:03 -04:00
Mark Roszko
a8d6292d61 Use boost::stacktrace w/ unit test handlers to start hunting for that copper sliver wabbit 2025-09-01 11:07:12 -04:00
jean-pierre charras
4953e80122 Fix some compil warnings 2025-09-01 16:22:05 +02:00
JamesJCode
bd04d508e0 Fix some compiler warnings 2025-09-01 14:50:22 +01:00
Seth Hillbrand
82c61efcbd Revert "When re-launching on MacOS, create a new instance"
Needs to launch without jumping back in and allow switching

This reverts commit 1885f4bdee6656d988bf088b048fbfbb70ac0f3d.
2025-09-01 06:39:34 -07:00
Jeff Young
4024a15a17 Don't reference stack variables from a long-life lambda.
In particular, a lambda for conditional menus should
never capture more than `[this]`.  Even the tool's
frame pointer could change.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21615
2025-09-01 12:44:20 +01:00
Jeff Young
0c8e7a7137 Reload symbol chooser on keep symbol, and improve accessibility.
(Respond to hotkey-generated clicks.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7698
2025-09-01 11:45:20 +01:00
Jeff Young
1f44417ad0 Attempt to improve ever-growing-window problems. 2025-09-01 11:45:20 +01:00
jean-pierre charras
5b31b11731 SHAPE_RECT: add Normalize method to assure width or height > 0
ROUNDRECT: add option to normalize the rectangle on creation

if the created rectangle has a negative size(width or height) there are issues
when drawing it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21613
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21610
2025-09-01 11:56:56 +02:00
Adrián García
5fb55ccb30 jobsets: fix Replace button to overwrite existing files (#19900) 2025-09-01 01:13:23 +00:00
Seth Hillbrand
2eb7ba2fb9 Simplify overlapping points after editing
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21571
2025-08-31 17:48:59 -07:00
Seth Hillbrand
2c4d792358 Stop converging at existing point
Prevents collapsing points into drag element when hitting convergence
2025-08-31 17:48:59 -07:00
Seth Hillbrand
77a2330a33 Fix QA result based on updated behavior 2025-08-31 15:52:38 -07:00
Seth Hillbrand
7b4f4540b4 ADDED: Light snapping to 45° multiples
When modifying the points of a polygon, we add a small snap to the
points preferring multiples of 45° unless you are holding shift

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15709
2025-08-31 13:47:34 -07:00
Seth Hillbrand
1885f4bdee When re-launching on MacOS, create a new instance
Allows people to run multiple copies of KiCad.  Only launches new copies
if the TLW is already shown.  Otherwise, sticks with the default MacOS
behavior of raising the running window
2025-08-31 12:54:55 -07:00
Seth Hillbrand
eba8d0748c Don't show angles for non-polygons 2025-08-31 12:54:38 -07:00
Seth Hillbrand
f5904cf2ac Prevent main KiCad window from expanding based on DPI events
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21602
2025-08-31 11:54:53 -07:00
Seth Hillbrand
bbc762a546 ADDED: Angle preview for polygon mod
Shows angle for the current and adjacent corners and whether they are
congruent
2025-08-31 11:49:41 -07:00
Seth Hillbrand
c6c8e19e39 The smallest angle between two segments is 0-180
Not 0-90.  Subtracting 180-angle and then taking the smaller of angle
and 180-angle will always get you 90 or less.  But obtuse angles are not
< 90
2025-08-31 11:49:41 -07:00
Jeff Young
1309b436da Allow stitching of graphic shapes. 2025-08-31 19:32:48 +01:00
Jeff Young
c47b7459aa Set free vias to graphic net if available.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21578
2025-08-31 19:21:29 +01:00
Jeff Young
a2e98fb53c Don't set point to a value we're not going to keep.
It just causes flicker.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19947
2025-08-31 17:13:11 +01:00
Seth Hillbrand
2321285c16 Maybe don't need eary exit here 2025-08-31 08:11:44 -07:00
Seth Hillbrand
2cdeb0cd7c Second pass at fixing warping and grids
First attempt caused additional problems for #21535

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18196
2025-08-31 07:54:21 -07:00
Seth Hillbrand
4af585c531 Revert "Remove the forced ancillary grid"
This reverts commit 29dc45d584a882866f2f3f27a7257481043ecc84.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21535
2025-08-31 07:54:12 -07:00
Seth Hillbrand
8c6f057f6c Re-organize points to allow missing radius
Not all rectangles want/need the radius point, but we will only be able
to drag one point at a time.  So we re-organize which point of an
overlapping set is selected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21605
2025-08-31 07:10:14 -07:00
Jeff Young
9d7db3d135 Better interactive feedback.
Don't wait for mouse to move before refreshing after a command.

Also fixes a crash bug deleting an item after an
Unstage() (the Unstage() has already deleted the item).

Also fixes a crash when changing label type during
creation of a label produces a mess.

Also Keep cursor aligned to grid when not warping
back to original point.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16828
2025-08-31 14:25:52 +01:00
Seth Hillbrand
b22f259ccb Make properties panel obey free pads setting
Pads should almost never be moved without their parent.  Only allow this
in the case where free pads has explicitly been checked

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21591
2025-08-31 06:08:27 -07:00
Seth Hillbrand
b86cddbbe9 Fix RRECT handling in processClosedShape 2025-08-31 05:43:59 -07:00
Seth Hillbrand
053c46aa72 Add last point in 3d export 2025-08-31 05:29:37 -07:00
jean-pierre charras
4610a49323 Fix round rect shape STEP export.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21599
2025-08-31 12:43:40 +02:00
jean-pierre charras
68f9b74ae9 SHAPE RECTANGLE: fix hatching clipping for round rectangle. 2025-08-31 10:05:21 +02:00
Adam Wysocki
814f78f2b2 ADDED: Add pcb/sch upgrade cli command 2025-08-30 20:57:41 +00:00
Jeff Young
be57c1a380 Fix undo for rounded rects.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21595
2025-08-30 21:16:47 +01:00
Jeff Young
194b7f9dc5 Add corner radius to Shape Properties dialog. 2025-08-30 20:45:02 +01:00
Jeff Young
c6fcf7e0b8 Allow easier code searching for property names. 2025-08-30 19:09:15 +01:00
Mark Roszko
cf09e8ae88 Adjust flags for dynamicdeopt to build 2025-08-30 13:46:38 -04:00
Mark Roszko
1ff5f09c3a Add cmake flag for enabling MSVC Dynamic Debugging in release 2025-08-30 13:35:40 -04:00
jean-pierre charras
7610c02fed 3D view: honor round rectangle shape.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21597
2025-08-30 18:51:43 +02:00
Jeff Young
7fd8b515b5 Prefer const&. 2025-08-30 17:45:49 +01:00
Jeff Young
ba84f50997 Commenting. 2025-08-30 17:45:49 +01:00
Jeff Young
acc7b1e508 ADDED: separate front/back silk and mask colours for STEP export.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21593
2025-08-30 17:45:49 +01:00
Jeff Young
67feb2e139 Performance tweaks. 2025-08-30 17:45:49 +01:00
Jeff Young
6f59821930 Prefer const &. 2025-08-30 17:45:49 +01:00
jean-pierre charras
6592c75345 fix issues in ROUNDRECT. This also fix a change commit by mistake in aeafbe48
Fix incorrect ROUNDRECT Ctor. It also fixes a link issue on msys2
- Do not throw  an error in CTor: this is not the place. It is much easy to
fix the value of incorrect radius.
Moreover, the Ctor is called without catching a throw-ed error in code.
- fix the test about radius validity, broken.
2025-08-30 17:35:26 +02:00
Seth Hillbrand
1a3f6028f8 Fix missed last points
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21596
2025-08-30 08:33:46 -07:00
Seth Hillbrand
fe4ddc66eb Limit radius in more places 2025-08-30 08:19:35 -07:00
Seth Hillbrand
e3b550dd13 Add a little radius helper
When rounding a rectangle, add a helper that shows the current radius
2025-08-30 08:19:35 -07:00
Mark Roszko
1baa28a1e6 Kick out more strtod. Actually should have used parseDouble from DSNLEXER years ago. 2025-08-30 10:46:06 -04:00
Seth Hillbrand
0f1b514964 Handle corner radius in Create from selection
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21601
2025-08-30 07:33:30 -07:00
jean-pierre charras
aeafbe48fe Step exporter: fix overzealous validity test.
When converting poly shapes with arcs in STEP_PCB_MODEL::MakeShapes,
when an error happens, a second try is made using a full polygonal shape.
However a fatal error was emitted at the first attempt, before the second try.
Now at first try, only a debug message is emitted on error. The fatal error
is emitted only if the second try fails.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21589
2025-08-30 12:58:56 +02:00
Mark Roszko
2b8542861c Missed a strtod in kicad legacy pcb parsing 2025-08-30 06:57:48 -04:00
Mark Roszko
9dd642b66c Kick out strtod in legacy parsers 2025-08-29 23:38:00 -04:00
Mark Roszko
d5c0d040b4 Add missing fast_float files 2025-08-29 22:18:08 -04:00
Mark Roszko
b3de964eff Add fast_float for float parsing.
2x faster than both std::from_chars and strtod on Windows.

macOS will get to benefit from a modern from_chars impl too.
2025-08-29 21:48:24 -04:00
Seth Hillbrand
8acf5c1a25 ADDED: Rounded Rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4742
2025-08-29 17:37:30 -07:00
Seth Hillbrand
e282dca102 Add configurable hysteresis to PCB snapping
Makes it harder to enter and harder to exit a snap.  ideally this should
help make snapping more intuitive and easier to use.  Once you have a
snap, it is harder to lose it but it avoids being overly snappy in the
begining
2025-08-29 16:21:35 -07:00
Seth Hillbrand
a811f61c39 Make Expand Connection respect the filter
Prevents expansion that would require traversing elements that are
disabled in the selection filter

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21581
2025-08-29 16:11:38 -07:00
Seth Hillbrand
50274352b1 Skip exterior segments when splitting
We need to avoid fracture points when choosing how to split exterior
segments
2025-08-29 15:50:34 -07:00
Seth Hillbrand
ec7b831be3 ADDED: Search feature for html message box
Allow search for text in e.g. the custom rules examples

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21550
2025-08-29 10:29:11 -07:00
Jeff Young
9525fae7c8 Run collision check on correct layer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21586
2025-08-29 17:13:16 +01:00
Seth Hillbrand
e8cec41355 ADDED: Indication of filter blocking
If the selection filter has blocked all selections under the cursor,
show a subtle flash on which filter(s) did the blocking.  Helpful for
people getting frustrated by not being able to select locked items.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20487
2025-08-29 07:08:27 -07:00
Jeff Young
8a60893249 Regularize content of item descriptions.
1) Use sentence capitalisation
2) Show text of text items

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21582
2025-08-29 12:03:55 +01:00
Mark Roszko
7115f9e716 Drop the FromChar in ConvertNotation 2025-08-28 18:27:06 -04:00
Jeff Young
736d87aa35 ADDED: directive labels checkbox to Schematic Editor Display Settings panel in Preferences.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21577
2025-08-28 17:49:06 +01:00
Jeff Young
eb6b2de648 Fix for the fix (for clang). 2025-08-28 13:20:20 +01:00
Jeff Young
83fab7b02c Fix undo for move of group-of-shapes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21563
2025-08-28 13:20:14 +01:00
Mark Roszko
af852ea15d Protect from_chars from clang 2025-08-28 07:11:08 -04:00
Mark Roszko
fd57f637ac Revert "Compilers should have complete from_chars support now"
This reverts commit 3a8dd87db4513b7c7ede748a4f30ef5192e1752b.
2025-08-28 07:07:44 -04:00
Jeff Young
5c240efd75 Consolidate to single copy of deletableItems. 2025-08-28 11:54:24 +01:00
Mark Roszko
b01c1f39c1 Add missing header 2025-08-28 01:22:08 +00:00
Mark Roszko
3e019ee4ae pcb plots dont need LOCALE_IO anymore 2025-08-27 20:44:16 -04:00
Mark Roszko
4f32146f9a nlohmann json is locale independent (uses to_chars) 2025-08-27 20:41:47 -04:00
Mark Roszko
9bc463606a More redundant LOCALE_IO 2025-08-27 20:11:26 -04:00
Mark Roszko
747106ea37 Redundant include 2025-08-27 20:07:58 -04:00
Mark Roszko
94d83773d0 Drop a LOCALE_IO via std::from_chars 2025-08-27 20:07:28 -04:00
Mark Roszko
3a8dd87db4 Compilers should have complete from_chars support now 2025-08-27 20:07:28 -04:00
Mark Roszko
2cf6ec2411 Remove some obsolete LOCALE_IO 2025-08-27 20:07:27 -04:00
Seth Hillbrand
408e1feae2 Fix Chessboard splitting
Due to a bug(?) in Clipper2, 45° collinear edges may not be detected.
See https://github.com/AngusJohnson/Clipper2/issues/1008 for current
status.  In the meantime, we pre-process these to remove the extraneous
joints preventing our triangulation from getting mixed up

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18176
2025-08-27 15:00:58 -07:00
Seth Hillbrand
ea8206eca5 Don't both designers with unneeded changes
If we are not asking for fields to be removed when updating, then don't
say we're doing anything if all we have to do is remove fields
2025-08-27 13:30:44 -07:00
Jeff Young
6dd4e01f16 ADDED: custom body styles.
(Also moves editing of unit display names to the
Symbol Properties dialog and retires the Set Unit
Display Name dialog.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16069

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14843
2025-08-27 18:11:56 +01:00
Mark Roszko
3eb6caaec6 Move gencad writer to {fmt} 2025-08-27 08:11:12 -04:00
jean-pierre charras
9725ac2215 GERBER_JOBFILE_WRITER: fix incorrect layer id in File Attributes for inner layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21569
2025-08-27 13:25:24 +02:00
jean-pierre charras
b349f1988a PAD: better HitTest( const VECTOR2I& aPosition, int aAccuracy, PCB_LAYER_ID aLayer ) 2025-08-27 13:23:02 +02:00
jean-pierre charras
963aa47778 Pcbnew: fix teardrop generation for pads having different shapes by layer.
Teardrop generator used pad::HitTest not testing the hit of a specific layer.
It created false test for some complex pads. Now use a test specific to a layer.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21560
2025-08-27 11:03:00 +02:00
Seth Hillbrand
2f21414186 Revert "Allow netlisting for multi-unit parts"
Breaks QA.  need to debug before re-committing

This reverts commit 635445c096c8624a47c9e0fdd6c1ebefa668e973.
2025-08-26 22:07:40 -07:00
Seth Hillbrand
8bd6da3ec9 Revert "Fix build error"
This reverts commit 19e4c3f498b8b66eacd2b651a570f0f137a8b6b2.
2025-08-26 22:07:26 -07:00
Mark Roszko
19e4c3f498 Fix build error
std::string does not have a overload for appending a wchar
2025-08-26 20:25:56 -04:00
modbw
57ad779797 Fix net assignment messed up in Eagle import
When there is a polygon in the Eagle project withput any pad connected 
netCode was not incremented and so the wrong nets were assigned to the 
following elements.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21243
2025-08-26 17:11:21 -07:00
Adrián García
46084c04b9 pcbnew: avoid missing or wrong lines inside hatched fill polygons
Avoid considering duplicated intersections between a segment of the
hatched fill and the polygon outline or vertices.
Also, check whether the segments of the lines are inside or outside
the polygon, so no lines are drawn outside when the shape is complex.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20450
2025-08-26 16:47:26 -07:00
Seth Hillbrand
635445c096 Allow netlisting for multi-unit parts
Merges pin map from each unit into coherent model prior to exporting for
spice simulation

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1779
2025-08-26 15:02:37 -07:00
Seth Hillbrand
394f6be509 Formatting 2025-08-26 14:47:04 -07:00
Seth Hillbrand
fe4de09d71 Add undo/redo functionality to dialog boxes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18986
2025-08-26 14:39:19 -07:00
Seth Hillbrand
b832ae7f45 Add checks to copper sliver QA
Fedora still doesn't like our copper sliver QA sometimes.  This adds a
bit more to try and get to the bottom of the issue
2025-08-26 13:27:03 -07:00
Seth Hillbrand
8592b2ee70 JP's patch to fix crash in routing empty board 2025-08-26 12:41:54 -07:00
Seth Hillbrand
1e76f1a11d Ensure that we check tracks exiting pads for gaps
The DP gap check should look for sections of track that are coupled by
wider than a given spacing.  Our primitive check of looking for
collisions on the segment between the start poins causes tracks exiting
but not entering pads to be excluded.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21561
2025-08-26 12:39:59 -07:00
Seth Hillbrand
0a767acb3a Wrap net_selector widget for properties
Provides consistent interface to modify/filter nets in property panel
and dialogs

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17643
2025-08-26 11:50:12 -07:00
Seth Hillbrand
29c4d9b197 Add width/height adjustment to reference image
Allows setting specific width or height on a reference image instead of
just scale

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18567
2025-08-26 11:22:32 -07:00
Seth Hillbrand
2db8c6eca0 Maintain group membership when shoving
Keep track of the original group membership and assign this to the newly
created element as well

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20862
2025-08-26 10:34:10 -07:00
Seth Hillbrand
9c577a4f4c Allow mid-track teardrops
Tracks passing through but not stopping at pads/vias should still get
teardrops

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21246
2025-08-26 10:04:52 -07:00
John Beard
0f0527bd03 Pcbnew: fix sensitivity of via placement to large grids
Another case where large grids are overly "grabby" for snaps.

In this case, because the via was moved to the grid-snap first,
and then THAT position was used to look for things like pad-snaps,
the pad snaps would not be found if a coarse grid meant the cursor
was outside the pad.

Instead, use the mouse position when looking for the non-grid snaps
in VIA_PLACER::SnapItem.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18626
2025-08-26 23:34:46 +08:00
John Beard
3d8803f579 Pcbnew: use R-tree for pad checks in via place tool
Otherwise this is an O(n-pads-on-board) operation for every new
candidate via position.
2025-08-26 23:34:46 +08:00
John Beard
4bebd09bd0 EDA_LIST_DIALOG: Simplify ctor args
Sometimes you want to add these in the ctor of the child
class based on some logic and having to construct the vector
in the init-list is a bit ugly.

Theoretically allows to not require a vector too.
2025-08-26 23:34:46 +08:00
John Beard
7f4a1bf64a Sym edit: allow to flatten symbol on save as
Sometimes, you don't want to drag the whole inheritance hierarchy with
you.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/8895
2025-08-26 23:34:46 +08:00
Seth Hillbrand
ab93dd8a68 Avoid trying to get a display when headless 2025-08-26 06:48:36 -07:00
Seth Hillbrand
cb620338db Prevent stale names in fp browser
When switching libraries, if there is an additional footprint with the
same name, we don't want to select it by default as this will prevent
updating the footprint display.  Instead, force the update

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9763
2025-08-26 06:21:59 -07:00
Seth Hillbrand
dad60f99c0 More GDI conservation 2025-08-26 06:04:30 -07:00
Seth Hillbrand
4660c72c69 Fix qa issue in api 2025-08-26 05:45:08 -07:00
Seth Hillbrand
b5f3d4cf7b Reduce GDI usage by caching layer swatches 2025-08-26 05:29:02 -07:00
Seth Hillbrand
412fc1e6d9 Fix pcbnew QA mock 2025-08-25 22:08:05 -07:00
Seth Hillbrand
8997b7bcf7 Remove old HasCorner 2025-08-25 22:06:26 -07:00
Seth Hillbrand
5b86f20476 Suppress unneeded move corner context
Doesn't really make sense in terms of a group

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21552
2025-08-25 22:04:32 -07:00
Seth Hillbrand
7841476ed6 Make all 4 corners draggable
When scaling, maybe you want to drag from the bottom left or top right

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21554
2025-08-25 22:02:20 -07:00
Seth Hillbrand
a034c30563 Properly add group size mod to commit
Allows escaping the current state

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21553
2025-08-25 21:59:13 -07:00
Seth Hillbrand
6dd03bc735 Fix screen scaling
We don't use wxWidget DPI (which is the screen DPI) for our on-screen
display.  Instead, we use 91 (?!?).  Make this configurable in advanced
config and use the set value in our scaling widget
2025-08-25 18:03:46 -07:00
Seth Hillbrand
1df5ad0e4c Fix circle scaling
We scale the full circle, which is just defined by its points

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21551
2025-08-25 18:03:46 -07:00
Seth Hillbrand
9013ddae43 Suppress deprecation warnings
Treats thread-pool as a system library so we don't see the deprecation
warnings that we're not going to address anyway
2025-08-25 16:31:39 -07:00
Seth Hillbrand
bfe805a221 Add user-controlled scaling factor
Lets the user decide what 100% zoom is for their system based on a
slider.

This is inspired by Inkscape's custom scaling widget

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19256
2025-08-25 14:37:07 -07:00
Addo White
843eea259d Fix for Cursor rendering on Linux+EGL+Nvidia in accelerated graphics mode
EGL/NVidia can sometimes clip the cursor based on its plane regardless of the depth mask.  This avoids the issue by forcing the cursor up over the existing plane.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12183
2025-08-25 14:35:33 -07:00
Jeff Young
cc9ec7c01c Move assignment operator for SCH_SHEET_PATH. 2025-08-25 20:48:37 +01:00
Jeff Young
537ea6ee0c Move assignment operator for TRIANGULATED_POLYGON. 2025-08-25 20:48:37 +01:00
Seth Hillbrand
cc9402ac9d A better fix for #21543
Instead of making a default parent, we set the parent to invalid
allowing the error to bubble up without an assert

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21543
2025-08-25 12:27:20 -07:00
Seth Hillbrand
20a80a5f94 Fix shadowing variable 2025-08-25 11:49:28 -07:00
Seth Hillbrand
ef0ca4840e Revert "Check for property prefix in DRC"
This reverts commit 85397f6edc835fa6abed8fdc77d53614c94a79b1.
2025-08-25 11:37:13 -07:00
Seth Hillbrand
4e7fa189aa Refactor gfx import cleanup
Break up monolithic function into responsibilities.  Adjust cleanup to
correctly modify each graphical pairing.  Fix drc test to properly
report gap distances that are relevant to outlines

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13090
2025-08-25 11:33:26 -07:00
Seth Hillbrand
87ee9c4b49 Don't preemptively skip previously seen objects
We need to return them in order to detect the self-intersection
2025-08-25 11:31:51 -07:00
Seth Hillbrand
9cabceb773 Properly extend our outline
Previously, if we had a single gap in the outline, we would report
multiple errors depending on the order in which we parsed the outline.
This was confusing as most of those errors were invalid.  Instead, we
build the outline in both directions before reporting gaps
2025-08-25 11:31:51 -07:00
Seth Hillbrand
ba9e9a2368 Be more explicit in the board outline errors
Show the two items that are closest to the gap and put the marker
directly in the gap center.  Then report the space between them to allow
the designer more information about what to look for
2025-08-25 11:31:51 -07:00
Seth Hillbrand
b709439b65 Avoid showing 0.0 if there are non-zeros
If the value we want to show is in nm but we are representing it as mm,
don't show 0.00 unless it is actually 0.  otherwise, convert to
scientific notation to represent the value in nm.
2025-08-25 11:31:51 -07:00
Seth Hillbrand
ad7235e386 Don't add tiny sections
When healing the board, adding nm-sized sections is worse than just
adjusting the elements to create a full outline
2025-08-25 11:31:51 -07:00
Jeff Young
3058bc6355 Expose shape in prop inspector for sheet pins. 2025-08-25 17:19:10 +01:00
Jeff Young
9808889c9c Make 3D view/toolbar/contextmenu command lists more consistent.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21347
2025-08-25 16:35:01 +01:00
Jeff Young
8c3026cf1a Naming conventions. 2025-08-25 12:13:38 +01:00
Jeff Young
0477fb65ec Better spacing in dialogs.
Also allows Symbol Properties to be narrower.
2025-08-25 10:48:19 +01:00
Seth Hillbrand
613db94679 Misspelled class/wrong fn
Should be fixed.
2025-08-24 21:45:55 -07:00
Seth Hillbrand
04dab54825 Fix dark mode filter combobox
MSW doesn't have a default dark color for the listbox but it does for
window color so temporarily we can use this for windows when in dark
mode

Fixes https://gitlab.com/kicad/code/kicad/issues/21386
2025-08-24 20:18:16 -07:00
Seth Hillbrand
85397f6edc Check for property prefix in DRC
All properties must have a parent.  This is a bit hacky way to find that
or generate a warning and set the default

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21543
2025-08-24 17:58:30 -07:00
Seth Hillbrand
626e9d9d1b We want to save invariant numbers also
If the number is invariant, save it below, don't prematurely exit

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21544
2025-08-24 16:16:09 -07:00
Seth Hillbrand
5442e5050e Ensure ERC Exclusions are maintained
After we load/resolve the exclusions, we want to ensure that the
resolved ones are re-recorded into the project file so that it always
remains consistent with the state of the system.  This way, if pcbnew
closes first and re-saves the project, our exclusions are not lost until
the schematic closes

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21410
2025-08-24 16:00:39 -07:00
Seth Hillbrand
eb753b8a1b Old-skool THT colors
Simple option for plain-jane THT pad stacks to color them like the via
holes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21531
2025-08-24 13:31:50 -07:00
Seth Hillbrand
3ef862f7b6 Specialize the pad wall drawing
Avoids slowdown when zoom/pan with many THTs as everything remains
cached.  Still slow in Cairo but this is expected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506
2025-08-24 11:25:50 -07:00
Seth Hillbrand
66c42f396c Ensure junction placed is placed
Added QA to maintain this

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21516
2025-08-24 10:22:12 -07:00
Seth Hillbrand
71a6d26054 Disable depth testing for cursor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12183
2025-08-24 09:45:00 -07:00
Seth Hillbrand
c842f2700f Guard against div-0 in gauge 2025-08-24 08:03:31 -07:00
Seth Hillbrand
9dc76f658d Help is always valid
Return 0 and no error, just help when the --help flag is present

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21538
2025-08-24 07:37:23 -07:00
jean-pierre charras
f3c222f5ba Compil issue: add missing include on MSYS2 2025-08-24 09:01:25 +02:00
Seth Hillbrand
e346139301 Add more parent safety checks
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21317
2025-08-23 14:14:05 -07:00
Jeff Young
a7772e3b91 CHANGED: flatten image properties dialogs.
Also moves scale to UNIT_BINDER for correct locale
handling.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17837
2025-08-23 20:32:11 +01:00
Jeff Young
8520bfefa0 Better debugging. 2025-08-23 20:32:11 +01:00
Jeff Young
8ce0bf7623 Can't veto a close event.
Fixes KICAD-SQM.
2025-08-23 20:32:11 +01:00
Jeff Young
7fa9aabead Don't fire asserts when reloading 3-state checkboxes.
Fixes KICAD-YVD.
Fixes KICAD-WBM.
Fixes KICAD-W89.
Fixes KICAD-WTX.
Fixes KICAD-WKP.
Fixes KICAD-W8P.
2025-08-23 20:32:11 +01:00
Seth Hillbrand
11f9817ebc Fix compile issue for Ubuntu
Thanks dnschneid!
2025-08-23 12:05:05 -07:00
Seth Hillbrand
cac334bb45 Enforce board-level hole to hole on diff pairs
Makes the router behave like the DRC

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21240
2025-08-23 07:45:05 -07:00
Seth Hillbrand
8acdcafe90 Find the proper line split
And avoid leaving duplicate tracks when overlapping

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10422
2025-08-23 07:10:05 -07:00
Seth Hillbrand
f415ba78fa ADDED: Drag and drop images into schematic editor
Also fixed paste so that the image attaches to the cursor for placement

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15379
2025-08-23 06:38:59 -07:00
Seth Hillbrand
26f0c03e61 ADDED: support for 45 degree crosshairs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6047
2025-08-23 06:20:00 -07:00
Seth Hillbrand
d02358da2f Make fullscreen cursor actually fullscreen
Very wide screens could see the edge of the cursor :)
2025-08-23 06:20:00 -07:00
jean-pierre charras
61aeea9237 DIALOG_CHANGE_SYMBOLS: fix hanging is some cases and shows a better message.
When (happens after converting old schematics to the new format) trying to
update symbols having a bad lib id can hang Eeschema (infinite loop)
It can easily happens when the user has badly converted the schematic.
Also display a error message when happens.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21536
2025-08-23 12:36:21 +02:00
Seth Hillbrand
8330cf5d12 Separate reset text pos from other attr
Position is frequently usefully placed and we might not want to nuke it
just to get the updated text

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18387
2025-08-22 20:11:03 -07:00
Seth Hillbrand
206dfa2883 Allow scaling grouped graphics in pcbnew
Adds scaling handles and editpoints to drag shapes larger/smaller while
maintaining proportions.  Future additions might include non
proportional scaling

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13072
2025-08-22 20:04:38 -07:00
Alex Shvartzkop
1dc278488d REPORTER's HasMessage indicates that any message got reported, not stored. 2025-08-23 00:24:58 +03:00
dsa-t
83427c38aa Revert "Use board stackup colors by default in 3D render job."
This reverts commit d2f852504a7f4893340d062e20c4b949ca6d3def
2025-08-23 00:09:42 +03:00
Seth Hillbrand
a77e1027d6 Fix QA error.
When updating the symbol, we clear the libpins, so remove it to avoid
getting garbage while updating
2025-08-22 12:53:43 -07:00
Seth Hillbrand
679ee7e4d1 Refactor symbol creation to extract from GUI
Adds QA testing to creation routine
2025-08-22 12:11:12 -07:00
Seth Hillbrand
2e1910ca86 Manually check pad layers before inserting
We do not rely on GetEffectiveShape(layer) to return null for layers
that the pad does not exist on.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21523
2025-08-22 11:27:29 -07:00
dsa-t
4da77e046c Revert "Add FOLLOW_PCB, FOLLOW_PLOT_SETTINGS appearance presets to 3D render job dialog."
This reverts commit 1a9993d764fb929e5ce4c3bf10f331d0c4f82c08
2025-08-22 21:27:01 +03:00
Jeff Young
03c230dd64 Read legacy tokens before current tokens.
(So current can overwrite.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21525
2025-08-22 16:33:31 +01:00
dsa-t
01991fed53 Prevent jobs from affecting each other via reporters when running jobsets from CLI.
(cherry picked from commit 44a3bb9274845593db733464aa3f68288e3eb150)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-22 17:42:16 +03:00
Damien Espitallier
5576d1ed9c schematic: allow label properties window to be closed with numpad enter 2025-08-22 14:24:11 +00:00
dsa-t
424807da03 Fix ODB++ path creation.
(cherry picked from commit 72e19047087a83fea784c4f00db24b50e5bc4f3e)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-22 15:07:52 +03:00
dsa-t
7fbca40dd8 Increase default precision in ODB++ export job dialog.
(cherry picked from commit 279a30974e13e25bd5862fa5d9ec51fba9ad7bb2)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-22 14:35:03 +03:00
jean-pierre charras
59af606a5c French translation update 2025-08-22 12:39:06 +02:00
Alex Shvartzkop
1a9993d764 Add FOLLOW_PCB, FOLLOW_PLOT_SETTINGS appearance presets to 3D render job dialog. 2025-08-22 13:37:49 +03:00
dsa-t
d2f852504a Use board stackup colors by default in 3D render job.
(cherry picked from commit f7380ae0155058fd16ea5940aebd4401ce9e79d0)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-22 13:36:08 +03:00
Graham Keeth
a467727503 Tweak display names for via protection features
- "Type II a" -> "Type II-a", as given in IPC-4761 text
- remove unnecessary spaces in parentheses
2025-08-21 21:11:41 +01:00
Seth Hillbrand
c47641f454 Revert "Add asan switch indicators"
This is a good idea but only for non-nested coroutines.  We nest.

This reverts commit a9121d4cd1b8ef495645127f89fdbfc2191efd9c.
2025-08-21 12:32:48 -07:00
jean-pierre charras
637902f43f DIALOG_PIN_PROPERTIES: fix display issue of invisible pins
After changes in Eeschema code, in DIALOG_PIN_PROPERTIES invisible Pin
were not displayed, making pin edition not easy. This is now fixed.
2025-08-21 18:22:41 +02:00
dsa-t
66a1e268d7 EasyEDA import: Add footprint Reference text on F_Fab.
(cherry picked from commit 26b6c28befdfbcd0978794977e98186d720d97f5)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-21 17:41:09 +03:00
dsa-t
3e58b34843 EasyEDA import: Build basic Courtyard box for footprints.
(cherry picked from commit 8cd7b73b2a143ada362f38912819156018eb8fe4)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-21 17:13:33 +03:00
dsa-t
26b5e89640 EasyEDA import: Place component shape and marking on F_Fab.
(cherry picked from commit c2d31699bfa3d1420b452715d23faa95f51b0270)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-21 17:13:26 +03:00
Alex Shvartzkop
ec2d9c9d4c Add green color indication to length tuning status popup. 2025-08-21 15:41:03 +03:00
Jeff Young
29a818218a Don't fire events when loading dialog state.
(Fixes crash when opening Pin Properties dialog.)
2025-08-21 12:44:09 +01:00
Jeff Young
3f85071f91 Don't double mirror groups.
Also removes previous fix, which had side-effects.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8121

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20465
2025-08-21 12:29:34 +01:00
Jeff Young
73bb65b802 Formatting. 2025-08-21 12:29:34 +01:00
Jeff Young
42735b775d Remove unreachable PASTE_MODE.
Also, don't depend on enum order.

Fixes KICAD-YJ8.
2025-08-21 12:29:34 +01:00
dsa-t
d636eec643 router: Inline drag by track end even if cursor is slightly outside the track shape.
(cherry picked from commit 12cf3f93011e5c7a76d52f17fd10253648049baf)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-21 13:56:49 +03:00
Alex Shvartzkop
937d53b77c Update golden ERC QA files after f896417ed41ac3623d01d84857cca07ba30ec9eb 2025-08-21 12:35:25 +03:00
Seth Hillbrand
7201918383 Track alt pin changes
Make sure that we are following the lib changes when updating

Fixes https://gitlab.com/kicad/code/kicad/issues/21202
2025-08-20 19:49:13 -07:00
Jeff Young
90621947bf Bug fixes for locked tuning patterns.
The router uses locking to know the bounds of the
tuning pattern so it must be temporarily unlocked
while editing with the router.
2025-08-20 23:23:45 +01:00
dsa-t
f896417ed4 Show errors before warnings in DRC/ERC.
(cherry picked from commit 316a9511e813af257af23f60642859fa623537d4)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-21 00:25:07 +03:00
Alex Shvartzkop
81864057d2 Update translations 2025-08-21 00:16:02 +03:00
Pedro Moreira
f005d9e688
Translated using Weblate (Portuguese (Brazil))
Currently translated at 94.0% (9865 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt_BR/
2025-08-20 23:15:05 +02:00
Pedro Moreira
ba7d9efb49
Translated using Weblate (Korean)
Currently translated at 94.0% (9859 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ko/
2025-08-20 23:15:05 +02:00
CloverGit
441032d914
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 96.9% (10164 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-08-20 23:15:05 +02:00
2tama3
b1e6298473
Translated using Weblate (Japanese)
Currently translated at 99.9% (10487 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-20 23:15:05 +02:00
Максим Горпиніч
40f1aaa0c1
Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10488 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2025-08-20 23:15:05 +02:00
CloverGit
3e93d3f5d9
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 96.9% (10164 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-08-20 23:15:05 +02:00
Henrik Kauhanen
80d20dd3a1
Translated using Weblate (Swedish)
Currently translated at 99.8% (10469 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-08-20 23:15:05 +02:00
2tama3
d92e2e5a62
Translated using Weblate (Japanese)
Currently translated at 99.9% (10478 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-20 23:15:05 +02:00
co8 j
5c9fead65c
Translated using Weblate (Japanese)
Currently translated at 99.9% (10478 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-20 23:15:04 +02:00
Frank Sonnenberg
08a3bac912
Translated using Weblate (German)
Currently translated at 99.0% (10385 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-08-20 23:15:04 +02:00
Ettore Atalan
67dc1d3c3b
Translated using Weblate (German)
Currently translated at 99.0% (10385 of 10488 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-08-20 23:15:04 +02:00
Seth Hillbrand
44228bd580 Move IPC2581 output to REPORTER
Adds a wx_reporter_panel to the 2581 output window, shunt messages
through the reporter instance

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16314
2025-08-20 13:42:19 -07:00
Seth Hillbrand
c2f503774b Ensure that we use lasso when in the lasso mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21499
2025-08-20 12:48:03 -07:00
Seth Hillbrand
29317ace77 Rotate graphics when part of fp
Non-pad features need to be rotated with fp as well

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18565
2025-08-20 12:40:31 -07:00
Mike Williams
0f0c2ea494 pcb: windows build fix 2025-08-20 15:20:13 -04:00
Mike Williams
7e4133b9ec design blocks: fix up tests, API 2025-08-20 15:20:13 -04:00
Mike Williams
1e3c95a1d5 append board: use design block info when we have it 2025-08-20 15:20:13 -04:00
Mike Williams
ef50c31584 pcb design blocks: cleanup unused parameter
The position would always be "don't move at all" since we need to ensure
the design block fits in the canvas area, which means we can't move any
objects that we import.
2025-08-20 15:20:13 -04:00
Mike Williams
2abeb5cb49 sch design blocks: add suffix to grouped and repeated placements 2025-08-20 15:20:13 -04:00
Mike Williams
6ab9faa83e design blocks: enable place as group by default
This preserves the design block link between sch<->pcb so will enable
the easiest learning curve for new users.
2025-08-20 15:20:13 -04:00
Mike Williams
3127bec9c4 pcb design blocks: stop clobbering NET_INFO
Items hold pointers even when cloned, so we need to make new ones
and replace the old ones.
2025-08-20 15:20:13 -04:00
Mike Williams
cdc8435fd8 pcb design blocks: need tool actions from base class, too 2025-08-20 15:20:13 -04:00
Mike Williams
6f5aad159a sch design blocks: some improvements and fixes around sch groups 2025-08-20 15:20:13 -04:00
Mike Williams
e30b325433 multichannel tool: fixup for rebase 2025-08-20 15:20:13 -04:00
Mike Williams
36ee61dfe4 schematic: prevent crash in symbol browser with no grids 2025-08-20 15:20:13 -04:00
Mike Williams
92ef03cf15 design blocks/multichannel: make apply layout do routing, etc. 2025-08-20 15:20:13 -04:00
Mike Williams
2f88ee9dee multichannel tool: just pass COMPAT_DATA& instead its parts 2025-08-20 15:20:13 -04:00
Mike Williams
3151d97010 multichannel tool: formatting and comments 2025-08-20 15:20:13 -04:00
Mike Williams
4df013cf13 multichannel tool: pass RULE_AREA to functions called findXInRuleArea
Was previously passing just the zone in some of them.
2025-08-20 15:20:13 -04:00
Mike Williams
fbb9b296e3 multichannel tool: rename ZONE* from m_area to m_zone for clarity 2025-08-20 15:20:13 -04:00
Mike Williams
5da6e482ed design blocks / multichannel: don't require user move of temp placement 2025-08-20 15:20:13 -04:00
Mike Williams
97af2af779 design blocks / multichannel: basics of placing DB layout 2025-08-20 15:20:13 -04:00
Mike Williams
986c1a597a multichannel tool: remove redundant m_raFootprints 2025-08-20 15:20:13 -04:00
Mike Williams
c6df815935 multichannel tool: remove some unused variables 2025-08-20 15:20:13 -04:00
Seth Hillbrand
2347b290cb Update cache when modifying schematic
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18297
2025-08-20 10:34:32 -07:00
Seth Hillbrand
fa566b8061 Set defaults instead of ternaries with duplicate values 2025-08-20 10:32:52 -07:00
Seth Hillbrand
8c0cf3550b Update schematic save as functionality
Default to copying subsheet data if it lives in the current project.
Allows options for other behavior.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21518
2025-08-20 10:08:49 -07:00
John Beard
2a3b758e82 Pcbnew: array tool: improve variable locality, use range-for 2025-08-21 00:18:22 +08:00
John Beard
f31a109ab4 Pcbnew: fix refdes ordering in arrays
The first cell of the array needs to not be reannotated, or it will
skips its own number(s) and take what we expect for the second cell.
The repeats until the last entry, which didn't reannotate anything,
leaving the original numbers. Producing a 'rotation' like 2,3,4,5,1
rather than the expected 1,2,3,4,5.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20935
2025-08-21 00:18:22 +08:00
Seth Hillbrand
c1cd4dd157 Allow multiple pad->single pin in 2581 correctly
Grouped pads by pin number in the IPC-2581 exporter so only one pin node
is created per number.  Still output multiple pad shapes with the same
number.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18688
2025-08-20 08:55:55 -07:00
Seth Hillbrand
b2039c1293 Ensure hash ordering
Footprint elements are not guaranteed to be stably ordered, so sort the
hashes before combining
2025-08-20 08:55:55 -07:00
jean-pierre charras
f24aba4093 DIALOG_EXPORT_STEP_LOG: fix log display issues, due to DIALOG_SHIM changes.
- Clear m_textCtrlLog and display the command line string in TransferDataToWindow()
- Clear m_textCtrlLog on window close to avoid storing useless data in config
2025-08-20 17:39:21 +02:00
Seth Hillbrand
bd86f979ed Set embedded delegate to update view properly
When embedding a 3d model we want to be able to see it immediately but
this requires getting the embedded files from the delegate model

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19991
2025-08-20 08:34:09 -07:00
Seth Hillbrand
09cdca876c Add embed option to standard file dialog for 3dmodels
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20025
2025-08-20 08:28:00 -07:00
Seth Hillbrand
8b06071aad Fix compile error 2025-08-20 08:25:24 -07:00
Jeff Young
1ceac1dafd Simplify locking to just be another filter now that we don't have a dialog. 2025-08-20 15:24:36 +01:00
John Beard
105b9fcfe8 Pcbnew: fix occasional failure-to-select for dragging
In the Drag tool client filter function, sometimes,
GuessSelectionCandidates trims the collector's item list.
But we used the old contents of the per-type vectors to make
judgements about what was connected.

If a call came in with 2 tracks (e.g. near a knee) and one
was removed by GuessSelectionCandidates, sometimes the
other one would be the one selected for removal in the
2 tracks/0 via case. This leaves the collector empty.

The other case, where the item removed by GuessSelectionCandidates
was removed from the collector is silent, as removing an item
not in the collector is a no-op.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21517
2025-08-20 20:34:08 +08:00
John Beard
54349c5845 Tool: minor reduction of transitive includes 2025-08-20 20:34:08 +08:00
Jeff Young
b0945ee697 Don't push someone else's commit. 2025-08-20 13:19:37 +01:00
Jeff Young
e9f8b72666 Allow clearing of multiple tuning patterns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21508
2025-08-20 13:19:37 +01:00
dsa-t
6d325e067a Remove unnecessary newlines in STEP exporter logging.
(cherry picked from commit 4cfa2e3a3873643dc09f0c6df3ebe337ca7ccac1)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-20 14:54:44 +03:00
dsa-t
0788ff3849 Remove a Message_Printer holding a stale REPORTER pointer from OCCT.
Fixes KICAD-V8A


(cherry picked from commit eecf0cd685fd41cdcf9780bd4f3c90a351eeb632)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-20 13:58:36 +03:00
dsa-t
03fa5fdebc Record execute command job input and error streams in the log.
Also print the resolved command.


(cherry picked from commit 91e5e81bb483ff58072f8b2fdf0a6aedb06ea4a1)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-20 13:58:30 +03:00
Seth Hillbrand
776881fb96 When we change the schematic, update the holder
We need the holder to be accessible at all times to use tooling
2025-08-19 15:49:39 -07:00
Seth Hillbrand
0586f02f00 Move wire/junction actions out of SCHEMATIC
They are tool actions and require that the tool holder is valid, so they
really need to be where this is only ever true

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21510
2025-08-19 15:47:54 -07:00
Seth Hillbrand
cea77b7e9b Avoid doubly-inserting wires when repeating
The repeat key should only insert one copy.  We don't want to depend on
later cleanup
2025-08-19 14:40:48 -07:00
Seth Hillbrand
b6b8a6d465 All junction dots to be placed on overlaps 2025-08-19 14:39:47 -07:00
Seth Hillbrand
81ceb8d123 selectionTool can be null
need to guard the dereference

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21514
2025-08-19 14:39:18 -07:00
Seth Hillbrand
c995d47c87 Force overlapping wires to share labels
Crossing wires with pathological label in the center are actually
connected for the netlist.  This is an ERC error but we should keep
things consistent.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21494
2025-08-19 13:19:00 -07:00
John Beard
811745ff96 Pcbnew: efficiency and error-checking in footprint layers 2025-08-20 01:41:19 +08:00
John Beard
9173d11398 Very minor Coverity fixes 2025-08-20 01:41:18 +08:00
Jeff Young
941ea9edbb Formatting. 2025-08-19 18:33:18 +01:00
Jeff Young
5fa635602b Fix accidentally-deleted functionality. 2025-08-19 18:33:18 +01:00
jean-pierre charras
57044fc89f DIALOG_TRACK_VIA_PROPERTIES: ensure data displayed in the dialog are good.
Data shown in widgets (texts, cCB state...) must be initialized in
TransferDataToWindow(), not inside Ctor, because now the base class DIALOG_SHIM
initialize a default value in its TransferDataToWindow() member, called after
the end of DIALOG_TRACK_VIA_PROPERTIES Ctor.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21511
2025-08-19 16:32:52 +02:00
Jeff Young
c287d9a222 Avoid div-by-zero. 2025-08-19 13:42:49 +01:00
Jeff Young
de1c6c86ab Fix missing initialization. 2025-08-19 13:38:43 +01:00
Jeff Young
e841ca1906 Add spacing for Mac file dialog custom controls. 2025-08-19 12:52:21 +01:00
Jeff Young
ddcd1ade28 Minor tidy-up (missing colon). 2025-08-19 11:29:24 +01:00
Jeff Young
dfee657456 Don't append to previously-restored value.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21458
2025-08-19 10:40:37 +01:00
jean-pierre charras
3021d0241c Fix compil warnings: missing include 2025-08-19 09:16:08 +02:00
Mark Roszko
4f96c45dff Edit doxygen.Dockerfile 2025-08-19 03:27:50 +00:00
Seth Hillbrand
c715a1c574 Properly sequence checks 2025-08-18 19:31:30 -07:00
Jeff Young
a0940b10d4 Always provide a SCH_SCREEN to SCH_COMMIT.
Fixes KICAD-YKY
2025-08-18 22:09:21 +01:00
Seth Hillbrand
c51d26e70a Radiobutton groups get vertical by default so no spaces
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21496
2025-08-18 14:01:43 -07:00
John Beard
34a73a3d77 FP edit: Move private layer settings to layers panel 2025-08-19 05:00:03 +08:00
John Beard
ed01324c1d Footprints: allow to set specific internal copper layers
Footprints can now have a custom stackup. This means that they specify
an exact number of copper layers and the layers map 1:1 to board layers.
If the board doesn't contain that layer, the element just doesn't
show. We could make this a DRC check later on.

If there is no stackup, the behavior is the current default: a rule area
the In1 layer "expands" to all Inner layers.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10838
2025-08-19 04:59:48 +08:00
Jeff Young
8e45f03bd3 Bounds checking.
Fixes KICAD-TZK
2025-08-18 21:25:14 +01:00
JamesJCode
91139fe24f Fix sausage-fingers in comment 2025-08-18 20:36:01 +01:00
JamesJCode
ee9e94df04 Don't assume SCH_SYMBOLs have a LIB_SYMBOL when resolving embedded files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21497
2025-08-18 20:30:33 +01:00
Jeff Young
599be6ec34 Fix bone-headed mistake. 2025-08-18 20:14:30 +01:00
Jeff Young
6f389fd320 Tighten parent/child undo/redo architecture.
Always look for pre-existing undo/redo record.  Checking for IsNew()
is less robust and should be avoided.  Also moves the checking to a
location where it will be easier to ensure that it's uniform.

Push get-undo-level-item processing down a level so it is uniformly
called.

Make sure tables & labels are uniformly handled.

Remove incorrect usage of Get/SetGroupId() for storing lastPin
(which we don't use anyway).

Lists of deleted and changed items MUST include the screen pointer.
An item could be changed on one screen but not on another.

Also tightens handling of PCB_NETINFO_T items, which are not in the
view.

Also fixes a bug where there is no increment parameter if you assign
the base increment command to a hotkey.
(This was discovered while testing the above changes.)

Also fixes a bug where delete during a move in PCB Editor did an
undo instead of a delete.
(Again, found while testing above.)

An experiment was also run to collapse shared parts of SCH_EDIT_FRAME
and SYMBOL_EDITOR_FRAME into SCH_BASE_EDIT_FRAME.  However, sharing the
undo code actually increased complexity, and there was very little else
of value in SCH_BASE_EDIT_FRAME (other than the Increment() routines).
2025-08-18 19:20:09 +01:00
Jeff Young
30637e65b0 Move dirtyConnectivity up a level. 2025-08-18 19:20:09 +01:00
Jeff Young
c2f953e3f7 Fix copy/pasta. 2025-08-18 19:20:09 +01:00
Jeff Young
bf8809c841 Repair deficiencies in swapData. 2025-08-18 19:20:09 +01:00
Seth Hillbrand
8faf1b4d0e Allow soldermask bridging between nettie items
Previously we only allowed graphical items but within the net-tie we
need to allow bridging for connected items as well

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19288
2025-08-18 08:47:26 -07:00
jean-pierre charras
54085c4e50 Eeschema: Reset m_ercRun flag when cleaning all markers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21113
2025-08-18 17:30:46 +02:00
Ian McInerney
c87211e1df Move Poppler library inclusion to the kiplatform library where it is used 2025-08-18 15:35:59 +01:00
dsa-t
df86056f99 Wrap command text control in execute command job dialog.
(cherry picked from commit eb4f9fa093923ed52876fd5f48f7d58632ffd878)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-18 17:06:50 +03:00
Seth Hillbrand
eb89d7ffcc Fix preferential coordinates in rule display
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11546
2025-08-18 06:29:26 -07:00
jean-pierre charras
614f4ddc05 Minor fix: Remove a useless include in .h files, costing compilation time. 2025-08-18 15:02:04 +02:00
dsa-t
1af8722b0f Disable ibeam cursor setter for search fields on non-OSX.
The ibeam cursor gets stuck on MSW when mouse leaves the field.


(cherry picked from commit 47381f3d90f08ca832dd1152d02fdaa01dc3a52a)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-18 15:56:06 +03:00
Seth Hillbrand
a93803cfd7 Properly gate printing.cpp 2025-08-18 05:14:08 -07:00
Mark Roszko
e4aa8278c5 Make new SCHEMATIC objects instead of reusing them between loads 2025-08-18 01:08:45 -04:00
Seth Hillbrand
4c5b44545f Slight modification to followTrivialPath
Now keeps track of branch points, recursing through them to find the
longest path it can in both directions.  This helps to ignore
overlapping segments

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7809
2025-08-17 20:19:40 -07:00
Seth Hillbrand
bce3e7340f Revert "Rework Apple printing to better handle rotation"
This reverts commit 35ac6bdeb450fe1acc3c12d4f09ec9badd7af7f2.
2025-08-17 07:47:16 -07:00
Seth Hillbrand
c072133fa4 Ensure radio buttons are grouped
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21496
2025-08-17 07:45:01 -07:00
Seth Hillbrand
90e10a2910 Properly invert logic for printing
I meant to gate this for MSVC/MacOS/Linux but missed the mark
2025-08-17 07:31:20 -07:00
Seth Hillbrand
35ac6bdeb4 Rework Apple printing to better handle rotation
Apparently, mixed orientation isn't a thing in normal Apple print but
can be handled by the PDFKit printing
2025-08-17 07:07:29 -07:00
Seth Hillbrand
98a8f8678a Add logging to Windows print functions 2025-08-17 07:07:13 -07:00
jean-pierre charras
25da9e4c2a French translation update 2025-08-17 09:46:32 +02:00
Seth Hillbrand
23c1a68da8 Make printing consistent with plotting.
How you ask?  Plot first -> then read the PDF and print directly to the
platform-specific printers.  Roundabout?  Yes.  Better than wx printing?
Darnbetcha.

Also allows multi-size page printing and proper margins and print
preview

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1831
2025-08-16 20:07:45 -07:00
Alex Shvartzkop
911e1630a8 Update translations 2025-08-17 01:15:35 +03:00
dsa-t
0df00c2755
Translated using Weblate (Spanish)
Currently translated at 82.0% (8570 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-08-17 00:13:37 +02:00
Максим Горпиніч
9adb0183b4
Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10443 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2025-08-17 00:11:26 +02:00
Sárkány Lőrinc
9783912344
Translated using Weblate (Hungarian)
Currently translated at 33.2% (3473 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-08-17 00:11:26 +02:00
Максим Горпиніч
533071c6ab
Translated using Weblate (Ukrainian)
Currently translated at 91.3% (9543 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2025-08-17 00:11:26 +02:00
Максим Горпиніч
f283c58b48
Translated using Weblate (Ukrainian)
Currently translated at 90.5% (9452 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/uk/
2025-08-17 00:11:26 +02:00
Sárkány Lőrinc
634d71bb80
Translated using Weblate (Hungarian)
Currently translated at 33.1% (3457 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-08-17 00:11:26 +02:00
Sárkány Lőrinc
7b30c09298
Translated using Weblate (Hungarian)
Currently translated at 33.0% (3451 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-08-17 00:11:26 +02:00
Frank Sonnenberg
f454f879b9
Translated using Weblate (German)
Currently translated at 98.8% (10324 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-08-17 00:11:26 +02:00
YÜKSEL AÇIKGÖZ
5cd8eec039
Translated using Weblate (Turkish)
Currently translated at 99.9% (10441 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-08-17 00:11:25 +02:00
2tama3
6fae1bebb0
Translated using Weblate (Japanese)
Currently translated at 100.0% (10443 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-17 00:11:25 +02:00
Gaston Schelotto
617b08a867
Translated using Weblate (Spanish)
Currently translated at 82.0% (8568 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-08-17 00:11:25 +02:00
Mahdi Ahmadzadeh
3bf34a7609
Translated using Weblate (Persian)
Currently translated at 8.2% (861 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-08-17 00:11:25 +02:00
YÜKSEL AÇIKGÖZ
818c709077
Translated using Weblate (Turkish)
Currently translated at 98.6% (10301 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-08-17 00:11:25 +02:00
CloverGit
6332b28768
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 97.2% (10160 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-08-17 00:11:25 +02:00
Jan Straka
ae5050e699
Translated using Weblate (Czech)
Currently translated at 73.8% (7707 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2025-08-17 00:11:25 +02:00
ZbeeGin
2957004474
Translated using Weblate (Polish)
Currently translated at 98.7% (10316 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-08-17 00:11:25 +02:00
2tama3
c9c6ca7d3d
Translated using Weblate (Japanese)
Currently translated at 100.0% (10443 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-17 00:11:25 +02:00
ssantos
f434156a3c
Translated using Weblate (Portuguese)
Currently translated at 94.8% (9909 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pt/
2025-08-17 00:11:24 +02:00
Francisco Jose Rey
dcd55a375a
Translated using Weblate (Spanish)
Currently translated at 81.6% (8530 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/es/
2025-08-17 00:11:24 +02:00
Stefan Bjornelund the Gnome
c65a4ec6bb
Translated using Weblate (Swedish)
Currently translated at 99.7% (10421 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-08-17 00:11:24 +02:00
Henrik Kauhanen
a018b9729f
Translated using Weblate (Swedish)
Currently translated at 99.7% (10421 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-08-17 00:11:24 +02:00
dsa-t
923ea61a99
Translated using Weblate (Russian)
Currently translated at 94.1% (9830 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-08-17 00:11:24 +02:00
co8 j
6368d6222f
Translated using Weblate (Japanese)
Currently translated at 99.6% (10410 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-17 00:11:24 +02:00
Henrik Kauhanen
600eec45a4
Translated using Weblate (German)
Currently translated at 98.8% (10324 of 10443 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-08-17 00:11:24 +02:00
Seth Hillbrand
9f2b04c7e2 Prevent autosave error from cluttering the screen
Once per session, per editor we can show the error.  After that, assume
that the designer has seen and knows about the issue.

Fixes https://gitlab.com/kicad/code/kicad/issues/21464
2025-08-16 13:49:32 -07:00
Seth Hillbrand
fcd2da354d Allow wildcard matching for Netclass naming
Fixes https://gitlab.com/kicad/code/kicad/issues/21455
2025-08-16 13:30:20 -07:00
jean-pierre charras
2ff3f1fac1 Eeschema, DXF plotter: allows dxf unit selection (inch/mm) like in Pcbnew
Fix other minor issues in DIALOG_PLOT_SCHEMATIC.
Previously the export was always in inch (and in mm in Pcbnew)
kicad-cli always export in mm (like in Pcbnew)
2025-08-16 17:24:10 +02:00
jean-pierre charras
6d576a11a8 Fix 2 compil warnings. 2025-08-16 17:19:26 +02:00
Mark Roszko
e08c7799fa Fix build error 2025-08-15 23:10:48 -04:00
John Beard
c5d5a718aa Altium: handle '.var' concatenated special strings
The ST MB2046 reference board, for example, has all the
assembly-layer ref-des text in the format '.R42' even though
they're not concatenated.

Enable the existing but commented-out text.
2025-08-16 05:51:12 +08:00
John Beard
85dcdd5cb2 Altium: advanced config to skip models
This can be really slow, and isn't required if testing
something that's unrelated to models in a large demo file.
2025-08-16 05:36:11 +08:00
Seth Hillbrand
2ded7b87af Ensure archives without ext are given .zip
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21423
2025-08-15 13:25:36 -07:00
Seth Hillbrand
1166cacc64 Snap point editor into place
Adds 90° support to the point editor and ensures editing is the same as
creating when it comes to point snapping

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21481
2025-08-15 12:19:06 -07:00
Seth Hillbrand
ddae938aa4 Allow grouping tuning pattern with tracks
Any object that shares a name should be able to be handled in a group
2025-08-15 10:54:23 -07:00
Jeff Young
d5f16adde1 ADDED: maintenance page to preferences. 2025-08-15 16:57:46 +01:00
Jeff Young
9ff30873fc Prettify spacemouse preferences panel. 2025-08-15 16:57:46 +01:00
Seth Hillbrand
3ec380d93c Allow generator actions to affect children
Changing the generator will often modify the underlying children's
properties.  We should store these data in the stack.  Also add the
ability to change layers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21476
2025-08-15 06:50:46 -07:00
Seth Hillbrand
8bf7975440 Make move tool obey snap settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21192
2025-08-15 06:35:12 -07:00
Mark Roszko
53e8d051e3 Reuse the visibility bitmap bundles to reduce gdi object exhaustion
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21386#note_2654658071
2025-08-15 08:15:24 -04:00
Alex Shvartzkop
49a1323945 Fix build error on MSVC. 2025-08-15 11:58:47 +03:00
Seth Hillbrand
a45cb0015a Fix copy pasta causing crash
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21486
2025-08-14 16:28:10 -07:00
Seth Hillbrand
17d9ff4fe7 Add the ability to edit advanced config
If you set the env var KICAD_EDIT_ADVANCED_CFG=1, you get a new menu
option in the KiCad project window's Edit menu.  Lets you modify the
settings for advanced config graphically without having to
remember/lookup the magic incantation
2025-08-14 15:37:02 -07:00
dsa-t
7c499f499d Altium PCB import: fix 3D models rotation when 3D body is on bottom side.
See https://gitlab.com/kicad/code/kicad/-/issues/18450


(cherry picked from commit 9de49e3ac5cde06db7f1a0d86f66b3bde4c24f71)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-08-15 01:15:13 +03:00
jean-pierre charras
de47d89e41 DIALOG_IMPORT_SETTINGS: fix some minor issues.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21483
2025-08-14 13:44:01 +02:00
Jeff Young
33c73d7db4 Fix crashes when settings manager doesn't exist yet. 2025-08-14 11:33:25 +01:00
Jeff Young
dafc9dd05a Fix crash with empty grid setting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21479
2025-08-14 10:34:43 +01:00
jean-pierre charras
4ac43a212e DIALOG_BOARD_REANNOTATE: ensure the Grid selection choice is valid (existing grid).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21479
2025-08-14 11:31:55 +02:00
Seth Hillbrand
e97fab9aee Fixup live junction display
We were a bit aggro with how we removed junctions after finishing.  Now,
we can avoid this by removing moved junctions and re-adding when needed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21480
2025-08-13 13:53:30 -07:00
Olliver Schinagl
98d77db5ae export_vrml: Skip missing 3D models with warning 2025-08-13 18:06:28 +01:00
Jeff Young
d27d80ab80 Don't crash in absence of settings. 2025-08-13 16:29:11 +01:00
Jeff Young
c85e5c08e4 Improve quasimodal comment. 2025-08-13 16:22:51 +01:00
Jeff Young
a0e768dd0e Cleanup compiler warnings. 2025-08-13 16:22:51 +01:00
Jeff Young
8ed367f8cd Prevent all-radio-buttons-unset case. 2025-08-13 16:22:51 +01:00
jean-pierre charras
2afd752bbc Fix my previous commit 20d8c9c7. 2025-08-13 14:35:54 +02:00
jean-pierre charras
20d8c9c7f9 PLOT_CONTROLLER::PlotLayer(): fix bug when drill marks must be plotted.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21474
2025-08-13 12:54:07 +02:00
Jeff Young
60b4202766 CHANGED: Rework lock overrides architecture.
We now use a checkbox in the aux toolbar rather
than a query dialog (with "remember setting" checkbox).
2025-08-13 10:30:26 +01:00
Mark Roszko
9883c798fe Add missing mock for QA build 2025-08-13 00:57:26 +00:00
Mark Roszko
8d37fc8e80 Fix driver candidates sort not enforcing ordering if two buses have identical members 2025-08-12 20:27:02 -04:00
Seth Hillbrand
188ffda029 Add a 90°-only mode for polygon creation
Sometimes, you don't want those 45° corners in your nice, clean zones.
This adds an additional mode that can be selected, cycling through
free-angle, 45° angle and 90° angle constraints
2025-08-12 16:48:36 -07:00
Seth Hillbrand
5375e27415 Fix qa for eeschema
Need to note bus entry position even if we don't care about the junction
2025-08-12 16:21:57 -07:00
Seth Hillbrand
87ccb2abc0 Move Annotation preferences (most) to schematic setup
The scope, recursion, reset options and message filters remain in the
user preferences.  Others including numbering, sort order and reuse are
schematic preferences.

Also, the oddball subunit display remains here but it doesn't really
belong in annotation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17942
2025-08-12 16:15:17 -07:00
Ian McInerney
87c86c04fd Don't recreate initializer list everytime we test a track
The initializer list stays the same, so don't waste time recreating the
list everytime we want to test a track.
2025-08-12 17:37:05 +01:00
Ian McInerney
3382cf3152 Bump Coverity build image to Fedora 41 for SPNAV 2025-08-12 17:35:06 +01:00
Ian McInerney
cd86cadc35 Dump default Fedora image to include new SPNAV dependency 2025-08-12 17:32:09 +01:00
Andrea Greco
f969a87ce5 Add some pcb stats to statistics dialog
ADDED: Track statistics, board thickness and drill sizes to the PCB statistics dialog
2025-08-12 17:19:02 +01:00
jean-pierre charras
516cfb7a74 DIALOG_BOARD_STATISTICS: display castellated and press-fit pads count. 2025-08-12 17:23:11 +02:00
Seth Hillbrand
8a081f60b1 Prevent error message when backpropagating
Need to allow only processing other fields

Fixes https://gitlab.com/kicad/code/kicad/issues/21467
2025-08-12 08:10:22 -07:00
Seth Hillbrand
899cf0bebc Remove unused variable 2025-08-12 07:09:24 -07:00
Seth Hillbrand
0a5de5010f ADDED: Spacemouse support for Linux
Uses libspnav to handle spacemouse data.  Overlays on existing
spacemouse framework to handle view activation

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16133
2025-08-12 07:04:54 -07:00
Seth Hillbrand
b2fbb326b0 Keep the ruler measurements on screen
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11546
2025-08-12 06:57:01 -07:00
Seth Hillbrand
2445b481c3 Fix compile issue 2025-08-12 06:09:05 -07:00
John Beard
803a25792f Pcbnew: Array tool - remove duplicate rotation checkbox
Sync up a few defaults too while in the area.
2025-08-12 20:01:02 +08:00
John Beard
6c648c5ea6 Assign netclass dialog: use TransferDataToWindow 2025-08-12 20:01:02 +08:00
John Beard
d1aa7b148a Eeschema/Pcbnew: allow multiple nets to be assigned to a netclass at once
There is only a simplistic multi-net pattern expression
generator here (A|B|...) with a single prefix detected
rather than anything too fancy.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21451
2025-08-12 20:00:33 +08:00
John Beard
7239862202 Assign netclass dialog: upgrade WxFB version, no changes 2025-08-12 20:00:16 +08:00
John Beard
6ad1a5bd61 Netinfo: HasAutoGeneratedNetname is const 2025-08-12 20:00:15 +08:00
John Beard
299a6c6c7b Netinfo: avoid transitive string_utils.h include
Put the string manipuuation utils in the cpp, and
remove string_utils.h from the includes of netinfo.h.

This spams that header into about 350 files, not all of which
need it. Then go round and tidy up the places (most exporters
and dialogs) where CPP files weren't including string_utils.h
when they used it, as well as some other order-sensitive
include issues that turned up.
2025-08-12 20:00:15 +08:00
Jeff Young
10ca84470c Don't remember remember checkbox.
(No, that's not a typo.  The locked items "remember"
checkbox is for the session.  We don't want to
reload the checkbox between sessions.)
2025-08-12 12:50:25 +01:00
John Beard
845c67fca3 Eeschema: forward declare outside the namespace
GCC didn't like the std::vector<class SCH_JUNCTION*> inside the NS.
2025-08-12 16:09:49 +08:00
Seth Hillbrand
1a7a97a496 ADDED: Realtime junction indicators
Adds potential junctions to the preview overlay while drawing wires or
dragging.  Also fixes an issue where junctions were created at old
splits

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18206
2025-08-11 17:42:58 -07:00
Seth Hillbrand
563489d612 Make 3d-viewer mouse controls standard
We should use the common panel preferences for 3d viewer as well

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20098
2025-08-11 15:55:58 -07:00
Seth Hillbrand
c1d4b537c5 Enforce unique scroll gesture
We should not allow setting multiple actions to the same gesture.  Just
confusing
2025-08-11 14:53:38 -07:00
Seth Hillbrand
a7e6fa8198 Allow panning with selectable key
Add optins to mouse dialog to allow modifier key-based mouse movement
panning

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2492
2025-08-11 13:21:22 -07:00
Jeff Young
833a5ee3ab Yet even more open-coded dialog state-saving cleanup. 2025-08-11 20:36:23 +01:00
Seth Hillbrand
1b0ed24558 Minor cleanup logic 2025-08-11 11:03:31 -07:00
Jeff Young
7cd9260a92 Extra row height now added in WX_GRID. 2025-08-11 18:30:53 +01:00
Jeff Young
92e139f64b Separate initialization from data loading. 2025-08-11 18:30:53 +01:00
Seth Hillbrand
ac7ae87495 Parse gitignore when building new project from template
Avoids cloning the .git subdirectory and will also avoid any files
listed as ignored in the .gitignore file.  It will copy both gitignore
and gitattributes into the new project

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16507
2025-08-11 10:06:39 -07:00
jean-pierre charras
09e1fca7e4 More about support of press-fit pad fabrication property
Also some fixes in dialogs.
2025-08-11 18:48:35 +02:00
Jeff Young
98f8afd41f Yet more open-coded dialog state-saving cleanup.
Daddy, are we *there* yet?
2025-08-11 17:19:12 +01:00
Jeff Young
38023a33b2 Give some more dialogs separate hashkeys for separate usages. 2025-08-11 17:19:12 +01:00
Jeff Young
6947b3b233 Even more open-coded dialog state-saving cleanup. 2025-08-11 17:19:12 +01:00
Jeff Young
cd325198c1 Give WX_TEXT_ENTRY_DIALOG a title- and label-specific hash.
This keeps us from attempting to save/restore control
state between different usage cases.
2025-08-11 17:19:12 +01:00
Jeff Young
af9fdbcd33 Nullptr safety. 2025-08-11 17:19:12 +01:00
Seth Hillbrand
8f625086b1 Remove namespacing from IPC2581 output
Because some readers maintain global namespace per the standard, we make
sure that we don't overlap names between namespaces but keep the minimum
viable name for each element

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19914
2025-08-11 08:50:23 -07:00
jean-pierre charras
da92279436 Pcbnew: add pad fabrication property Press-Fit
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21457
2025-08-11 15:59:19 +02:00
John Beard
ea8d0519bd Eeschema: propagate alt mode icons to render settings on prefs change
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21462
2025-08-11 20:58:15 +08:00
Seth Hillbrand
aa4bba3c94 Resistor calculator should minimize parts
If we can get a equivalent value match using the same parts, prefer
that.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7100
2025-08-10 21:09:43 -07:00
Seth Hillbrand
77b99968ed Fix typo in previous commit 2025-08-10 20:25:35 -07:00
Seth Hillbrand
02e9dd697b ADDED: Action to embed all 3d models referenced
Moves through the footprints and replaces external references with
internal embedded files

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20847
2025-08-10 20:20:32 -07:00
Seth Hillbrand
c4d78d2bce Add plausibility check to DRC custom rules
- Checks for duplicate conditions
- Checks for non-existent netclasses
- Checks for non-existent layers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13498
2025-08-10 19:28:20 -07:00
Jeff Young
88e97566c3 Fix build error. 2025-08-10 22:14:40 +01:00
Jeff Young
cf5c00bcf2 Make more use of shared dialogs. 2025-08-10 21:32:10 +01:00
Jeff Young
892f9031d7 More open-coded dialog state-saving cleanup. 2025-08-10 21:00:17 +01:00
Jeff Young
567c7aa96b Separate control building from control value setting.
The first needs to happen before dialog layout, the
second after DIALOG_SHIM's control state restoration.
2025-08-10 18:43:09 +01:00
Jeff Young
8d26313d8d Separate control building from control value setting.
The first needs to happen before dialog layout, the
second after DIALOG_SHIM's control state restoration.
2025-08-10 18:30:14 +01:00
Jeff Young
44bd29d592 More removal of open-coded dialog state saving. 2025-08-10 15:57:20 +01:00
Jeff Young
2909e984b6 There is no need to store the m_reporter pointer. 2025-08-10 11:40:04 +01:00
Jeff Young
661be06168 Use TransferDataToWindow() to init controls. 2025-08-09 21:52:08 +01:00
Jeff Young
a45f8bc2f7 Don't store m_severities. It won't follow save control state. 2025-08-09 19:11:27 +01:00
Jeff Young
5805f67459 Save notebook page titles rather than index.
(Some notebooks have variable pages from invocation
to invocation.)

Also adds bounds-checking where appropriate.
2025-08-09 17:18:57 +01:00
Jeff Young
5a358d99bb Save notebook page titles rather than index.
(Some notebooks have variable pages from invocation
to invocation.)
2025-08-09 17:11:54 +01:00
Jeff Young
5dabfaf26e Remove more old open-coded dialog state saving.
(State saving is now handled uniformly in DIALOG_SHIM.)
2025-08-09 16:11:36 +01:00
Jeff Young
d1dd446e4e Remove more old open-coded dialog state saving.
(State saving is now handled uniformly in DIALOG_SHIM.)
2025-08-09 16:11:36 +01:00
Carsten Schoenert
9fcee70827 python: Use raw-strings expressions
Python 3.12 is now more pedantic about the used string regexp syntax in
re.* functions.

Signed-off-by: Carsten Schoenert <c.schoenert@t-online.de>
Signed-off-by: Adrien Ricciardi <adrien.ricciardi@hotmail.fr>
[Adrien Ricciardi: This patch comes from Debian: https://sources.debian.org/src/kicad/9.0.3+dfsg-1/debian/patches/fixes/python-Use-raw-strings-expressions.patch]
2025-08-08 21:29:53 -07:00
Seth Hillbrand
58c9893a3f Add QA for COMMMIT/SCH_COMMIT/BOARD_COMMIT 2025-08-08 21:28:54 -07:00
Seth Hillbrand
a9121d4cd1 Add asan switch indicators 2025-08-08 21:25:19 -07:00
Seth Hillbrand
b207ec8817 Remove negative index access from CPoint
Callers should be responsible for index count and/or use iterators
2025-08-08 10:46:45 -07:00
Jeff Young
5df10e23b9 Cleanup. (And fix compile issue with test.) 2025-08-08 18:16:33 +01:00
Jeff Young
9930e3b252 Remove more old open-coded dialog state saving.
(State saving is now handled uniformly in DIALOG_SHIM.)
2025-08-08 18:15:53 +01:00
jean-pierre charras
69ab015d19 QA test: fix a compil issue. 2025-08-08 18:06:53 +02:00
jean-pierre charras
33826b4af3 DIALOG_TEMPLATE_SELECTOR: fix minor issues Windows specific.
- deselect the string showing the folder path (selected at opening the dlg)
- replace a linear-gradient HTML data not handled by wx webview library
standard build version on MSYS2 (MSYS2 specific)
2025-08-08 17:19:03 +02:00
John Beard
db97d77544 Netclass: allow multiple assignments with the same pattern
This isn't really a problem, and overwriting the entry allows
for silent data loss by making a new assignment with the
same pattern as an existing one.

The resolve netclasses are de-duplicated later, so it's even
OK if the whole assignment is duplicated (in theory), but
continue to clean these up.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21316
2025-08-08 21:39:41 +08:00
JamesJCode
88c09517f2 Ignore empty net class fields in net class ERC 2025-08-08 14:37:11 +01:00
Jeff Young
69c4526358 Fix broken build. 2025-08-08 14:30:51 +01:00
Jeff Young
373d91336b Fix broken build. 2025-08-08 14:17:35 +01:00
Jeff Young
4819487ea2 Save/restore state of UNIT_BINDER and other textboxes. 2025-08-08 13:54:27 +01:00
Jeff Young
60dbfd3eec Don't show locked shadow in pad preview. 2025-08-08 13:54:26 +01:00
Jeff Young
66ee17cdcd Start removing old open-coded dialog state saving.
(State saving is now handled uniformly in DIALOG_SHIM.)
2025-08-08 13:54:26 +01:00
Jeff Young
ac867f6aa7 Add owner-drawn combos to control state saving.
(Also fixes LAYER_BOX_SELECTOR, etc.)

Also fixes a bug in saving wxComboBox state (we
need to save the value, not the index).
2025-08-08 13:54:26 +01:00
jean-pierre charras
9c051a8138 DIALOG_TEMPLATE_SELECTOR: fix a panel min size.
A min size panel was already set, but for some reason did not work.
Setting the min size of the sizer containing this panel works better.
2025-08-08 09:52:39 +02:00
Mark Roszko
5895c27f4a Rename Prj() on schematic to avoid conflict with global function 2025-08-07 23:21:41 -04:00
Seth Hillbrand
1a4eba56a7 ADDED: Skip Via support
Skip vias are vias that are flashed on their start and end layers but
have no annular rings on the interior layers and do not connect to zones
in those layers

You can now select Annular ring type "Start and end layers only".  This
will prevent annular ring flashing on intermediate layers and zones
fills will provide clearance.  You can still connect tracks to
intermediate layers but preventing that will fall to the designer

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21433
2025-08-07 15:48:10 -07:00
Seth Hillbrand
d8a99ea38f ADDED: New ERC test for mis-match GND pins
If you have a pin with a label containing the letters "GND" in it and it
is not connected to a net with a label also containing "GND" AND there
is another pin on your symbol that _is_ connected to a net containing
"GND", then there is a likelihood that you have accidentally mixed up
your connections to the GND pin
2025-08-07 15:42:56 -07:00
Ben Gamari
a07db6763a api/common: Fix units of Time
Times are internally represented in attoseconds, not picoseconds.
2025-08-07 18:06:59 +01:00
JamesJCode
37ba83a44b Make delay base units documentation consistent with other usages 2025-08-07 17:59:46 +01:00
Seth Hillbrand
9e326c29db Disable snap when moving with keyboard
Keyboard movement is for precision control, so avoid snapping behavior

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21235
2025-08-07 08:25:53 -07:00
John Beard
6bdfe2bce6 Pcbnew: fix outline drawing of PTH pads
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21448
2025-08-07 22:48:22 +08:00
jean-pierre charras
0fccd846e6 Fix missing include. 2025-08-07 15:29:43 +02:00
Seth Hillbrand
762aa66d62 Try again to fix template assert
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21438
2025-08-07 05:18:25 -07:00
Jeff Young
d2293ab56a Fix key generation for dialog control state.
(Previous algo overwrote className and then later
tried to use it to find siblings.)
2025-08-07 11:44:47 +01:00
Jeff Young
241d9a4c30 Separate locked & unlocked vias in global deletions.
Also allows a dialog to opt out of control-state
saving at the top level (rather than on every control).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21441
2025-08-07 11:44:47 +01:00
Jeff Young
3f8709ff55 Missed checking in file in earlier commit. 2025-08-07 11:44:47 +01:00
Jeff Young
3f1f9e8e72 Remove stale comment. 2025-08-07 11:44:47 +01:00
Jeff Young
1e9da4684a Move properties inspector font-listing to SetChoicesFunc(). 2025-08-07 11:44:47 +01:00
Mark Roszko
4f8a4e4e2b Add CreateResourceCpp helpers for future use 2025-08-07 00:13:54 -04:00
Mark Roszko
3f549748e9 Ensure webview always included for wxwidgets in vcpkg 2025-08-06 21:14:31 -04:00
Mark Roszko
990caa1988 Use the full bitmap bundles in ACTION_MENU 2025-08-06 20:28:41 -04:00
Seth Hillbrand
8f34543569 Make sure there is a valid parent
I _thought_ Detaching removed the parent but turns out not.  Set the
panel to temporary, known-good parent and reparent later after adding
the new page

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21438
2025-08-06 17:03:55 -07:00
Seth Hillbrand
1a8dac9296 Have Find dialog update its cache on board mod
We don't want to find stale references

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21445
2025-08-06 16:37:03 -07:00
Seth Hillbrand
73aa437259 Finalize lasso selection tool
- Move under rectangular selection
- Simplify available modes
- Link to new icon
- Make selection state persistent
- Allow additive/subtractive with KiCad configurable keys
2025-08-06 16:07:43 -07:00
Seth Hillbrand
065748213e Update lasso icon 2025-08-06 16:07:43 -07:00
Andrzej Wolski
c73d555fe2 ADDED: Lasso selection in pcbnew
Adds a lasso or freeform selection tool to KiCad in addition to standard
rectangular selection.  Adds supporting HitTest routines

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1977
2025-08-06 16:06:40 -07:00
Seth Hillbrand
1306cb337d Fix fat-fingering mistake 2025-08-06 13:26:20 -07:00
John Beard
da1495cd67 Pcbnew: Zero-thickness layers are not specified rather than actually zero
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21443
2025-08-07 03:56:41 +08:00
JamesJCode
b87a050bd8 Use full start / end copper layer heights in length calculations
Previously we halved the start / end copper layer heights, which is
not in line with how other EDA tools behave. This was also inconsistent
with adding pad-to-die lengths as we did not add back in the missing
half.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21365
2025-08-06 20:30:13 +01:00
Seth Hillbrand
7dc83fbffd Ensure dialogs are visible on all Spaces
We never want to hide dialogs if their parent is on a different Space
(MacOS-specific terminology), so set the window property to show
everywhere when showing a dialog

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13906
2025-08-06 11:48:07 -07:00
Seth Hillbrand
fa02553d53 Don't special case custom pads from Altium
All pads should follow the same behavior.  Remains todo to
differentiate between missing values (inherit in Altium) and custom 0mil
values (force no expansion)
2025-08-06 11:41:42 -07:00
John Beard
a8d69c856f Eeschema: fix alt mode resetting on symbol update
GetName is the alt name if it's set, so use GetBaseName.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21439
2025-08-07 01:18:34 +08:00
John Beard
8023227829 Eeschema: fix alt pin icon/OP current preference resetting
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/21440
2025-08-07 00:55:48 +08:00
John Beard
e82d19eeb7 Pcbnew 3D: Add a toggle for plated barrel visibility
This can be useful when checking 3D models and/or generating
images of components in place on board, or if a dense via field is
in the way when looking at something on an inner layer.
2025-08-07 00:55:48 +08:00
John Beard
71750aa87e Icons: Pixel-align some icons
This avoids lines being fuzzy at 1:1 and 1:2 sizes.
2025-08-07 00:55:48 +08:00
John Beard
bbe5280d57 Eeschema: provide tooltip for place sheet pin action 2025-08-07 00:55:48 +08:00
John Beard
4f629e2d6d Eeschema: better differentiate hierarchical label action icons 2025-08-07 00:55:48 +08:00
John Beard
1832aba14e Eeschema: fix missing include 2025-08-07 00:55:48 +08:00
John Beard
2bf2e30af6 Pcbnew: squash shadowed variable warning in copper clearance DRC 2025-08-07 00:55:48 +08:00
John Beard
0eaedb770b Edit constraints: formalise ownership semantics 2025-08-07 00:55:47 +08:00
jean-pierre charras
9ccc47cf0b panel_setup_rules_help_8expression_functions: use style similar to other help texts 2025-08-06 18:33:36 +02:00
jean-pierre charras
de208b3f00 Kicad manager: display the number of GDI objects in About Dialog (Windows only)
On Windows, if the number of GDI objects reach a limit (usually 10000) some can
be not shown, thus creating  a strange behavior not easy to diagnose.
Displaying the number in use can help.
2025-08-06 18:17:05 +02:00
Jeff Young
54d8cf10fc Selected is not the same as highlighted.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19976
2025-08-06 15:27:58 +01:00
Jeff Young
e16c8fdba0 Formatting. 2025-08-06 15:27:58 +01:00
Jeff Young
43a1134397 Performance tweak. 2025-08-06 15:27:58 +01:00
Jeff Young
400fd96ee2 Make use of new move assignment operators. 2025-08-06 15:27:58 +01:00
jean-pierre charras
d7cf008397 Try to fix a QA test. 2025-08-06 16:20:55 +02:00
Jeff Young
8e534449af Forgot to bump file format version for 5a70fc0bd5985416f3ed279eae221c41704bb349. 2025-08-06 11:28:34 +01:00
Jeff Young
b2ecaf1ddc Don't set m_IsPreviewer to force 3D models.
It has unintended side-effects (such as showing
user drawings and user comments layers).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21428
2025-08-06 11:21:55 +01:00
Seth Hillbrand
ece58909ba Avoid infinite loop if the grid size is zero or less 2025-08-05 16:18:02 -07:00
Seth Hillbrand
29eee9f126 Refactor grid_helper to allow testing
Make view and tool manager optional so that we can implement QA on the
actual snapping
2025-08-05 16:10:17 -07:00
Alex Shvartzkop
fb6bc9ca11 Improve Library link label to text field alignment in symbol/footprint properties dialogs. 2025-08-05 20:23:41 +03:00
Jeff Young
2e629ca55c ADDED: follow-pcb and follow-plot-settings to render job settings.
Also added Follow-board-stackup-colors to both
render job settings and render CLI arguments

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21341
2025-08-05 18:01:50 +01:00
Jeff Young
fa9df08f94 Quiet assert.
Fixes KICAD-V9P.
2025-08-05 13:49:31 +01:00
Jeff Young
5a70fc0bd5 Convert (island) to (island yes). 2025-08-05 13:49:31 +01:00
Jeff Young
d3f2bec6a6 Performance tweaks. 2025-08-05 13:49:31 +01:00
Alex Shvartzkop
d340fa1a12 Update translations 2025-08-05 15:14:21 +03:00
CloverGit
9063c1bbe7
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 97.7% (10166 of 10399 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-08-05 14:13:51 +02:00
dsa-t
5e5ce91400
Translated using Weblate (Russian)
Currently translated at 94.5% (9833 of 10399 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ru/
2025-08-05 14:13:51 +02:00
co8 j
c977640b90
Translated using Weblate (Japanese)
Currently translated at 100.0% (10399 of 10399 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-05 14:13:51 +02:00
2tama3
175c6f5e62
Translated using Weblate (Japanese)
Currently translated at 100.0% (10399 of 10399 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-05 14:13:51 +02:00
co8 j
12a1a3c028
Translated using Weblate (Japanese)
Currently translated at 100.0% (10399 of 10399 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-08-05 14:13:50 +02:00
Pferd O
ed7892d5b6
Translated using Weblate (German)
Currently translated at 99.3% (10330 of 10399 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-08-05 14:13:50 +02:00
Mahdi Ahmadzadeh
c062908b8f
Translated using Weblate (Persian)
Currently translated at 8.0% (840 of 10399 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-08-05 14:13:50 +02:00
Alex Shvartzkop
f4c356a4f8 Update generated custom DRC rules help files, required for Weblate. 2025-08-05 14:37:17 +03:00
Alex Shvartzkop
188e0fc545 Revert "Ignore autogenerated files"
This reverts commit 36366e254d2526be009f2bf3c33ed52b7e3efafd.
2025-08-05 14:33:20 +03:00
Mojca Miklavec Groenhuis
f145d8750d Name change 2025-08-05 10:40:10 +01:00
Seth Hillbrand
416e54f0d5 Update template selector to modern webview
Allow more attractive templates.  Start of building singular
template+new project layout

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15987
2025-08-04 22:20:54 -07:00
Seth Hillbrand
dd889ddac9 Add Tesselation QA tests 2025-08-04 22:20:42 -07:00
Jeff Young
dc7312efd6 Frame needs an extra kick to toggle grid visibility.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21409
2025-08-04 21:19:21 +01:00
Seth Hillbrand
321b5793a2 Add some QA tests
Created basic tests for:
- Notification Manager
- Clipboard
- File history
- Filename Resolver
- Hotkey store
- Collector
- Reporters
2025-08-04 11:36:43 -07:00
Jeff Young
ea84879b06 Allow deletion of nested embedded files.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20581
2025-08-04 19:11:59 +01:00
Jeff Young
7240128130 Formatting. 2025-08-04 19:11:59 +01:00
Jeff Young
2c3408aad5 Grid is already updated by AddFile() callback.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20565
2025-08-04 19:11:59 +01:00
Jeff Young
724e44d5a0 Move assignment operators for some hot-path classes. 2025-08-04 19:11:59 +01:00
Seth Hillbrand
43a9c760b1 Add some QA tests for FILE_HISTORY, SEARCH_PATH and FILENAME_RESOLVER 2025-08-04 09:59:30 -07:00
Seth Hillbrand
50c7aff3ff Simplify KiROUND using std::llround/clamp
Removes the bespoke rounding in favor of std::llround and std::clamp
routines
2025-08-04 09:26:25 -07:00
Seth Hillbrand
4aa2047f45 Replace alg::delete and alg::delete_if with std c++20 2025-08-04 09:03:16 -07:00
Seth Hillbrand
06d5503db1 Remove heap-managed WX custom list in BOM
No need to do the extra memory management for what is essentially a
vector
2025-08-04 08:49:47 -07:00
Seth Hillbrand
e379e91081 Store hierarchy expansion/collapse state
Defaults to fully expanded but stores the names for nodes that are
collapsed in project local settings.  Because project local settings are
generally changed by modifying views or selection filters, these should
be saved on close rather than only when the project is saved

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19276
2025-08-04 08:34:09 -07:00
Jeff Young
b67b467483 Uninitialized variable. 2025-08-04 11:18:20 +01:00
Jeff Young
82124c9cef Leave decision to show mandatory field columns to user.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13600
2025-08-04 11:11:19 +01:00
John Beard
2b69e118e0 Pcbnew: fix mistaken angle int cast in arc properties 2025-08-04 17:37:55 +08:00
dsa-t
6eb68aaf6e Revert "Fix copy-pasta in common PCH command (-5.4% time on MSVC/Debug)"
This reverts commit af8491e788323bfc3316001730d88c364ef2a665
2025-08-04 08:16:41 +03:00
Alex Shvartzkop
af8491e788 Fix copy-pasta in common PCH command (-5.4% time on MSVC/Debug) 2025-08-04 08:02:05 +03:00
Seth Hillbrand
bf16dcfbe8 Make all windows remember their preferences
Hook into DIALOG_SHIM to remember stylistic preferences for windows such
as position, size, sash position, notebook selection, etc.

Dialogs and controls can opt out of this by setting a client data user
property "persist" to false.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19992

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10756

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21108
2025-08-03 20:22:30 -07:00
Seth Hillbrand
11d0bb466b ADDED: PROPERTY_HOLDER class
Useful for attaching arbitrary properties to userdata
2025-08-03 20:22:30 -07:00
Alex Shvartzkop
39978ab2e2 Fix erroneous hex parsing when opening legacy PCB files on MSVC.
e.g. "FFFF8007" does not fit into signed "long" type (4 bytes on MSVC),
so strtoul returns 0x7FFFFFFF and sets errno to EINVAL.
2025-08-04 06:06:13 +03:00
Jeff Young
95da436ddd Focus second column control after property grid navigation.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20651
2025-08-03 23:17:09 +01:00
Jeff Young
918f0ec6af More discriminatory test for 2-1/2 digits after decimal. 2025-08-03 23:16:11 +01:00
Jeff Young
34e075e112 Rework libtree SearchTerms to honour shownColumns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21419
2025-08-03 20:32:19 +01:00
Jeff Young
a8df4b16e2 Range checking. 2025-08-03 20:32:19 +01:00
Seth Hillbrand
558627289b Add WebView widget for future use
This is mostly for testing Thunderdome but we will be using this for
future template rendering as well
2025-08-03 12:28:43 -07:00
John Beard
cef8e77eed Revert "Pcbnew point editor: avoid flickering when dragging"
This doesn't work properly as EDIT_CONSTRAINTs are using
references to the wrong point.

This reverts commit f632bad5768420776bd639303c0ecd2bf591cc28.
2025-08-04 00:25:25 +08:00
Seth Hillbrand
52f8bf83f6 Remove threading from connection vec update
At most, we will have 4 items.  Or maybe a few more with stacked pins.
But not enough to thread.  The overhead of starting threads and using
mutexes is greater than any savings
2025-08-03 09:18:54 -07:00
John Beard
f632bad576 Pcbnew point editor: avoid flickering when dragging
Only apply the update point to the EDIT_POINT if it will actually
change. Otherwise the intermediate position before grid snapping, etc.,
caused flickering when dragging with a large grid.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19947
2025-08-04 00:03:07 +08:00
jean-pierre charras
82ea895ed9 Fix qa test compil issue due to my previous (e1c56c71) commit 2025-08-03 17:10:29 +02:00
Seth Hillbrand
b21e3e45d9 Extract generic item connectivity update and add QA 2025-08-03 08:09:01 -07:00
Seth Hillbrand
15ca4b1ba2 Extract symbol connectivity routine and add QA 2025-08-03 08:09:01 -07:00
jean-pierre charras
e1c56c71ef Fix compil warnings (some due to declarations colliding with a Windows header) 2025-08-03 16:11:14 +02:00
Seth Hillbrand
7102b2d5e5 Clarify some driver sorting logic and add addl QA 2025-08-03 06:46:28 -07:00
John Beard
8c4c3b7e5e Pcbnew: when moving, select move origin by mouse, not cursor
Selecting the origin fby the cursor position makes it impossible
to select a item further from a grid point than another. This is
especially noticeable when selecting pins while using large grids

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10471
2025-08-03 20:38:18 +08:00
John Beard
3606d25ab6 Pcbnew: improve snapping: avoid cases where a valid snap is excluded
Trimming items that don't have an "involved" real item needs to be
done at the time that the nearest point is found. Otherwise, if
there are multiple nearest points at the same location, and an
'uninvolved' one is chosen, it will later be discarded, and the
grid snap will be the fallback.

The effect of this is that grid snaps can appear to be very
agressive and also inconsistent, as it sometimes uses the item
snap (when it happens to choose an "involved" one) and sometimes not.
2025-08-03 20:38:18 +08:00
John Beard
16d2d1573d Fix minor compiler warning (sign mismatch) 2025-08-03 20:38:18 +08:00
Jeff Young
57f3f22aa4 nullptr safety 2025-08-03 12:51:34 +01:00
Jeff Young
70d1950bbe Use hairlines for point editor construction lines. 2025-08-03 12:51:34 +01:00
Jeff Young
55097b9539 Formatting. 2025-08-03 12:51:34 +01:00
Jeff Young
5160bfb212 Angle is included angle, not start angle. 2025-08-03 12:51:34 +01:00
Seth Hillbrand
1a25f07c76 Add QA for connection graph resolve drivers 2025-08-02 20:38:54 -07:00
Seth Hillbrand
9ea088f83f Add git shutdown command
Will allow interrupting long commands during the update message
2025-08-02 20:31:40 -07:00
Seth Hillbrand
c5545d202d Remove doubly-included kicad_algo 2025-08-02 19:55:55 -07:00
Seth Hillbrand
c9e9a4e073 Allow git init to succeed without remote 2025-08-02 16:39:11 -07:00
Wayne Stambaugh
b76ef4e239 Fix broken GCC build. 2025-08-02 17:57:55 -04:00
Jeff Young
25ad1f051e Attempt to fix non-Clang builds. 2025-08-02 22:56:52 +01:00
Jeff Young
91b7bc0843 Support dash-dot-dot line style in DXF.
Fixes KICAD-TY8.
2025-08-02 22:56:52 +01:00
Seth Hillbrand
e6e44d08fc ADDED: Common 3d image export and file size choice
Instead of two actions for exporting to two different file formats,
unify into a single Export Image command with the format chosen based on
file extension/selected format in save dialog.

Also allow arbitrary image size export

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3689

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4693
2025-08-02 14:30:07 -07:00
Jeff Young
5accdc2d94 Move search handlers to std::shared_ptr. 2025-08-02 22:04:53 +01:00
Jeff Young
dc3cd81a2a Don't run connectivity on non-existant layers.
Fixes KICAD-X8V.
Fixes KICAD-VH3.
2025-08-02 22:04:53 +01:00
Jeff Young
a75fd2bb23 See if copying netclasses is responsible for KICAD-V6Z (and others). 2025-08-02 22:04:53 +01:00
Jeff Young
8c85cd43f3 Copy c'tor / operator= safety.
Also fixes a memory leak of search pane handlers.
2025-08-02 22:04:53 +01:00
Seth Hillbrand
a7ab02224e Fix pathspec lifetime issue
Don't let stack pointers go out of scope before using

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21417
2025-08-02 12:33:55 -07:00
Jeff Young
d91cce930f Don't allow default copy c'tor to copy arrays of pointers.
Fixes KICAD-SJ2.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21408
2025-08-01 21:27:12 +01:00
Jeff Young
ed40391bde Don't attempt to fetch last char of empty string.
Fixes KICAD-5ED.
Fixes KICAD-RC1.
Fixes KICAD-W0B.
2025-08-01 16:46:51 +01:00
Jeff Young
ac3eac9ed0 Nullptr safety.
Fixes KICAD-P7Q.
2025-08-01 16:46:50 +01:00
Jeff Young
6c6c02a329 Don't assume a tree root.
Fixes KICAD-Y72.
2025-08-01 16:46:50 +01:00
jean-pierre charras
bf21edb7ce French translation update 2025-08-01 10:59:48 +02:00
Mark Roszko
275bbf1aef Add missing copy pasta for ps jobs handler 2025-07-31 21:35:42 -04:00
Alex Shvartzkop
eadce8852f Update translations 2025-07-31 19:36:57 +03:00
CloverGit
f462301dc7
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.5% (10238 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-31 18:36:30 +02:00
co8 j
02e404c121
Translated using Weblate (Japanese)
Currently translated at 99.9% (10385 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-31 18:36:30 +02:00
Mahdi Ahmadzadeh
6fdf45a6e9
Translated using Weblate (Persian)
Currently translated at 7.8% (816 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:30 +02:00
2tama3
bc273768c2
Translated using Weblate (Japanese)
Currently translated at 99.9% (10384 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-31 18:36:30 +02:00
Mahdi Ahmadzadeh
1743cba006
Translated using Weblate (Persian)
Currently translated at 6.9% (724 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:30 +02:00
2tama3
a9e2c4c73f
Translated using Weblate (Japanese)
Currently translated at 99.3% (10321 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-31 18:36:30 +02:00
co8 j
5b5b6bb2f0
Translated using Weblate (Japanese)
Currently translated at 99.3% (10321 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-31 18:36:30 +02:00
Jan Straka
2b93e04b9f
Translated using Weblate (Czech)
Currently translated at 74.6% (7756 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/cs/
2025-07-31 18:36:30 +02:00
Mahdi Ahmadzadeh
b38e8ecd24
Translated using Weblate (Persian)
Currently translated at 5.5% (577 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:30 +02:00
Mahdi Ahmadzadeh
8ef498158e
Translated using Weblate (Persian)
Currently translated at 5.2% (546 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:30 +02:00
2tama3
216222b962
Translated using Weblate (Japanese)
Currently translated at 98.4% (10222 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
4cb72f1076
Translated using Weblate (Persian)
Currently translated at 4.7% (498 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mustafa Selçuk ÇAVDAR
4d62baa094
Translated using Weblate (Turkish)
Currently translated at 99.8% (10374 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
aa42ea15cf
Translated using Weblate (Persian)
Currently translated at 4.5% (468 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
d0be07c367
Translated using Weblate (Persian)
Currently translated at 3.0% (318 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
0f51432d37
Translated using Weblate (Persian)
Currently translated at 3.0% (315 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
c9e547e21b
Translated using Weblate (Persian)
Currently translated at 2.9% (306 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
b644a52d0d
Translated using Weblate (Persian)
Currently translated at 2.9% (303 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
778c8e8ce5
Translated using Weblate (Persian)
Currently translated at 2.8% (300 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
875c5e2423
Translated using Weblate (Persian)
Currently translated at 2.8% (298 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
49f5947c45
Translated using Weblate (Persian)
Currently translated at 2.8% (297 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
63d622443e
Translated using Weblate (Persian)
Currently translated at 2.8% (295 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
859297ea56
Translated using Weblate (Persian)
Currently translated at 2.8% (293 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:29 +02:00
Mahdi Ahmadzadeh
16b06f8094
Translated using Weblate (Persian)
Currently translated at 2.7% (290 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
Mahdi Ahmadzadeh
ac95356c56
Translated using Weblate (Persian)
Currently translated at 2.7% (288 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
Mahdi Ahmadzadeh
f2e7aeef8f
Translated using Weblate (Persian)
Currently translated at 2.7% (286 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
Mahdi Ahmadzadeh
e5bee14033
Translated using Weblate (Persian)
Currently translated at 2.7% (285 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
Mahdi Ahmadzadeh
8e749c166b
Translated using Weblate (Persian)
Currently translated at 2.7% (284 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
Mahdi Ahmadzadeh
f83663b798
Translated using Weblate (Persian)
Currently translated at 2.7% (283 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
Mahdi Ahmadzadeh
7e8d805e62
Translated using Weblate (Persian)
Currently translated at 2.7% (281 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
Mahdi Ahmadzadeh
aff2420102
Translated using Weblate (Persian)
Currently translated at 2.7% (281 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:28 +02:00
CloverGit
c053b6164e
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.5% (10231 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-31 18:36:28 +02:00
Stefan De Raedemaeker
c70246ebec
Translated using Weblate (Dutch)
Currently translated at 86.2% (8956 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/nl/
2025-07-31 18:36:28 +02:00
co8 j
69ace50a6f
Translated using Weblate (Japanese)
Currently translated at 98.3% (10218 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-31 18:36:27 +02:00
Mahdi Ahmadzadeh
5416cbe704
Translated using Weblate (Persian)
Currently translated at 2.0% (208 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:27 +02:00
Sárkány Lőrinc
cd9ccb7ebf
Translated using Weblate (Hungarian)
Currently translated at 33.2% (3452 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-31 18:36:27 +02:00
Mahdi Ahmadzadeh
23e37afcfb
Translated using Weblate (Persian)
Currently translated at 0.1% (1 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/fa/
2025-07-31 18:36:27 +02:00
ZbeeGin
6eda1e2220
Translated using Weblate (Polish)
Currently translated at 100.0% (10386 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-07-31 18:36:27 +02:00
Sárkány Lőrinc
a12dba078d
Translated using Weblate (Hungarian)
Currently translated at 32.3% (3362 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-31 18:36:27 +02:00
Pferd O
db5a44bafc
Translated using Weblate (German)
Currently translated at 100.0% (10386 of 10386 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-31 18:36:27 +02:00
Seth Hillbrand
943fa562e8 Add functionality to get board items matching condition
Precursor to highlight items matching rules
2025-07-31 09:17:13 -07:00
Seth Hillbrand
f2b6ac5d18 Refactor git calls into their own namespace 2025-07-31 08:32:07 -07:00
Seth Hillbrand
01cf01981f Add more generalized pull for non-origin remotes 2025-07-31 08:32:07 -07:00
Seth Hillbrand
261d31c9e8 Handle case where there is no parent in the commit 2025-07-31 08:32:06 -07:00
Seth Hillbrand
7af404af43 Fix improper boolean check
This was assigning a boolean 1 or 0 to the error instead of the git
error code
2025-07-31 08:32:06 -07:00
Jeff Young
736d3c2d26 Don't require callers to jump through hoops.
Fixes KICAD-Y6J.
Fixes KICAD-Y6H.
Fixes KICAD-Y6G.
2025-07-31 15:58:49 +01:00
Jeff Young
b0663d84cb ADDED: Paste tabular contents to parent table.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21109
2025-07-31 14:15:13 +01:00
Jeff Young
6ac5ca7fc4 Don't clip table borders. 2025-07-31 13:45:55 +01:00
Jeff Young
3fe806d7c9 Compiler warning. 2025-07-31 13:45:40 +01:00
Jeff Young
b1e686be97 Bump short-form-mm from 2 digits after decimal to 2-1/2.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21357
2025-07-31 12:29:00 +01:00
jean-pierre charras
fdba4cf406 fix missing includes when KICAD_USE_PCH=OFF 2025-07-31 08:27:51 +02:00
Ben Gamari
e6ab1194ed pcbnew/api: Expose pad-to-die delay
Addresses #21346.
2025-07-30 22:36:50 -04:00
Ben Gamari
eaac9a6465 api: Introduce common.types.base_types.Time
This is needed to represent pad-to-die delays.
2025-07-30 22:36:50 -04:00
Ben Gamari
29c733c651 pcbnew/api: Expose pad-to-die length
Closes #21346.
2025-07-30 22:36:50 -04:00
Mark Roszko
4b70e20250 Add support for check zones before plot to plot jobsets 2025-07-30 20:49:07 -04:00
Seth Hillbrand
5b3d4fc91d Put PCH behind a cmake flag
Allows developers to turn it off if they don't like/don't want it
2025-07-30 17:04:06 -07:00
Seth Hillbrand
2aad11e3e7 Refactor some git routines into utility class 2025-07-30 16:59:41 -07:00
Seth Hillbrand
3d4afcc051 Handle bad init in libgit2 2025-07-30 16:20:11 -07:00
Seth Hillbrand
da19b87cb1 Be sure to clean up remote pointer 2025-07-30 16:18:57 -07:00
Seth Hillbrand
949021dc35 Fix potential crash if git_repository_init fails
Don't wrap smart pointer before init
2025-07-30 16:15:55 -07:00
Jeff Young
3eb66e1b3d Similar local labels on different sheets are fine
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21334
2025-07-30 18:03:50 +01:00
Jeff Young
15468c86b9 Formatting. 2025-07-30 17:56:45 +01:00
Jeff Young
0b90d941d3 ADDED: Find/Replace for symbol editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21397
2025-07-30 16:42:23 +01:00
Mark Roszko
b0b07bbc41 Add option to save the pcb during drc cli (but with refill-zones required in parallel) 2025-07-29 21:12:31 -04:00
Jeff Young
707d668a01 Fix selection filter GBPositions in symbol editor. 2025-07-29 23:29:03 +01:00
Jeff Young
fa7d67d80a Prevent stale selections. 2025-07-29 23:11:19 +01:00
Jeff Young
7a4107b985 Formatting. 2025-07-29 23:11:19 +01:00
Jeff Young
606a5c7d21 Hide dialog before running picker tool.
(If the user were to close the dialog in between,
we'd be in a world of hurt.)
2025-07-29 23:11:19 +01:00
Jeff Young
0128fb2eaf Formatting. 2025-07-29 23:11:19 +01:00
Seth Hillbrand
ff5a309386 Show inherited fields in symbols
When working with derived symbols, make sure that we show all of the
fields, not just the ones that are defined in the current level since
they are all attached to the output.

Inherited fields are shown in italics until changed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11422
2025-07-29 13:23:23 -07:00
dsa-t
7616b7aed8 Fix DPI value in Cairo printing on MSW.
Linux will need a different fix.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20477 on MSW


(cherry picked from commit 2a36da6723c4ed33a917783887e13cf24ec42cc1)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-07-29 17:08:13 +03:00
Jeff Young
d7b5456dfb Honour board's PAGE_INFO when plotting drill maps.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21393
2025-07-28 20:09:15 +01:00
Jeff Young
875fcffdf9 Mac has no fallback graphics. 2025-07-28 19:38:39 +01:00
Jeff Young
8de16736d3 Improve spacing, add colons to labels as necessary.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20322
2025-07-28 19:37:53 +01:00
Jeff Young
51e244d7d4 Don't remove nonexistent entries from wxArrayStrings (KICAD-PG7) 2025-07-28 19:37:52 +01:00
Jeff Young
325570eeec Coverity tweaks. 2025-07-28 19:37:52 +01:00
Jeff Young
59caea4344 Shutdown safety (KICAD-N5Y). 2025-07-28 19:37:52 +01:00
Jeff Young
6cfe5ecc94 Improve debugging (KICAD-XS0). 2025-07-28 19:37:52 +01:00
Jeff Young
37b0ba6273 Fix bad format statements (KICAD-Y1N). 2025-07-28 19:37:52 +01:00
Jeff Young
7b5603503e Fix typo. 2025-07-28 19:37:52 +01:00
Jeff Young
32afe5285e Finish off WX_GRID code sharing exercise. 2025-07-28 19:37:52 +01:00
Jeff Young
65f4524164 Cleanup (KICAD-XZP). 2025-07-28 19:37:52 +01:00
Seth Hillbrand
ff9d2e616b Missed one more Mac-specific change 2025-07-28 09:50:22 -07:00
Seth Hillbrand
25616cdeed Remove Mac option for fallback antialiasing
This was hidden behind a flag and missed in the previous commit
2025-07-28 09:14:51 -07:00
jean-pierre charras
76c5e256a7 Fix a name ( INPUT ) conflicting with a windows header, creating compil warnings
This name is just renamed, without actual code change
2025-07-28 15:19:38 +02:00
Seth Hillbrand
66f37beff7 Move canvas selection to common
Makes all canvases obey the same rendering parameter.  Also keeps the
canvas selection with the anti-alias selection, which makes logical
sense.  Reduce the antialias selection to a single choice rather than
two different choices for different canvases
2025-07-27 20:22:59 -07:00
Seth Hillbrand
7f46f2a8d1 Remove unused variables 2025-07-27 17:23:53 -07:00
Seth Hillbrand
0271047b26 Add a method to force KiCad to software rendering
There are enough cases of problematic OpenGL implementations to need a
way to avoid calling OpenGL in the first place.  This provides a
temporary method for people experiencing crashing KiCad or starting
KiCad over a remote terminal to temporarily enforce software rendering
2025-07-27 17:23:53 -07:00
Jeff Young
a191d4e6e5 Handle undo when changing new item before placing.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21391
2025-07-27 15:56:16 +01:00
Jeff Young
046c36d060 Fix padstack/boundingbox issue.
Earlier fix to stop clearing the boundingRadius
for each unique layer also cleared it for
ERROR_INSIDE (when we aren't rebuilding it).

Re-order whole routine to make this more clear.
2025-07-27 13:55:16 +01:00
Jeff Young
8a1669dc53 Coverity tweaks. 2025-07-27 13:55:16 +01:00
Jeff Young
755537ad8c Fix some std::move() of a reference parameter issues.
Also some coding standard fixes for member variable
names.
2025-07-27 13:55:16 +01:00
Seth Hillbrand
4a07154ba3 Restrict pcbnew PCH to clang 2025-07-26 17:59:35 -07:00
Seth Hillbrand
53f8ccef22 Suppress warnings in MSVC/gcc 2025-07-26 16:57:04 -07:00
Seth Hillbrand
42ed78cf69 Fix PCB for gcc 2025-07-26 16:40:40 -07:00
Seth Hillbrand
7a94a61cfb Fix MSVC build 2025-07-26 16:40:27 -07:00
Seth Hillbrand
6b44c4cbae update qa config to new data 2025-07-26 15:58:08 -07:00
Seth Hillbrand
267b21d81c Added precompiled header support
- PCBNew
- Schematic Editor
- Common libs
2025-07-26 15:33:42 -07:00
Jeff Young
1b8119056f More code sharing. 2025-07-26 21:24:37 +01:00
Jeff Young
60ec152d90 Fix deficient c'tors and operator=. 2025-07-26 19:18:16 +01:00
Jeff Young
c58b1146de Honour pad holes when hit-testing.
They may be bigger than the pad.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21331
2025-07-26 18:37:16 +01:00
Seth Hillbrand
f875fd1d60 Add support for chamfering larger sizes
If we are only chamfering opposite corners, we can support up to 100%
chamfer

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13567
2025-07-26 10:33:36 -07:00
Seth Hillbrand
dd41e2b00b Don't prompt for rule areas and no-net shapes
Highlighting and placing vias will pop up a potential net list. This
should not include things without nets

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21381
2025-07-25 16:39:59 -07:00
Seth Hillbrand
15166a9f14 Refactor REFDES_TRACKER
Keep state for reuse in the class.  This allows us to properly pick the
value when fully reannotating

Don't annotate when placing new units.  Just step ahead in the unit
value while keeping the refdes number constant.  This eliminates the
jumping around to unplaced units when placing new multi-unit symbols

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21378
2025-07-25 16:16:09 -07:00
Seth Hillbrand
9fff1d955e Add Contains search to SCHEMATIC 2025-07-25 16:16:09 -07:00
Seth Hillbrand
fd7abdfdd5 Bug fix for RefDes Tracker
When pasting, set the pastedSheetPath reference list tracker.  This is a
follow-on fix for https://gitlab.com/kicad/code/kicad/-/issues/13052
2025-07-25 16:16:09 -07:00
Seth Hillbrand
0e83bf9bc4 Fix position of hidden locked filter 2025-07-25 16:16:09 -07:00
Jeff Young
61bb922077 Not all SCH_ITEMs are symbol children.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21380
2025-07-25 18:03:49 +01:00
Jeff Young
2dfacd648f Share more code. 2025-07-25 18:03:49 +01:00
jean-pierre charras
93d90962e5 FOOTPRINT_CHOOSER_FRAME: add tool-tips to buttons; PROJECT_TEMPLATE: fix strings
Translated strings must use Printf to be built, and cannot be created by
concatenating sub strings that fixes the word ordering (that should be
depending on language)
2025-07-25 10:09:47 +02:00
Mark Roszko
dc6e0223c7 Add cli option for zone refill before drc
Note: Does not save yet
2025-07-24 20:40:45 -04:00
Seth Hillbrand
d538f8d848 Avoid unmapped layers
ViewGetLayers returns the item layer even if it is invalid.  We filter
this out at the base and skip items that cannot be displayed in the
view.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21368
2025-07-24 13:41:09 -07:00
Seth Hillbrand
322c08d5f0 Pass hotkeys from search pane to frame
If the search pane doesn't handle the key, push it through the frame
hotkey handling system

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12474
2025-07-24 13:14:31 -07:00
Seth Hillbrand
f14ba983d6 Allow scrolling by keyboard in search panel
Lets you quickly scroll through elements in the board, zooming and
selecting each
2025-07-24 11:47:17 -07:00
Seth Hillbrand
e6f06456db Add area to Zone search panel
If the zone is a filled area, show the total filled area.  If it is a
rule area, show the area to which the rule applies (the outline area)
2025-07-24 11:22:34 -07:00
Seth Hillbrand
e064a3481d Add Rule Area selection filter in schematic editor
Allows rule areas to be ungrouped from the "Other Items" when selecting
2025-07-24 11:03:38 -07:00
Seth Hillbrand
16f82d1de5 Junctions are wires in schematic editor
Treat junctions like wires for the purposes of the selection filter.
Allows selecting them together with wires and avoids grouping with
"Other Items" which is confusing
2025-07-24 10:52:27 -07:00
Seth Hillbrand
40125c73d0 Add option to D356 output to suppress NC pads
Since this is a net test format, some importers do not like dealing with
NC pads
2025-07-24 10:25:52 -07:00
Jeff Young
14c9ed1fda Prevent stale selection when deleting grid rows. 2025-07-24 18:16:21 +01:00
Seth Hillbrand
f877425e62 Tweak mask/paste dialog panel text
Unify terminology (web width, specifications) to match dialog
2025-07-24 08:01:43 -07:00
Seth Hillbrand
8d65217fda Force trimming whitespace in env vars
Nothing good can come of leading or trailing whitespace in environment
variables.  They don't resolve correctly and you can't see why
2025-07-23 17:36:51 -07:00
Seth Hillbrand
d195e93ebe Don't protect arbitrary paths
We only need to protect our predefined variables, not ones that the user
might create that uses the same pattern
2025-07-23 17:36:51 -07:00
Seth Hillbrand
094870e7a4 String fixes
- Clarify wording in a couple places
- Fix missing 'not' and remove non-standard dashes
- Standardize on single-quote for strings in strings
2025-07-23 17:36:51 -07:00
Seth Hillbrand
740f55fd30 Align import brd file icon with grid 2025-07-23 17:36:51 -07:00
Jeff Young
8c72711662 Increase contrast on grid origin over grid.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13532
2025-07-24 00:11:27 +01:00
Seth Hillbrand
e387953490 ADDED refdes tracker
Provide an option to track ever reference designator ever used in the
project to prevent its reuse even if the component has been removed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13052
2025-07-23 14:28:33 -07:00
jean-pierre charras
410a43a602 Try to fix an ambiguous cast for MSVC (round 3) 2025-07-23 19:33:36 +02:00
jean-pierre charras
998806b814 Try to fix an ambiguous cast for MSVC (round 2) 2025-07-23 18:36:11 +02:00
jean-pierre charras
4248f26bae Try to fix an ambiguous cast for MSVC 2025-07-23 18:03:37 +02:00
jean-pierre charras
eb473012a6 *.kicad_sch files: add missing quotes to uuid string for some grahic shapes.
Uuid strings are (like other strings) quoted, but a few items were missing quotes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21360
2025-07-23 17:07:35 +02:00
Jeff Young
ec155c00f3 Comboboxes for units and body styles.
Also for pin-types in pad properties.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19904

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19905
2025-07-23 14:35:37 +01:00
Jeff Young
c63e2edfff Allow setting Pin Function and Pin Type.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20992
2025-07-23 14:35:37 +01:00
Jeff Young
60d9713baf Consistent formatting. 2025-07-23 14:35:37 +01:00
Seth Hillbrand
b3ce6f26bb Optimize kissing poly routine
Inserting many points into the middle of a line chain is not as
efficient as just creating a new line chain and replacing the old one
(single allocation and copy vs many)
2025-07-22 14:43:15 -07:00
Seth Hillbrand
4221c1d93b Additional speed-up for outlines and fills
BBOX check before polgon point inside
Clean representation of segment iterator
Pre-allocate line chain space
2025-07-22 13:38:39 -07:00
Seth Hillbrand
4dab336f95 One more pass at optimizing the board outline gen
Instead of iterating through the segment list each time, we use a kdTree
structure to efficiently query a 2d point cloud for the nearest
neighbors

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21352
2025-07-22 12:49:13 -07:00
Seth Hillbrand
32f083e066 Properly thread soldermask item-item check 2025-07-21 15:10:03 -07:00
Seth Hillbrand
2aeecec9bd Remove Creepage generation from reporting
Recalculating creepeage every time we reported a new clearance error was
unneccesarily complex.  Since the clearance errors are always straight
lines, we just need to calculate the closest approach and present that
segment
2025-07-21 14:10:34 -07:00
Jeff Young
8c7dca7532 Don't promote pads to footprints for align/distribute.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21337
2025-07-21 21:31:34 +01:00
Jeff Young
c49156fb35 Naming conventions. 2025-07-21 20:59:26 +01:00
Jeff Young
da8abffea4 Code clarity. 2025-07-21 20:59:26 +01:00
Jeff Young
f1686cc568 Formatting. 2025-07-21 20:59:26 +01:00
Seth Hillbrand
ff41ab9d8a Thread footprint pad clearance DRC
This needs to run in multiple threads in order to speed up
2025-07-21 11:03:17 -07:00
Seth Hillbrand
faeaee824a Optimize zone-zone clearance checks
Improve the CREEPAGE_GRAPH:::GeneratePaths to skip unused checks.
Handle zone-zone paralellism better

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21353
2025-07-21 11:03:17 -07:00
Seth Hillbrand
4c03ab8ebb Finally remove other_math routines
Replace with standard SEG and VECTOR2 alternatives.  Add QA test for
additional SEG-line intersection routine
2025-07-21 11:03:17 -07:00
Seth Hillbrand
0459c54a92 Cleanup and clarify SEG::intersect and SEG::Collide
Fix handling of end point intersection case
Fix degenerate handling
Fix overflow cases
Simplify logic in SEG::Collide
Remove overly simplistic check for intersection

Add multiple QA regression tests
2025-07-21 11:03:17 -07:00
Jeff Young
9d074c1679 See if we can't fix the ever-growing window bug.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20120

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18543

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10609
2025-07-21 17:24:29 +01:00
Jeff Young
d0fe69bcda Formatting. 2025-07-21 16:29:50 +01:00
Jeff Young
3774d77cc7 Propagate from zone to free-via.
This must be open-coded as the CSM_PROPAGATION
algo ignores zones.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21251
2025-07-21 11:46:31 +01:00
Jeff Young
7cf028b457 Formatting. 2025-07-21 10:50:28 +01:00
Jeff Young
55a36c1ce7 CHANGED: retire the select-lib-table dialogs.
We now allow the user to specify which in the
New Library dialog.

Also retires the "Export power symbols too" dialog.

Also gives a bunch of file and library dialogs
more explicit titles.

Also removes separate code-paths for Export to
Library and Export to New Library.  The regular
code path has a "New Library..." button now.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16323
2025-07-20 19:06:40 +01:00
Jeff Young
d8cbafe858 Fix merge error. 2025-07-20 19:06:40 +01:00
Jeff Young
f2ecf87d1e Settings safety. 2025-07-20 19:06:40 +01:00
Seth Hillbrand
d53cbe638f Speed up massively slow outline convert
Avoid unneeded comparisons for segments that will never touch.  Helps in
pathological cases of O(10000+) segments in an outline

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21352
2025-07-19 17:28:05 -07:00
Seth Hillbrand
cb1bf5613e Remove context menu from position interactively
It was marked "TODO: This does not work" and indeed it crashed when
trying to use it on some items.  When it did not crash, it did not show
a menu, so the TODO was in fact accurate
2025-07-18 16:55:14 -07:00
Seth Hillbrand
3a06de0076 Consolidate ERC label warnings
If global or local labels are floating -> error
If global or local labels are only connected to one pin -> warning

Rather than forcing two different errors depending on whether the label
is local or global
2025-07-18 16:47:25 -07:00
Seth Hillbrand
21b9200744 Update translations 2025-07-18 08:09:33 -07:00
Seth Hillbrand
53b659dadc Update languages
Allow translators to view their work in the master branch
2025-07-18 08:08:33 -07:00
Seth Hillbrand
4f2c4f97c8 Update translations 2025-07-18 07:52:53 -07:00
CloverGit
9bc45805b1
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.6% (10240 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-18 16:51:11 +02:00
CloverGit
134c595f8c
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.6% (10240 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-18 16:51:11 +02:00
Stefan Bjornelund the Gnome
a2eae47400
Translated using Weblate (Swedish)
Currently translated at 99.7% (10359 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-07-18 16:51:10 +02:00
Stefan Bjornelund the Gnome
a19f62a903
Translated using Weblate (Swedish)
Currently translated at 99.7% (10359 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-07-18 16:51:10 +02:00
2tama3
d67f1be88a
Translated using Weblate (Japanese)
Currently translated at 98.2% (10204 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:10 +02:00
2tama3
995ff08826
Translated using Weblate (Japanese)
Currently translated at 98.2% (10204 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:10 +02:00
pominglee
f61f5f946a
Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 96.3% (10001 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hant/
2025-07-18 16:51:10 +02:00
Stefan Bjornelund the Gnome
ba8bb5f021
Translated using Weblate (Swedish)
Currently translated at 99.7% (10357 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sv/
2025-07-18 16:51:10 +02:00
Luka Borkovic
0512c6ce6d
Translated using Weblate (Serbian)
Currently translated at 18.5% (1931 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sr/
2025-07-18 16:51:10 +02:00
Luka Borkovic
2f2bb4c96d
Translated using Weblate (Serbian)
Currently translated at 18.5% (1931 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sr/
2025-07-18 16:51:10 +02:00
Luka Borkovic
cd184656f0
Translated using Weblate (Serbian)
Currently translated at 18.5% (1931 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sr/
2025-07-18 16:51:10 +02:00
co8 j
ca2d58a4a5
Translated using Weblate (Japanese)
Currently translated at 98.1% (10189 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:10 +02:00
co8 j
b35a357b6b
Translated using Weblate (Japanese)
Currently translated at 98.1% (10189 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:10 +02:00
Sárkány Lőrinc
319bfd73b1
Translated using Weblate (Hungarian)
Currently translated at 32.3% (3363 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:10 +02:00
Sárkány Lőrinc
dded4b3cae
Translated using Weblate (Hungarian)
Currently translated at 32.3% (3363 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:10 +02:00
Sárkány Lőrinc
c0c00bdb91
Translated using Weblate (Hungarian)
Currently translated at 32.3% (3363 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:10 +02:00
CloverGit
cdb46a6699
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.5% (10233 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-18 16:51:09 +02:00
CloverGit
1b62aa0b52
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.5% (10233 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-18 16:51:09 +02:00
CloverGit
32874a795d
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.5% (10233 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-18 16:51:09 +02:00
co8 j
f92f679056
Translated using Weblate (Japanese)
Currently translated at 97.9% (10169 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:09 +02:00
co8 j
a01e8fd644
Translated using Weblate (Japanese)
Currently translated at 97.9% (10169 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:09 +02:00
co8 j
b107694c04
Translated using Weblate (Japanese)
Currently translated at 97.9% (10169 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:09 +02:00
CloverGit
8aa2b2ad49
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.5% (10229 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-18 16:51:09 +02:00
Pferd O
092c055d77
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:09 +02:00
Pferd O
eb8cd1ec51
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:09 +02:00
Luka Borkovic
79e448a649
Translated using Weblate (Serbian)
Currently translated at 18.4% (1921 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sr/
2025-07-18 16:51:08 +02:00
Luka Borkovic
56150f8d37
Translated using Weblate (Serbian)
Currently translated at 18.4% (1921 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sr/
2025-07-18 16:51:08 +02:00
ZbeeGin
efc3316cd2
Translated using Weblate (Polish)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/pl/
2025-07-18 16:51:08 +02:00
Sárkány Lőrinc
d087c87e9f
Translated using Weblate (Hungarian)
Currently translated at 32.2% (3354 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:08 +02:00
Sárkány Lőrinc
ae6a807575
Translated using Weblate (Hungarian)
Currently translated at 32.2% (3354 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:08 +02:00
Sárkány Lőrinc
e2db0cb713
Translated using Weblate (Hungarian)
Currently translated at 32.2% (3354 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:08 +02:00
Sárkány Lőrinc
ec3b0c7b7f
Translated using Weblate (Hungarian)
Currently translated at 32.2% (3354 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:08 +02:00
Sárkány Lőrinc
0085eefae9
Translated using Weblate (Hungarian)
Currently translated at 32.2% (3354 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:08 +02:00
Pferd O
10b02e2de1
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:08 +02:00
Luka Borkovic
d82e34cbe2
Translated using Weblate (Serbian)
Currently translated at 18.4% (1920 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sr/
2025-07-18 16:51:08 +02:00
Luka Borkovic
db59c8b23e
Translated using Weblate (Serbian)
Currently translated at 18.4% (1920 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/sr/
2025-07-18 16:51:08 +02:00
YÜKSEL AÇIKGÖZ
99c27133dd
Translated using Weblate (Turkish)
Currently translated at 99.9% (10383 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-07-18 16:51:07 +02:00
YÜKSEL AÇIKGÖZ
9459d28c5f
Translated using Weblate (Turkish)
Currently translated at 99.9% (10383 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/tr/
2025-07-18 16:51:07 +02:00
CloverGit
8783bb6ec0
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 98.5% (10229 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/zh_Hans/
2025-07-18 16:51:07 +02:00
2tama3
2a2d851ec6
Translated using Weblate (Japanese)
Currently translated at 97.7% (10148 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:07 +02:00
2tama3
0d3d97744e
Translated using Weblate (Japanese)
Currently translated at 97.7% (10148 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/ja/
2025-07-18 16:51:07 +02:00
Sárkány Lőrinc
6834c0d3bc
Translated using Weblate (Hungarian)
Currently translated at 31.7% (3299 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/hu/
2025-07-18 16:51:07 +02:00
Pferd O
c8e9b9d7b1
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:07 +02:00
Pferd O
5c7c3e9fda
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:07 +02:00
Pferd O
38bcbc9804
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:07 +02:00
Pferd O
48190ac3f9
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:07 +02:00
Pferd O
c6b5fb4bfd
Translated using Weblate (German)
Currently translated at 100.0% (10384 of 10384 strings)

Translation: KiCad EDA/master source
Translate-URL: https://hosted.weblate.org/projects/kicad/master-source/de/
2025-07-18 16:51:06 +02:00
Jeff Young
be0da70839 Shutdown safety. (Possibly KICAD-8S0.) 2025-07-18 11:49:06 +01:00
Seth Hillbrand
8556bd45c2 Handle model projection in Altium import
If the model is seated on the back, KiCad just needs to rotate and
offset for the board (if it is placed)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/213356
2025-07-17 16:48:26 -07:00
Seth Hillbrand
e8219c4300 Properly align imported dimensions
The height depends on which direction the dimension is being pulled.

Also try to mimic Altium's automatic arrow in/out style

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21329
2025-07-17 10:34:26 -07:00
Jeff Young
5fb40f152c Make auto-created labels work with new multi-create architecture.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21306
2025-07-17 18:28:33 +01:00
Jeff Young
e1a6261df5 Fix one more missing addParamsForWindow(). 2025-07-17 16:50:35 +01:00
Jeff Young
beb83e87ea Must use addParamsForWindow to init WINDOW_SETTINGs structs. 2025-07-17 16:26:50 +01:00
Emmanuel Vera
b5df0ad3eb Update power filter for power symbols placement 2025-07-17 09:10:35 -04:00
Jeff Young
50923b7a64 Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21328
2025-07-17 13:44:44 +01:00
Jeff Young
b4dcb05208 Don't clear pin-assignments when changing sim model.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19533
2025-07-17 12:49:55 +01:00
jean-pierre charras
582012e8d9 French translation update 2025-07-17 11:00:14 +02:00
jean-pierre charras
e6c36703d0 Gerbview: code cleaning: update a .fbp dialog to use our usual .fbp settings
It does not really change the actual code.
2025-07-17 11:00:14 +02:00
Jeff Young
e230d5164d Honour renderSettings' default font.
This still leaves a few things out in the cold,
such as hit-testing and polygon generation.
But at least it allows us to plot with a default
font.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19031
2025-07-17 09:35:21 +01:00
Jeff Young
0495828a55 Honour front/back layer types for user layer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21284
2025-07-17 09:35:21 +01:00
Adam Feuer
7cbf86f864 fix for issue 17429 - backported from master
- issue: https://gitlab.com/kicad/code/kicad/-/issues/17429
- fix makes RunOnUnconnectedEdges sort the unnconnected edges before
  running the passed in function on them
- stable sort order keeps the algorith from having non-deterministic
  runs
2025-01-14 08:51:23 -08:00
2100 changed files with 646304 additions and 459174 deletions

1
.gitignore vendored
View File

@ -24,7 +24,6 @@ common/template_fieldnames_lexer.h
eeschema/schematic_keywords.*
pcbnew/pcb_plot_params_keywords.cpp
pcbnew/pcb_plot_params_lexer.h
pcbnew/dialogs/panel_setup_rules_help_*.h
Makefile
CMakeUserPresets.json
CMakeCache.txt

View File

@ -4,7 +4,7 @@ stages:
- report
variables:
DEFAULT_FEDORA_IMAGE: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:40
DEFAULT_FEDORA_IMAGE: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:41
default:
image:

View File

@ -8,6 +8,8 @@ win64_build:
interruptible: false
image: registry.gitlab.com/kicad/kicad-ci/windows-build-image/ltsc2022-msvc:latest
variables:
VCPKG_BINARY_SOURCES: 'nuget,gitlab,readwrite'
VCPKG_DISABLE_COMPILER_TRACKING: '1'
# Switch the compressor to fastzip and reduce the compression level
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "fast"
@ -23,6 +25,7 @@ win64_build:
script:
- C:\builder\build.ps1 -Env -Arch x64
- $vcpkgCache=Join-Path -Path (Get-Location) -ChildPath ".vcpkgCache";$env:VCPKG_DEFAULT_BINARY_CACHE=$vcpkgCache;New-Item -ItemType Directory -Force -Path $vcpkgCache
- nuget.exe sources add -Name gitlab -Source "https://gitlab.com/api/v4/projects/27426693/packages/nuget/index.json" -UserName gitlab-ci-token -Password $env:CI_JOB_TOKEN
- mkdir -p build/windows -Force
- cd build/windows
- cmake `
@ -37,8 +40,6 @@ win64_build:
../../
- cmake --build . 2>&1 | tee compilation_log.txt
- cd ../../
after_script:
- Get-Content -Path C:\builder\vcpkg\buildtrees\wxpython-33\python3-tool-post-install-err.log
artifacts:
# Only save the artifacts that are needed for running the tests in the next stage
# and the compilation log. The entire build directory is too large to save as an

View File

@ -42,7 +42,7 @@ Coverity:
tags:
- coverity
stage: build
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:40
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:41
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_JOB_NAME == "coverity"
cache:

View File

@ -20,6 +20,7 @@
variables:
BOOST_TEST_LOGGER: 'JUNIT,warning,test_results.${TEST}.xml:HRF,message'
CTEST_OUTPUT_ON_FAILURE: 1
BOOST_TEST_CATCH_SYSTEM_ERRORS: 'no'
script:
- cd build/linux/qa
- ctest -R qa_${TEST}

View File

@ -485,26 +485,18 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
// Fill not copper layers zpos
for( int layer_id = 0; layer_id < PCB_LAYER_ID_COUNT; layer_id++ )
for( int layer = 0; layer < PCB_LAYER_ID_COUNT; layer++ )
{
if( IsCopperLayer( (PCB_LAYER_ID)layer_id ) )
PCB_LAYER_ID layer_id = ToLAYER_ID( layer );
if( IsCopperLayer( layer_id ) )
continue;
float zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
float zposTop = zposBottom + m_frontCopperThickness3DU;
float zposBottom;
float zposTop;
switch( layer_id )
{
case B_Adhes:
zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
zposTop = zposBottom - m_nonCopperLayerThickness3DU;
break;
case F_Adhes:
zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
zposTop = zposBottom + m_nonCopperLayerThickness3DU;
break;
case B_Mask:
zposBottom = zpos_copperTop_back;
zposTop = zpos_copperTop_back - m_backMaskThickness3DU;
@ -536,11 +528,21 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
break;
default:
if( m_board->IsBackLayer( layer_id ) )
{
zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
zposTop = zposBottom - m_nonCopperLayerThickness3DU;
}
else
{
zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
zposTop = zposBottom + m_nonCopperLayerThickness3DU;
}
break;
}
m_layerZcoordTop[(PCB_LAYER_ID)layer_id] = zposTop;
m_layerZcoordBottom[(PCB_LAYER_ID)layer_id] = zposBottom;
m_layerZcoordTop[layer_id] = zposTop;
m_layerZcoordBottom[layer_id] = zposBottom;
}
m_boardCenter = SFVEC3F( m_boardPos.x * m_biuTo3Dunits, m_boardPos.y * m_biuTo3Dunits, 0.0f );
@ -757,6 +759,7 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
{
m_Cfg->m_Render.show_board_body = aLayers.test( LAYER_3D_BOARD );
m_Cfg->m_Render.show_plated_barrels = aLayers.test( LAYER_3D_PLATED_BARRELS );
m_Cfg->m_Render.show_copper_top = aLayers.test( LAYER_3D_COPPER_TOP );
m_Cfg->m_Render.show_copper_bottom = aLayers.test( LAYER_3D_COPPER_BOTTOM );
m_Cfg->m_Render.show_silkscreen_top = aLayers.test( LAYER_3D_SILKSCREEN_TOP );
@ -804,6 +807,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
ret.set( LAYER_3D_ADHESIVE, m_Cfg->m_Render.show_adhesive );
}
ret.set( LAYER_3D_PLATED_BARRELS, true );
ret.set( LAYER_3D_COPPER_TOP, true );
ret.set( LAYER_3D_COPPER_BOTTOM, true );
ret.set( LAYER_3D_SILKSCREEN_TOP, true );
@ -834,6 +838,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
}
ret.set( LAYER_3D_BOARD, m_Cfg->m_Render.show_board_body );
ret.set( LAYER_3D_PLATED_BARRELS, m_Cfg->m_Render.show_plated_barrels );
ret.set( LAYER_3D_COPPER_TOP, m_Cfg->m_Render.show_copper_top );
ret.set( LAYER_3D_COPPER_BOTTOM, m_Cfg->m_Render.show_copper_bottom );
ret.set( LAYER_3D_SILKSCREEN_TOP, m_Cfg->m_Render.show_silkscreen_top );
@ -932,6 +937,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
std::bitset<LAYER_3D_END> ret;
ret.set( LAYER_3D_BOARD, true );
ret.set( LAYER_3D_PLATED_BARRELS, true );
ret.set( LAYER_3D_COPPER_TOP, true );
ret.set( LAYER_3D_COPPER_BOTTOM, true );
ret.set( LAYER_3D_SILKSCREEN_TOP, true );

View File

@ -368,11 +368,12 @@ private:
void createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayer, int aMargin = 0 );
// Generate the pad shape on board layers. The pad hole is not generated by createPadWithMargin
void createPadWithMargin( const PAD *aPad, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayer, const VECTOR2I& aMargin ) const;
void createPadWithHole( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
int aInflateValue );
// Generate the hole shape of aPad, stored in aDstContainer
void createPadHoleShape( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer, int aInflateValue );
void addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDstContainer,
PCB_LAYER_ID aLayerId );

View File

@ -47,6 +47,7 @@
#include <geometry/shape_segment.h>
#include <geometry/geometry_utils.h>
#include <geometry/shape_circle.h>
#include <geometry/roundrect.h>
#include <geometry/shape_rect.h>
#include <geometry/shape_simple.h>
#include <utility>
@ -473,12 +474,12 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
}
void BOARD_ADAPTER::createPadWithHole( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
void BOARD_ADAPTER::createPadHoleShape( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
int aInflateValue )
{
if( !aPad->HasHole() )
{
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::createPadWithHole - found an invalid pad" ) );
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::createPadHole pad has no hole" ) );
return;
}
@ -648,6 +649,29 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
}
else
{
if( aShape->GetCornerRadius() > 0 )
{
ROUNDRECT rr( SHAPE_RECT( aShape->GetPosition(),
aShape->GetRectangleWidth(),
aShape->GetRectangleHeight() ),
aShape->GetCornerRadius() );
SHAPE_POLY_SET poly;
rr.TransformToPolygon( poly );
SHAPE_LINE_CHAIN& r_outline = poly.Outline( 0 );
r_outline.SetClosed( true );
for( int ii = 0; ii < r_outline.PointCount(); ii++ )
{
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( r_outline.CPoint( ii ) ),
TO_SFVEC2F( r_outline.CPoint( ii+1 ) ),
linewidth3DU, *aOwner );
}
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( r_outline.CLastPoint() ),
TO_SFVEC2F( r_outline.CPoint( 0 ) ), linewidth3DU, *aOwner );
}
else
{
std::vector<VECTOR2I> pts = aShape->GetRectCorners();
@ -660,6 +684,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( pts[3] ), TO_SFVEC2F( pts[0] ),
linewidth3DU, *aOwner );
}
}
break;
case SHAPE_T::ARC:

View File

@ -507,27 +507,32 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
for( PAD* pad : footprint->Pads() )
{
const VECTOR2I padHole = pad->GetDrillSize();
if( !padHole.x ) // Not drilled pad like SMD pad
// Note: holes of NPTH are already built by GetBoardPolygonOutlines
if( !pad->HasHole() )
continue;
// The hole in the body is inflated by copper thickness, if not plated, no copper
int inflate = 0;
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
inflate = KiROUND( GetHolePlatingThickness() / 2.0 );
m_holeCount++;
double holeDiameter = ( pad->GetDrillSize().x + pad->GetDrillSize().y ) / 2.0;
m_averageHoleDiameter += static_cast<float>( holeDiameter * m_biuTo3Dunits );
createPadWithHole( pad, &m_TH_ODs, inflate );
if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
{
// Ensure the silk drawings are clipped to the NPTH hole, like other pad/via holes
// even if the clip to board body is not activated (remember NPTH holes are part of
// the board body)
createPadHoleShape( pad, &m_TH_ODs, 0 );
continue;
}
// The hole in the body is inflated by copper thickness
int inflate = KiROUND( GetHolePlatingThickness() / 2.0 );
createPadHoleShape( pad, &m_TH_ODs, inflate );
if( cfg.clip_silk_on_via_annuli )
createPadWithHole( pad, &m_viaAnnuli, inflate );
createPadHoleShape( pad, &m_viaAnnuli, inflate );
createPadWithHole( pad, &m_TH_IDs, 0 );
createPadHoleShape( pad, &m_TH_IDs, 0 );
}
}
@ -539,9 +544,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
for( PAD* pad : footprint->Pads() )
{
const VECTOR2I padHole = pad->GetDrillSize();
if( !padHole.x ) // Not drilled pad like SMD pad
if( !pad->HasHole() )
continue;
// The hole in the body is inflated by copper thickness.

View File

@ -35,14 +35,22 @@
#include <advanced_config.h>
#include <build_version.h>
#include <board.h>
#include <pad.h>
#include <pcb_field.h>
#include <reporter.h>
#include <gal/opengl/gl_context_mgr.h>
#include <core/profile.h> // To use GetRunningMicroSecs or another profiling utility
#include <bitmaps.h>
#include <kiway_holder.h>
#include <kiway.h>
#include <macros.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>
#include <tool/tool_dispatcher.h>
#include <string_utils.h>
#include <mail_type.h>
#include <kiway_express.h>
#include <fmt/format.h>
#include <widgets/wx_busy_indicator.h>
@ -69,6 +77,8 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, HIDPI_GL_3D_CANVAS )
EVT_LEFT_UP( EDA_3D_CANVAS::OnLeftUp )
EVT_MIDDLE_UP( EDA_3D_CANVAS::OnMiddleUp )
EVT_MIDDLE_DOWN( EDA_3D_CANVAS::OnMiddleDown)
EVT_RIGHT_DOWN( EDA_3D_CANVAS::OnRightDown )
EVT_RIGHT_UP( EDA_3D_CANVAS::OnRightUp )
EVT_MOUSEWHEEL( EDA_3D_CANVAS::OnMouseWheel )
EVT_MOTION( EDA_3D_CANVAS::OnMouseMove )
EVT_MAGNIFY( EDA_3D_CANVAS::OnMagnify )
@ -93,25 +103,9 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttrib
HIDPI_GL_3D_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aCamera, aParent, aGLAttribs,
EDA_3D_CANVAS_ID, wxDefaultPosition,
wxDefaultSize, wxFULL_REPAINT_ON_RESIZE ),
m_eventDispatcher( nullptr ),
m_parentStatusBar( nullptr ),
m_parentInfoBar( nullptr ),
m_glRC( nullptr ),
m_is_opengl_initialized( false ),
m_is_opengl_version_supported( true ),
m_editing_timeout_timer( this, wxID_HIGHEST + 1 ),
m_redraw_trigger_timer( this, wxID_HIGHEST + 2 ),
m_render_pivot( false ),
m_camera_moving_speed( 1.0f ),
m_strtime_camera_movement( 0 ),
m_animation_enabled( true ),
m_moving_speed_multiplier( 3 ),
m_boardAdapter( aBoardAdapter ),
m_3d_render( nullptr ),
m_opengl_supports_raytracing( true ),
m_render_raytracing_was_requested( false ),
m_accelerator3DShapes( nullptr ),
m_currentRollOverItem( nullptr )
m_boardAdapter( aBoardAdapter )
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::EDA_3D_CANVAS" ) );
@ -480,7 +474,9 @@ void EDA_3D_CANVAS::DoRePaint()
if( m_camera_is_moving )
{
const int64_t curtime_delta = GetRunningMicroSecs() - m_strtime_camera_movement;
curtime_delta_s = ( curtime_delta / 1e6 ) * m_camera_moving_speed;
// Convert microseconds to seconds as float and apply speed multiplier
curtime_delta_s = static_cast<float>( static_cast<double>( curtime_delta ) / 1e6 )
* m_camera_moving_speed;
m_camera.Interpolate( curtime_delta_s );
if( curtime_delta_s > 1.0f )
@ -600,6 +596,216 @@ void EDA_3D_CANVAS::DoRePaint()
}
void EDA_3D_CANVAS::RenderToFrameBuffer( unsigned char* buffer, int width, int height )
{
if( m_is_currently_painting.test_and_set() )
return;
// Validate input parameters
if( !buffer || width <= 0 || height <= 0 )
{
m_is_currently_painting.clear();
return;
}
// Because the board to draw is handled by the parent viewer frame,
// ensure this parent is still alive
if( !GetParent() || !GetParent()->GetParent() || !GetParent()->GetParent()->IsShownOnScreen() )
{
m_is_currently_painting.clear();
return;
}
wxString err_messages;
int64_t start_time = GetRunningMicroSecs();
GL_CONTEXT_MANAGER* gl_mgr = Pgm().GetGLContextManager();
// Create OpenGL context if needed
if( m_glRC == nullptr )
m_glRC = gl_mgr->CreateCtx( this );
if( m_glRC == nullptr )
{
wxLogError( _( "OpenGL context creation error" ) );
m_is_currently_painting.clear();
return;
}
gl_mgr->LockCtx( m_glRC, this );
// Set up framebuffer objects for off-screen rendering
GLuint framebuffer = 0;
GLuint colorTexture = 0;
GLuint depthBuffer = 0;
GLint oldFramebuffer = 0;
GLint oldViewport[4];
// Save current state
glGetIntegerv( GL_FRAMEBUFFER_BINDING, &oldFramebuffer );
glGetIntegerv( GL_VIEWPORT, oldViewport );
// Create and bind framebuffer
glGenFramebuffers( 1, &framebuffer );
glBindFramebuffer( GL_FRAMEBUFFER, framebuffer );
// Create color texture attachment
glGenTextures( 1, &colorTexture );
glBindTexture( GL_TEXTURE_2D, colorTexture );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0 );
// Create depth renderbuffer attachment
glGenRenderbuffers( 1, &depthBuffer );
glBindRenderbuffer( GL_RENDERBUFFER, depthBuffer );
glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height );
glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer );
auto resetState = std::unique_ptr<void, std::function<void(void*)>>(
reinterpret_cast<void*>(1),
[&](void*) {
glBindFramebuffer( GL_FRAMEBUFFER, oldFramebuffer );
glViewport( oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3] );
glDeleteFramebuffers( 1, &framebuffer );
glDeleteTextures( 1, &colorTexture );
glDeleteRenderbuffers( 1, &depthBuffer );
gl_mgr->UnlockCtx( m_glRC );
m_is_currently_painting.clear();
}
);
// Check framebuffer completeness
GLenum framebufferStatus = glCheckFramebufferStatus( GL_FRAMEBUFFER );
if( framebufferStatus != GL_FRAMEBUFFER_COMPLETE )
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer Framebuffer incomplete: 0x%04X" ),
framebufferStatus );
return;
}
// Set viewport for off-screen rendering
glViewport( 0, 0, width, height );
// Set window size for camera and rendering
wxSize clientSize( width, height );
const bool windows_size_changed = m_camera.SetCurWindowSize( clientSize );
// Initialize OpenGL if needed
if( !m_is_opengl_initialized )
{
if( !initializeOpenGL() )
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer OpenGL initialization failed." ) );
return;
}
if( !m_is_opengl_version_supported )
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer OpenGL version not supported." ) );
}
}
if( !m_is_opengl_version_supported )
{
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
glClear( GL_COLOR_BUFFER_BIT );
// Read black screen to buffer
glReadPixels( 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer );
return;
}
// Handle raytracing/OpenGL renderer selection
if( !m_opengl_supports_raytracing )
{
m_3d_render = m_3d_render_opengl;
m_render_raytracing_was_requested = false;
m_boardAdapter.m_Cfg->m_Render.engine = RENDER_ENGINE::OPENGL;
}
if( m_boardAdapter.m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL )
{
const bool was_camera_changed = m_camera.ParametersChanged();
if( ( m_mouse_is_moving || m_camera_is_moving || was_camera_changed || windows_size_changed )
&& m_render_raytracing_was_requested )
{
m_render_raytracing_was_requested = false;
m_3d_render = m_3d_render_opengl;
}
}
// Handle camera animation (simplified for off-screen rendering)
float curtime_delta_s = 0.0f;
if( m_camera_is_moving )
{
const int64_t curtime_delta = GetRunningMicroSecs() - m_strtime_camera_movement;
curtime_delta_s = static_cast<float>( static_cast<double>( curtime_delta ) / 1e6 )
* m_camera_moving_speed;
m_camera.Interpolate( curtime_delta_s );
if( curtime_delta_s > 1.0f )
{
m_render_pivot = false;
m_camera_is_moving = false;
m_mouse_was_moved = true;
}
}
// Perform the actual rendering
bool requested_redraw = false;
if( m_3d_render )
{
try
{
m_3d_render->SetCurWindowSize( clientSize );
bool reloadRaytracingForCalculations = false;
if( m_boardAdapter.m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL
&& m_3d_render_opengl->IsReloadRequestPending() )
{
reloadRaytracingForCalculations = true;
}
requested_redraw = m_3d_render->Redraw( false, nullptr, nullptr );
if( reloadRaytracingForCalculations )
m_3d_render_raytracing->Reload( nullptr, nullptr, true );
}
catch( std::runtime_error& )
{
m_is_opengl_version_supported = false;
m_opengl_supports_raytracing = false;
m_is_opengl_initialized = false;
return;
}
}
// Read pixels from framebuffer to the provided buffer
// Note: This reads RGB format. Adjust format as needed.
glReadPixels( 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer );
// Check for OpenGL errors
GLenum error = glGetError();
if( error != GL_NO_ERROR )
{
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer OpenGL error: 0x%04X" ), error );
err_messages += wxString::Format( _( "OpenGL error during off-screen rendering: 0x%04X\n" ), error );
}
// Reset camera parameters changed flag
m_camera.ParametersChanged();
if( !err_messages.IsEmpty() )
wxLogMessage( err_messages );
}
void EDA_3D_CANVAS::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher )
{
m_eventDispatcher = aEventDispatcher;
@ -676,7 +882,7 @@ void EDA_3D_CANVAS::OnZoomGesture( wxZoomGestureEvent& aEvent )
m_camera.Pan( aEvent.GetPosition() );
m_camera.SetCurMousePosition( aEvent.GetPosition() );
m_camera.Zoom( aEvent.GetZoomFactor() / m_gestureLastZoomFactor );
m_camera.Zoom( static_cast<float>( aEvent.GetZoomFactor() / m_gestureLastZoomFactor ) );
m_gestureLastZoomFactor = aEvent.GetZoomFactor();
@ -719,7 +925,7 @@ void EDA_3D_CANVAS::OnRotateGesture( wxRotateGestureEvent& aEvent )
if( m_camera_is_moving )
return;
m_camera.RotateScreen( m_gestureLastAngle - aEvent.GetRotationAngle() );
m_camera.RotateScreen( static_cast<float>( m_gestureLastAngle - aEvent.GetRotationAngle() ) );
m_gestureLastAngle = aEvent.GetRotationAngle();
DisplayStatus();
@ -857,7 +1063,43 @@ void EDA_3D_CANVAS::OnLeftDown( wxMouseEvent& event )
BOARD_ITEM* intersectedBoardItem = m_3d_render_raytracing->IntersectBoardItem( mouseRay );
// !TODO: send a selection item to pcbnew, eg: via kiway?
if( intersectedBoardItem )
{
FOOTPRINT* footprint = nullptr;
switch( intersectedBoardItem->Type() )
{
case PCB_FOOTPRINT_T:
footprint = static_cast<FOOTPRINT*>( intersectedBoardItem );
break;
case PCB_PAD_T:
footprint = static_cast<PAD*>( intersectedBoardItem )->GetParentFootprint();
break;
case PCB_FIELD_T:
footprint = static_cast<PCB_FIELD*>( intersectedBoardItem )->GetParentFootprint();
break;
default:
break;
}
if( footprint )
{
std::string command =
fmt::format( "$SELECT: 0,F{}",
EscapeString( footprint->GetReference(), CTX_IPC ).ToStdString() );
EDA_3D_VIEWER_FRAME* frame = static_cast<EDA_3D_VIEWER_FRAME*>( GetParent() );
if( frame )
{
frame->Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_SELECTION, command, frame );
frame->Kiway().ExpressMail( FRAME_SCH, MAIL_SELECTION, command, frame );
}
}
}
}
}
@ -877,20 +1119,43 @@ void EDA_3D_CANVAS::OnLeftUp( wxMouseEvent& event )
int logicalW = logicalSize.GetWidth();
int logicalH = logicalSize.GetHeight();
int gizmo_x, gizmo_y, gizmo_width, gizmo_height;
int gizmo_x = 0, gizmo_y = 0, gizmo_width = 0, gizmo_height = 0;
std::tie( gizmo_x, gizmo_y, gizmo_width, gizmo_height ) = m_3d_render_opengl->getGizmoViewport();
float scaleX = static_cast<float>( gizmo_width ) / logicalW;
float scaleY = static_cast<float>( gizmo_height ) / logicalH;
float scaleX = static_cast<float>( static_cast<double>( gizmo_width ) / static_cast<double>( logicalW ) );
float scaleY = static_cast<float>( static_cast<double>( gizmo_height ) / static_cast<double>( logicalH ) );
int scaledMouseX = static_cast<int>( event.GetX() * scaleX );
int scaledMouseY = static_cast<int>( ( logicalH - event.GetY() ) * scaleY );
int scaledMouseX = static_cast<int>( static_cast<float>( event.GetX() ) * scaleX );
int scaledMouseY = static_cast<int>( static_cast<float>( logicalH - event.GetY() ) * scaleY );
m_3d_render_opengl->handleGizmoMouseInput( scaledMouseX, scaledMouseY );
Refresh();
}
void EDA_3D_CANVAS::OnRightDown( wxMouseEvent& event )
{
SetFocus();
stop_editingTimeOut_Timer();
// Ensure m_camera.m_lastPosition is up to date for future drag events.
OnMouseMoveCamera( event );
}
void EDA_3D_CANVAS::OnRightUp( wxMouseEvent& event )
{
if( m_camera_is_moving )
return;
if( m_mouse_is_moving )
{
m_mouse_is_moving = false;
restart_editingTimeOut_Timer();
}
}
void EDA_3D_CANVAS::OnMiddleDown( wxMouseEvent& event )
{
SetFocus();
@ -995,7 +1260,7 @@ void EDA_3D_CANVAS::request_start_moving_camera( float aMovingSpeed, bool aRende
// Map speed multiplier option to actual multiplier value
// [1,2,3,4,5] -> [0.25, 0.5, 1, 2, 4]
aMovingSpeed *= ( 1 << m_moving_speed_multiplier ) / 8.0f;
aMovingSpeed *= static_cast<float>( ( 1 << m_moving_speed_multiplier ) ) / 8.0f;
m_render_pivot = aRenderPivot;
m_camera_moving_speed = aMovingSpeed;
@ -1015,7 +1280,7 @@ void EDA_3D_CANVAS::move_pivot_based_on_cur_mouse_position()
{
RAY mouseRay = getRayAtCurrentMousePosition();
float hit_t;
float hit_t = 0.0f;
// Test it with the board bounding box
if( m_boardAdapter.GetBBox().Intersect( mouseRay, &hit_t ) )

View File

@ -42,7 +42,7 @@ class RENDER_3D_RAYTRACE_GL;
class RENDER_3D_OPENGL;
#define EDA_3D_CANVAS_ID wxID_HIGHEST + 1321
#define EDA_3D_CANVAS_ID (wxID_HIGHEST + 1321)
/**
* Implement a canvas based on a wxGLCanvas
@ -61,7 +61,7 @@ public:
EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttribs, BOARD_ADAPTER& aSettings,
CAMERA& aCamera, S3D_CACHE* a3DCachePointer );
~EDA_3D_CANVAS();
~EDA_3D_CANVAS() override;
/**
* Set a dispatcher that processes events and forwards them to tools.
@ -218,6 +218,8 @@ public:
*/
void DoRePaint();
void RenderToFrameBuffer( unsigned char* aBuffer, int aWidth, int aHeight );
void OnCloseWindow( wxCloseEvent& event );
private:
@ -236,6 +238,9 @@ private:
void OnLeftUp( wxMouseEvent& event );
void OnMiddleUp( wxMouseEvent& event );
void OnMiddleDown( wxMouseEvent& event );
void OnRightUp( wxMouseEvent& event );
void OnRightDown( wxMouseEvent& event );
void OnTimerTimeout_Editing( wxTimerEvent& event );
void OnResize( wxSizeEvent& event );
void OnTimerTimeout_Redraw( wxTimerEvent& event );
@ -297,36 +302,36 @@ private:
RAY getRayAtCurrentMousePosition();
private:
TOOL_DISPATCHER* m_eventDispatcher;
wxStatusBar* m_parentStatusBar; // Parent statusbar to report progress
WX_INFOBAR* m_parentInfoBar;
TOOL_DISPATCHER* m_eventDispatcher = nullptr;
wxStatusBar* m_parentStatusBar = nullptr; // Parent statusbar to report progress
WX_INFOBAR* m_parentInfoBar = nullptr;
wxGLContext* m_glRC; // Current OpenGL context
bool m_is_opengl_initialized;
bool m_is_opengl_version_supported;
wxGLContext* m_glRC = nullptr; // Current OpenGL context
bool m_is_opengl_initialized = false;
bool m_is_opengl_version_supported = true;
wxTimer m_editing_timeout_timer; // Expires after some time signaling that
// the mouse / keyboard movements are over
wxTimer m_redraw_trigger_timer; // Used to schedule a redraw event
std::atomic_flag m_is_currently_painting; // Avoid drawing twice at the same time
std::atomic_flag m_is_currently_painting = ATOMIC_FLAG_INIT; // Avoid drawing twice at the same time
bool m_render_pivot; // Render the pivot while camera moving
float m_camera_moving_speed; // 1.0f will be 1:1
int64_t m_strtime_camera_movement; // Ticktime of camera movement start
bool m_animation_enabled; // Camera animation enabled
int m_moving_speed_multiplier; // Camera animation speed multiplier option
bool m_render_pivot = false; // Render the pivot while camera moving
float m_camera_moving_speed = 1.0f; // 1.0f will be 1:1
int64_t m_strtime_camera_movement = 0; // Ticktime of camera movement start
bool m_animation_enabled = true; // Camera animation enabled
int m_moving_speed_multiplier = 3; // Camera animation speed multiplier option
BOARD_ADAPTER& m_boardAdapter; // Pre-computed 3D info and settings
RENDER_3D_BASE* m_3d_render;
RENDER_3D_BASE* m_3d_render = nullptr;
RENDER_3D_RAYTRACE_GL* m_3d_render_raytracing;
RENDER_3D_OPENGL* m_3d_render_opengl;
bool m_opengl_supports_raytracing;
bool m_render_raytracing_was_requested;
bool m_opengl_supports_raytracing = true;
bool m_render_raytracing_was_requested = false;
ACCELERATOR_3D* m_accelerator3DShapes; // used for mouse over searching
ACCELERATOR_3D* m_accelerator3DShapes = nullptr; // used for mouse over searching
BOARD_ITEM* m_currentRollOverItem;
BOARD_ITEM* m_currentRollOverItem = nullptr;
bool m_render3dmousePivot = false; // Render the 3dmouse pivot
SFVEC3F m_3dmousePivotPos; // The position of the 3dmouse pivot

View File

@ -544,9 +544,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetHitSelectionOnly( bool onlySelection )
long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
{
if( commandId.empty() )
{
return 0;
}
std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
TOOL_ACTION* context = nullptr;
@ -557,10 +555,8 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
std::string nm = action->GetName();
if( commandId == nm )
{
context = action;
}
}
if( context != nullptr )
{
@ -568,27 +564,21 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
// Only allow command execution if the window is enabled. i.e. there is not a modal dialog
// currently active.
TOOLS_HOLDER* tools_holder = nullptr;
if( parent->IsEnabled() && ( tools_holder = dynamic_cast<TOOLS_HOLDER*>( parent ) ) )
if( parent && parent->IsEnabled() )
{
TOOL_MANAGER* tool_manager = tools_holder->GetToolManager();
TOOLS_HOLDER* tools_holder = dynamic_cast<TOOLS_HOLDER*>( parent );
TOOL_MANAGER* tool_manager = tools_holder ? tools_holder->GetToolManager() : nullptr;
if( tool_manager == nullptr )
{
if( !tool_manager )
return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
}
// Get the selection to use to test if the action is enabled
SELECTION& sel = tool_manager->GetToolHolder()->GetCurrentSelection();
bool runAction = true;
if( const ACTION_CONDITIONS* aCond =
tool_manager->GetActionManager()->GetCondition( *context ) )
{
if( const ACTION_CONDITIONS* aCond = tool_manager->GetActionManager()->GetCondition( *context ) )
runAction = aCond->enableCondition( sel );
}
if( runAction )
{

View File

@ -771,10 +771,13 @@ void RENDER_3D_OPENGL::generateViasAndPads()
wxASSERT( zbot < ztop );
if( m_boardAdapter.m_Cfg->m_Render.show_plated_barrels )
{
generateCylinder( via_center, hole_inner_radius, hole_inner_radius + platingThickness3d,
ztop, zbot, nrSegments, layerTriangleVIA );
}
}
}
m_microviaHoles = new OPENGL_RENDER_LIST( *layerTriangleVIA, 0, 0.0f, 0.0f );
@ -816,10 +819,7 @@ void RENDER_3D_OPENGL::generateViasAndPads()
{
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
{
const VECTOR2I drillsize = pad->GetDrillSize();
const bool hasHole = drillsize.x && drillsize.y;
if( !hasHole )
if( !pad->HasHole() )
continue;
pad->TransformHoleToPolygon( tht_outer_holes_poly, platingThickness,
@ -842,7 +842,7 @@ void RENDER_3D_OPENGL::generateViasAndPads()
const LIST_OBJECT2D& holes2D = holesContainer.GetList();
if( holes2D.size() > 0 )
if( holes2D.size() > 0 && m_boardAdapter.m_Cfg->m_Render.show_plated_barrels )
{
float layer_z_top, layer_z_bot, dummy;

View File

@ -115,6 +115,11 @@ public:
~BVH_PBRT();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
BVH_PBRT( const BVH_PBRT& ) = delete;
BVH_PBRT& operator=( const BVH_PBRT& ) = delete;
bool Intersect( const RAY& aRay, HITINFO& aHitInfo ) const override;
bool Intersect( const RAY& aRay, HITINFO& aHitInfo, unsigned int aAccNodeInfo ) const override;
bool Intersect( const RAYPACKET& aRayPacket, HITINFO_PACKET* aHitInfoPacket ) const override;

View File

@ -22,12 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file container_2d.h
*/
#ifndef _CONTAINER_2D_H_
#define _CONTAINER_2D_H_
#pragma once
#include "../shapes2D/object_2d.h"
#include <list>
@ -71,8 +66,7 @@ public:
* @param aBBox The bounding box to test.
* @param aOutList The list of objects that intersects the bounding box.
*/
virtual void GetIntersectingObjects( const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const = 0;
virtual void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const = 0;
/**
* Intersect and check if a segment ray hits a object or is inside it.
@ -96,8 +90,7 @@ class CONTAINER_2D : public CONTAINER_2D_BASE
public:
CONTAINER_2D();
void GetIntersectingObjects( const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const override;
void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const override;
bool IntersectAny( const RAYSEG2D& aSegRay ) const override;
};
@ -119,28 +112,30 @@ public:
BVH_CONTAINER_2D();
~BVH_CONTAINER_2D();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
BVH_CONTAINER_2D( const BVH_CONTAINER_2D& ) = delete;
BVH_CONTAINER_2D& operator=( const BVH_CONTAINER_2D& ) = delete;
void BuildBVH();
void Clear() override;
void GetIntersectingObjects( const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const override;
void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const override;
bool IntersectAny( const RAYSEG2D& aSegRay ) const override;
private:
void destroy();
void recursiveBuild_MIDDLE_SPLIT( BVH_CONTAINER_NODE_2D* aNodeParent );
void recursiveGetListObjectsIntersects( const BVH_CONTAINER_NODE_2D* aNode,
const BBOX_2D& aBBox,
void recursiveGetListObjectsIntersects( const BVH_CONTAINER_NODE_2D* aNode, const BBOX_2D& aBBox,
CONST_LIST_OBJECT2D& aOutList ) const;
bool recursiveIntersectAny( const BVH_CONTAINER_NODE_2D* aNode,
const RAYSEG2D& aSegRay ) const;
bool recursiveIntersectAny( const BVH_CONTAINER_NODE_2D* aNode, const RAYSEG2D& aSegRay ) const;
private:
bool m_isInitialized;
std::list<BVH_CONTAINER_NODE_2D*> m_elementsToDelete;
BVH_CONTAINER_NODE_2D* m_tree;
};
#endif // _CONTAINER_2D_H_

View File

@ -277,7 +277,7 @@ void RENDER_3D_RAYTRACE_BASE::renderTracing( uint8_t* ptrPBO, REPORTER* aStatusR
BS::multi_future<void> futures;
for( size_t i = 0; i < tp.get_thread_count(); ++i )
futures.push_back( tp.submit( processBlocks ) );
futures.push_back( tp.submit_task( processBlocks ) );
futures.wait();
@ -486,9 +486,12 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( uint8_t* ptrPBO, signed int iB
// Initialize ray packets
const SFVEC2UI& blockPos = m_blockPositions[iBlock];
const SFVEC2I blockPosI = SFVEC2I( blockPos.x + m_xoffset, blockPos.y + m_yoffset );
const SFVEC2F randDisp = ( m_camera.GetProjection() == PROJECTION_TYPE::ORTHO ) ?
SFVEC2F( 0.0f, 0.0f ) :
SFVEC2F( DISP_FACTOR, DISP_FACTOR );
RAYPACKET blockPacket( m_camera, (SFVEC2F) blockPosI + SFVEC2F( DISP_FACTOR, DISP_FACTOR ),
SFVEC2F( DISP_FACTOR, DISP_FACTOR ) /* Displacement random factor */ );
RAYPACKET blockPacket( m_camera, (SFVEC2F) blockPosI + randDisp,
randDisp /* Displacement random factor */ );
HITINFO_PACKET hitPacket_X0Y0[RAYPACKET_RAYS_PER_PACKET];
@ -566,7 +569,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( uint8_t* ptrPBO, signed int iB
HITINFO_PACKET_init( hitPacket_AA_X1Y1 );
RAYPACKET blockPacket_AA_X1Y1( m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.5f, 0.5f ),
SFVEC2F( DISP_FACTOR, DISP_FACTOR ) );
randDisp );
if( !m_accelerator->Intersect( blockPacket_AA_X1Y1, hitPacket_AA_X1Y1 ) )
{
@ -603,16 +606,16 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( uint8_t* ptrPBO, signed int iB
RAY blockRayPck_AA_X1Y1_half[RAYPACKET_RAYS_PER_PACKET];
RAYPACKET_InitRays_with2DDisplacement(
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.5f - DISP_FACTOR, DISP_FACTOR ),
SFVEC2F( DISP_FACTOR, DISP_FACTOR ), blockRayPck_AA_X1Y0 );
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.5f - randDisp.x, randDisp.y ),
randDisp, blockRayPck_AA_X1Y0 );
RAYPACKET_InitRays_with2DDisplacement(
m_camera, (SFVEC2F) blockPosI + SFVEC2F( DISP_FACTOR, 0.5f - DISP_FACTOR ),
SFVEC2F( DISP_FACTOR, DISP_FACTOR ), blockRayPck_AA_X0Y1 );
m_camera, (SFVEC2F) blockPosI + SFVEC2F( randDisp.x, 0.5f - randDisp.y ),
randDisp, blockRayPck_AA_X0Y1 );
RAYPACKET_InitRays_with2DDisplacement(
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.25f - DISP_FACTOR, 0.25f - DISP_FACTOR ),
SFVEC2F( DISP_FACTOR, DISP_FACTOR ), blockRayPck_AA_X1Y1_half );
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.25f - randDisp.x, 0.25f - randDisp.y ),
randDisp, blockRayPck_AA_X1Y1_half );
renderAntiAliasPackets( bgColor, hitPacket_X0Y0, hitPacket_AA_X1Y1, blockRayPck_AA_X1Y0,
hitColor_AA_X1Y0 );

View File

@ -23,12 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file layer_item_2d.h
*/
#ifndef _LAYER_ITEM_2D_H_
#define _LAYER_ITEM_2D_H_
#pragma once
#include "object_2d.h"
#include <vector>
@ -84,6 +79,11 @@ public:
~LAYER_ITEM_2D();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
LAYER_ITEM_2D( const LAYER_ITEM_2D& ) = delete;
LAYER_ITEM_2D& operator=( const LAYER_ITEM_2D& ) = delete;
// Imported from OBJECT_2D
bool Overlaps( const BBOX_2D& aBBox ) const override;
bool Intersects( const BBOX_2D& aBBox ) const override;
@ -97,4 +97,3 @@ private:
const OBJECT_2D* m_objectC;
};
#endif // _LAYER_ITEM_2D_H_

View File

@ -0,0 +1,14 @@
if( UNIX AND NOT APPLE )
add_library(3d-viewer_spacenav STATIC
spnav_viewer_plugin.cpp
)
add_dependencies( 3d-viewer_spacenav pcbcommon )
target_include_directories(3d-viewer_spacenav PRIVATE
${CMAKE_SOURCE_DIR}/common
${CMAKE_SOURCE_DIR}/3d-viewer
)
target_link_libraries(3d-viewer_spacenav
PRIVATE
kicommon
)
endif()

View File

@ -0,0 +1,111 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see CHANGELOG.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/gpl-3.0.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "spnav_viewer_plugin.h"
#include <3d-viewer/3d_canvas/eda_3d_canvas.h>
#include <3d-viewer/3d_rendering/track_ball.h>
#include <pgm_base.h>
#include <settings/common_settings.h>
SPNAV_VIEWER_PLUGIN::SPNAV_VIEWER_PLUGIN( EDA_3D_CANVAS* aCanvas )
: m_timer( this ), m_canvas( aCanvas ), m_camera( nullptr ), m_focused( true )
{
m_camera = dynamic_cast<TRACK_BALL*>( aCanvas->GetCamera() );
m_driver = std::make_unique<LIBSPNAV_DRIVER>();
if( m_driver->Connect() )
{
m_driver->SetHandler( this );
Bind( wxEVT_TIMER, &SPNAV_VIEWER_PLUGIN::onPollTimer, this );
m_timer.Start( 10 );
}
}
SPNAV_VIEWER_PLUGIN::~SPNAV_VIEWER_PLUGIN()
{
m_timer.Stop();
if( m_driver )
m_driver->Disconnect();
}
void SPNAV_VIEWER_PLUGIN::SetFocus( bool aFocus )
{
m_focused = aFocus;
}
void SPNAV_VIEWER_PLUGIN::onPollTimer( wxTimerEvent& )
{
if( m_driver && m_focused )
m_driver->Poll();
}
void SPNAV_VIEWER_PLUGIN::OnPan( double x, double y, double z )
{
if( const COMMON_SETTINGS* cfg = Pgm().GetCommonSettings() )
{
float scale = 0.0005f * ( cfg->m_SpaceMouse.pan_speed / 5.0f );
if( cfg->m_SpaceMouse.reverse_pan_x )
x = -x;
if( cfg->m_SpaceMouse.reverse_pan_y )
y = -y;
if( cfg->m_SpaceMouse.reverse_zoom )
z = -z;
if( m_camera )
{
m_camera->Pan( SFVEC3F( x * scale, -y * scale, z * scale ) );
m_canvas->Request_refresh();
}
}
}
void SPNAV_VIEWER_PLUGIN::OnRotate( double rx, double ry, double rz )
{
if( const COMMON_SETTINGS* cfg = Pgm().GetCommonSettings() )
{
float scale = 0.001f * ( cfg->m_SpaceMouse.rotate_speed / 5.0f );
if( cfg->m_SpaceMouse.reverse_rotate )
scale = -scale;
if( m_camera )
{
m_camera->RotateX( ry * scale );
m_camera->RotateY( rx * scale );
m_camera->RotateZ( rz * scale );
m_canvas->Request_refresh();
}
}
}
void SPNAV_VIEWER_PLUGIN::OnButton( int button, bool pressed )
{
// Buttons are ignored for now
(void) button;
(void) pressed;
}

View File

@ -0,0 +1,57 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see CHANGELOG.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/gpl-3.0.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SPNAV_VIEWER_PLUGIN_H
#define SPNAV_VIEWER_PLUGIN_H
#include <memory>
#include <wx/timer.h>
#include "common/spacenav/spacenav_driver.h"
#include "common/spacenav/libspnav_driver.h"
class EDA_3D_CANVAS;
class TRACK_BALL;
class SPNAV_VIEWER_PLUGIN : public wxEvtHandler, public SPACEMOUSE_HANDLER
{
public:
explicit SPNAV_VIEWER_PLUGIN( EDA_3D_CANVAS* aCanvas );
~SPNAV_VIEWER_PLUGIN();
void SetFocus( bool aFocus = true );
void OnPan( double x, double y, double z ) override;
void OnRotate( double rx, double ry, double rz ) override;
void OnButton( int button, bool pressed ) override;
private:
void onPollTimer( wxTimerEvent& evt );
std::unique_ptr<SPACENAV_DRIVER> m_driver;
wxTimer m_timer;
EDA_3D_CANVAS* m_canvas;
TRACK_BALL* m_camera;
bool m_focused;
};
#endif // SPNAV_VIEWER_PLUGIN_H

View File

@ -48,8 +48,7 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
//
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
fileMenu->Add( EDA_3D_ACTIONS::exportAsPNG );
fileMenu->Add( EDA_3D_ACTIONS::exportAsJPEG );
fileMenu->Add( EDA_3D_ACTIONS::exportImage );
fileMenu->AppendSeparator();
fileMenu->AddClose( _( "3D Viewer" ) );
@ -87,22 +86,39 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
viewMenu->Add( gridSubmenu );
viewMenu->AppendSeparator();
viewMenu->Add( EDA_3D_ACTIONS::rotateXCW );
viewMenu->Add( EDA_3D_ACTIONS::rotateXCCW );
viewMenu->Add( EDA_3D_ACTIONS::viewTop );
viewMenu->Add( EDA_3D_ACTIONS::viewBottom );
viewMenu->Add( EDA_3D_ACTIONS::viewRight );
viewMenu->Add( EDA_3D_ACTIONS::viewLeft );
viewMenu->Add( EDA_3D_ACTIONS::viewFront );
viewMenu->Add( EDA_3D_ACTIONS::viewBack );
ACTION_MENU* rotateSubmenu = new ACTION_MENU( false, tool );
rotateSubmenu->SetTitle( _( "Rotate Board" ) );
rotateSubmenu->SetIcon( BITMAPS::rotate_cw );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCW );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCCW );
rotateSubmenu->AppendSeparator();
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCW );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCCW );
rotateSubmenu->AppendSeparator();
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCW );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCCW );
ACTION_MENU* moveSubmenu = new ACTION_MENU( false, tool );
moveSubmenu->SetTitle( _( "Move Board" ) );
moveSubmenu->SetIcon( BITMAPS::move );
moveSubmenu->Add( EDA_3D_ACTIONS::moveLeft );
moveSubmenu->Add( EDA_3D_ACTIONS::moveRight );
moveSubmenu->Add( EDA_3D_ACTIONS::moveUp );
moveSubmenu->Add( EDA_3D_ACTIONS::moveDown );
viewMenu->AppendSeparator();
viewMenu->Add( EDA_3D_ACTIONS::rotateYCW );
viewMenu->Add( EDA_3D_ACTIONS::rotateYCCW );
viewMenu->AppendSeparator();
viewMenu->Add( EDA_3D_ACTIONS::rotateZCW );
viewMenu->Add( EDA_3D_ACTIONS::rotateZCCW );
viewMenu->AppendSeparator();
viewMenu->Add( EDA_3D_ACTIONS::moveLeft );
viewMenu->Add( EDA_3D_ACTIONS::moveRight );
viewMenu->Add( EDA_3D_ACTIONS::moveUp );
viewMenu->Add( EDA_3D_ACTIONS::moveDown );
viewMenu->Add( rotateSubmenu );
viewMenu->Add( EDA_3D_ACTIONS::flipView );
viewMenu->Add( moveSubmenu );
viewMenu->AppendSeparator();
viewMenu->Add( EDA_3D_ACTIONS::showLayersManager, ACTION_MENU::CHECK );

View File

@ -34,6 +34,7 @@
#include "dialogs/appearance_controls_3D.h"
#include <dialogs/eda_view_switcher.h>
#include <eda_3d_viewer_settings.h>
#include <3d_rendering/raytracing/render_3d_raytrace_ram.h>
#include <3d_viewer_id.h>
#include <3d_viewer/tools/eda_3d_actions.h>
#include <3d_viewer/tools/eda_3d_controller.h>
@ -60,7 +61,12 @@
#include <project_pcb.h>
#include <toolbars_3d.h>
#ifdef __linux__
#include <spacenav/libspnav_driver.h>
#include <3d_spacenav/spnav_viewer_plugin.h>
#else
#include <3d_navlib/nl_3d_viewer_plugin.h>
#endif
/**
* Flag to enable 3D viewer main frame window debug tracing.
@ -191,7 +197,11 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
try
{
#ifdef __linux__
m_spaceMouse = std::make_unique<SPNAV_VIEWER_PLUGIN>( m_canvas );
#else
m_spaceMouse = std::make_unique<NL_3D_VIEWER_PLUGIN>( m_canvas );
#endif
}
catch( const std::system_error& e )
{
@ -656,80 +666,304 @@ void EDA_3D_VIEWER_FRAME::OnDarkModeToggle()
void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
{
wxString fullFileName;
bool fmt_is_jpeg = false;
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG )
fmt_is_jpeg = true;
if( aFormat != EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
{
// Remember path between saves during this session only.
const wxString wildcard =
fmt_is_jpeg ? FILEEXT::JpegFileWildcard() : FILEEXT::PngFileWildcard();
const wxString ext = fmt_is_jpeg ? FILEEXT::JpegFileExtension : FILEEXT::PngFileExtension;
if( !getExportFileName( aFormat, fullFileName ) )
return;
}
wxImage screenshotImage = captureCurrentViewScreenshot();
if( screenshotImage.IsOk() )
{
saveOrCopyImage( screenshotImage, aFormat, fullFileName );
}
}
wxImage EDA_3D_VIEWER_FRAME::captureCurrentViewScreenshot()
{
// Ensure we have the latest 3D view (remember 3D view is buffered)
// Also ensure any highlighted item is not highlighted when creating screen shot
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS& cfg = m_boardAdapter.m_Cfg->m_Render;
bool original_highlight = cfg.highlight_on_rollover;
cfg.highlight_on_rollover = false;
m_canvas->DoRePaint(); // init first buffer
m_canvas->DoRePaint(); // init second buffer
wxImage screenshotImage;
if( m_canvas )
{
// Build image from the 3D buffer
wxWindowUpdateLocker noUpdates( this );
m_canvas->GetScreenshot( screenshotImage );
}
// Restore highlight setting
cfg.highlight_on_rollover = original_highlight;
return screenshotImage;
}
void EDA_3D_VIEWER_FRAME::ExportImage( EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxSize& aSize )
{
wxString fullFileName;
if( aFormat != EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
{
if( !getExportFileName( aFormat, fullFileName ) )
return;
}
wxImage screenshotImage = captureScreenshot( aSize );
if( screenshotImage.IsOk() )
{
saveOrCopyImage( screenshotImage, aFormat, fullFileName );
}
}
bool EDA_3D_VIEWER_FRAME::getExportFileName( EDA_3D_VIEWER_EXPORT_FORMAT& aFormat, wxString& fullFileName )
{
// Create combined wildcard for both formats
const wxString wildcard = FILEEXT::JpegFileWildcard() + "|" + FILEEXT::PngFileWildcard();
// First time path is set to the project path.
if( !m_defaultSaveScreenshotFileName.IsOk() )
m_defaultSaveScreenshotFileName = Parent()->Prj().GetProjectFullName();
m_defaultSaveScreenshotFileName.SetExt( ext );
// Set default extension based on current format
const wxString defaultExt = ( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) ?
FILEEXT::JpegFileExtension : FILEEXT::PngFileExtension;
m_defaultSaveScreenshotFileName.SetExt( defaultExt );
wxFileDialog dlg( this, _( "3D Image File Name" ),
m_defaultSaveScreenshotFileName.GetPath(),
m_defaultSaveScreenshotFileName.GetFullName(), wildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
// Set initial filter index based on current format
dlg.SetFilterIndex( ( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) ? 0 : 1 );
if( dlg.ShowModal() == wxID_CANCEL )
return;
return false;
m_defaultSaveScreenshotFileName = dlg.GetPath();
if( m_defaultSaveScreenshotFileName.GetExt().IsEmpty() )
// Determine format based on file extension first
wxString fileExt = m_defaultSaveScreenshotFileName.GetExt().Lower();
EDA_3D_VIEWER_EXPORT_FORMAT detectedFormat;
bool formatDetected = false;
if( fileExt == wxT("jpg") || fileExt == wxT("jpeg") )
{
detectedFormat = EDA_3D_VIEWER_EXPORT_FORMAT::JPEG;
formatDetected = true;
}
else if( fileExt == wxT("png") )
{
detectedFormat = EDA_3D_VIEWER_EXPORT_FORMAT::PNG;
formatDetected = true;
}
// If format can't be determined from extension, use dropdown selection
if( !formatDetected )
{
int filterIndex = dlg.GetFilterIndex();
detectedFormat = ( filterIndex == 0 ) ? EDA_3D_VIEWER_EXPORT_FORMAT::JPEG :
EDA_3D_VIEWER_EXPORT_FORMAT::PNG;
// Append appropriate extension
const wxString ext = ( detectedFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) ?
FILEEXT::JpegFileExtension : FILEEXT::PngFileExtension;
m_defaultSaveScreenshotFileName.SetExt( ext );
}
fullFileName = m_defaultSaveScreenshotFileName.GetFullPath();
// Update the format parameter
aFormat = detectedFormat;
wxFileName fn = fullFileName;
// Check directory permissions using the updated filename
wxFileName fn = m_defaultSaveScreenshotFileName;
if( !fn.IsDirWritable() )
{
wxString msg;
msg.Printf( _( "Insufficient permissions to save file '%s'." ), fullFileName );
msg.Printf( _( "Insufficient permissions to save file '%s'." ),
m_defaultSaveScreenshotFileName.GetFullPath() );
wxMessageBox( msg, _( "Error" ), wxOK | wxICON_ERROR, this );
return;
return false;
}
// Be sure the screen area destroyed by the file dialog is redrawn
// before making a screen copy.
// Without this call, under Linux the screen refresh is made to late.
wxYield();
fullFileName = m_defaultSaveScreenshotFileName.GetFullPath();
return true;
}
// Be sure we have the latest 3D view (remember 3D view is buffered)
// Also ensure any highlighted item is not highlighted when creating screen shot
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS& cfg = m_boardAdapter.m_Cfg->m_Render;
bool allow_highlight = cfg.highlight_on_rollover;
cfg.highlight_on_rollover = false;
m_canvas->DoRePaint(); // init first buffer
m_canvas->DoRePaint(); // init second buffer
wxImage EDA_3D_VIEWER_FRAME::captureScreenshot( const wxSize& aSize )
{
TRACK_BALL camera = m_trackBallCamera;
camera.SetCurWindowSize( aSize );
// Build image from the 3D buffer
wxWindowUpdateLocker noUpdates( this );
EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
EDA_3D_VIEWER_SETTINGS* backupCfg = m_boardAdapter.m_Cfg;
auto configRestorer = std::unique_ptr<void, std::function<void(void*)>>(
reinterpret_cast<void*>(1),
[&](void*) { m_boardAdapter.m_Cfg = backupCfg; }
);
if( cfg )
m_boardAdapter.m_Cfg = cfg;
if( cfg && cfg->m_Render.engine == RENDER_ENGINE::RAYTRACING )
return captureRaytracingScreenshot( m_boardAdapter, camera, aSize );
else
return captureOpenGLScreenshot( m_boardAdapter, camera, aSize );
}
void EDA_3D_VIEWER_FRAME::setupRenderingConfig( BOARD_ADAPTER& aAdapter )
{
EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
if( cfg )
aAdapter.m_Cfg = cfg;
}
wxImage EDA_3D_VIEWER_FRAME::captureRaytracingScreenshot( BOARD_ADAPTER& aAdapter, TRACK_BALL& aCamera, const wxSize& aSize )
{
BOARD_ADAPTER tempadapter;
tempadapter.SetBoard( GetBoard() );
tempadapter.m_Cfg = aAdapter.m_Cfg;
tempadapter.InitSettings( nullptr, nullptr );
tempadapter.Set3dCacheManager( aAdapter.Get3dCacheManager() );
RENDER_3D_RAYTRACE_RAM raytrace( tempadapter, aCamera );
raytrace.SetCurWindowSize( aSize );
while( raytrace.Redraw( false, nullptr, nullptr ) );
uint8_t* rgbaBuffer = raytrace.GetBuffer();
wxSize realSize = raytrace.GetRealBufferSize();
if( !rgbaBuffer )
return wxImage();
return convertRGBAToImage( rgbaBuffer, realSize );
}
wxImage EDA_3D_VIEWER_FRAME::convertRGBAToImage( uint8_t* aRGBABuffer, const wxSize& aRealSize )
{
const unsigned int wxh = aRealSize.x * aRealSize.y;
unsigned char* rgbBuffer = (unsigned char*) malloc( wxh * 3 );
unsigned char* alphaBuffer = (unsigned char*) malloc( wxh );
unsigned char* rgbaPtr = aRGBABuffer;
unsigned char* rgbPtr = rgbBuffer;
unsigned char* alphaPtr = alphaBuffer;
for( int y = 0; y < aRealSize.y; y++ )
{
for( int x = 0; x < aRealSize.x; x++ )
{
rgbPtr[0] = rgbaPtr[0];
rgbPtr[1] = rgbaPtr[1];
rgbPtr[2] = rgbaPtr[2];
alphaPtr[0] = rgbaPtr[3];
rgbaPtr += 4;
rgbPtr += 3;
alphaPtr += 1;
}
}
wxImage screenshotImage;
screenshotImage.Create( aRealSize );
screenshotImage.SetData( rgbBuffer );
screenshotImage.SetAlpha( alphaBuffer );
return screenshotImage.Mirror( false );
}
if( m_canvas )
m_canvas->GetScreenshot( screenshotImage );
cfg.highlight_on_rollover = allow_highlight;
wxImage EDA_3D_VIEWER_FRAME::captureOpenGLScreenshot( BOARD_ADAPTER& aAdapter, TRACK_BALL& aCamera, const wxSize& aSize )
{
EDA_3D_VIEWER_SETTINGS* cfg = aAdapter.m_Cfg;
ANTIALIASING_MODE aaMode = cfg ? static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode )
: ANTIALIASING_MODE::AA_NONE;
wxFrame temp( this, wxID_ANY, wxEmptyString, wxDefaultPosition, aSize, wxFRAME_NO_TASKBAR );
temp.Hide();
BOARD_ADAPTER tempadapter;
tempadapter.SetBoard( GetBoard() );
tempadapter.m_Cfg = aAdapter.m_Cfg;
tempadapter.InitSettings( nullptr, nullptr );
tempadapter.Set3dCacheManager( aAdapter.Get3dCacheManager() );
auto canvas = std::make_unique<EDA_3D_CANVAS>( &temp,
OGL_ATT_LIST::GetAttributesList( aaMode, true ),
tempadapter, aCamera,
aAdapter.Get3dCacheManager() );
canvas->SetSize( aSize );
configureCanvas( canvas, cfg );
wxWindowUpdateLocker noUpdates( this );
// Temporarily disable highlight during screenshot
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS& renderCfg = aAdapter.m_Cfg->m_Render;
bool original_highlight = renderCfg.highlight_on_rollover;
bool original_navigator = renderCfg.show_navigator;
renderCfg.show_navigator = false;
renderCfg.highlight_on_rollover = false;
std::vector<unsigned char> buffer(aSize.x * aSize.y * 4); // RGBA format
canvas->RenderToFrameBuffer( buffer.data(), aSize.x, aSize.y );
wxImage result = convertRGBAToImage( buffer.data(), aSize );
// Restore highlight setting
renderCfg.highlight_on_rollover = original_highlight;
renderCfg.show_navigator = original_navigator;
return result;
}
void EDA_3D_VIEWER_FRAME::configureCanvas( std::unique_ptr<EDA_3D_CANVAS>& aCanvas, EDA_3D_VIEWER_SETTINGS* aCfg )
{
if( aCfg )
{
aCanvas->SetAnimationEnabled( aCfg->m_Camera.animation_enabled );
aCanvas->SetMovingSpeedMultiplier( aCfg->m_Camera.moving_speed_multiplier );
aCanvas->SetProjectionMode( aCfg->m_Camera.projection_mode );
}
aCanvas->SetVcSettings( EDA_DRAW_PANEL_GAL::GetVcSettings() );
}
void EDA_3D_VIEWER_FRAME::saveOrCopyImage( const wxImage& aScreenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& aFullFileName )
{
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
{
wxBitmap bitmap( screenshotImage );
copyImageToClipboard( aScreenshotImage );
}
else
{
saveImageToFile( aScreenshotImage, aFormat, aFullFileName );
}
}
wxLogNull doNotLog; // disable logging of failed clipboard actions
void EDA_3D_VIEWER_FRAME::copyImageToClipboard( const wxImage& aScreenshotImage )
{
wxBitmap bitmap( aScreenshotImage );
wxLogNull doNotLog;
if( wxTheClipboard->Open() )
{
@ -738,18 +972,19 @@ void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
if( !wxTheClipboard->SetData( dobjBmp ) )
wxMessageBox( _( "Failed to copy image to clipboard" ) );
wxTheClipboard->Flush(); /* the data in clipboard will stay
* available after the application exits */
wxTheClipboard->Flush();
wxTheClipboard->Close();
}
}
else
{
if( !screenshotImage.SaveFile( fullFileName,
fmt_is_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
wxMessageBox( _( "Can't save file" ) );
screenshotImage.Destroy();
void EDA_3D_VIEWER_FRAME::saveImageToFile( const wxImage& aScreenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& aFullFileName )
{
bool fmt_is_jpeg = ( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG );
if( !aScreenshotImage.SaveFile( aFullFileName, fmt_is_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
{
wxMessageBox( _( "Can't save file" ) );
}
}

View File

@ -44,7 +44,11 @@
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
// Forward declarations
#ifdef __linux__
class SPNAV_VIEWER_PLUGIN;
#else
class NL_3D_VIEWER_PLUGIN;
#endif
class APPEARANCE_CONTROLS_3D;
@ -60,6 +64,7 @@ enum EDA_3D_VIEWER_STATUSBAR
enum class EDA_3D_VIEWER_EXPORT_FORMAT
{
CLIPBOARD,
IMAGE,
PNG,
JPEG
};
@ -136,6 +141,13 @@ public:
*/
void TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat );
/**
* Export 3D viewer image to file or clipboard
* @param aFormat - Export format (JPEG, PNG, or CLIPBOARD)
* @param aSize - Size of the exported image
*/
void ExportImage( EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxSize& aSize );
protected:
void setupUIConditions() override;
@ -174,6 +186,90 @@ private:
void applySettings( EDA_3D_VIEWER_SETTINGS* aSettings );
/**
* Get export filename through file dialog
* @param aFormat - [in/out] Export format to determine default file extension and wildcard.
* Will be updated to the selected format.
* @param fullFileName - [out] Full path of selected file
* @return true if filename was successfully obtained, false if cancelled
*/
bool getExportFileName( EDA_3D_VIEWER_EXPORT_FORMAT& aFormat, wxString& fullFileName );
/**
* Capture screenshot using appropriate rendering method
* @param aSize - Size of the screenshot
* @return wxImage containing the screenshot
*/
wxImage captureScreenshot( const wxSize& aSize );
/**
* Setup rendering configuration for screenshot capture
* @param adapter - Board adapter to configure
*/
void setupRenderingConfig( BOARD_ADAPTER& adapter );
/**
* Capture screenshot of the current view using the configured renderer.
* This function handles both ray tracing and OpenGL rendering methods.
* @return wxImage containing the screenshot of the current view.
*/
wxImage captureCurrentViewScreenshot();
/**
* Capture screenshot using raytracing renderer
* @param adapter - Configured board adapter
* @param camera - Camera settings
* @param aSize - Size of the screenshot
* @return wxImage containing the screenshot
*/
wxImage captureRaytracingScreenshot( BOARD_ADAPTER& adapter, TRACK_BALL& camera, const wxSize& aSize );
/**
* Convert RGBA buffer to wxImage format
* @param rgbaBuffer - Source RGBA buffer
* @param realSize - Size of the buffer
* @return wxImage with RGB data and alpha channel
*/
wxImage convertRGBAToImage( uint8_t* rgbaBuffer, const wxSize& realSize );
/**
* Capture screenshot using OpenGL renderer
* @param adapter - Configured board adapter
* @param camera - Camera settings
* @param aSize - Size of the screenshot
* @return wxImage containing the screenshot
*/
wxImage captureOpenGLScreenshot( BOARD_ADAPTER& adapter, TRACK_BALL& camera, const wxSize& aSize );
/**
* Configure canvas settings for screenshot capture
* @param canvas - Canvas to configure
* @param cfg - Configuration settings (can be nullptr)
*/
void configureCanvas( std::unique_ptr<EDA_3D_CANVAS>& canvas, EDA_3D_VIEWER_SETTINGS* cfg );
/**
* Save image to file or copy to clipboard based on format
* @param screenshotImage - Image to save/copy
* @param aFormat - Export format
* @param fullFileName - Full path for file save (ignored for clipboard)
*/
void saveOrCopyImage( const wxImage& screenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& fullFileName );
/**
* Copy image to system clipboard
* @param screenshotImage - Image to copy
*/
void copyImageToClipboard( const wxImage& screenshotImage );
/**
* Save image to file
* @param screenshotImage - Image to save
* @param aFormat - Export format (JPEG or PNG)
* @param fullFileName - Full path of target file
*/
void saveImageToFile( const wxImage& screenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& fullFileName );
private:
wxFileName m_defaultSaveScreenshotFileName;
@ -184,7 +280,11 @@ private:
bool m_disable_ray_tracing;
#ifdef __linux__
std::unique_ptr<SPNAV_VIEWER_PLUGIN> m_spaceMouse;
#else
std::unique_ptr<NL_3D_VIEWER_PLUGIN> m_spaceMouse;
#endif
/**
* Trace mask used to enable or disable the trace output of this class.

View File

@ -38,6 +38,7 @@ LAYER_PRESET_3D::LAYER_PRESET_3D( const wxString& aName ) :
name( aName )
{
layers.set( LAYER_3D_BOARD );
layers.set( LAYER_3D_PLATED_BARRELS );
layers.set( LAYER_3D_COPPER_TOP );
layers.set( LAYER_3D_COPPER_BOTTOM );
layers.set( LAYER_3D_SILKSCREEN_TOP );
@ -59,6 +60,7 @@ LAYER_PRESET_3D::LAYER_PRESET_3D( const wxString& aName ) :
colors[ LAYER_3D_BACKGROUND_TOP ] = BOARD_ADAPTER::g_DefaultBackgroundTop;
colors[ LAYER_3D_BACKGROUND_BOTTOM ] = BOARD_ADAPTER::g_DefaultBackgroundBot;
colors[ LAYER_3D_BOARD ] = BOARD_ADAPTER::g_DefaultBoardBody;
colors[ LAYER_3D_PLATED_BARRELS ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
colors[ LAYER_3D_COPPER_TOP ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
colors[ LAYER_3D_COPPER_BOTTOM ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
colors[ LAYER_3D_SILKSCREEN_TOP ] = BOARD_ADAPTER::g_DefaultSilkscreen;
@ -91,6 +93,7 @@ PARAM_LAYER_PRESET_3D::PARAM_LAYER_PRESET_3D( const std::string& aPath,
LAYER( "background_bottom", LAYER_3D_BACKGROUND_BOTTOM );
LAYER( "background_top", LAYER_3D_BACKGROUND_TOP );
LAYER( "board", LAYER_3D_BOARD );
LAYER( "plated_barrels", LAYER_3D_PLATED_BARRELS );
LAYER( "copper", LAYER_3D_COPPER_TOP );
LAYER( "copper_bottom", LAYER_3D_COPPER_BOTTOM );
LAYER( "silkscreen_bottom", LAYER_3D_SILKSCREEN_BOTTOM );
@ -346,6 +349,8 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
&m_Render.show_navigator, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_board_body",
&m_Render.show_board_body, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_plated_barrels",
&m_Render.show_plated_barrels, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_comments",
&m_Render.show_comments, true ) );
m_params.emplace_back( new PARAM<bool>( "render.show_drawings",

View File

@ -128,6 +128,7 @@ public:
bool show_adhesive;
bool show_navigator;
bool show_board_body;
bool show_plated_barrels;
bool show_comments;
bool show_drawings;
bool show_eco1;

View File

@ -65,21 +65,13 @@ TOOL_ACTION EDA_3D_ACTIONS::copyToClipboard( TOOL_ACTION_ARGS()
.Icon( BITMAPS::copy )
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD ) );
TOOL_ACTION EDA_3D_ACTIONS::exportAsPNG( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.exportAsPNG" )
TOOL_ACTION EDA_3D_ACTIONS::exportImage( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.exportImage" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Export Current View as PNG..." ) )
.Tooltip( _( "Export the Current View as a PNG image" ) )
.Icon( BITMAPS::export_png )
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::PNG ) );
TOOL_ACTION EDA_3D_ACTIONS::exportAsJPEG( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.exportAsJPEG" )
.Scope( AS_GLOBAL )
.FriendlyName( _( "Export Current View as JPEG..." ) )
.Tooltip( _( "Export the Current View as a JPEG image" ) )
.FriendlyName( _( "Export Image..." ) )
.Tooltip( _( "Export the Current View as an image file" ) )
.Icon( BITMAPS::export_file )
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) );
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::IMAGE ) );
TOOL_ACTION EDA_3D_ACTIONS::pivotCenter( TOOL_ACTION_ARGS()
.Name( "3DViewer.Control.pivotCenter" )

View File

@ -46,8 +46,7 @@ public:
static TOOL_ACTION toggleRaytacing;
static TOOL_ACTION copyToClipboard;
static TOOL_ACTION exportAsPNG;
static TOOL_ACTION exportAsJPEG;
static TOOL_ACTION exportImage;
static TOOL_ACTION pivotCenter;
static TOOL_ACTION rotateXCW;

View File

@ -30,6 +30,7 @@
#include <kiface_base.h>
#include <tools/eda_3d_controller.h>
#include <tools/eda_3d_actions.h>
#include <dialogs/dialog_export_3d_image.h>
#include <dialogs/panel_preview_3d_model.h>
#include <dialogs/appearance_controls_3D.h>
#include <3d_rendering/opengl/render_3d_opengl.h>
@ -37,6 +38,30 @@
bool EDA_3D_CONTROLLER::Init()
{
std::shared_ptr<ACTION_MENU> rotateSubmenu = std::make_shared<ACTION_MENU>( true, this );
rotateSubmenu->SetTitle( _( "Rotate Board" ) );
rotateSubmenu->SetIcon( BITMAPS::rotate_cw );
m_menu->RegisterSubMenu( rotateSubmenu );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCW );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCCW );
rotateSubmenu->AppendSeparator();
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCW );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCCW );
rotateSubmenu->AppendSeparator();
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCW );
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCCW );
std::shared_ptr<ACTION_MENU> moveSubmenu = std::make_shared<ACTION_MENU>( true, this );
moveSubmenu->SetTitle( _( "Move Board" ) );
moveSubmenu->SetIcon( BITMAPS::move );
m_menu->RegisterSubMenu( moveSubmenu );
moveSubmenu->Add( EDA_3D_ACTIONS::moveLeft );
moveSubmenu->Add( EDA_3D_ACTIONS::moveRight );
moveSubmenu->Add( EDA_3D_ACTIONS::moveUp );
moveSubmenu->Add( EDA_3D_ACTIONS::moveDown );
CONDITIONAL_MENU& ctxMenu = m_menu->GetMenu();
ctxMenu.AddItem( ACTIONS::zoomInCenter, SELECTION_CONDITIONS::ShowAlways );
@ -45,23 +70,15 @@ bool EDA_3D_CONTROLLER::Init()
ctxMenu.AddSeparator();
ctxMenu.AddItem( EDA_3D_ACTIONS::viewTop, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddItem( EDA_3D_ACTIONS::viewBottom, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddSeparator();
ctxMenu.AddItem( EDA_3D_ACTIONS::viewRight, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddItem( EDA_3D_ACTIONS::viewLeft, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddSeparator();
ctxMenu.AddItem( EDA_3D_ACTIONS::viewFront, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddItem( EDA_3D_ACTIONS::viewBack, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddSeparator();
ctxMenu.AddMenu( rotateSubmenu.get(), SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddItem( EDA_3D_ACTIONS::flipView, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddSeparator();
ctxMenu.AddItem( EDA_3D_ACTIONS::moveLeft, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddItem( EDA_3D_ACTIONS::moveRight, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddItem( EDA_3D_ACTIONS::moveUp, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddItem( EDA_3D_ACTIONS::moveDown, SELECTION_CONDITIONS::ShowAlways );
ctxMenu.AddMenu( moveSubmenu.get(), SELECTION_CONDITIONS::ShowAlways );
return true;
}
@ -137,8 +154,13 @@ int EDA_3D_CONTROLLER::Main( const TOOL_EVENT& aEvent )
evt->SetPassEvent();
}
}
else if( evt->IsClick( BUT_RIGHT ) )
else if( evt->IsMouseDown() )
{
}
else if( evt->IsClick() && ( evt->Buttons() & BUT_RIGHT ) )
{
if( !m_canvas->m_mouse_was_moved )
m_menu->ShowContextMenu();
}
else
@ -235,8 +257,7 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent )
auto flipLayer =
[&]( int layer )
{
appearanceManager->OnLayerVisibilityChanged( layer,
!visibilityFlags.test( layer ) );
appearanceManager->OnLayerVisibilityChanged( layer, !visibilityFlags.test( layer ) );
};
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
@ -246,20 +267,13 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent )
if( appearanceManager )
{
if( aEvent.IsAction( &EDA_3D_ACTIONS::showTHT ) )
flipLayer( LAYER_3D_TH_MODELS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showSMD ) )
flipLayer( LAYER_3D_SMD_MODELS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showVirtual ) )
flipLayer( LAYER_3D_VIRTUAL_MODELS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNotInPosFile ) )
flipLayer( LAYER_3D_MODELS_NOT_IN_POS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showDNP ) )
flipLayer( LAYER_3D_MODELS_MARKED_DNP );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNavigator ) )
flipLayer( LAYER_3D_NAVIGATOR );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showBBoxes ) )
flipLayer( LAYER_3D_BOUNDING_BOXES );
if( aEvent.IsAction( &EDA_3D_ACTIONS::showTHT ) ) flipLayer( LAYER_3D_TH_MODELS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showSMD ) ) flipLayer( LAYER_3D_SMD_MODELS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showVirtual ) ) flipLayer( LAYER_3D_VIRTUAL_MODELS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNotInPosFile ) ) flipLayer( LAYER_3D_MODELS_NOT_IN_POS );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showDNP ) ) flipLayer( LAYER_3D_MODELS_MARKED_DNP );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNavigator ) ) flipLayer( LAYER_3D_NAVIGATOR );
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showBBoxes ) ) flipLayer( LAYER_3D_BOUNDING_BOXES );
}
return 0;
@ -313,8 +327,7 @@ int EDA_3D_CONTROLLER::doZoomInOut( bool aDirection, bool aCenterOnCursor )
{
if( m_canvas )
{
m_canvas->SetView3D( aDirection ? VIEW3D_TYPE::VIEW3D_ZOOM_IN
: VIEW3D_TYPE::VIEW3D_ZOOM_OUT );
m_canvas->SetView3D( aDirection ? VIEW3D_TYPE::VIEW3D_ZOOM_IN : VIEW3D_TYPE::VIEW3D_ZOOM_OUT );
m_canvas->DisplayStatus();
}
@ -374,8 +387,26 @@ int EDA_3D_CONTROLLER::ExportImage( const TOOL_EVENT& aEvent )
{
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
static_cast<EDA_3D_VIEWER_FRAME*>( frame )->TakeScreenshot( aEvent.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>() );
if( !frame || frame->GetFrameType() != FRAME_PCB_DISPLAY3D )
return 0;
EDA_3D_VIEWER_FRAME* viewer = static_cast<EDA_3D_VIEWER_FRAME*>( frame );
EDA_3D_VIEWER_EXPORT_FORMAT fmt = aEvent.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>();
wxSize currentSize = viewer->GetCanvas()->GetClientSize();
if( fmt == EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
{
viewer->ExportImage( fmt, currentSize );
return 0;
}
static wxSize lastSize( viewer->GetCanvas()->GetClientSize() );
static EDA_3D_VIEWER_EXPORT_FORMAT lastFormat = EDA_3D_VIEWER_EXPORT_FORMAT::PNG;
DIALOG_EXPORT_3D_IMAGE dlg( viewer, currentSize );
if( dlg.ShowModal() == wxID_OK )
viewer->ExportImage( lastFormat, dlg.GetSize() );
return 0;
}
@ -390,8 +421,7 @@ void EDA_3D_CONTROLLER::setTransitions()
Go( &EDA_3D_CONTROLLER::ReloadBoard, EDA_3D_ACTIONS::reloadBoard.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ToggleRaytracing, EDA_3D_ACTIONS::toggleRaytacing.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::copyToClipboard.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsPNG.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsJPEG.MakeEvent() );
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportImage.MakeEvent() );
// Pan control
Go( &EDA_3D_CONTROLLER::PanControl, ACTIONS::panUp.MakeEvent() );

View File

@ -22,8 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _3D_VIEWER_CONTROL_H
#define _3D_VIEWER_CONTROL_H
#pragma once
#include <tool/tool_interactive.h>
@ -38,8 +37,8 @@ class BOARD_ADAPTER;
class EDA_3D_CONTROLLER : public TOOL_INTERACTIVE
{
public:
EDA_3D_CONTROLLER()
: TOOL_INTERACTIVE( "3DViewer.Control" ),
EDA_3D_CONTROLLER() :
TOOL_INTERACTIVE( "3DViewer.Control" ),
m_canvas( nullptr ),
m_boardAdapter( nullptr ),
m_camera( nullptr ),
@ -63,20 +62,8 @@ public:
*
* @param aRotIncrement is the rotation increment in degrees
*/
void SetRotationIncrement( double aRotIncrement )
{
m_rotationIncrement = aRotIncrement;
}
/**
* Get the increment used by the RotateView actions.
*
* @return the rotation increment in degrees
*/
double GetRotationIncrement()
{
return m_rotationIncrement;
}
void SetRotationIncrement( double aRotIncrement ) { m_rotationIncrement = aRotIncrement; }
double GetRotationIncrement() { return m_rotationIncrement; }
// View controls
int ZoomRedraw( const TOOL_EVENT& aEvent );
@ -112,5 +99,3 @@ private:
CAMERA* m_camera;
double m_rotationIncrement; ///< Rotation increment for the rotate actions (degrees)
};
#endif

View File

@ -98,6 +98,7 @@ set(3D-VIEWER_SRCS
dialogs/dialog_select_3d_model.cpp
dialogs/panel_preview_3d_model_base.cpp
dialogs/panel_preview_3d_model.cpp
dialogs/dialog_export_3d_image.cpp
dialogs/panel_3D_display_options.cpp
dialogs/panel_3D_display_options_base.cpp
dialogs/panel_3D_opengl_options.cpp
@ -123,6 +124,13 @@ target_link_libraries( 3d-viewer
add_subdirectory( 3d_cache )
if( UNIX AND NOT APPLE )
message( STATUS "Including libspnav support in 3d-viewer" )
add_subdirectory( 3d_spacenav )
target_link_libraries( 3d-viewer PRIVATE 3d-viewer_spacenav )
else()
message( STATUS "Including 3Dconnexion SpaceMouse navigation support in 3d-viewer" )
add_subdirectory( 3d_navlib )
target_link_libraries( 3d-viewer PRIVATE 3d-viewer_navlib)
endif()

View File

@ -43,6 +43,7 @@
#include <wx/checkbox.h>
#include <../3d_rendering/opengl/render_3d_opengl.h>
#include <algorithm>
/// Render Row abbreviation to reduce source width.
#define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D
@ -52,6 +53,7 @@ const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_la
// text id tooltip
RR( _HKI( "Board Body" ), LAYER_3D_BOARD, _HKI( "Show board body" ) ),
RR( _HKI( "Plated Barrels" ),LAYER_3D_PLATED_BARRELS, _HKI( "Show barrels of plated through-holes and vias" ) ),
RR( wxS( "F.Cu" ), LAYER_3D_COPPER_TOP, _HKI( "Show front copper / surface finish color" ) ),
RR( wxS( "B.Cu" ), LAYER_3D_COPPER_BOTTOM, _HKI( "Show back copper / surface finish color" ) ),
RR( _HKI( "Adhesive" ), LAYER_3D_ADHESIVE, _HKI( "Show adhesive" ) ),
@ -428,6 +430,7 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
case LAYER_3D_BOARD:
case LAYER_3D_COPPER_TOP:
case LAYER_3D_COPPER_BOTTOM:
case LAYER_3D_PLATED_BARRELS:
case LAYER_3D_SILKSCREEN_BOTTOM:
case LAYER_3D_SILKSCREEN_TOP:
case LAYER_3D_SOLDERMASK_BOTTOM:
@ -499,15 +502,23 @@ void APPEARANCE_CONTROLS_3D::onColorSwatchChanged( COLOR_SWATCH* aSwatch )
// be applied to all copper layers.
COLOR_SWATCH* otherSwatch = nullptr;
if( layer == LAYER_3D_COPPER_TOP )
const std::vector<int> copperIndices{
LAYER_3D_COPPER_TOP,
LAYER_3D_COPPER_BOTTOM,
LAYER_3D_PLATED_BARRELS,
};
// If the changed swatch is one of the copper layers, we need to update the other copper layers
if( std::find( copperIndices.begin(), copperIndices.end(), layer ) != copperIndices.end() )
{
colors[ LAYER_3D_COPPER_BOTTOM ] = newColor;
otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_BOTTOM]->m_Ctl_color;
for( int index : copperIndices )
{
if( layer != index && colors.count( index ) )
{
colors[index] = newColor;
otherSwatch = m_layerSettingsMap[index]->m_Ctl_color;
}
}
else if( layer == LAYER_3D_COPPER_BOTTOM )
{
colors[ LAYER_3D_COPPER_TOP ] = newColor;
otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_TOP]->m_Ctl_color;
}
if( otherSwatch )
@ -872,7 +883,7 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent )
if( m_cbLayerPresets->FindString( name ) != wxNOT_FOUND )
m_cbLayerPresets->Delete( m_cbLayerPresets->FindString( name ) );
alg::delete_if( cfg->m_LayerPresets,
std::erase_if( cfg->m_LayerPresets,
[name]( const LAYER_PRESET_3D& preset )
{
return preset.name == name;
@ -965,7 +976,9 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
if( !viewport->name.IsEmpty() )
{
if( m_viewportMRU.Index( viewport->name ) != wxNOT_FOUND )
m_viewportMRU.Remove( viewport->name );
m_viewportMRU.Insert( viewport->name, 0 );
}
}
@ -1000,6 +1013,8 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
{
m_viewports[name].matrix = m_frame->GetCurrentCamera().GetViewMatrix();
index = m_cbViewports->FindString( name );
if( m_viewportMRU.Index( name ) != wxNOT_FOUND )
m_viewportMRU.Remove( name );
}
@ -1035,8 +1050,10 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
{
m_viewports.erase( viewportName );
m_cbViewports->Delete( idx );
m_viewportMRU.Remove( viewportName );
}
if( m_viewportMRU.Index( viewportName ) != wxNOT_FOUND )
m_viewportMRU.Remove( viewportName );
}
if( m_lastSelectedViewport )
@ -1083,5 +1100,3 @@ void APPEARANCE_CONTROLS_3D::passOnFocus()
{
m_focusOwner->SetFocus();
}

View File

@ -18,8 +18,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef APPEARANCE_CONTROLS_3D_H
#define APPEARANCE_CONTROLS_3D_H
#pragma once
#include <vector>
@ -113,6 +112,11 @@ public:
APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wxWindow* aFocusOwner );
~APPEARANCE_CONTROLS_3D();
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
// will only land us in trouble.
APPEARANCE_CONTROLS_3D( const APPEARANCE_CONTROLS_3D& ) = delete;
APPEARANCE_CONTROLS_3D& operator=( const APPEARANCE_CONTROLS_3D& ) = delete;
wxSize GetBestSize() const;
void OnDarkModeToggle();
void OnLayerVisibilityChanged( int aLayer, bool isVisible );
@ -189,5 +193,3 @@ private:
wxCheckBox* m_cbUseBoardStackupColors;
wxCheckBox* m_cbUseBoardEditorCopperColors;
};
#endif

View File

@ -0,0 +1,397 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/gpl-3.0.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dialog_export_3d_image.h"
#include <bitmaps/bitmap_types.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/spinctrl.h>
#include <wx/choice.h>
#include <wx/bmpbuttn.h>
#include <wx/statline.h>
DIALOG_EXPORT_3D_IMAGE::DIALOG_EXPORT_3D_IMAGE( wxWindow* aParent, const wxSize& aSize ) :
DIALOG_SHIM( aParent, wxID_ANY, _( "Export 3D View" ), wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE ),
m_format( EDA_3D_VIEWER_EXPORT_FORMAT::PNG ),
m_originalSize( aSize ),
m_width( aSize.GetWidth() ),
m_height( aSize.GetHeight() ),
m_xResolution( 300.0 ),
m_yResolution( 300.0 ),
m_lockAspectRatio( true ),
m_sizeUnits( SIZE_UNITS::PIXELS ),
m_resolutionUnits( RESOLUTION_UNITS::PIXELS_PER_INCH )
{
m_aspectRatio = static_cast<double>(m_width) / static_cast<double>(m_height);
wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
// Image Size section
wxStaticText* imageSizeHeader = new wxStaticText( this, wxID_ANY, _( "Image Size" ) );
imageSizeHeader->SetFont( imageSizeHeader->GetFont().Bold() );
mainSizer->Add( imageSizeHeader, 0, wxLEFT | wxTOP, 10 );
wxFlexGridSizer* sizeGrid = new wxFlexGridSizer( 2, 4, 5, 5 );
sizeGrid->AddGrowableCol( 1 );
// Width row
sizeGrid->Add( new wxStaticText( this, wxID_ANY, _( "Width:" ) ), 0, wxALIGN_CENTER_VERTICAL );
m_spinWidth = new wxSpinCtrlDouble( this, wxID_ANY );
m_spinWidth->SetRange( 1, 50000 );
m_spinWidth->SetDigits( 0 );
sizeGrid->Add( m_spinWidth, 1, wxEXPAND );
// Lock button - will span 2 rows
m_lockButton = new wxBitmapButton( this, wxID_ANY, KiBitmapBundle( BITMAPS::locked ) );
sizeGrid->Add( m_lockButton, 0, wxALIGN_CENTER | wxALL, 2 );
// Size units choice
m_choiceSizeUnits = new wxChoice( this, wxID_ANY );
m_choiceSizeUnits->Append( _( "pixels" ) );
m_choiceSizeUnits->Append( _( "%" ) );
m_choiceSizeUnits->Append( _( "mm" ) );
m_choiceSizeUnits->Append( _( "in" ) );
m_choiceSizeUnits->SetSelection( 0 ); // pixels
sizeGrid->Add( m_choiceSizeUnits, 0, wxEXPAND );
// Height row
sizeGrid->Add( new wxStaticText( this, wxID_ANY, _( "Height:" ) ), 0, wxALIGN_CENTER_VERTICAL );
m_spinHeight = new wxSpinCtrlDouble( this, wxID_ANY );
m_spinHeight->SetRange( 1, 50000 );
m_spinHeight->SetDigits( 0 );
sizeGrid->Add( m_spinHeight, 1, wxEXPAND );
sizeGrid->AddSpacer( 0 ); // Empty space where lock button is
sizeGrid->AddSpacer( 0 ); // Empty space for units column
mainSizer->Add( sizeGrid, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
// Pixel size display
m_pixelSizeLabel = new wxStaticText( this, wxID_ANY, wxEmptyString );
m_pixelSizeLabel->SetFont( m_pixelSizeLabel->GetFont().Smaller() );
mainSizer->Add( m_pixelSizeLabel, 0, wxLEFT | wxTOP, 10 );
// Separator
wxStaticLine* line = new wxStaticLine( this );
mainSizer->Add( line, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
// Resolution section
wxStaticText* resolutionHeader = new wxStaticText( this, wxID_ANY, _( "Resolution" ) );
resolutionHeader->SetFont( resolutionHeader->GetFont().Bold() );
mainSizer->Add( resolutionHeader, 0, wxLEFT | wxTOP, 10 );
wxFlexGridSizer* resGrid = new wxFlexGridSizer( 2, 3, 5, 5 );
resGrid->AddGrowableCol( 1 );
// X Resolution row
resGrid->Add( new wxStaticText( this, wxID_ANY, _( "X resolution:" ) ), 0, wxALIGN_CENTER_VERTICAL );
m_spinXResolution = new wxSpinCtrlDouble( this, wxID_ANY );
m_spinXResolution->SetRange( 1, 10000 );
m_spinXResolution->SetDigits( 3 );
resGrid->Add( m_spinXResolution, 1, wxEXPAND );
// Resolution units choice
m_choiceResolutionUnits = new wxChoice( this, wxID_ANY );
m_choiceResolutionUnits->Append( _( "pixels/in" ) );
m_choiceResolutionUnits->Append( _( "pixels/mm" ) );
m_choiceResolutionUnits->SetSelection( 0 ); // pixels/in
resGrid->Add( m_choiceResolutionUnits, 0, wxEXPAND );
// Y Resolution row
resGrid->Add( new wxStaticText( this, wxID_ANY, _( "Y resolution:" ) ), 0, wxALIGN_CENTER_VERTICAL );
m_spinYResolution = new wxSpinCtrlDouble( this, wxID_ANY );
m_spinYResolution->SetRange( 1, 10000 );
m_spinYResolution->SetDigits( 3 );
resGrid->Add( m_spinYResolution, 1, wxEXPAND );
resGrid->AddSpacer( 0 ); // Empty space for units column
mainSizer->Add( resGrid, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
// Dialog buttons
wxStdDialogButtonSizer* btnSizer = CreateStdDialogButtonSizer( wxOK | wxCANCEL );
mainSizer->Add( btnSizer, 0, wxEXPAND | wxALL, 10 );
SetSizerAndFit( mainSizer );
Centre();
// Set initial values AFTER creating all controls
m_spinWidth->SetValue( m_width );
m_spinHeight->SetValue( m_height );
m_spinXResolution->SetValue( m_xResolution );
m_spinYResolution->SetValue( m_yResolution );
UpdatePixelSize();
// Bind events AFTER setting initial values
m_lockButton->Bind( wxEVT_BUTTON, &DIALOG_EXPORT_3D_IMAGE::OnLockToggle, this );
m_spinWidth->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnWidthChange, this );
m_spinHeight->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnHeightChange, this );
m_spinXResolution->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnXResolutionChange, this );
m_spinYResolution->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnYResolutionChange, this );
m_choiceSizeUnits->Bind( wxEVT_CHOICE, &DIALOG_EXPORT_3D_IMAGE::OnSizeUnitChange, this );
m_choiceResolutionUnits->Bind( wxEVT_CHOICE, &DIALOG_EXPORT_3D_IMAGE::OnResolutionUnitChange, this );
}
bool DIALOG_EXPORT_3D_IMAGE::TransferDataFromWindow()
{
// Convert current values back to pixels if needed
double width = m_spinWidth->GetValue();
double height = m_spinHeight->GetValue();
switch( m_sizeUnits )
{
case SIZE_UNITS::PIXELS:
m_width = static_cast<int>( width );
m_height = static_cast<int>( height );
break;
case SIZE_UNITS::PERCENT:
// Assume 100% = original size
m_width = static_cast<int>( width * m_originalSize.GetWidth() / 100.0 );
m_height = static_cast<int>( height * m_originalSize.GetHeight() / 100.0 );
break;
case SIZE_UNITS::MM:
// Convert mm to pixels using resolution
m_width = static_cast<int>( width * m_xResolution / 25.4 );
m_height = static_cast<int>( height * m_yResolution / 25.4 );
break;
case SIZE_UNITS::INCHES:
// Convert inches to pixels using resolution
m_width = static_cast<int>( width * m_xResolution );
m_height = static_cast<int>( height * m_yResolution );
break;
}
m_xResolution = m_spinXResolution->GetValue();
m_yResolution = m_spinYResolution->GetValue();
return true;
}
void DIALOG_EXPORT_3D_IMAGE::OnLockToggle( wxCommandEvent& aEvent )
{
m_lockAspectRatio = !m_lockAspectRatio;
if( m_lockAspectRatio )
{
m_lockButton->SetBitmap( KiBitmapBundle( BITMAPS::locked ) );
UpdateAspectRatio();
}
else
{
m_lockButton->SetBitmap( KiBitmapBundle( BITMAPS::unlocked ) );
}
}
void DIALOG_EXPORT_3D_IMAGE::OnWidthChange( wxSpinDoubleEvent& aEvent )
{
if( m_lockAspectRatio )
{
double width = m_spinWidth->GetValue();
double height;
if( m_sizeUnits == SIZE_UNITS::PERCENT )
height = m_originalSize.GetWidth() * width / 100.0 / m_aspectRatio;
else
height = width / m_aspectRatio;
// Ensure height is not less than 1
if( height < 1 )
height = 1;
m_spinHeight->SetValue( height );
}
UpdatePixelSize();
}
void DIALOG_EXPORT_3D_IMAGE::OnHeightChange( wxSpinDoubleEvent& aEvent )
{
if( m_lockAspectRatio )
{
double height = m_spinHeight->GetValue();
double width;
if( m_sizeUnits == SIZE_UNITS::PERCENT )
width = m_originalSize.GetHeight() * height / 100.0 * m_aspectRatio;
else
width = height * m_aspectRatio;
// Ensure width is not less than 1
if( width < 1 )
width = 1;
m_spinWidth->SetValue( width );
}
UpdatePixelSize();
}
void DIALOG_EXPORT_3D_IMAGE::OnXResolutionChange( wxSpinDoubleEvent& aEvent )
{
UpdatePixelSize();
}
void DIALOG_EXPORT_3D_IMAGE::OnYResolutionChange( wxSpinDoubleEvent& aEvent )
{
UpdatePixelSize();
}
void DIALOG_EXPORT_3D_IMAGE::OnSizeUnitChange( wxCommandEvent& aEvent )
{
SIZE_UNITS oldUnits = m_sizeUnits;
m_sizeUnits = static_cast<SIZE_UNITS>( m_choiceSizeUnits->GetSelection() );
ConvertSizeUnits( oldUnits, m_sizeUnits );
UpdatePixelSize();
}
void DIALOG_EXPORT_3D_IMAGE::OnResolutionUnitChange( wxCommandEvent& aEvent )
{
RESOLUTION_UNITS oldUnits = m_resolutionUnits;
m_resolutionUnits = static_cast<RESOLUTION_UNITS>( m_choiceResolutionUnits->GetSelection() );
ConvertResolutionUnits( oldUnits, m_resolutionUnits );
UpdatePixelSize();
}
wxSize DIALOG_EXPORT_3D_IMAGE::GetPixelSize( double aWidth, double aHeight, double aXResolution, double aYResolution, SIZE_UNITS aSizeUnits ) const
{
switch( aSizeUnits )
{
case SIZE_UNITS::PIXELS:
return wxSize( static_cast<int>( aWidth ), static_cast<int>( aHeight ) );
case SIZE_UNITS::PERCENT:
return wxSize( static_cast<int>( 100.0 * m_originalSize.GetWidth() ),
static_cast<int>( 100.0 * m_originalSize.GetHeight() ) );
case SIZE_UNITS::MM:
return wxSize( static_cast<int>( aWidth * aXResolution / 25.4 ),
static_cast<int>( aHeight * aYResolution / 25.4 ) );
case SIZE_UNITS::INCHES:
return wxSize( static_cast<int>( aWidth * aXResolution ),
static_cast<int>( aHeight * aYResolution ) );
default:
break;
}
return wxSize( 10, 10 ); // Should not happen
}
void DIALOG_EXPORT_3D_IMAGE::UpdatePixelSize()
{
double width = m_spinWidth->GetValue();
double height = m_spinHeight->GetValue();
double xRes = m_spinXResolution->GetValue();
double yRes = m_spinYResolution->GetValue();
// Convert resolution to standard pixels/inch
if( m_resolutionUnits == RESOLUTION_UNITS::PIXELS_PER_MM )
{
xRes *= 25.4; // Convert mm to inches
yRes *= 25.4;
}
wxSize pixelSize = GetPixelSize( width, height, xRes, yRes, m_sizeUnits );
m_pixelSizeLabel->SetLabel( wxString::Format( _( "%d × %d pixels" ), pixelSize.GetWidth(), pixelSize.GetHeight() ) );
}
void DIALOG_EXPORT_3D_IMAGE::UpdateAspectRatio()
{
m_aspectRatio = m_spinWidth->GetValue() / m_spinHeight->GetValue();
}
void DIALOG_EXPORT_3D_IMAGE::ConvertSizeUnits( SIZE_UNITS aFromUnit, SIZE_UNITS aToUnit )
{
if( aFromUnit == aToUnit )
return;
double width = m_spinWidth->GetValue();
double height = m_spinHeight->GetValue();
double xRes = m_spinXResolution->GetValue();
double yRes = m_spinYResolution->GetValue();
// Convert resolution to standard pixels/inch
if( m_resolutionUnits == RESOLUTION_UNITS::PIXELS_PER_MM )
{
xRes *= 25.4; // Convert mm to inches
yRes *= 25.4;
}
// Convert to pixels first
wxSize pixelSize = GetPixelSize( width, height, xRes, yRes, aFromUnit );
// Convert from pixels to target unit
switch( aToUnit )
{
case SIZE_UNITS::PIXELS:
m_spinWidth->SetValue( pixelSize.GetWidth() );
m_spinHeight->SetValue( pixelSize.GetHeight() );
break;
case SIZE_UNITS::PERCENT:
m_spinWidth->SetValue( pixelSize.GetWidth() * 100.0 / m_originalSize.GetWidth() );
m_spinHeight->SetValue( pixelSize.GetHeight() * 100.0 / m_originalSize.GetHeight() );
break;
case SIZE_UNITS::MM:
m_spinWidth->SetValue( pixelSize.GetWidth() * 25.4 / xRes );
m_spinHeight->SetValue( pixelSize.GetHeight() * 25.4 / yRes );
break;
case SIZE_UNITS::INCHES:
m_spinWidth->SetValue( pixelSize.GetWidth() / xRes );
m_spinHeight->SetValue( pixelSize.GetHeight() / yRes );
break;
}
}
void DIALOG_EXPORT_3D_IMAGE::ConvertResolutionUnits( RESOLUTION_UNITS aFromUnit, RESOLUTION_UNITS aToUnit )
{
if( aFromUnit == aToUnit )
return;
double xRes = m_spinXResolution->GetValue();
double yRes = m_spinYResolution->GetValue();
if( aFromUnit == RESOLUTION_UNITS::PIXELS_PER_INCH && aToUnit == RESOLUTION_UNITS::PIXELS_PER_MM )
{
// Convert from pixels/inch to pixels/mm
m_spinXResolution->SetValue( xRes / 25.4 );
m_spinYResolution->SetValue( yRes / 25.4 );
}
else if( aFromUnit == RESOLUTION_UNITS::PIXELS_PER_MM && aToUnit == RESOLUTION_UNITS::PIXELS_PER_INCH )
{
// Convert from pixels/mm to pixels/inch
m_spinXResolution->SetValue( xRes * 25.4 );
m_spinYResolution->SetValue( yRes * 25.4 );
}
}

View File

@ -0,0 +1,95 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/gpl-3.0.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma once
#include "dialog_shim.h"
#include <3d_viewer/eda_3d_viewer_frame.h> // for EDA_3D_VIEWER_EXPORT_FORMAT
#include <wx/spinctrl.h>
#include <wx/choice.h>
#include <wx/stattext.h>
#include <wx/bmpbuttn.h>
enum class SIZE_UNITS
{
PIXELS,
PERCENT,
MM,
INCHES
};
enum class RESOLUTION_UNITS
{
PIXELS_PER_INCH,
PIXELS_PER_MM
};
class DIALOG_EXPORT_3D_IMAGE : public DIALOG_SHIM
{
public:
DIALOG_EXPORT_3D_IMAGE( wxWindow* aParent,
const wxSize& aSize );
wxSize GetSize() const { return wxSize( m_width, m_height ); }
double GetXResolution() const { return m_xResolution; }
double GetYResolution() const { return m_yResolution; }
private:
bool TransferDataFromWindow() override;
void OnLockToggle( wxCommandEvent& aEvent );
void OnWidthChange( wxSpinDoubleEvent& aEvent );
void OnHeightChange( wxSpinDoubleEvent& aEvent );
void OnXResolutionChange( wxSpinDoubleEvent& aEvent );
void OnYResolutionChange( wxSpinDoubleEvent& aEvent );
void OnSizeUnitChange( wxCommandEvent& aEvent );
void OnResolutionUnitChange( wxCommandEvent& aEvent );
wxSize GetPixelSize( double aWidth, double aHeight, double aXResolution, double aYResolution, SIZE_UNITS aSizeUnits ) const;
void UpdatePixelSize();
void UpdateAspectRatio();
void ConvertSizeUnits( SIZE_UNITS aFromUnit, SIZE_UNITS aToUnit );
void ConvertResolutionUnits( RESOLUTION_UNITS aFromUnit, RESOLUTION_UNITS aToUnit );
private:
EDA_3D_VIEWER_EXPORT_FORMAT m_format;
wxSize m_originalSize;
int m_width;
int m_height;
double m_xResolution;
double m_yResolution;
double m_aspectRatio;
bool m_lockAspectRatio;
SIZE_UNITS m_sizeUnits;
RESOLUTION_UNITS m_resolutionUnits;
wxSpinCtrlDouble* m_spinWidth;
wxSpinCtrlDouble* m_spinHeight;
wxSpinCtrlDouble* m_spinXResolution;
wxSpinCtrlDouble* m_spinYResolution;
wxChoice* m_choiceSizeUnits;
wxChoice* m_choiceResolutionUnits;
wxBitmapButton* m_lockButton;
wxStaticText* m_pixelSizeLabel;
};

View File

@ -47,7 +47,11 @@
#include <eda_3d_viewer_settings.h>
#include <board_design_settings.h>
#ifndef __linux__
#include <3d_navlib/nl_footprint_properties_plugin.h>
#else
#include <3d_spacenav/spnav_viewer_plugin.h>
#endif
PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
FOOTPRINT* aFootprint,
@ -132,7 +136,11 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
try
{
#ifndef __linux__
m_spaceMouse = std::make_unique<NL_FOOTPRINT_PROPERTIES_PLUGIN>( m_previewPane );
#else
m_spaceMouse = std::make_unique<SPNAV_VIEWER_PLUGIN>( m_previewPane );
#endif
m_spaceMouse->SetFocus( true );
}
catch( const std::system_error& e )
@ -654,6 +662,12 @@ void PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint( bool aReloadRequired )
}
void PANEL_PREVIEW_3D_MODEL::SetEmbeddedFilesDelegate( EMBEDDED_FILES* aDelegate )
{
m_dummyBoard->SetEmbeddedFilesDelegate( aDelegate );
}
void PANEL_PREVIEW_3D_MODEL::onModify()
{
KIWAY_HOLDER* kiwayHolder = dynamic_cast<KIWAY_HOLDER*>( wxGetTopLevelParent( this ) );

View File

@ -59,10 +59,15 @@ wxDECLARE_EVENT( wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent );
class WX_INFOBAR;
class S3D_CACHE;
class FILENAME_RESOLVER;
class EMBEDDED_FILES;
class BOARD;
class BOARD_ADAPTER;
class FOOTPRINT;
#ifndef __linux__
class NL_FOOTPRINT_PROPERTIES_PLUGIN;
#else
class SPNAV_VIEWER_PLUGIN;
#endif
#define PANEL_PREVIEW_3D_MODEL_ID wxID_HIGHEST + 1244
@ -97,6 +102,8 @@ public:
*/
void UpdateDummyFootprint( bool aRelaodRequired = true );
void SetEmbeddedFilesDelegate( EMBEDDED_FILES* aDelegate );
/**
* Get the dummy footprint that is used for previewing the 3D model.
* We use this to hold the temporary 3D model shapes.
@ -226,7 +233,11 @@ private:
/// The 3d viewer Render initial settings (must be saved and restored)
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender;
#ifndef __linux__
std::unique_ptr<NL_FOOTPRINT_PROPERTIES_PLUGIN> m_spaceMouse;
#else
std::unique_ptr<SPNAV_VIEWER_PLUGIN> m_spaceMouse;
#endif
};
#endif // PANEL_PREVIEW_3D_MODEL_H

View File

@ -359,7 +359,7 @@
Eryk Michalak
Michal Jahelka
Dmitry Mikhirev
Mojca Miklavec
Mojca Miklavec Groenhuis
Ashley Mills
Michael Misirlis
Michail Misirlis

View File

@ -48,6 +48,7 @@ project( kicad )
# Create a default build type for our QA that doesn't include `NDEBUG`
set(CMAKE_CXX_FLAGS_QABUILD "-Os -g1 -ggdb1")
string( APPEND CMAKE_EXE_LINKER_FLAGS_QABUILD " -rdynamic" )
include( GNUInstallDirs )
include( CMakeDependentOption )
@ -193,7 +194,12 @@ option( KICAD_I18N_UNIX_STRICT_PATH
cmake_dependent_option( KICAD_WIN32_INSTALL_PDBS
"Installs debug pdb to the bin folder, DO NOT USE (NOR REQUIRED) FOR DEBUGGING THE SOURCE ON MSVC. This is purely for release building.
MSVC can find the PDBs without this."
OFF "WIN32"
OFF "MSVC"
OFF )
cmake_dependent_option( KICAD_MSVC_DYNDEOPT
"Builds release builds with /dynamicdeopt for dynamic debugging."
OFF "MSVC"
OFF )
####################################
@ -233,6 +239,10 @@ cmake_dependent_option( KICAD_WIN32_LTCG
OFF "WIN32"
OFF )
option( KICAD_USE_PCH
"Enable precompiled header support"
ON )
# Advanced option to make link maps (only available on linux)
cmake_dependent_option( KICAD_MAKE_LINK_MAPS
"Create link maps for artifacts"
@ -553,6 +563,11 @@ if( MSVC )
# but we want to turn it on to enable debug performance improvements available under C++17 in MSVC 17.5+
string( APPEND CMAKE_CXX_FLAGS " /permissive-" )
if( KICAD_MSVC_DYNDEOPT )
string( APPEND CMAKE_CXX_FLAGS_RELEASE " /dynamicdeopt" )
string( APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " /dynamicdeopt" )
endif()
# Exception handling
# Remove the potential default EHsc option cmake doesn't allow us to remove easily
string( REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
@ -581,11 +596,20 @@ if( MSVC )
# /DEBUG: create PDB
string( APPEND CMAKE_${type}_LINKER_FLAGS " /DEBUG /MANIFEST:NO" )
# /OPT:REF: omit unreferenced code
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:REF /MANIFEST:NO" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:REF /MANIFEST:NO" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:REF" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:REF" )
# /MANIFEST:NO
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /MANIFEST:NO" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /MANIFEST:NO" )
if( KICAD_MSVC_DYNDEOPT )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /dynamicdeopt" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /dynamicdeopt" )
else()
# /OPT:ICF: fold common data
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:ICF /MANIFEST:NO" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:ICF /MANIFEST:NO" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:ICF" )
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:ICF" )
endif()
if( KICAD_WIN32_LTCG )
# we are implementing this manually because CMake's LTCG option is incomplete
@ -594,6 +618,11 @@ if( MSVC )
endif()
endforeach()
if( KICAD_MSVC_DYNDEOPT )
string( APPEND CMAKE_STATIC_LINKER_FLAGS_RELEASE " /dynamicdeopt" )
string( APPEND CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO " /dynamicdeopt" )
endif()
# Let cl.exe parallelize builds
if( KICAD_WIN32_BUILD_PARALLEL_CL_MP )
string( APPEND CMAKE_CXX_FLAGS " /MP" )
@ -776,6 +805,11 @@ find_package(ZSTD REQUIRED)
#
find_package( CURL REQUIRED )
if( UNIX AND NOT APPLE )
find_package( SPNAV REQUIRED )
include_directories( SYSTEM ${SPNAV_INCLUDE_DIR} )
endif()
#
# Find Cairo library, required
#
@ -1028,7 +1062,7 @@ endif()
# See line 49 of cmake/FindwxWidgets.cmake
set( wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --static=no )
find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core net base propgrid xml stc richtext REQUIRED )
find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core net base propgrid xml stc richtext webview REQUIRED )
# Include wxWidgets macros.
include( ${wxWidgets_USE_FILE} )

View File

@ -196,6 +196,10 @@ enum UnconnectedLayerRemoval
// Remove annular rings on unconnected layers, but preserve start and end layers even if unconnected.
ULR_REMOVE_EXCEPT_START_AND_END = 3;
// Keep annular rings only on the start and end layers regardless of connections.
// Since: 10.0.0
ULR_START_END_ONLY = 4;
}
// The shape of a pad on a given layer
@ -517,6 +521,12 @@ message Pad
// Copper-to-copper clearance override
kiapi.common.types.Distance copper_clearance_override = 8;
// Since: 9.0.4
kiapi.common.types.Distance pad_to_die_length = 9;
// Since: 10.0.0
kiapi.common.types.Time pad_to_die_delay = 10;
}
enum ZoneType
@ -610,6 +620,7 @@ enum PlacementRuleSourceType
PRST_SHEET_NAME = 1;
PRST_COMPONENT_CLASS = 2;
PRST_GROUP = 3;
PRST_DESIGN_BLOCK = 4;
}
message RuleAreaSettings

View File

@ -223,6 +223,12 @@ message Ratio
double value = 1;
}
// Represents a time delay in attoseconds. Since 10.0.0.
message Time
{
int64 value_as = 1;
}
// Corresponds to COLOR4D. Each color channel is a double from 0.0 to 1.0.
message Color
{
@ -365,6 +371,7 @@ message GraphicRectangleAttributes
{
kiapi.common.types.Vector2 top_left = 1;
kiapi.common.types.Vector2 bottom_right = 2;
kiapi.common.types.Distance corner_radius = 3;
}
message GraphicArcAttributes

View File

@ -387,8 +387,6 @@ void BITMAPCONV_INFO::createOutputData( const wxString& aLayer )
potrace_dpoint_t( *c )[3];
LOCALE_IO toggle; // Temporary switch the locale to standard C to r/w floats
// The layer name has meaning only for .kicad_mod files.
// For these files the header creates 2 invisible texts: value and ref
// (needed but not useful) on silk screen layer

View File

@ -0,0 +1,99 @@
#
# Used as a standalone cmake script to process a given file into binary arrays
# at compile-time
#
# Include CreateResourceCppFunction.cmake to get access to the add_compiled_resource
# function
#
# This file is structured to be invoked from add_custom_command in order
# to have GENERATED marked output files that can be rebuilt on change.
#
# Required Arguments:
# SOURCE_FILE - Path to source shader file
# OUT_CPP_DIR - Destination path for cpp file
# OUT_HEADER_DIR - Destination path for header file
# OUT_CPP_FILENAME - cpp filename
# OUT_HEADER_FILENAME - header filename
# OUT_VAR_NAME - Name of variable containing shader to be created
#
# Parts taken from https://github.com/sivachandran/cmake-bin2h
# Copyright 2020 Sivachandran Paramasivam
#
# Function to wrap a given string into multiple lines at the given column position.
# Parameters:
# VARIABLE - The name of the CMake variable holding the string.
# AT_COLUMN - The column position at which string will be wrapped.
function(WRAP_STRING)
set(oneValueArgs VARIABLE AT_COLUMN)
cmake_parse_arguments(WRAP_STRING "${options}" "${oneValueArgs}" "" ${ARGN})
string(LENGTH ${${WRAP_STRING_VARIABLE}} stringLength)
math(EXPR offset "0")
while(stringLength GREATER 0)
if(stringLength GREATER ${WRAP_STRING_AT_COLUMN})
math(EXPR length "${WRAP_STRING_AT_COLUMN}")
else()
math(EXPR length "${stringLength}")
endif()
string(SUBSTRING ${${WRAP_STRING_VARIABLE}} ${offset} ${length} line)
set(lines "${lines}\n${line}")
math(EXPR stringLength "${stringLength} - ${length}")
math(EXPR offset "${offset} + ${length}")
endwhile()
set(${WRAP_STRING_VARIABLE} "${lines}" PARENT_SCOPE)
endfunction()
file( READ ${SOURCE_FILE} _SOURCE_BINARY HEX )
string(LENGTH ${_SOURCE_BINARY} _SOURCE_BINARY_LENGTH)
set(SOURCE_BINARY "${_SOURCE_BINARY}00") # null terminate for the sake of it
wrap_string(VARIABLE _SOURCE_BINARY AT_COLUMN 32)
math(EXPR _ARRAY_SIZE "${_SOURCE_BINARY_LENGTH} / 2")
# adds '0x' prefix and comma suffix before and after every byte respectively
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1, " _ARRAY_VALUES ${_SOURCE_BINARY})
# removes trailing comma
string(REGEX REPLACE ", $" "" _ARRAY_VALUES ${_ARRAY_VALUES})
set( outCppTextByteArray "unsigned char ${OUT_VAR_NAME}_bytes[] = { ${_ARRAY_VALUES} };")
set( outCppTextByteSize "size_t ${OUT_VAR_NAME}_size = ${_ARRAY_SIZE};")
set( outCppText
"
#include <stddef.h>
#include <${OUT_HEADER_FILENAME}>
namespace RESOURCE {
${outCppTextByteArray}
${outCppTextByteSize}
}
" )
file(
WRITE ${OUT_CPP_DIR}/${OUT_CPP_FILENAME}
"${outCppText}"
)
set( outHeaderText
"namespace RESOURCE {
extern unsigned char ${OUT_VAR_NAME}_bytes[];
extern size_t ${OUT_VAR_NAME}_size;
}"
)
file(
WRITE ${OUT_HEADER_DIR}/${OUT_HEADER_FILENAME}
"${outHeaderText}"
)
message(STATUS "Resource ${SOURCE_FILE} converted to ${OUT_CPP_DIR}/${OUT_CPP_FILENAME}")

View File

@ -0,0 +1,39 @@
#
# Used to mark and generate resource files to conversion to binary arrays
#
# Usage example:
# add_compiled_resource( pcbnew ${CMAKE_SOURCE_DIR}/resources/html/about.html about_html)
#
# The source file about.html above will be converted to about_html.cpp/.h and placed into
# the /resources/cpp cmake binary directory folder. The include directories for the target are also
# expanded to cover including about_html.h
#
# The output is marked as depends so changes to about.html will trigger a update of the about_html.cpp/.h
#
# The CreateResourceCpp.cmake helper script is also marked a depends so any changes to our output writing
# will cause updates.
#
function( add_compiled_resource outTarget inFile resourceName )
set(outCppName "${resourceName}.cpp")
set(outHeaderName "${resourceName}.h")
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/resources/cpp/${outCppName}
${CMAKE_BINARY_DIR}/resources/cpp/${outHeaderName}
COMMAND ${CMAKE_COMMAND}
-DSOURCE_FILE="${inFile}"
-DOUT_CPP_DIR="${CMAKE_BINARY_DIR}/resources/cpp"
-DOUT_HEADER_DIR="${CMAKE_BINARY_DIR}/resources/cpp"
-DOUT_CPP_FILENAME="${outCppName}"
-DOUT_HEADER_FILENAME="${outHeaderName}"
-DOUT_VAR_NAME="${resourceName}"
-P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/CreateResourceCpp.cmake
DEPENDS ${inFile}
${KICAD_CMAKE_MODULE_PATH}/BuildSteps/CreateResourceCpp.cmake
)
target_sources( ${outTarget} PRIVATE ${CMAKE_BINARY_DIR}/resources/cpp/${outCppName} )
target_include_directories( ${outTarget} PUBLIC ${CMAKE_BINARY_DIR}/resources/cpp )
endfunction()

View File

@ -0,0 +1,277 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
ECMFindModuleHelpers
--------------------
Helper macros for find modules: ``ecm_find_package_version_check()``,
``ecm_find_package_parse_components()`` and
``ecm_find_package_handle_library_components()``.
::
ecm_find_package_version_check(<name>)
Prints warnings if the CMake version or the project's required CMake version
is older than that required by extra-cmake-modules.
::
ecm_find_package_parse_components(<name>
RESULT_VAR <variable>
KNOWN_COMPONENTS <component1> [<component2> [...]]
[SKIP_DEPENDENCY_HANDLING])
This macro will populate <variable> with a list of components found in
<name>_FIND_COMPONENTS, after checking that all those components are in the
list of ``KNOWN_COMPONENTS``; if there are any unknown components, it will print
an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
``return()``.
The order of components in <variable> is guaranteed to match the order they
are listed in the ``KNOWN_COMPONENTS`` argument.
If ``SKIP_DEPENDENCY_HANDLING`` is not set, for each component the variable
<name>_<component>_component_deps will be checked for dependent components.
If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
dependencies will also be added to <variable>.
::
ecm_find_package_handle_library_components(<name>
COMPONENTS <component> [<component> [...]]
[SKIP_DEPENDENCY_HANDLING])
[SKIP_PKG_CONFIG])
Creates an imported library target for each component. The operation of this
macro depends on the presence of a number of CMake variables.
The <name>_<component>_lib variable should contain the name of this library,
and <name>_<component>_header variable should contain the name of a header
file associated with it (whatever relative path is normally passed to
'#include'). <name>_<component>_header_subdir variable can be used to specify
which subdirectory of the include path the headers will be found in.
``ecm_find_package_components()`` will then search for the library
and include directory (creating appropriate cache variables) and create an
imported library target named <name>::<component>.
Additional variables can be used to provide additional information:
If ``SKIP_PKG_CONFIG``, the <name>_<component>_pkg_config variable is set, and
pkg-config is found, the pkg-config module given by
<name>_<component>_pkg_config will be searched for and used to help locate the
library and header file. It will also be used to set
<name>_<component>_VERSION.
Note that if version information is found via pkg-config,
<name>_<component>_FIND_VERSION can be set to require a particular version
for each component.
If ``SKIP_DEPENDENCY_HANDLING`` is not set, the ``INTERFACE_LINK_LIBRARIES`` property
of the imported target for <component> will be set to contain the imported
targets for the components listed in <name>_<component>_component_deps.
<component>_FOUND will also be set to ``FALSE`` if any of the components in
<name>_<component>_component_deps are not found. This requires the components
in <name>_<component>_component_deps to be listed before <component> in the
``COMPONENTS`` argument.
The following variables will be set:
``<name>_TARGETS``
the imported targets
``<name>_LIBRARIES``
the found libraries
``<name>_INCLUDE_DIRS``
the combined required include directories for the components
``<name>_DEFINITIONS``
the "other" CFLAGS provided by pkg-config, if any
``<name>_VERSION``
the value of ``<name>_<component>_VERSION`` for the first component that
has this variable set (note that components are searched for in the order
they are passed to the macro), although if it is already set, it will not
be altered
.. note::
These variables are never cleared, so if
``ecm_find_package_handle_library_components()`` is called multiple times with
different components (typically because of multiple ``find_package()`` calls) then
``<name>_TARGETS``, for example, will contain all the targets found in any
call (although no duplicates).
Since pre-1.0.0.
#]=======================================================================]
macro(ecm_find_package_version_check module_name)
if(CMAKE_VERSION VERSION_LESS 3.16.0)
message(FATAL_ERROR "CMake 3.16.0 is required by Find${module_name}.cmake")
endif()
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.16.0)
message(AUTHOR_WARNING "Your project should require at least CMake 3.16.0 to use Find${module_name}.cmake")
endif()
endmacro()
macro(ecm_find_package_parse_components module_name)
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
set(ecm_fppc_oneValueArgs RESULT_VAR)
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
if(ECM_FPPC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPPC_RESULT_VAR)
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
endif()
if(${module_name}_FIND_COMPONENTS)
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
# Make sure deps are included
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
if("${ecm_fppc_index}" STREQUAL "-1")
if(NOT ${module_name}_FIND_QUIETLY)
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
endif()
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
endif()
endforeach()
endforeach()
else()
message(STATUS "Skipping dependency handling for ${module_name}")
endif()
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
# This makes sure components are listed in the same order as
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
set(${ECM_FPPC_RESULT_VAR})
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
endif()
endforeach()
# if there are any left, they are unknown components
if(ecm_fppc_requestedComps)
set(ecm_fppc_msgType STATUS)
if(${module_name}_FIND_REQUIRED)
set(ecm_fppc_msgType FATAL_ERROR)
endif()
if(NOT ${module_name}_FIND_QUIETLY)
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
endif()
return()
endif()
else()
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
endif()
endmacro()
macro(ecm_find_package_handle_library_components module_name)
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
set(ecm_fpwc_oneValueArgs)
set(ecm_fpwc_multiValueArgs COMPONENTS)
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
if(ECM_FPWC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPWC_COMPONENTS)
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
endif()
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
set(ecm_fpwc_dep_vars)
set(ecm_fpwc_dep_targets)
if(NOT SKIP_DEPENDENCY_HANDLING)
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
endforeach()
endif()
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
${${module_name}_${ecm_fpwc_comp}_pkg_config})
endif()
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
)
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
)
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
if(NOT ${module_name}_VERSION)
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
endif()
set(FPHSA_NAME_MISMATCHED 1)
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
FOUND_VAR
${module_name}_${ecm_fpwc_comp}_FOUND
REQUIRED_VARS
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
${ecm_fpwc_dep_vars}
VERSION_VAR
${module_name}_${ecm_fpwc_comp}_VERSION
)
unset(FPHSA_NAME_MISMATCHED)
mark_as_advanced(
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
)
if(${module_name}_${ecm_fpwc_comp}_FOUND)
list(APPEND ${module_name}_LIBRARIES
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
list(APPEND ${module_name}_INCLUDE_DIRS
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
set(${module_name}_DEFINITIONS
${${module_name}_DEFINITIONS}
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
)
endif()
list(APPEND ${module_name}_TARGETS
"${module_name}::${ecm_fpwc_comp}")
endif()
endforeach()
if(${module_name}_LIBRARIES)
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
endif()
if(${module_name}_INCLUDE_DIRS)
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
endif()
if(${module_name}_DEFINITIONS)
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
endif()
if(${module_name}_TARGETS)
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
endif()
endmacro()

132
cmake/FindPoppler.cmake Normal file
View File

@ -0,0 +1,132 @@
# SPDX-FileCopyrightText: 2015 Alex Richardson <arichardson.kde@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindPoppler
-----------
Try to find Poppler.
This is a component-based find module, which makes use of the COMPONENTS
and OPTIONAL_COMPONENTS arguments to find_module. The following components
are available::
Core Cpp Qt5 Qt4 Glib
If no components are specified, this module will act as though all components
were passed to OPTIONAL_COMPONENTS.
This module will define the following variables, independently of the
components searched for or found:
``Poppler_FOUND``
TRUE if (the requested version of) Poppler is available
``Poppler_VERSION``
Found Poppler version
``Poppler_TARGETS``
A list of all targets imported by this module (note that there may be more
than the components that were requested)
``Poppler_LIBRARIES``
This can be passed to target_link_libraries() instead of the imported
targets
``Poppler_INCLUDE_DIRS``
This should be passed to target_include_directories() if the targets are
not used for linking
``Poppler_DEFINITIONS``
This should be passed to target_compile_options() if the targets are not
used for linking
For each searched-for components, ``Poppler_<component>_FOUND`` will be set to
TRUE if the corresponding Poppler library was found, and FALSE otherwise. If
``Poppler_<component>_FOUND`` is TRUE, the imported target
``Poppler::<component>`` will be defined. This module will also attempt to
determine ``Poppler_*_VERSION`` variables for each imported target, although
``Poppler_VERSION`` should normally be sufficient.
In general we recommend using the imported targets, as they are easier to use
and provide more control. Bear in mind, however, that if any target is in the
link interface of an exported library, it must be made available by the
package config file.
Since 5.19
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake)
ecm_find_package_version_check(Poppler)
set(Poppler_known_components
Cpp
Qt4
Qt5
Qt6
Glib
)
foreach(_comp ${Poppler_known_components})
string(TOLOWER "${_comp}" _lc_comp)
set(Poppler_${_comp}_component_deps "Core")
set(Poppler_${_comp}_pkg_config "poppler-${_lc_comp}")
set(Poppler_${_comp}_lib "poppler-${_lc_comp}")
set(Poppler_${_comp}_header_subdir "poppler/${_lc_comp}")
endforeach()
set(Poppler_known_components Core ${Poppler_known_components})
set(Poppler_Core_component_deps "")
set(Poppler_Core_pkg_config "poppler")
# poppler-config.h header is only installed with --enable-xpdf-headers
# fall back to using any header from a submodule with a path to make it work in that case too
set(Poppler_Core_header "poppler-config.h" "cpp/poppler-version.h" "qt6/poppler-qt6.h" "qt5/poppler-qt5.h" "qt4/poppler-qt4.h" "glib/poppler.h")
set(Poppler_Core_header_subdir "poppler")
set(Poppler_Core_lib "poppler")
set(Poppler_Cpp_header "poppler-version.h")
set(Poppler_Qt6_header "poppler-qt6.h")
set(Poppler_Qt5_header "poppler-qt5.h")
set(Poppler_Qt4_header "poppler-qt4.h")
set(Poppler_Glib_header "poppler.h")
ecm_find_package_parse_components(Poppler
RESULT_VAR Poppler_components
KNOWN_COMPONENTS ${Poppler_known_components}
)
ecm_find_package_handle_library_components(Poppler
COMPONENTS ${Poppler_components}
)
# If pkg-config didn't provide us with version information,
# try to extract it from poppler-version.h or poppler-config.h
if(NOT Poppler_VERSION)
find_file(Poppler_VERSION_HEADER
NAMES "poppler-config.h" "cpp/poppler-version.h"
HINTS ${Poppler_INCLUDE_DIRS}
PATH_SUFFIXES ${Poppler_Core_header_subdir}
)
mark_as_advanced(Poppler_VERSION_HEADER)
if(Poppler_VERSION_HEADER)
file(READ ${Poppler_VERSION_HEADER} _poppler_version_header_contents)
string(REGEX REPLACE
"^.*[ \t]+POPPLER_VERSION[ \t]+\"([0-9d.]*)\".*$"
"\\1"
Poppler_VERSION
"${_poppler_version_header_contents}"
)
unset(_poppler_version_header_contents)
endif()
endif()
find_package_handle_standard_args(Poppler
FOUND_VAR
Poppler_FOUND
REQUIRED_VARS
Poppler_LIBRARIES
VERSION_VAR
Poppler_VERSION
HANDLE_COMPONENTS
)
include(FeatureSummary)
set_package_properties(Poppler PROPERTIES
DESCRIPTION "A PDF rendering library"
URL "https://poppler.freedesktop.org/"
)

63
cmake/FindSPNAV.cmake Normal file
View File

@ -0,0 +1,63 @@
# BSD 3-Clause License
# Copyright (c) 2008, Willow Garage, Inc.
# Copyright (c) 2020, Nils Schulte
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Find the spnav library and header.
#
# Sets the usual variables expected for find_package scripts:
#
# SPNAV_INCLUDE_DIR - header location
# SPNAV_LIBRARIES - library to link against
# SPNAV_FOUND - true if pugixml was found.
if(UNIX)
find_path(SPNAV_INCLUDE_DIR spnav.h)
find_library(SPNAV_LIBRARY
NAMES
spnav libspnav
)
# Support the REQUIRED and QUIET arguments, and set spnav_FOUND if found.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SPNAV DEFAULT_MSG
SPNAV_LIBRARY
SPNAV_INCLUDE_DIR)
if(SPNAV_FOUND)
set(SPNAV_LIBRARIES ${SPNAV_LIBRARY})
endif()
mark_as_advanced(
SPNAV_LIBRARY
SPNAV_INCLUDE_DIR)
endif()

View File

@ -103,6 +103,8 @@ set( KICOMMON_SRCS
jobs/job_sch_erc.cpp
jobs/job_sym_export_svg.cpp
jobs/job_sym_upgrade.cpp
jobs/job_pcb_upgrade.cpp
jobs/job_sch_upgrade.cpp
kicad_curl/kicad_curl.cpp
kicad_curl/kicad_curl_easy.cpp
@ -128,6 +130,9 @@ set( KICOMMON_SRCS
project/project_local_settings.cpp
project/time_domain_parameters.cpp
text_eval/text_eval_wrapper.cpp
text_eval/text_eval_parser.cpp
# This is basically a settings object, but for the toolbar
tool/ui/toolbar_configuration.cpp
@ -223,6 +228,12 @@ set( KICOMMON_SRCS
api/api_utils.cpp
)
if( UNIX AND NOT APPLE )
list( APPEND KICOMMON_SRCS
spacenav/libspnav_driver.cpp
)
endif()
if( KICAD_IPC_API )
set( KICOMMON_SRCS
${KICOMMON_SRCS}
@ -239,6 +250,21 @@ add_library( kicommon SHARED
${KICOMMON_SRCS}
)
if( KICAD_USE_PCH )
target_precompile_headers( kicommon
PRIVATE
<kicommon.h>
<algorithm>
<map>
<memory>
<optional>
<set>
<string>
<vector>
<wx/wx.h>
)
endif()
set_target_properties(kicommon PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries( kicommon
@ -248,6 +274,7 @@ target_link_libraries( kicommon
kiplatform
nlohmann_json
nlohmann_json_schema_validator
FastFloat::fast_float
fmt::fmt
CURL::libcurl
picosha2
@ -255,6 +282,7 @@ target_link_libraries( kicommon
${ZSTD_LIBRARY}
${wxWidgets_LIBRARIES}
${LIBGIT2_LIBRARIES}
${SPNAV_LIBRARIES}
# needed by kiid to allow linking for Boost for the UUID against bcrypt (msys2 only)
${EXTRA_LIBS}
@ -368,7 +396,6 @@ set( COMMON_DLG_SRCS
dialogs/dialog_design_block_properties_base.cpp
dialogs/dialog_display_html_text_base.cpp
dialogs/dialog_edit_library_tables.cpp
dialogs/dialog_embed_files.cpp
dialogs/dialog_global_lib_table_config.cpp
dialogs/dialog_global_lib_table_config_base.cpp
dialogs/dialog_global_design_block_lib_table_config.cpp
@ -380,8 +407,6 @@ set( COMMON_DLG_SRCS
dialogs/dialog_HTML_reporter_base.cpp
dialogs/dialog_import_choose_project.cpp
dialogs/dialog_import_choose_project_base.cpp
dialogs/dialog_locked_items_query.cpp
dialogs/dialog_locked_items_query_base.cpp
dialogs/dialog_multi_unit_entry.cpp
dialogs/dialog_page_settings_base.cpp
dialogs/dialog_paste_special.cpp
@ -411,14 +436,20 @@ set( COMMON_DLG_SRCS
dialogs/panel_design_block_lib_table.cpp
dialogs/panel_embedded_files.cpp
dialogs/panel_embedded_files_base.cpp
dialogs/panel_gal_display_options.cpp
dialogs/panel_base_display_options.cpp
dialogs/panel_hotkeys_editor.cpp
dialogs/panel_image_editor.cpp
dialogs/panel_image_editor_base.cpp
dialogs/panel_gal_options.cpp
dialogs/panel_gal_options_base.cpp
dialogs/panel_grid_settings.cpp
dialogs/panel_grid_settings_base.cpp
dialogs/panel_maintenance.cpp
dialogs/panel_maintenance_base.cpp
dialogs/panel_mouse_settings.cpp
dialogs/panel_mouse_settings_base.cpp
dialogs/panel_spacemouse.cpp
dialogs/panel_spacemouse_base.cpp
dialogs/panel_packages_and_updates.cpp
dialogs/panel_packages_and_updates_base.cpp
dialogs/panel_plugin_settings.cpp
@ -454,8 +485,6 @@ set( COMMON_WIDGET_SRCS
widgets/footprint_diff_widget.cpp
widgets/footprint_preview_widget.cpp
widgets/footprint_select_widget.cpp
widgets/gal_options_panel.cpp
widgets/gal_options_panel_base.cpp
widgets/grid_bitmap_toggle.cpp
widgets/grid_button.cpp
widgets/grid_checkbox.cpp
@ -499,6 +528,8 @@ set( COMMON_WIDGET_SRCS
widgets/wx_progress_reporters.cpp
widgets/wx_splitter_window.cpp
widgets/wx_treebook.cpp
widgets/webview_panel.cpp
widgets/zoom_correction_ctrl.cpp
)
set( COMMON_DRAWING_SHEET_SRCS
@ -514,6 +545,7 @@ set( COMMON_DRAWING_SHEET_SRCS
set( COMMON_PREVIEW_ITEMS_SRCS
preview_items/anchor_debug.cpp
preview_items/angle_item.cpp
preview_items/arc_assistant.cpp
preview_items/arc_geom_manager.cpp
preview_items/bezier_assistant.cpp
@ -586,16 +618,23 @@ set( COMMON_IMPORT_GFX_SRCS
set( COMMON_GIT_SRCS
git/git_add_to_index_handler.cpp
git/git_branch_handler.cpp
git/git_clone_handler.cpp
git/git_commit_handler.cpp
git/git_config_handler.cpp
git/git_init_handler.cpp
git/git_pull_handler.cpp
git/git_push_handler.cpp
git/git_remove_from_index_handler.cpp
git/git_resolve_conflict_handler.cpp
git/git_revert_handler.cpp
git/git_status_handler.cpp
git/git_sync_handler.cpp
git/project_git_utils.cpp
git/kicad_git_common.cpp
git/kicad_git_errors.cpp
git/git_backend.cpp
git/libgit_backend.cpp
)
set( COMMON_SRCS
@ -724,6 +763,13 @@ set( COMMON_SRCS
api/api_enums.cpp
)
# This needs to be in the common library until draw_panel_gal is moved to kicommon
if( UNIX AND NOT APPLE )
list( APPEND COMMON_SRCS
spacenav/spnav_2d_plugin.cpp
)
endif()
if( KICAD_IPC_API )
set( COMMON_SRCS
${COMMON_SRCS}
@ -736,6 +782,21 @@ add_library( common STATIC
${COMMON_SRCS}
)
if( KICAD_USE_PCH )
target_precompile_headers( kicommon
PRIVATE
<kicommon.h>
<algorithm>
<map>
<memory>
<optional>
<set>
<string>
<vector>
<wx/wx.h>
)
endif()
add_dependencies( common version_header )
add_dependencies( common compoundfilereader ) # used by altium_parser.cpp
@ -820,11 +881,13 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/pcb_marker.cpp
${CMAKE_SOURCE_DIR}/pcbnew/footprint.cpp
${CMAKE_SOURCE_DIR}/pcbnew/fix_board_shape.cpp
${CMAKE_SOURCE_DIR}/pcbnew/layer_utils.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pad_utils.cpp
${CMAKE_SOURCE_DIR}/pcbnew/padstack.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_point.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_reference_image.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_field.cpp
@ -900,13 +963,24 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_utils.cpp
)
# add -DPCBNEW to compilation of these PCBNEW sources
set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
COMPILE_DEFINITIONS "PCBNEW"
)
add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
if( KICAD_USE_PCH )
target_precompile_headers( pcbcommon
PRIVATE
<vector>
<map>
<memory>
<unordered_map>
<board.h>
<footprint.h>
<zone.h>
<connectivity/connectivity_data.h>
<drc/drc_engine.h> )
endif()
target_compile_definitions(pcbcommon PRIVATE PCBNEW)
target_include_directories( pcbcommon PRIVATE
)
@ -916,11 +990,15 @@ target_link_libraries( pcbcommon PUBLIC
delaunator
kimath
kiplatform
nanoflann
)
if( APPLE OR NOT UNIX )
# On Windows/MacOS, the SpaceMouse support is provided by the navlib subdirectory
message( STATUS "Including 3Dconnexion SpaceMouse navigation support in pcbcommon" )
add_subdirectory( ../pcbnew/navlib ./navlib)
target_link_libraries( pcbcommon PUBLIC pcbnew_navlib)
endif()
add_dependencies( pcbcommon delaunator )
@ -940,6 +1018,13 @@ generate_lemon_grammar(
libeval_compiler/grammar.lemon
)
generate_lemon_grammar(
kicommon
text_eval
text_eval/text_eval_wrapper.cpp
text_eval/text_eval.lemon
)
# auto-generate stroke_params_lexer.h and stroke_params_keywords.cpp
# Called twice one for common and one for gal, to ensure the files are created
# on all devel tools ( Linux and msys2 )

View File

@ -84,6 +84,7 @@ static const wxChar ExtraZoneDisplayModes[] = wxT( "ExtraZoneDisplayModes" );
static const wxChar MinPlotPenWidth[] = wxT( "MinPlotPenWidth" );
static const wxChar DebugZoneFiller[] = wxT( "DebugZoneFiller" );
static const wxChar DebugPDFWriter[] = wxT( "DebugPDFWriter" );
static const wxChar UsePdfPrint[] = wxT( "UsePdfPrint" );
static const wxChar SmallDrillMarkSize[] = wxT( "SmallDrillMarkSize" );
static const wxChar HotkeysDumper[] = wxT( "HotkeysDumper" );
static const wxChar DrawBoundingBoxes[] = wxT( "DrawBoundingBoxes" );
@ -118,6 +119,7 @@ static const wxChar EnableExtensionSnaps[] = wxT( "EnableExtensionSnaps" );
static const wxChar ExtensionSnapTimeoutMs[] = wxT( "ExtensionSnapTimeoutMs" );
static const wxChar ExtensionSnapActivateOnHover[] = wxT( "ExtensionSnapActivateOnHover" );
static const wxChar EnableSnapAnchorsDebug[] = wxT( "EnableSnapAnchorsDebug" );
static const wxChar SnapHysteresis[] = wxT( "SnapHysteresis" );
static const wxChar MinParallelAngle[] = wxT( "MinParallelAngle" );
static const wxChar HoleWallPaintingMultiplier[] = wxT( "HoleWallPaintingMultiplier" );
static const wxChar MsgPanelShowUuids[] = wxT( "MsgPanelShowUuids" );
@ -129,6 +131,8 @@ static const wxChar GitIconRefreshInterval[] = wxT( "GitIconRefreshInterval" );
static const wxChar ConfigurableToolbars[] = wxT( "ConfigurableToolbars" );
static const wxChar MaxPastedTextLength[] = wxT( "MaxPastedTextLength" );
static const wxChar PNSProcessClusterTimeout[] = wxT( "PNSProcessClusterTimeout" );
static const wxChar ImportSkipComponentBodies[] = wxT( "ImportSkipComponentBodies" );
static const wxChar ScreenDPI[] = wxT( "ScreenDPI" );
} // namespace KEYS
@ -186,13 +190,13 @@ wxString dumpParamCfg( const PARAM_CFG& aParam )
/**
* Dump the configs in the given array to trace.
*/
static void dumpCfg( const std::vector<PARAM_CFG*>& aArray )
static void dumpCfg( const std::vector<std::unique_ptr<PARAM_CFG>>& aArray )
{
// only dump if we need to
if( !wxLog::IsAllowedTraceMask( AdvancedConfigMask ) )
return;
for( const PARAM_CFG* param : aArray )
for( const auto& param : aArray )
{
wxLogTrace( AdvancedConfigMask, dumpParamCfg( *param ) );
}
@ -244,6 +248,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_DebugZoneFiller = false;
m_DebugPDFWriter = false;
m_UsePdfPrint = false;
m_SmallDrillMarkSize = 0.35;
m_HotkeysDumper = false;
m_DrawBoundingBoxes = false;
@ -257,7 +262,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_CompactSave = false;
m_UpdateUIEventInterval = 0;
m_ShowRepairSchematic = false;
m_EnablePcbDesignBlocks = false;
m_EnablePcbDesignBlocks = true;
m_EnableGenerators = false;
m_EnableLibWithText = false;
m_EnableLibDir = false;
@ -295,6 +300,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_ExtensionSnapTimeoutMs = 500;
m_ExtensionSnapActivateOnHover = true;
m_EnableSnapAnchorsDebug = false;
m_SnapHysteresis = 5;
m_MinParallelAngle = 0.001;
m_HoleWallPaintingMultiplier = 1.5;
@ -315,6 +321,10 @@ ADVANCED_CFG::ADVANCED_CFG()
m_PNSProcessClusterTimeout = 100; // Default: 100 ms
m_ImportSkipComponentBodies = false;
m_ScreenDPI = 91;
loadFromConfigFile();
}
@ -326,6 +336,21 @@ const ADVANCED_CFG& ADVANCED_CFG::GetCfg()
}
void ADVANCED_CFG::Reload()
{
loadFromConfigFile();
}
void ADVANCED_CFG::Save()
{
wxFileName k_advanced = getAdvancedCfgFilename();
wxFileConfig file_cfg( wxS( "" ), wxS( "" ), k_advanced.GetFullPath() );
wxConfigSaveSetups( &file_cfg, m_entries );
}
void ADVANCED_CFG::loadFromConfigFile()
{
const wxFileName k_advanced = getAdvancedCfgFilename();
@ -355,270 +380,283 @@ void ADVANCED_CFG::loadFromConfigFile()
void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
{
std::vector<PARAM_CFG*> configParams;
m_entries.clear();
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::ExtraFillMargin,
&m_ExtraClearance,
m_ExtraClearance, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableCreepageSlot,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableCreepageSlot,
&m_EnableCreepageSlot, m_EnableCreepageSlot ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCEpsilon,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCEpsilon,
&m_DRCEpsilon, m_DRCEpsilon, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverWidthTolerance,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCSliverWidthTolerance,
&m_SliverWidthTolerance, m_SliverWidthTolerance,
0.01, 0.25 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverMinimumLength,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCSliverMinimumLength,
&m_SliverMinimumLength, m_SliverMinimumLength,
1e-9, 10 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverAngleTolerance,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCSliverAngleTolerance,
&m_SliverAngleTolerance, m_SliverAngleTolerance,
1.0, 90.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::HoleWallThickness,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::HoleWallThickness,
&m_HoleWallThickness, m_HoleWallThickness,
0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::CoroutineStackSize,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::CoroutineStackSize,
&m_CoroutineStackSize, AC_STACK::default_stack,
AC_STACK::min_stack, AC_STACK::max_stack ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::UpdateUIEventInterval,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::UpdateUIEventInterval,
&m_UpdateUIEventInterval, m_UpdateUIEventInterval,
-1, 100000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowRouterDebugGraphics,
&m_ShowRouterDebugGraphics,
m_ShowRouterDebugGraphics ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableRouterDump,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableRouterDump,
&m_EnableRouterDump, m_EnableRouterDump ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HyperZoom,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HyperZoom,
&m_HyperZoom, m_HyperZoom ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::CompactFileSave,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::CompactFileSave,
&m_CompactSave, m_CompactSave ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcAccuracy,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DrawArcAccuracy,
&m_DrawArcAccuracy, m_DrawArcAccuracy,
0.0, 100000.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcCenterStartEndMaxAngle,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DrawArcCenterStartEndMaxAngle,
&m_DrawArcCenterMaxAngle,
m_DrawArcCenterMaxAngle, 0.0, 100000.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTangentTrackAngleDeviation,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MaxTangentTrackAngleDeviation,
&m_MaxTangentAngleDeviation,
m_MaxTangentAngleDeviation, 0.0, 90.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTrackLengthToKeep,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MaxTrackLengthToKeep,
&m_MaxTrackLengthToKeep, m_MaxTrackLengthToKeep,
0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ExtraZoneDisplayModes,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ExtraZoneDisplayModes,
&m_ExtraZoneDisplayModes,
m_ExtraZoneDisplayModes ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::StrokeTriangulation,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::StrokeTriangulation,
&m_DrawTriangulationOutlines,
m_DrawTriangulationOutlines ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinPlotPenWidth,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MinPlotPenWidth,
&m_MinPlotPenWidth, m_MinPlotPenWidth,
0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugZoneFiller,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DebugZoneFiller,
&m_DebugZoneFiller, m_DebugZoneFiller ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugPDFWriter,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DebugPDFWriter,
&m_DebugPDFWriter, m_DebugPDFWriter ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::SmallDrillMarkSize,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::UsePdfPrint,
&m_UsePdfPrint, m_UsePdfPrint ) );
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::SmallDrillMarkSize,
&m_SmallDrillMarkSize, m_SmallDrillMarkSize,
0.0, 3.0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HotkeysDumper,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HotkeysDumper,
&m_HotkeysDumper, m_HotkeysDumper ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DrawBoundingBoxes,
&m_DrawBoundingBoxes, m_DrawBoundingBoxes ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowPcbnewExportNetlist,
&m_ShowPcbnewExportNetlist,
m_ShowPcbnewExportNetlist ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelFileCache,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Skip3DModelFileCache,
&m_Skip3DModelFileCache, m_Skip3DModelFileCache ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelMemoryCache,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Skip3DModelMemoryCache,
&m_Skip3DModelMemoryCache,
m_Skip3DModelMemoryCache ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HideVersionFromTitle,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HideVersionFromTitle,
&m_HideVersionFromTitle, m_HideVersionFromTitle ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRepairSchematic,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowRepairSchematic,
&m_ShowRepairSchematic, m_ShowRepairSchematic ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowEventCounters,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowEventCounters,
&m_ShowEventCounters, m_ShowEventCounters ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowManualCanvasScale,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::AllowManualCanvasScale,
&m_AllowManualCanvasScale,
m_AllowManualCanvasScale ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::V3DRT_BevelHeight_um,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::V3DRT_BevelHeight_um,
&m_3DRT_BevelHeight_um, m_3DRT_BevelHeight_um,
0, std::numeric_limits<int>::max(),
AC_GROUPS::V3D_RayTracing ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::V3DRT_BevelExtentFactor,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::V3DRT_BevelExtentFactor,
&m_3DRT_BevelExtentFactor,
m_3DRT_BevelExtentFactor, 0.0, 100.0,
AC_GROUPS::V3D_RayTracing ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Use3DConnexionDriver,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Use3DConnexionDriver,
&m_Use3DConnexionDriver, m_Use3DConnexionDriver ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::IncrementalConnectivity,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::IncrementalConnectivity,
&m_IncrementalConnectivity,
m_IncrementalConnectivity ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::DisambiguationTime,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::DisambiguationTime,
&m_DisambiguationMenuDelay,
m_DisambiguationMenuDelay,
50, 10000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnablePcbDesignBlocks, &m_EnablePcbDesignBlocks,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnablePcbDesignBlocks, &m_EnablePcbDesignBlocks,
m_EnablePcbDesignBlocks ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableGenerators,
&m_EnableGenerators, m_EnableGenerators ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableAPILogging,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableAPILogging,
&m_EnableAPILogging, m_EnableAPILogging ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibWithText,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableLibWithText,
&m_EnableLibWithText, m_EnableLibWithText ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibDir,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableLibDir,
&m_EnableLibDir, m_EnableLibDir ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::PcbSelectionVisibilityRatio,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::PcbSelectionVisibilityRatio,
&m_PcbSelectionVisibilityRatio,
m_PcbSelectionVisibilityRatio, 0.0, 1.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::FontErrorSize,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::FontErrorSize,
&m_FontErrorSize,
m_FontErrorSize, 0.01, 100 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::OcePluginLinearDeflection,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::OcePluginLinearDeflection,
&m_OcePluginLinearDeflection,
m_OcePluginLinearDeflection, 0.01, 1.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::OcePluginAngularDeflection,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::OcePluginAngularDeflection,
&m_OcePluginAngularDeflection,
m_OcePluginAngularDeflection, 0.01, 360.0 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateSimplificationLevel,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::TriangulateSimplificationLevel,
&m_TriangulateSimplificationLevel,
m_TriangulateSimplificationLevel, 5, 1000 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateMinimumArea,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::TriangulateMinimumArea,
&m_TriangulateMinimumArea,
m_TriangulateMinimumArea, 25, 100000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableCacheFriendlyFracture,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableCacheFriendlyFracture,
&m_EnableCacheFriendlyFracture,
m_EnableCacheFriendlyFracture ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaxFileSystemWatchers,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaxFileSystemWatchers,
&m_MaxFilesystemWatchers, m_MaxFilesystemWatchers,
0, 2147483647 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MinorSchematicGraphSize,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MinorSchematicGraphSize,
&m_MinorSchematicGraphSize,
m_MinorSchematicGraphSize,
0, 2147483647 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ResolveTextRecursionDepth,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ResolveTextRecursionDepth,
&m_ResolveTextRecursionDepth,
m_ResolveTextRecursionDepth, 0, 10 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableExtensionSnaps,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableExtensionSnaps,
&m_EnableExtensionSnaps,
m_EnableExtensionSnaps ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ExtensionSnapTimeoutMs,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ExtensionSnapTimeoutMs,
&m_ExtensionSnapTimeoutMs,
m_ExtensionSnapTimeoutMs, 0 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ExtensionSnapActivateOnHover,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ExtensionSnapActivateOnHover,
&m_ExtensionSnapActivateOnHover,
m_ExtensionSnapActivateOnHover ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableSnapAnchorsDebug,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableSnapAnchorsDebug,
&m_EnableSnapAnchorsDebug,
m_EnableSnapAnchorsDebug ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinParallelAngle,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::SnapHysteresis,
&m_SnapHysteresis, m_SnapHysteresis,
0, 100 ) );
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MinParallelAngle,
&m_MinParallelAngle, m_MinParallelAngle,
0.0, 45.0 ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::HoleWallPaintingMultiplier,
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::HoleWallPaintingMultiplier,
&m_HoleWallPaintingMultiplier,
m_HoleWallPaintingMultiplier,
0.1, 100.0 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MsgPanelShowUuids,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MsgPanelShowUuids,
&m_MsgPanelShowUuids,
m_MsgPanelShowUuids ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaximumThreads,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaximumThreads,
&m_MaximumThreads, m_MaximumThreads,
0, 500 ) );
configParams.push_back(
new PARAM_CFG_INT( true, AC_KEYS::NetInspectorBulkUpdateOptimisationThreshold,
m_entries.push_back(
std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::NetInspectorBulkUpdateOptimisationThreshold,
&m_NetInspectorBulkUpdateOptimisationThreshold,
m_NetInspectorBulkUpdateOptimisationThreshold, 0, 1000 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ExcludeFromSimulationLineWidth,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ExcludeFromSimulationLineWidth,
&m_ExcludeFromSimulationLineWidth,
m_ExcludeFromSimulationLineWidth, 1, 100 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::GitIconRefreshInterval,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::GitIconRefreshInterval,
&m_GitIconRefreshInterval,
m_GitIconRefreshInterval, 0, 100000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ConfigurableToolbars,
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ConfigurableToolbars,
&m_ConfigurableToolbars,
m_ConfigurableToolbars ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaxPastedTextLength,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaxPastedTextLength,
&m_MaxPastedTextLength,
m_MaxPastedTextLength, 0, 100000 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::PNSProcessClusterTimeout,
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::PNSProcessClusterTimeout,
&m_PNSProcessClusterTimeout, 100, 10, 10000 ) );
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ImportSkipComponentBodies,
&m_ImportSkipComponentBodies,
m_ImportSkipComponentBodies ) );
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ScreenDPI,
&m_ScreenDPI, m_ScreenDPI,
50, 500 ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
wxString traceMasks;
configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks,
m_entries.push_back( std::make_unique<PARAM_CFG_WXSTRING>( true, AC_KEYS::TraceMasks, &m_traceMasks,
wxS( "" ) ) );
// Load the config from file
wxConfigLoadSetups( &aCfg, configParams );
wxConfigLoadSetups( &aCfg, m_entries );
// Now actually set the trace masks
wxStringTokenizer traceMaskTokenizer( traceMasks, wxS( "," ) );
wxStringTokenizer traceMaskTokenizer( m_traceMasks, wxS( "," ) );
while( traceMaskTokenizer.HasMoreTokens() )
{
@ -626,13 +664,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
wxLog::AddTraceMask( mask );
}
dumpCfg( configParams );
for( PARAM_CFG* param : configParams )
delete param;
dumpCfg( m_entries );
wxLogTrace( kicadTraceCoroutineStack, wxT( "Using coroutine stack size %d" ),
m_CoroutineStackSize );
}

View File

@ -178,7 +178,7 @@ HANDLER_RESULT<types::Box2> API_HANDLER_COMMON::handleGetTextExtents(
types::Box2 response;
BOX2I bbox = text.GetTextBox();
BOX2I bbox = text.GetTextBox( nullptr );
EDA_ANGLE angle = text.GetTextAngle();
if( !angle.IsZero() )

View File

@ -397,6 +397,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_24.png" ), 24, wxT( "light" ) );
@ -448,6 +449,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_24.png" ), 24, wxT( "light" ) );
@ -570,6 +573,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_24.png" ), 24, wxT( "light" ) );
@ -833,6 +837,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_24.png" ), 24, wxT( "dark" ) );
@ -884,6 +889,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_24.png" ), 24, wxT( "dark" ) );
@ -1006,6 +1013,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_24.png" ), 24, wxT( "dark" ) );
@ -1269,6 +1277,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_16.png" ), 16, wxT( "light" ) );
@ -1320,6 +1329,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_16.png" ), 16, wxT( "light" ) );
@ -1442,6 +1453,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_16.png" ), 16, wxT( "light" ) );
@ -1705,6 +1717,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_16.png" ), 16, wxT( "dark" ) );
@ -1756,6 +1769,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_16.png" ), 16, wxT( "dark" ) );
@ -1878,6 +1893,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_16.png" ), 16, wxT( "dark" ) );
@ -2141,6 +2157,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_32.png" ), 32, wxT( "light" ) );
@ -2192,6 +2209,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_32.png" ), 32, wxT( "light" ) );
@ -2314,6 +2333,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_32.png" ), 32, wxT( "light" ) );
@ -2577,6 +2597,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_32.png" ), 32, wxT( "dark" ) );
@ -2628,6 +2649,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_32.png" ), 32, wxT( "dark" ) );
@ -2750,6 +2773,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_32.png" ), 32, wxT( "dark" ) );
@ -3013,6 +3037,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_48.png" ), 48, wxT( "light" ) );
@ -3064,6 +3089,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_48.png" ), 48, wxT( "light" ) );
@ -3186,6 +3213,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_48.png" ), 48, wxT( "light" ) );
@ -3449,6 +3477,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_48.png" ), 48, wxT( "dark" ) );
@ -3500,6 +3529,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_48.png" ), 48, wxT( "dark" ) );
@ -3622,6 +3653,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_48.png" ), 48, wxT( "dark" ) );
@ -3885,6 +3917,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_64.png" ), 64, wxT( "light" ) );
@ -3936,6 +3969,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_64.png" ), 64, wxT( "light" ) );
@ -4058,6 +4093,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_64.png" ), 64, wxT( "light" ) );
@ -4321,6 +4357,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_64.png" ), 64, wxT( "dark" ) );
@ -4372,6 +4409,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_64.png" ), 64, wxT( "dark" ) );
@ -4494,6 +4533,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_64.png" ), 64, wxT( "dark" ) );

View File

@ -207,18 +207,15 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
void BITMAP_STORE::ThemeChanged()
{
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
wxString oldTheme = m_theme;
if( settings )
if( COMMON_SETTINGS* settings = Pgm().GetCommonSettings() )
{
switch( settings->m_Appearance.icon_theme )
{
case ICON_THEME::LIGHT: m_theme = wxT( "light" ); break;
case ICON_THEME::DARK: m_theme = wxT( "dark" ); break;
case ICON_THEME::AUTO:
m_theme = KIPLATFORM::UI::IsDarkTheme() ? wxT( "dark" ) : wxT( "light" );
break;
case ICON_THEME::AUTO: m_theme = KIPLATFORM::UI::IsDarkTheme() ? wxT( "dark" ) : wxT( "light" ); break;
}
}
else

View File

@ -317,6 +317,13 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
aMsg << indent4 << "KICAD_IPC_API=" << OFF;
#endif
aMsg << indent4 << "KICAD_USE_PCH=";
#ifdef KICAD_USE_PCH
aMsg << ON;
#else
aMsg << OFF;
#endif
#ifndef NDEBUG
aMsg << indent4 << "KICAD_STDLIB_DEBUG=";
#ifdef KICAD_STDLIB_DEBUG

View File

@ -24,6 +24,7 @@
#include "clipboard.h"
#include <wx/clipbrd.h>
#include <wx/dataobj.h>
#include <wx/image.h>
#include <wx/log.h>
#include <wx/string.h>
@ -90,10 +91,10 @@ std::unique_ptr<wxImage> GetImageFromClipboard()
{
if( wxTheClipboard->IsSupported( wxDF_BITMAP ) )
{
wxImageDataObject data;
wxBitmapDataObject data;
if( wxTheClipboard->GetData( data ) )
{
image = std::make_unique<wxImage>( data.GetImage() );
image = std::make_unique<wxImage>( data.GetBitmap().ConvertToImage() );
}
}
else if( wxTheClipboard->IsSupported( wxDF_FILENAME ) )

View File

@ -38,52 +38,66 @@ COMMIT::COMMIT()
COMMIT::~COMMIT()
{
for( COMMIT_LINE& ent : m_changes )
for( COMMIT_LINE& ent : m_entries )
delete ent.m_copy;
}
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen,
RECURSE_MODE aRecurse )
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen, RECURSE_MODE aRecurse )
{
int flags = aChangeType & CHT_FLAGS;
int changeType = aChangeType & CHT_TYPE;
EDA_ITEM* undoItem = undoLevelItem( aItem );
if( undoItem != aItem )
changeType = CHT_MODIFY;
// CHT_MODIFY and CHT_DONE are not compatible
wxASSERT( ( aChangeType & ( CHT_MODIFY | CHT_DONE ) ) != ( CHT_MODIFY | CHT_DONE ) );
if( changeType == CHT_MODIFY )
wxASSERT( ( flags & CHT_DONE ) == 0 );
int flag = aChangeType & CHT_FLAGS;
switch( aChangeType & CHT_TYPE )
switch( changeType )
{
case CHT_ADD:
makeEntry( aItem, CHT_ADD | flag, nullptr, aScreen );
if( m_addedItems.find( { aItem, aScreen } ) != m_addedItems.end() )
break;
makeEntry( aItem, CHT_ADD | flags, nullptr, aScreen );
break;
case CHT_REMOVE:
if( m_deletedItems.insert( aItem ).second )
{
makeEntry( aItem, CHT_REMOVE | flag, makeImage( aItem ), aScreen );
if( m_deletedItems.find( { aItem, aScreen } ) != m_deletedItems.end() )
break;
makeEntry( aItem, CHT_REMOVE | flags, makeImage( aItem ), aScreen );
if( EDA_GROUP* parentGroup = aItem->GetParentGroup() )
{
if( parentGroup->AsEdaItem()->GetFlags() & STRUCT_DELETED )
Modify( parentGroup->AsEdaItem(), aScreen, RECURSE_MODE::NO_RECURSE );
}
break;
case CHT_MODIFY:
if( EDA_ITEM* parent = parentObject( aItem ) )
createModified( parent, makeImage( parent ), flag, aScreen );
if( m_addedItems.find( { aItem, aScreen } ) != m_addedItems.end() )
break;
if( m_changedItems.find( { undoItem, aScreen } ) != m_changedItems.end() )
break;
makeEntry( undoItem, CHT_MODIFY | flags, makeImage( undoItem ), aScreen );
break;
default:
wxFAIL;
UNIMPLEMENTED_FOR( undoItem->GetClass() );
}
return *this;
}
COMMIT& COMMIT::Stage( std::vector<EDA_ITEM*> &container, CHANGE_TYPE aChangeType,
BASE_SCREEN *aScreen )
COMMIT& COMMIT::Stage( std::vector<EDA_ITEM*> &container, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen )
{
for( EDA_ITEM* item : container )
Stage( item, aChangeType, aScreen);
@ -119,31 +133,45 @@ COMMIT& COMMIT::Stage( const PICKED_ITEMS_LIST &aItems, UNDO_REDO aModFlag, BASE
}
int COMMIT::GetStatus( EDA_ITEM* aItem, BASE_SCREEN *aScreen )
void COMMIT::Unstage( EDA_ITEM* aItem, BASE_SCREEN* aScreen )
{
COMMIT_LINE* entry = findEntry( parentObject( aItem ), aScreen );
std::erase_if( m_entries,
[&]( COMMIT_LINE& line )
{
if( line.m_item == aItem && line.m_screen == aScreen )
{
// Only new items which have never been committed can be unstaged
wxASSERT( line.m_item->IsNew() );
return entry ? entry->m_type : 0;
delete line.m_item;
delete line.m_copy;
return true;
}
return false;
} );
}
COMMIT& COMMIT::createModified( EDA_ITEM* aItem, EDA_ITEM* aCopy, int aExtraFlags,
BASE_SCREEN* aScreen )
COMMIT& COMMIT::Modified( EDA_ITEM* aItem, EDA_ITEM* aCopy, BASE_SCREEN *aScreen )
{
EDA_ITEM* parent = parentObject( aItem );
if( m_changedItems.find( parent ) != m_changedItems.end() )
{
delete aCopy;
return *this; // item has been already modified once
}
makeEntry( parent, CHT_MODIFY | aExtraFlags, aCopy, aScreen );
if( undoLevelItem( aItem ) != aItem )
wxFAIL_MSG( "We've no way to get a copy of the undo level item at this point" );
else
makeEntry( aItem, CHT_MODIFY, aCopy, aScreen );
return *this;
}
int COMMIT::GetStatus( EDA_ITEM* aItem, BASE_SCREEN *aScreen )
{
COMMIT_LINE* entry = findEntry( undoLevelItem( aItem ), aScreen );
return entry ? entry->m_type : 0;
}
void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BASE_SCREEN *aScreen )
{
COMMIT_LINE ent;
@ -156,17 +184,24 @@ void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BAS
// N.B. Do not throw an assertion for multiple changed items. An item can be changed
// multiple times in a single commit such as when importing graphics and grouping them.
m_changedItems.insert( aItem );
m_changes.push_back( ent );
switch( aType & CHT_TYPE )
{
case CHT_ADD: m_addedItems.insert( { aItem, aScreen } ); break;
case CHT_REMOVE: m_deletedItems.insert( { aItem, aScreen } ); break;
case CHT_MODIFY: m_changedItems.insert( { aItem, aScreen } ); break;
default: wxFAIL; break;
}
m_entries.push_back( ent );
}
COMMIT::COMMIT_LINE* COMMIT::findEntry( EDA_ITEM* aItem, BASE_SCREEN *aScreen )
{
for( COMMIT_LINE& change : m_changes )
for( COMMIT_LINE& entry : m_entries )
{
if( change.m_item == aItem && change.m_screen == aScreen )
return &change;
if( entry.m_item == aItem && entry.m_screen == aScreen )
return &entry;
}
return nullptr;
@ -180,7 +215,7 @@ CHANGE_TYPE COMMIT::convert( UNDO_REDO aType ) const
case UNDO_REDO::NEWITEM: return CHT_ADD;
case UNDO_REDO::DELETED: return CHT_REMOVE;
case UNDO_REDO::CHANGED: return CHT_MODIFY;
default: wxASSERT( false ); return CHT_MODIFY;
default: wxFAIL; return CHT_MODIFY;
}
}
@ -192,7 +227,7 @@ UNDO_REDO COMMIT::convert( CHANGE_TYPE aType ) const
case CHT_ADD: return UNDO_REDO::NEWITEM;
case CHT_REMOVE: return UNDO_REDO::DELETED;
case CHT_MODIFY: return UNDO_REDO::CHANGED;
default: wxASSERT( false ); return UNDO_REDO::CHANGED;
default: wxFAIL; return UNDO_REDO::CHANGED;
}
}

View File

@ -30,12 +30,12 @@
#include <wx/config.h> // for wxConfigBase
#include <wx/debug.h> // for wxASSERT
void wxConfigLoadParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList,
void wxConfigLoadParams( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList,
const wxString& aGroup )
{
wxASSERT( aCfg );
for( PARAM_CFG* param : aList )
for( const auto& param : aList )
{
if( !!param->m_Group )
aCfg->SetPath( param->m_Group );
@ -50,11 +50,11 @@ void wxConfigLoadParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aLis
}
void wxConfigLoadSetups( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList )
void wxConfigLoadSetups( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList )
{
wxASSERT( aCfg );
for( PARAM_CFG* param : aList )
for( const auto& param : aList )
{
if( !param->m_Setup )
continue;
@ -64,12 +64,12 @@ void wxConfigLoadSetups( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aLis
}
void wxConfigSaveParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList,
void wxConfigSaveParams( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList,
const wxString& aGroup )
{
wxASSERT( aCfg );
for( PARAM_CFG* param : aList )
for( const auto& param : aList )
{
if( !!param->m_Group )
aCfg->SetPath( param->m_Group );
@ -92,11 +92,11 @@ void wxConfigSaveParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aLis
}
void wxConfigSaveSetups( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList )
void wxConfigSaveSetups( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList )
{
wxASSERT( aCfg );
for( PARAM_CFG* param : aList )
for( const auto& param : aList )
{
if( !param->m_Setup )
continue;

View File

@ -24,6 +24,7 @@
#include <core/kicad_algo.h>
#include <json_common.h>
#include <algorithm>
#include <database/database_lib_settings.h>
#include <settings/parameters.h>
@ -91,7 +92,7 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
// Sanitize library display names; currently only `/` is removed because we
// use it as a separator and allow it in symbol names.
alg::delete_matching( table.name, '/' );
std::erase( table.name, '/' );
if( entry.contains( "properties" ) && entry["properties"].is_object() )
{

View File

@ -48,12 +48,8 @@ public:
const wxString& GetBoardFile() const { return m_boardFile; }
void SetBoardFile( const wxString& aFile ) { m_boardFile = aFile; }
void SetFields( nlohmann::ordered_map<wxString, wxString>& aFields )
{
m_fields = std::move( aFields );
}
const nlohmann::ordered_map<wxString, wxString>& GetFields() const { return m_fields; }
nlohmann::ordered_map<wxString, wxString>& GetFields() { return m_fields; }
DESIGN_BLOCK() = default;

View File

@ -190,7 +190,7 @@ void DESIGN_BLOCK_LIST_IMPL::loadDesignBlocks()
};
for( size_t ii = 0; ii < num_elements; ++ii )
returns[ii] = tp.submit( db_thread );
returns[ii] = tp.submit_task( db_thread );
for( const std::future<size_t>& ret : returns )
{

View File

@ -325,8 +325,6 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
if( dbMetadata.contains( "keywords" ) )
newDB->SetKeywords( dbMetadata["keywords"] );
nlohmann::ordered_map<wxString, wxString> fields;
// Read the "fields" object from the JSON
if( dbMetadata.contains( "fields" ) )
{
@ -335,10 +333,8 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
wxString name = wxString::FromUTF8( item.key() );
wxString value = wxString::FromUTF8( item.value().get<std::string>() );
fields[name] = value;
newDB->GetFields()[name] = value;
}
newDB->SetFields( fields );
}
}
catch( ... )

View File

@ -79,7 +79,7 @@ void DESIGN_BLOCK_TREE_MODEL_ADAPTER::AddLibraries( EDA_BASE_FRAME* aParent )
DoAddLibrary( libName, library->GetDescr(), getDesignBlocks( aParent, libName ), pinned, true );
}
m_tree.AssignIntrinsicRanks();
m_tree.AssignIntrinsicRanks( m_shownColumns );
}

View File

@ -449,7 +449,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
ADD_DEV( wxT( "Martin McNamara" ), CONTRIB_DEV );
ADD_DEV( wxT( "Cameron McQuinn" ), CONTRIB_DEV );
ADD_DEV( wxT( "Ievgenii Meshcheriakov" ), CONTRIB_DEV );
ADD_DEV( wxT( "Mojca Miklavec" ), CONTRIB_DEV );
ADD_DEV( wxT( "Mojca Miklavec Groenhuis" ), CONTRIB_DEV );
ADD_DEV( wxT( "Ashley Mills" ), CONTRIB_DEV );
ADD_DEV( wxT( "Christoph Moench-Tegeder" ), CONTRIB_DEV );
ADD_DEV( wxT( "Peter Montgomery" ), CONTRIB_DEV );
@ -873,7 +873,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
ADD_LIBRARIAN( wxT( "Uli Köhler" ) );
ADD_LIBRARIAN( wxT( "Graham Keeth" ) );
ADD_LIBRARIAN( wxT( "Andrew Lutsenko" ) );
ADD_LIBRARIAN( wxT( "Mojca Miklavec" ) );
ADD_LIBRARIAN( wxT( "Mojca Miklavec Groenhuis" ) );
ADD_LIBRARIAN( wxT( "Jorge Neiva" ) );
ADD_LIBRARIAN( wxT( "Carlos Nieves Ónega" ) );
ADD_LIBRARIAN( wxT( "Lynn Ochs" ) );

View File

@ -22,6 +22,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if defined( _WIN32 )
#include <windows.h>
#endif
#include <build_version.h>
#include <eda_base_frame.h>
@ -108,8 +111,20 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
m_titleName = aParent->GetAboutTitle();
m_untranslatedTitleName = aParent->GetUntranslatedAboutTitle();
m_staticTextAppTitle->SetLabel( m_titleName );
// On windows, display the number of GDI objects in use. Can be useful when some GDI objects
// are not displayed because the max count of GDI objects (usually 10000) is reached
// So displaying this number can help to diagnose strange display issues
wxString extraInfo;
#if defined( _WIN32 )
uint32_t gdi_count = GetGuiResources( GetCurrentProcess(), GR_GDIOBJECTS );
extraInfo.Printf( _( "GDI objects in use %u" ), gdi_count );
extraInfo.Prepend( wxT( "\n" ) );
#endif
m_staticTextBuildVersion->SetLabel( wxS( "Version: " ) + m_info.GetBuildVersion() );
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() );
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() + extraInfo );
SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
createNotebooks();

File diff suppressed because it is too large Load Diff

View File

@ -21,22 +21,148 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <dialogs/dialog_assign_netclass.h>
#include "dialogs/dialog_assign_netclass.h"
#include <wx/regex.h>
#include <widgets/wx_html_report_box.h>
#include <project.h>
#include <project/project_file.h>
#include <project/net_settings.h>
#include <eda_base_frame.h>
#include <string_utils.h>
DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS( EDA_BASE_FRAME* aParent, const wxString aNetName,
wxString UpgradeGlobStarToRegex( const wxString& aPattern )
{
// Match a '*' that is NOT preceded by '.'
// (needs lookbehind, so no std::regex)
static const wxRegEx globStarPattern( wxT( R"((?<!\.)\*)" ) );
wxString result = aPattern;
globStarPattern.ReplaceAll( &result, ".*" );
return result;
}
static wxString GetStringCommonPrefix( const wxArrayString& aSet )
{
if( aSet.empty() )
return wxEmptyString;
wxString commonPrefix = *aSet.begin();
for( const wxString& str : aSet )
{
const size_t minLength = std::min( commonPrefix.size(), str.size() );
size_t matchUntil = 0;
while( matchUntil < minLength && commonPrefix[matchUntil] == str[matchUntil] )
{
++matchUntil;
}
commonPrefix = commonPrefix.substr( 0, matchUntil );
// If the common prefix is empty, we can stop early
// as there is no common prefix.
if( commonPrefix.empty() )
break;
}
return commonPrefix;
}
/**
* Propose a netclass pattern for a set of net names.
*
* This is a bit of a fudge, as there is no true answer for a perfect pattern.
* (e.g. if you have A0 and A1, is the answer A*, A[0-9], A[0|1] or A0|A1, or
* something else?)
*
* Also if you select A0, A1 and there is an A2 in the schematics,
* is the answer to include A2 or exclude it? E.g. A*, A0|A1 are not the same.
*
* For now, we just glue the net names together with a pipe, handle the most basic
* case of a single prefix if we can. No attempt is made to see if a star is
* safe (i.e. the options given are all the options there are).
*/
static wxString GetNetclassPatternForSet( const std::set<wxString>& aNetNames )
{
if( aNetNames.empty() )
return wxEmptyString;
if( aNetNames.size() == 1 )
{
return *aNetNames.begin();
}
wxArrayString netNames;
for( const wxString& netName : aNetNames )
{
// If the net name contains a '*' (e..g it was a bus prefix),
// we CAN use it in a pipe-separated regex pattern, but it has to be
// upgraded from a glob star to a regex star.
netNames.Add( UpgradeGlobStarToRegex( netName ) );
}
// Sort the net names to have a consistent order.
StrNumSort( netNames, CASE_SENSITIVITY::INSENSITIVE );
// Get the common prefix of all net names.
const wxString commonPrefix = GetStringCommonPrefix( netNames );
if( !commonPrefix.IsEmpty() && commonPrefix != wxT( "/" ) )
{
// If the common prefix is not empty, we can use it to simplify the pattern.
// This only works for one prefix, but with tries or similar, we can find
// multiple prefixes if that's something we want to do.
wxArrayString netTails;
for( const wxString& netName : netNames )
{
// Add the tail of the net name after the common prefix.
netTails.Add( netName.Mid( commonPrefix.size() ) );
}
return commonPrefix + + wxT("(") + wxJoin( netTails, wxT( '|' ) ) + wxT(")");
}
// No better ideas, just a straight pipe-separated list of net names.
return wxJoin( netNames, wxT( '|' ) );
}
DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS( EDA_BASE_FRAME* aParent,
const std::set<wxString>& aNetNames,
const std::set<wxString> aCandidateNetNames,
const std::function<void( const std::vector<wxString>& )>& aPreviewer ) :
DIALOG_ASSIGN_NETCLASS_BASE( aParent ),
m_frame( aParent ),
m_selectedNetNames( aNetNames ),
m_netCandidates( aCandidateNetNames ),
m_previewer( aPreviewer )
{
m_matchingNets->SetFont( KIUI::GetInfoFont( this ) );
m_info->SetFont( KIUI::GetInfoFont( this ).Italic() );
// @translate the string below.
if( aParent->GetFrameType() == FRAME_PCB_EDITOR )
m_info->SetLabel( wxT( "Note: complete netclass assignments can be edited in Board "
"Setup > Project." ) );
SetupStandardButtons();
finishDialogSettings();
}
bool DIALOG_ASSIGN_NETCLASS::TransferDataToWindow()
{
if( !wxWindow::TransferDataToWindow() )
return false;
std::shared_ptr<NET_SETTINGS>& netSettings = m_frame->Prj().GetProjectFile().m_NetSettings;
m_netclassCtrl->Append( NETCLASS::Default );
@ -49,18 +175,10 @@ DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS( EDA_BASE_FRAME* aParent, const w
else
m_netclassCtrl->SetSelection( 0 ); // Default netclass
m_patternCtrl->SetValue( aNetName );
m_matchingNets->SetFont( KIUI::GetInfoFont( this ) );
m_info->SetFont( KIUI::GetInfoFont( this ).Italic() );
const wxString initialNetclassPattern = GetNetclassPatternForSet( m_selectedNetNames );
m_patternCtrl->SetValue( initialNetclassPattern );
// @translate the string below.
if( aParent->GetFrameType() == FRAME_PCB_EDITOR )
m_info->SetLabel( wxT( "Note: complete netclass assignments can be edited in Board "
"Setup > Project." ) );
SetupStandardButtons();
finishDialogSettings();
return true;
}
@ -110,5 +228,3 @@ void DIALOG_ASSIGN_NETCLASS::onPatternText( wxCommandEvent& aEvent )
m_lastPattern = pattern;
}
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!

View File

@ -1,41 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration">; </property>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="cpp_class_decoration">; </property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_assign_netclass_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">DIALOG_ASSIGN_NETCLASS_BASE</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center">wxBOTH</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
@ -56,33 +59,33 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bUpperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -95,6 +98,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -131,19 +135,19 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<object class="wxTextCtrl" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -156,6 +160,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -166,7 +171,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">240,-1</property>
@ -196,19 +201,19 @@
<event name="OnText">onPatternText</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">30</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -221,6 +226,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -257,19 +263,19 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxComboBox" expanded="1">
<object class="wxComboBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -283,6 +289,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -324,28 +331,28 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bLowerSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">2</property>
<object class="wxHtmlWindow" expanded="1">
<object class="wxHtmlWindow" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -358,6 +365,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -391,19 +399,19 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -416,6 +424,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -454,11 +463,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="0">
<object class="wxStdDialogButtonSizer" expanded="false">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -28,7 +28,6 @@ class WX_HTML_REPORT_BOX;
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_ASSIGN_NETCLASS_BASE
///////////////////////////////////////////////////////////////////////////////

View File

@ -252,6 +252,9 @@ void DIALOG_CONFIGURE_PATHS::OnGridCellChanging( wxGridEvent& event )
int col = event.GetCol();
wxString text = event.GetString();
text.Trim( true ).Trim( false ); // Trim from both sides
grid->SetCellValue( row, col, text ); // Update the grid with trimmed value
if( text.IsEmpty() )
{
if( grid == m_EnvVars )
@ -316,38 +319,32 @@ void DIALOG_CONFIGURE_PATHS::OnGridCellChanging( wxGridEvent& event )
void DIALOG_CONFIGURE_PATHS::OnAddEnvVar( wxCommandEvent& event )
{
if( !m_EnvVars->CommitPendingChanges() )
return;
m_EnvVars->OnAddRow(
[&]() -> std::pair<int, int>
{
AppendEnvVar( wxEmptyString, wxEmptyString, false );
m_EnvVars->MakeCellVisible( m_EnvVars->GetNumberRows() - 1, TV_NAME_COL );
m_EnvVars->SetGridCursor( m_EnvVars->GetNumberRows() - 1, TV_NAME_COL );
m_EnvVars->EnableCellEditControl( true );
m_EnvVars->ShowCellEditControl();
return { m_EnvVars->GetNumberRows() - 1, TV_NAME_COL };
} );
}
void DIALOG_CONFIGURE_PATHS::OnRemoveEnvVar( wxCommandEvent& event )
{
int curRow = m_EnvVars->GetGridCursorRow();
if( curRow < 0 || m_EnvVars->GetNumberRows() <= curRow )
m_EnvVars->OnDeleteRows(
[&]( int row )
{
return;
}
else if( ENV_VAR::IsEnvVarImmutable( m_EnvVars->GetCellValue( curRow, TV_NAME_COL ) ) )
if( ENV_VAR::IsEnvVarImmutable( m_EnvVars->GetCellValue( row, TV_NAME_COL ) ) )
{
wxBell();
return;
return false;
}
m_EnvVars->CommitPendingChanges( true /* silent mode; we don't care if it's valid */ );
m_EnvVars->DeleteRows( curRow, 1 );
m_EnvVars->MakeCellVisible( std::max( 0, curRow-1 ), m_EnvVars->GetGridCursorCol() );
m_EnvVars->SetGridCursor( std::max( 0, curRow-1 ), m_EnvVars->GetGridCursorCol() );
return true;
},
[&]( int row )
{
m_EnvVars->DeleteRows( row, 1 );
} );
}

View File

@ -116,11 +116,10 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromWindow()
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnAddField( wxCommandEvent& event )
{
if( !m_fieldsGrid->CommitPendingChanges() )
return;
m_fieldsGrid->OnAddRow(
[&]() -> std::pair<int, int>
{
int row = m_fieldsGrid->GetNumberRows();
m_fieldsGrid->AppendRows( 1 );
m_fieldsGrid->SetCellValue( row, 0, _( "Untitled Field" ) );
@ -130,81 +129,38 @@ void DIALOG_DESIGN_BLOCK_PROPERTIES::OnAddField( wxCommandEvent& event )
m_fieldsGrid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
m_fieldsGrid->SetCellAlignment( row, 1, wxALIGN_LEFT, wxALIGN_CENTRE );
// wx documentation is wrong, SetGridCursor does not make visible.
m_fieldsGrid->MakeCellVisible( row, 0 );
m_fieldsGrid->SetGridCursor( row, 0 );
return { row, 0 };
} );
}
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnDeleteField( wxCommandEvent& event )
{
if( !m_fieldsGrid->CommitPendingChanges() )
return;
wxArrayInt selectedRows = m_fieldsGrid->GetSelectedRows();
if( selectedRows.empty() && m_fieldsGrid->GetGridCursorRow() >= 0 )
selectedRows.push_back( m_fieldsGrid->GetGridCursorRow() );
if( selectedRows.empty() )
return;
// Reverse sort so deleting a row doesn't change the indexes of the other rows.
selectedRows.Sort( []( int* first, int* second ) { return *second - *first; } );
for( int row : selectedRows )
m_fieldsGrid->OnDeleteRows(
[&]( int row )
{
m_fieldsGrid->DeleteRows( row );
m_fieldsGrid->MakeCellVisible( std::max( 0, row - 1 ), m_fieldsGrid->GetGridCursorCol() );
m_fieldsGrid->SetGridCursor( std::max( 0, row - 1 ), m_fieldsGrid->GetGridCursorCol() );
}
} );
}
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnMoveFieldUp( wxCommandEvent& event )
{
if( !m_fieldsGrid->CommitPendingChanges() )
return;
int row = m_fieldsGrid->GetGridCursorRow();
if( m_fieldsGrid->GetNumberRows() < 2 || row == 0 )
return;
// Swap the grid at row with the grid at row - 1
wxString temp0 = m_fieldsGrid->GetCellValue( row, 0 );
m_fieldsGrid->SetCellValue( row, 0, m_fieldsGrid->GetCellValue( row - 1, 0 ) );
m_fieldsGrid->SetCellValue( row - 1, 0, temp0 );
wxString temp1 = m_fieldsGrid->GetCellValue( row, 1 );
m_fieldsGrid->SetCellValue( row, 1, m_fieldsGrid->GetCellValue( row - 1, 1 ) );
m_fieldsGrid->SetCellValue( row - 1, 1, temp1 );
m_fieldsGrid->SetGridCursor( row - 1, 0 );
m_fieldsGrid->OnMoveRowUp(
[&]( int row )
{
m_fieldsGrid->SwapRows( row, row - 1 );
} );
}
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnMoveFieldDown( wxCommandEvent& event )
{
if( !m_fieldsGrid->CommitPendingChanges() )
return;
int row = m_fieldsGrid->GetGridCursorRow();
if( m_fieldsGrid->GetNumberRows() < 2 || row == ( (int) m_fieldsGrid->GetNumberRows() - 1 ) )
return;
// Swap the grid at row with the grid at row + 1
wxString temp0 = m_fieldsGrid->GetCellValue( row, 0 );
m_fieldsGrid->SetCellValue( row, 0, m_fieldsGrid->GetCellValue( row + 1, 0 ) );
m_fieldsGrid->SetCellValue( row + 1, 0, temp0 );
wxString temp1 = m_fieldsGrid->GetCellValue( row, 1 );
m_fieldsGrid->SetCellValue( row, 1, m_fieldsGrid->GetCellValue( row + 1, 1 ) );
m_fieldsGrid->SetCellValue( row + 1, 1, temp1 );
m_fieldsGrid->SetGridCursor( row + 1, 0 );
m_fieldsGrid->OnMoveRowUp(
[&]( int row )
{
m_fieldsGrid->SwapRows( row, row + 1 );
} );
}
@ -238,7 +194,7 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromGrid()
if( !m_fieldsGrid->CommitPendingChanges() )
return false;
nlohmann::ordered_map<wxString, wxString> newFields;
m_designBlock->GetFields().clear();
for( int row = 0; row < m_fieldsGrid->GetNumberRows(); row++ )
{
@ -246,17 +202,15 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromGrid()
fieldName.Replace( wxT( "\n" ), wxT( "" ), true ); // strip all newlines
fieldName.Replace( wxT( " " ), wxT( " " ), true ); // double space to single
if( newFields.count( fieldName ) )
if( m_designBlock->GetFields().count( fieldName ) )
{
wxMessageBox( _( "Duplicate fields are not allowed." ) );
return false;
}
newFields[fieldName] = m_fieldsGrid->GetCellValue( row, 1 );
m_designBlock->GetFields()[fieldName] = m_fieldsGrid->GetCellValue( row, 1 );
}
m_designBlock->SetFields( newFields );
return true;
}

View File

@ -1,78 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wx/button.h>
#include <wx/sizer.h>
#include <dialogs/dialog_embed_files.h>
DIALOG_EMBED_FILES::DIALOG_EMBED_FILES( wxWindow* aParent, const wxString& aTitle ) :
DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
m_contentPanel( nullptr )
{
// Construction delayed until after panel is installed
}
void DIALOG_EMBED_FILES::InstallPanel( wxPanel* aPanel )
{
m_contentPanel = aPanel;
// Now perform the body of the constructor
auto mainSizer = new wxBoxSizer( wxVERTICAL );
SetSizer( mainSizer );
mainSizer->Add( m_contentPanel, 1, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 5 );
m_contentPanel->SetMinSize( FromDIP( wxSize( 1000, 600 ) ) );
auto sdbSizer = new wxStdDialogButtonSizer();
auto sdbSizerOK = new wxButton( this, wxID_OK );
sdbSizer->AddButton( sdbSizerOK );
auto sdbSizerCancel = new wxButton( this, wxID_CANCEL );
sdbSizer->AddButton( sdbSizerCancel );
sdbSizer->Realize();
mainSizer->Add( sdbSizer, 0, wxALL|wxEXPAND, 5 );
SetupStandardButtons();
finishDialogSettings();
// On some windows manager (Unity, XFCE), this dialog is not always raised, depending
// on how the dialog is run.
Raise();
}
bool DIALOG_EMBED_FILES::TransferDataToWindow()
{
return m_contentPanel->TransferDataToWindow();
}
bool DIALOG_EMBED_FILES::TransferDataFromWindow()
{
/**
* N.B. *do not* call wxDialog::TransferDataFromWindow() in the dialog code.
*/
return m_contentPanel->TransferDataFromWindow();
}

View File

@ -0,0 +1,171 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <dialogs/dialog_generate_database_connection.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/msgdlg.h>
#include <database/database_connection.h>
#include <vector>
DIALOG_GENERATE_DATABASE_CONNECTION::DIALOG_GENERATE_DATABASE_CONNECTION( wxWindow* aParent ) :
DIALOG_SHIM( aParent, wxID_ANY, _( "Generate Database Connection" ), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{
wxBoxSizer* topSizer = new wxBoxSizer( wxVERTICAL );
m_dsnChoice = new wxChoice( this, wxID_ANY );
std::vector<std::string> dsns;
DATABASE_CONNECTION::ListDataSources( dsns );
for( const std::string& d : dsns )
m_dsnChoice->Append( d );
m_dsnChoice->Append( _( "Custom" ) );
topSizer->Add( new wxStaticText( this, wxID_ANY, _( "Data Source Name" ) ), 0, wxALL, 5 );
topSizer->Add( m_dsnChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxFlexGridSizer* grid = new wxFlexGridSizer( 2, 2, 5, 5 );
grid->AddGrowableCol( 1, 1 );
grid->Add( new wxStaticText( this, wxID_ANY, _( "Username" ) ), 0, wxALIGN_CENTER_VERTICAL );
m_userCtrl = new wxTextCtrl( this, wxID_ANY );
grid->Add( m_userCtrl, 1, wxEXPAND );
grid->Add( new wxStaticText( this, wxID_ANY, _( "Password" ) ), 0, wxALIGN_CENTER_VERTICAL );
m_passCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_PASSWORD );
grid->Add( m_passCtrl, 1, wxEXPAND );
grid->Add( new wxStaticText( this, wxID_ANY, _( "Timeout" ) ), 0, wxALIGN_CENTER_VERTICAL );
m_timeoutCtrl = new wxSpinCtrl( this, wxID_ANY );
m_timeoutCtrl->SetRange( 0, 999 );
m_timeoutCtrl->SetValue( DATABASE_CONNECTION::DEFAULT_TIMEOUT );
grid->Add( m_timeoutCtrl, 0, wxEXPAND );
grid->Add( new wxStaticText( this, wxID_ANY, _( "Connection String" ) ), 0,
wxALIGN_CENTER_VERTICAL );
m_connStrCtrl = new wxTextCtrl( this, wxID_ANY );
grid->Add( m_connStrCtrl, 1, wxEXPAND );
topSizer->Add( grid, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_testButton = new wxButton( this, wxID_ANY, _( "Test Connection" ) );
topSizer->Add( m_testButton, 0, wxLEFT | wxBOTTOM, 5 );
topSizer->Add( new wxStaticText( this, wxID_ANY, _( "Tables" ) ), 0, wxLEFT | wxRIGHT, 5 );
m_tableChoice = new wxChoice( this, wxID_ANY );
m_tableChoice->Enable( false );
topSizer->Add( m_tableChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
SetSizerAndFit( topSizer );
m_dsnChoice->Bind( wxEVT_CHOICE, &DIALOG_GENERATE_DATABASE_CONNECTION::OnDSNChanged, this );
m_testButton->Bind( wxEVT_BUTTON, &DIALOG_GENERATE_DATABASE_CONNECTION::OnTest, this );
UpdateControls();
SetupStandardButtons();
}
DATABASE_SOURCE DIALOG_GENERATE_DATABASE_CONNECTION::GetSource() const
{
DATABASE_SOURCE src;
src.type = DATABASE_SOURCE_TYPE::ODBC;
int sel = m_dsnChoice->GetSelection();
if( sel != wxNOT_FOUND && sel < (int) m_dsnChoice->GetCount() - 1 )
{
src.dsn = m_dsnChoice->GetString( sel ).ToStdString();
src.username = m_userCtrl->GetValue().ToStdString();
src.password = m_passCtrl->GetValue().ToStdString();
src.timeout = m_timeoutCtrl->GetValue();
}
else
{
src.connection_string = m_connStrCtrl->GetValue().ToStdString();
src.timeout = DATABASE_CONNECTION::DEFAULT_TIMEOUT;
}
return src;
}
void DIALOG_GENERATE_DATABASE_CONNECTION::OnDSNChanged( wxCommandEvent& aEvent )
{
UpdateControls();
}
void DIALOG_GENERATE_DATABASE_CONNECTION::UpdateControls()
{
bool custom = m_dsnChoice->GetSelection() == (int) m_dsnChoice->GetCount() - 1;
m_userCtrl->Enable( !custom );
m_passCtrl->Enable( !custom );
m_timeoutCtrl->Enable( !custom );
m_connStrCtrl->Enable( custom );
}
void DIALOG_GENERATE_DATABASE_CONNECTION::OnTest( wxCommandEvent& aEvent )
{
m_tableChoice->Clear();
std::unique_ptr<DATABASE_CONNECTION> conn;
if( m_dsnChoice->GetSelection() != (int) m_dsnChoice->GetCount() - 1 )
{
wxString dsn = m_dsnChoice->GetStringSelection();
wxString user = m_userCtrl->GetValue();
wxString pass = m_passCtrl->GetValue();
int timeout = m_timeoutCtrl->GetValue();
conn = std::make_unique<DATABASE_CONNECTION>( dsn.ToStdString(), user.ToStdString(), pass.ToStdString(),
timeout, false );
}
else
{
conn = std::make_unique<DATABASE_CONNECTION>( m_connStrCtrl->GetValue().ToStdString(),
DATABASE_CONNECTION::DEFAULT_TIMEOUT, false );
}
if( !conn->Connect() )
{
wxMessageBox( _( "Unable to connect to database" ), _( "Database Error" ), wxOK | wxICON_ERROR,
this );
return;
}
std::vector<std::string> tables;
if( conn->GetTables( tables ) )
{
for( const std::string& t : tables )
m_tableChoice->Append( t );
if( !tables.empty() )
m_tableChoice->SetSelection( 0 );
m_tableChoice->Enable( true );
}
}

View File

@ -42,6 +42,9 @@ DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS( wxWindow* aParent, wxWindow* aEventS
m_gridSizeX( aProvider, aEventSource, m_staticTextX, m_textX, m_staticTextXUnits, true ),
m_gridSizeY( aProvider, aEventSource, m_staticTextY, m_textY, m_staticTextYUnits, true )
{
// Properties dialogs don't really want state-saving/restoring
OptOut( this );
SetupStandardButtons();
SetInitialFocus( m_textName );
@ -83,8 +86,7 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow()
return false;
}
if( !m_checkLinked->IsChecked()
&& !m_gridSizeY.Validate( 0.001, 1000.0, EDA_UNITS::MM ) )
if( !m_checkLinked->IsChecked() && !m_gridSizeY.Validate( 0.001, 1000.0, EDA_UNITS::MM ) )
{
wxMessageBox( _( "Grid size Y out of range." ), _( "Error" ), wxOK | wxICON_ERROR );
return false;
@ -94,10 +96,8 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow()
m_grid.name = m_textName->GetValue();
// Grid X/Y are always stored in millimeters so we can compare them easily
m_grid.x = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM,
gridX );
m_grid.y = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM,
gridY );
m_grid.x = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM, gridX );
m_grid.y = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM, gridY );
return true;
}

View File

@ -41,6 +41,9 @@ DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES( EDA_DRAW_FRAME* aParent, EDA_G
m_group( aGroup ),
m_commit( aCommit )
{
// Properties dialogs don't really want state-saving/restoring
OptOut( this );
m_bpAddMember->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
m_bpRemoveMember->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );

View File

@ -101,8 +101,7 @@ std::vector<IMPORT_PROJECT_DESC> DIALOG_IMPORT_CHOOSE_PROJECT::GetProjects()
std::vector<IMPORT_PROJECT_DESC>
DIALOG_IMPORT_CHOOSE_PROJECT::RunModal( wxWindow* aParent,
const std::vector<IMPORT_PROJECT_DESC>& aProjectDesc )
DIALOG_IMPORT_CHOOSE_PROJECT::RunModal( wxWindow* aParent, const std::vector<IMPORT_PROJECT_DESC>& aProjectDesc )
{
DIALOG_IMPORT_CHOOSE_PROJECT dlg( aParent, aProjectDesc );

View File

@ -1,78 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <dialogs/dialog_locked_items_query.h>
#include <bitmaps.h>
DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent,
std::size_t aLockedItemCount,
PCBNEW_SETTINGS::LOCKING_OPTIONS& aLockingOptions ) :
DIALOG_LOCKED_ITEMS_QUERY_BASE( aParent ),
m_lockingOptions( aLockingOptions )
{
m_icon->SetBitmap( KiBitmapBundle( BITMAPS::locked ) );
m_messageLine1->SetLabel( wxString::Format( m_messageLine1->GetLabel(), aLockedItemCount ) );
SetupStandardButtons( { { wxID_OK, _( "Skip Locked Items" ) } } );
m_sdbSizerOK->SetToolTip( _( "Remove locked items from the selection and only apply the "
"operation to the unlocked items (if any)." ) );
m_doNotShowBtn->SetToolTip( _( "Do not show this dialog again until KiCad restarts. "
"You can re-enable this dialog in Pcbnew preferences." ) );
SetInitialFocus( m_sdbSizerOK );
Layout();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
void DIALOG_LOCKED_ITEMS_QUERY::onOverrideLocks( wxCommandEvent& event )
{
// This will choose the correct way to end the dialog no matter how is was shown.
EndDialog( wxID_APPLY );
}
int DIALOG_LOCKED_ITEMS_QUERY::ShowModal()
{
static int doNotShowValue = wxID_ANY;
if( doNotShowValue != wxID_ANY && m_lockingOptions.m_sessionSkipPrompts )
return doNotShowValue;
int ret = DIALOG_SHIM::ShowModal();
// Has the user asked not to show the dialog again this session?
if( m_doNotShowBtn->IsChecked() && ret != wxID_CANCEL )
{
doNotShowValue = ret;
m_lockingOptions.m_sessionSkipPrompts = true;
}
return ret;
}

View File

@ -1,88 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_locked_items_query_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 0, 2, 10, 0 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_icon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer4->Add( m_icon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 10 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxVERTICAL );
m_messageLine1 = new wxStaticText( this, wxID_ANY, _("The selection contains %zu locked items."), wxDefaultPosition, wxDefaultSize, 0 );
m_messageLine1->Wrap( -1 );
bSizer4->Add( m_messageLine1, 0, wxALL, 5 );
m_messageLine2 = new wxStaticText( this, wxID_ANY, _("These items will be skipped unless you override the locks."), wxDefaultPosition, wxDefaultSize, 0 );
m_messageLine2->Wrap( -1 );
bSizer4->Add( m_messageLine2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
fgSizer4->Add( bSizer4, 1, wxEXPAND|wxRIGHT, 5 );
fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
m_doNotShowBtn = new wxCheckBox( this, wxID_ANY, _("Remember decision for this session."), wxDefaultPosition, wxDefaultSize, 0 );
m_doNotShowBtn->SetToolTip( _("Remember the option selected for the remainder of this session.\nThis dialog will not be shown again until KiCad is restarted.") );
fgSizer4->Add( m_doNotShowBtn, 0, wxALL, 5 );
bSizerMain->Add( fgSizer4, 1, wxEXPAND|wxALL, 5 );
wxBoxSizer* bButtonSizer;
bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
m_overrideBtn = new wxButton( this, wxID_ANY, _("Override Locks"), wxDefaultPosition, wxDefaultSize, 0 );
m_overrideBtn->SetToolTip( _("Override locks and apply the operation on all the items selected.\nAny locked items will remain locked after the operation is complete.") );
bButtonSizer->Add( m_overrideBtn, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bButtonSizer->Add( m_sdbSizer, 1, wxBOTTOM|wxTOP, 5 );
bSizerMain->Add( bButtonSizer, 0, wxEXPAND, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) );
m_overrideBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this );
}
DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) );
m_overrideBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this );
}

View File

@ -1,462 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="code_generation">C++</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="file">dialog_locked_items_query_base</property>
<property name="first_id">1000</property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">dialog_locked_items_query</property>
<property name="path">.</property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_LOCKED_ITEMS_QUERY_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Locked Items</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnInitDialog">OnInitDlg</event>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="true">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer4</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">10</property>
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_icon</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">The selection contains %zu locked items.</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_messageLine1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">These items will be skipped unless you override the locks.</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_messageLine2</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="true">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Remember decision for this session.</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_doNotShowBtn</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Remember the option selected for the remainder of this session.&#x0A;This dialog will not be shown again until KiCad is restarted.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bButtonSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="false">
<property name="border">10</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Override Locks</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_overrideBtn</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Override locks and apply the operation on all the items selected.&#x0A;Any locked items will remain locked after the operation is complete.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onOverrideLocks</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxTOP</property>
<property name="proportion">1</property>
<object class="wxStdDialogButtonSizer" expanded="true">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -27,7 +27,8 @@
DIALOG_MIGRATE_SETTINGS::DIALOG_MIGRATE_SETTINGS( SETTINGS_MANAGER* aManager ) :
DIALOG_MIGRATE_SETTINGS_BASE( nullptr ), m_manager( aManager )
DIALOG_MIGRATE_SETTINGS_BASE( nullptr ),
m_manager( aManager )
{
SetMinSize( FromDIP( GetMinSize() ) );
m_standardButtonsCancel->SetLabel( _( "Quit KiCad" ) );
@ -45,11 +46,6 @@ DIALOG_MIGRATE_SETTINGS::DIALOG_MIGRATE_SETTINGS( SETTINGS_MANAGER* aManager ) :
}
DIALOG_MIGRATE_SETTINGS::~DIALOG_MIGRATE_SETTINGS()
{
}
bool DIALOG_MIGRATE_SETTINGS::TransferDataToWindow()
{
if( !wxDialog::TransferDataToWindow() )
@ -106,8 +102,6 @@ bool DIALOG_MIGRATE_SETTINGS::TransferDataFromWindow()
m_manager->SetMigrationSource( wxEmptyString );
}
return true;
}
@ -160,7 +154,7 @@ void DIALOG_MIGRATE_SETTINGS::OnDefaultSelected( wxCommandEvent& event )
bool DIALOG_MIGRATE_SETTINGS::validatePath()
{
wxString path = m_cbPath->GetValue();
bool valid = m_manager->IsSettingsPathValid( path );
bool valid = SETTINGS_MANAGER::IsSettingsPathValid( path );
showPathError( !valid );
m_standardButtons->GetAffirmativeButton()->Enable( valid && !path.IsEmpty() );

View File

@ -26,7 +26,7 @@
#include <eda_draw_frame.h>
#include <widgets/unit_binder.h>
#include <core/type_helpers.h>
#include <string_utils.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/gbsizer.h>
@ -35,7 +35,8 @@
WX_MULTI_ENTRY_DIALOG::WX_MULTI_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aCaption,
std::vector<ENTRY> aEntries ) :
DIALOG_SHIM( aParent, wxID_ANY, aCaption ), m_entries( std::move( aEntries ) )
DIALOG_SHIM( aParent, wxID_ANY, aCaption ),
m_entries( std::move( aEntries ) )
{
SetSizeHints( wxDefaultSize, wxDefaultSize );
@ -57,52 +58,41 @@ WX_MULTI_ENTRY_DIALOG::WX_MULTI_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxS
[&]( const auto& aValue )
{
using EntryType = std::decay_t<decltype( aValue )>;
if constexpr( std::is_same_v<EntryType, UNIT_BOUND> )
{
// Label / Entry / Unit
// and a binder
wxStaticText* label =
new wxStaticText( this, wxID_ANY, entry.m_label, wxDefaultPosition,
wxDefaultSize, 0 );
wxStaticText* label = new wxStaticText( this, wxID_ANY, entry.m_label );
label->Wrap( -1 );
bSizerContent->Add( label, wxGBPosition( gbRow, 0 ), wxGBSpan( 1, 1 ),
wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxLEFT,
5 );
wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxLEFT, 5 );
wxTextCtrl* textCtrl =
new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxDefaultSize, 0 );
wxTextCtrl* textCtrl = new wxTextCtrl( this, wxID_ANY );
bSizerContent->Add( textCtrl, wxGBPosition( gbRow, 1 ), wxGBSpan( 1, 1 ),
wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 5 );
wxStaticText* unit_label = new wxStaticText(
this, wxID_ANY, _( "unit" ), wxDefaultPosition, wxDefaultSize, 0 );
unit_label->Wrap( -1 );
bSizerContent->Add( unit_label, wxGBPosition( gbRow, 2 ), wxGBSpan( 1, 1 ),
wxTOP | wxBOTTOM | wxRIGHT | wxALIGN_CENTER_VERTICAL,
5 );
wxStaticText* units = new wxStaticText( this, wxID_ANY, _( "unit" ) );
units->Wrap( -1 );
bSizerContent->Add( units, wxGBPosition( gbRow, 2 ), wxGBSpan( 1, 1 ),
wxTOP | wxBOTTOM | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5 );
if( !entry.m_tooltip.IsEmpty() )
textCtrl->SetToolTip( entry.m_tooltip );
m_controls.push_back( textCtrl );
m_unit_binders.push_back( std::make_unique<UNIT_BINDER>(
aParent, label, textCtrl, unit_label ) );
m_unit_binders.push_back( std::make_unique<UNIT_BINDER>( aParent, label, textCtrl, units ) );
m_unit_binders.back()->SetValue( aValue.m_default );
}
else if constexpr( std::is_same_v<EntryType, CHECKBOX> )
{
// Checkbox across all 3 cols
wxCheckBox* checkBox =
new wxCheckBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxDefaultSize, 0 );
wxCheckBox* checkBox = new wxCheckBox( this, wxID_ANY, entry.m_label );
checkBox->SetValue( aValue.m_default );
bSizerContent->Add( checkBox, wxGBPosition( gbRow, 0 ), wxGBSpan( 1, 3 ),
wxALIGN_CENTER_VERTICAL | wxALL, 5 );
checkBox->SetLabel( entry.m_label );
checkBox->SetValue( aValue.m_default );
if( !entry.m_tooltip.IsEmpty() )
checkBox->SetToolTip( entry.m_tooltip );
@ -131,6 +121,10 @@ WX_MULTI_ENTRY_DIALOG::WX_MULTI_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxS
bSizerMain->Add( sdbSizer1, 0, wxALL | wxEXPAND, 5 );
// DIALOG_SHIM needs a title--specific hash_key so we don't save/restore state between
// usage cases.
m_hash_key = TO_UTF8( GetTitle() );
SetSizer( bSizerMain );
SetupStandardButtons();
Layout();

View File

@ -40,7 +40,7 @@
#include <drawing_sheet/ds_painter.h>
#include <string_utils.h>
#include <widgets/std_bitmap_button.h>
#include <widgets/filedlg_open_embed_file.h>
#include <widgets/filedlg_hook_embed_file.h>
#include <wx/valgen.h>
#include <wx/tokenzr.h>
#include <wx/filedlg.h>
@ -78,9 +78,8 @@ static const wxString pageFmts[] =
// to be recognized in code
};
DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* aParent,
EMBEDDED_FILES* aEmbeddedFiles, double aIuPerMils,
const VECTOR2D& aMaxUserSizeMils ) :
DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* aParent, EMBEDDED_FILES* aEmbeddedFiles,
double aIuPerMils, const VECTOR2D& aMaxUserSizeMils ) :
DIALOG_PAGES_SETTINGS_BASE( aParent ),
m_parent( aParent ),
m_screen( m_parent->GetScreen() ),
@ -479,9 +478,7 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
BASE_SCREEN::m_DrawingSheetFileName = fileName;
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName, &msg ) )
{
DisplayErrorMessage( this, wxString::Format( _( "Error loading drawing sheet '%s'." ), fullFileName ), msg );
}
m_localPrjConfigChanged = true;
@ -506,36 +503,21 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
else
{
// search for longest common string first, e.g. A4 before A
if( paperType.Contains( PAGE_INFO::USLetter ) )
success = m_pageInfo.SetType( PAGE_INFO::USLetter );
else if( paperType.Contains( PAGE_INFO::USLegal ) )
success = m_pageInfo.SetType( PAGE_INFO::USLegal );
else if( paperType.Contains( PAGE_INFO::USLedger ) )
success = m_pageInfo.SetType( PAGE_INFO::USLedger );
else if( paperType.Contains( PAGE_INFO::GERBER ) )
success = m_pageInfo.SetType( PAGE_INFO::GERBER );
else if( paperType.Contains( PAGE_INFO::A5 ) )
success = m_pageInfo.SetType( PAGE_INFO::A5 );
else if( paperType.Contains( PAGE_INFO::A4 ) )
success = m_pageInfo.SetType( PAGE_INFO::A4 );
else if( paperType.Contains( PAGE_INFO::A3 ) )
success = m_pageInfo.SetType( PAGE_INFO::A3 );
else if( paperType.Contains( PAGE_INFO::A2 ) )
success = m_pageInfo.SetType( PAGE_INFO::A2 );
else if( paperType.Contains( PAGE_INFO::A1 ) )
success = m_pageInfo.SetType( PAGE_INFO::A1 );
else if( paperType.Contains( PAGE_INFO::A0 ) )
success = m_pageInfo.SetType( PAGE_INFO::A0 );
else if( paperType.Contains( PAGE_INFO::A ) )
success = m_pageInfo.SetType( PAGE_INFO::A );
else if( paperType.Contains( PAGE_INFO::B ) )
success = m_pageInfo.SetType( PAGE_INFO::B );
else if( paperType.Contains( PAGE_INFO::C ) )
success = m_pageInfo.SetType( PAGE_INFO::C );
else if( paperType.Contains( PAGE_INFO::D ) )
success = m_pageInfo.SetType( PAGE_INFO::D );
else if( paperType.Contains( PAGE_INFO::E ) )
success = m_pageInfo.SetType( PAGE_INFO::E );
if( paperType.Contains( PAGE_INFO::USLetter ) ) success = m_pageInfo.SetType( PAGE_INFO::USLetter );
else if( paperType.Contains( PAGE_INFO::USLegal ) ) success = m_pageInfo.SetType( PAGE_INFO::USLegal );
else if( paperType.Contains( PAGE_INFO::USLedger ) ) success = m_pageInfo.SetType( PAGE_INFO::USLedger );
else if( paperType.Contains( PAGE_INFO::GERBER ) ) success = m_pageInfo.SetType( PAGE_INFO::GERBER );
else if( paperType.Contains( PAGE_INFO::A5 ) ) success = m_pageInfo.SetType( PAGE_INFO::A5 );
else if( paperType.Contains( PAGE_INFO::A4 ) ) success = m_pageInfo.SetType( PAGE_INFO::A4 );
else if( paperType.Contains( PAGE_INFO::A3 ) ) success = m_pageInfo.SetType( PAGE_INFO::A3 );
else if( paperType.Contains( PAGE_INFO::A2 ) ) success = m_pageInfo.SetType( PAGE_INFO::A2 );
else if( paperType.Contains( PAGE_INFO::A1 ) ) success = m_pageInfo.SetType( PAGE_INFO::A1 );
else if( paperType.Contains( PAGE_INFO::A0 ) ) success = m_pageInfo.SetType( PAGE_INFO::A0 );
else if( paperType.Contains( PAGE_INFO::A ) ) success = m_pageInfo.SetType( PAGE_INFO::A );
else if( paperType.Contains( PAGE_INFO::B ) ) success = m_pageInfo.SetType( PAGE_INFO::B );
else if( paperType.Contains( PAGE_INFO::C ) ) success = m_pageInfo.SetType( PAGE_INFO::C );
else if( paperType.Contains( PAGE_INFO::D ) ) success = m_pageInfo.SetType( PAGE_INFO::D );
else if( paperType.Contains( PAGE_INFO::E ) ) success = m_pageInfo.SetType( PAGE_INFO::E );
if( success )
{
@ -799,9 +781,8 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
}
// Display a file picker dialog
FILEDLG_OPEN_EMBED_FILE customize;
wxFileDialog fileDialog( this, _( "Drawing Sheet File" ), path, name,
FILEEXT::DrawingSheetFileWildcard(),
FILEDLG_HOOK_EMBED_FILE customize;
wxFileDialog fileDialog( this, _( "Drawing Sheet File" ), path, name, FILEEXT::DrawingSheetFileWildcard(),
wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
if( m_embeddedFiles )

View File

@ -24,28 +24,21 @@
#include <dialogs/dialog_paste_special.h>
static PASTE_MODE g_paste_mode = PASTE_MODE::UNIQUE_ANNOTATIONS;
DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent,
PASTE_MODE* aMode,
const wxString& aReplacement ) :
DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent, PASTE_MODE* aMode, const wxString& aDefaultRef ) :
DIALOG_PASTE_SPECIAL_BASE( aParent ),
m_mode( aMode )
{
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::UNIQUE_ANNOTATIONS ),
_( "Finds the next available reference designator for "
"any designators that already exist in the design." ) );
m_options->SetItemToolTip( static_cast<int>( PASTE_MODE::UNIQUE_ANNOTATIONS ),
_( "Finds the next available reference designator for any designators that already "
"exist in the design." ) );
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::KEEP_ANNOTATIONS ),
m_options->SetItemToolTip( static_cast<int>( PASTE_MODE::KEEP_ANNOTATIONS ),
wxT( "" ) ); // Self explanatory
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::REMOVE_ANNOTATIONS ),
wxString::Format( _( "Replaces reference designators "
"with '%s'." ),
aReplacement ) );
m_options->SetItemToolTip( static_cast<int>( PASTE_MODE::REMOVE_ANNOTATIONS ),
wxString::Format( _( "Replaces reference designators with '%s'." ), aDefaultRef ) );
m_pasteOptions->SetFocus();
m_options->SetFocus();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
@ -54,14 +47,26 @@ DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent,
bool DIALOG_PASTE_SPECIAL::TransferDataToWindow()
{
m_pasteOptions->SetSelection( static_cast<int>( g_paste_mode ) );
switch( *m_mode )
{
case PASTE_MODE::UNIQUE_ANNOTATIONS: m_options->SetSelection( 0 ); break;
case PASTE_MODE::KEEP_ANNOTATIONS: m_options->SetSelection( 1 ); break;
case PASTE_MODE::REMOVE_ANNOTATIONS: m_options->SetSelection( 2 ); break;
}
return true;
}
bool DIALOG_PASTE_SPECIAL::TransferDataFromWindow()
{
g_paste_mode = *m_mode = static_cast<PASTE_MODE>( m_pasteOptions->GetSelection() );
switch( m_options->GetSelection() )
{
case 0: *m_mode = PASTE_MODE::UNIQUE_ANNOTATIONS; break;
case 1: *m_mode = PASTE_MODE::KEEP_ANNOTATIONS; break;
case 2: *m_mode = PASTE_MODE::REMOVE_ANNOTATIONS; break;
}
return true;
}

View File

@ -19,11 +19,11 @@ DIALOG_PASTE_SPECIAL_BASE::DIALOG_PASTE_SPECIAL_BASE( wxWindow* parent, wxWindow
wxBoxSizer* optionsSizer;
optionsSizer = new wxBoxSizer( wxVERTICAL );
wxString m_pasteOptionsChoices[] = { _("Assign unique reference designators to pasted symbols"), _("Keep existing reference designators, even if they are duplicated"), _("Clear reference designators on all pasted symbols") };
int m_pasteOptionsNChoices = sizeof( m_pasteOptionsChoices ) / sizeof( wxString );
m_pasteOptions = new wxRadioBox( this, wxID_ANY, _("Reference Designators"), wxDefaultPosition, wxDefaultSize, m_pasteOptionsNChoices, m_pasteOptionsChoices, 1, wxRA_SPECIFY_COLS );
m_pasteOptions->SetSelection( 1 );
optionsSizer->Add( m_pasteOptions, 0, wxALL, 5 );
wxString m_optionsChoices[] = { _("Assign unique reference designators to pasted symbols"), _("Keep existing reference designators, even if they are duplicated"), _("Clear reference designators on all pasted symbols") };
int m_optionsNChoices = sizeof( m_optionsChoices ) / sizeof( wxString );
m_options = new wxRadioBox( this, wxID_ANY, _("Reference Designators"), wxDefaultPosition, wxDefaultSize, m_optionsNChoices, m_optionsChoices, 1, wxRA_SPECIFY_COLS );
m_options->SetSelection( 1 );
optionsSizer->Add( m_options, 0, wxALL, 5 );
m_clearNetsCB = new wxCheckBox( this, wxID_ANY, _("Clear net assignments"), wxDefaultPosition, wxDefaultSize, 0 );
m_clearNetsCB->SetToolTip( _("Remove the net information from all connected items before pasting") );
@ -50,12 +50,12 @@ DIALOG_PASTE_SPECIAL_BASE::DIALOG_PASTE_SPECIAL_BASE( wxWindow* parent, wxWindow
this->Centre( wxBOTH );
// Connect Events
m_pasteOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
m_options->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
}
DIALOG_PASTE_SPECIAL_BASE::~DIALOG_PASTE_SPECIAL_BASE()
{
// Disconnect Events
m_pasteOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
m_options->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
}

View File

@ -116,7 +116,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_pasteOptions</property>
<property name="name">m_options</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -32,7 +32,7 @@ class DIALOG_PASTE_SPECIAL_BASE : public DIALOG_SHIM
private:
protected:
wxRadioBox* m_pasteOptions;
wxRadioBox* m_options;
wxCheckBox* m_clearNetsCB;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;

View File

@ -147,29 +147,20 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow()
int DIALOG_PLUGIN_OPTIONS::appendRow()
{
int row = m_grid->GetNumberRows();
m_grid->AppendRows( 1 );
// wx documentation is wrong, SetGridCursor does not make visible.
m_grid->MakeCellVisible( row, 0 );
m_grid->SetGridCursor( row, 0 );
return row;
return m_grid->GetNumberRows() - 1;
}
void DIALOG_PLUGIN_OPTIONS::appendOption()
int DIALOG_PLUGIN_OPTIONS::appendOption()
{
int selected_row = m_listbox->GetSelection();
if( selected_row != wxNOT_FOUND )
int row = m_listbox->GetSelection();
if( row != wxNOT_FOUND )
{
wxString option = m_listbox->GetString( selected_row );
wxString option = m_listbox->GetString( row );
int row_count = m_grid->GetNumberRows();
int row;
for( row=0; row<row_count; ++row )
for( row = 0; row < m_grid->GetNumberRows(); ++row )
{
wxString col0 = m_grid->GetCellValue( row, 0 );
@ -177,12 +168,14 @@ void DIALOG_PLUGIN_OPTIONS::appendOption()
break;
}
if( row == row_count )
if( row == m_grid->GetNumberRows() )
row = appendRow();
m_grid->SetCellValue( row, 0, option );
m_grid_widths_dirty = true;
}
return row;
}
@ -211,35 +204,32 @@ void DIALOG_PLUGIN_OPTIONS::onListBoxItemDoubleClicked( wxCommandEvent& event )
void DIALOG_PLUGIN_OPTIONS::onAppendOption( wxCommandEvent& )
{
if( !m_grid->CommitPendingChanges() )
return;
appendOption();
m_grid->OnAddRow(
[&]() -> std::pair<int, int>
{
return { appendOption(), -1 };
} );
}
void DIALOG_PLUGIN_OPTIONS::onAppendRow( wxCommandEvent& )
{
if( !m_grid->CommitPendingChanges() )
return;
appendRow();
m_grid->OnAddRow(
[&]() -> std::pair<int, int>
{
return { appendRow(), 0 };
} );
}
void DIALOG_PLUGIN_OPTIONS::onDeleteRow( wxCommandEvent& )
{
if( !m_grid->CommitPendingChanges() )
return;
int curRow = m_grid->GetGridCursorRow();
m_grid->DeleteRows( curRow );
m_grid->OnDeleteRows(
[&]( int row )
{
m_grid->DeleteRows( row );
m_grid_widths_dirty = true;
curRow = std::max( 0, curRow - 1 );
m_grid->MakeCellVisible( curRow, m_grid->GetGridCursorCol() );
m_grid->SetGridCursor( curRow, m_grid->GetGridCursorCol() );
} );
}

View File

@ -33,6 +33,8 @@
static constexpr double MIN_SCALE = 0.01;
static constexpr double MAX_SCALE = 100.0;
wxPrintData* DIALOG_PRINT_GENERIC::s_printData = nullptr;
wxPageSetupDialogData* DIALOG_PRINT_GENERIC::s_pageSetupData = nullptr;
/**
@ -43,9 +45,8 @@ static constexpr double MAX_SCALE = 100.0;
class KI_PREVIEW_FRAME : public wxPreviewFrame
{
public:
KI_PREVIEW_FRAME( wxPrintPreview* aPreview, wxWindow* aParent,
const wxString& aTitle, const wxPoint& aPos = wxDefaultPosition,
const wxSize& aSize = wxDefaultSize ) :
KI_PREVIEW_FRAME( wxPrintPreview* aPreview, wxWindow* aParent, const wxString& aTitle,
const wxPoint& aPos = wxDefaultPosition, const wxSize& aSize = wxDefaultSize ) :
wxPreviewFrame( aPreview, aParent, aTitle, aPos, aSize )
{
}
@ -85,16 +86,10 @@ wxPoint KI_PREVIEW_FRAME::s_pos;
wxSize KI_PREVIEW_FRAME::s_size;
DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SETTINGS* aSettings )
: DIALOG_PRINT_GENERIC_BASE( aParent ),
m_config( nullptr ),
DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SETTINGS* aSettings ) :
DIALOG_PRINT_GENERIC_BASE( aParent ),
m_settings( aSettings )
{
// Note: for the validator, min value is 0.0, to allow typing values like 0.5
// that start by 0
m_scaleValidator.SetRange( 0.0, MAX_SCALE );
m_scaleCustomText->SetValidator( m_scaleValidator );
// Show m_panelPrinters only if there are printers to list:
m_panelPrinters->Show( m_panelPrinters->AsPrintersAvailable() );
@ -114,22 +109,10 @@ DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SE
}
DIALOG_PRINT_GENERIC::~DIALOG_PRINT_GENERIC()
{
}
void DIALOG_PRINT_GENERIC::ForcePrintBorder( bool aValue )
{
m_titleBlock->SetValue( aValue );
m_titleBlock->Hide();
if( m_config )
{
m_settings->Load( m_config );
m_settings->m_titleBlock = aValue;
m_settings->Save( m_config );
}
}
@ -138,27 +121,27 @@ void DIALOG_PRINT_GENERIC::saveSettings()
m_settings->m_scale = getScaleValue();
m_settings->m_titleBlock = m_titleBlock->GetValue();
m_settings->m_blackWhite = m_outputMode->GetSelection();
if( m_config )
m_settings->Save( m_config );
}
double DIALOG_PRINT_GENERIC::getScaleValue()
{
if( m_scale1->GetValue() )
{
return 1.0;
if( m_scaleFit->GetValue() )
}
else if( m_scaleFit->GetValue() )
{
return 0.0;
if( m_scaleCustom->GetValue() )
}
else if( m_scaleCustom->GetValue() )
{
double scale = 1.0;;
if( !m_scaleCustomText->GetValue().ToDouble( &scale ) )
{
DisplayInfoMessage( nullptr, _( "Warning: scale is not a number." ) );
DisplayInfoMessage( nullptr, _( "Warning: custom scale is not a number." ) );
setScaleValue( 1.0 );
scale = 1.0;
}
@ -166,17 +149,15 @@ double DIALOG_PRINT_GENERIC::getScaleValue()
{
scale = MAX_SCALE;
setScaleValue( scale );
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: scale set to a very large "
"value.\nIt will be clamped to %f." ),
scale ) );
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: custom scale is too large.\n"
"It will be clamped to %f." ), scale ) );
}
else if( scale < MIN_SCALE )
{
scale = MIN_SCALE;
setScaleValue( scale );
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: scale set to a very small "
"value.\nIt will be clamped to %f." ),
scale ) );
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: custom scale is too small.\n"
"It will be clamped to %f." ), scale ) );
}
return scale;
@ -218,9 +199,6 @@ bool DIALOG_PRINT_GENERIC::TransferDataToWindow()
if( !wxDialog::TransferDataToWindow() )
return false;
if( m_config )
m_settings->Load( m_config );
setScaleValue( m_settings->m_scale );
m_titleBlock->SetValue( m_settings->m_titleBlock );
m_outputMode->SetSelection( m_settings->m_blackWhite ? 1 : 0 );
@ -234,7 +212,7 @@ void DIALOG_PRINT_GENERIC::onPageSetup( wxCommandEvent& event )
wxPageSetupDialog pageSetupDialog( this, s_pageSetupData );
pageSetupDialog.ShowModal();
(*s_PrintData) = pageSetupDialog.GetPageSetupDialogData().GetPrintData();
(*s_printData ) = pageSetupDialog.GetPageSetupDialogData().GetPrintData();
(*s_pageSetupData) = pageSetupDialog.GetPageSetupDialogData();
}
@ -255,12 +233,11 @@ void DIALOG_PRINT_GENERIC::onPrintPreview( wxCommandEvent& event )
if( m_panelPrinters )
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
s_PrintData->SetPrinterName( selectedPrinterName );
s_printData->SetPrinterName( selectedPrinterName );
// Pass two printout objects: for preview, and possible printing.
wxString title = _( "Print Preview" );
wxPrintPreview* preview =
new wxPrintPreview( createPrintout( title ), createPrintout( title ), s_PrintData );
wxPrintPreview* preview = new wxPrintPreview( createPrintout( title ), createPrintout( title ), s_printData );
preview->SetZoom( 100 );
@ -313,9 +290,9 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
if( m_panelPrinters )
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
s_PrintData->SetPrinterName( selectedPrinterName );
s_printData->SetPrinterName( selectedPrinterName );
wxPrintDialogData printDialogData( *s_PrintData );
wxPrintDialogData printDialogData( *s_printData );
printDialogData.SetMaxPage( m_settings->m_pageCount );
wxPrinter printer( &printDialogData );
@ -331,7 +308,7 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
}
else
{
*s_PrintData = printer.GetPrintDialogData().GetPrintData();
*s_printData = printer.GetPrintDialogData().GetPrintData();
}
}
@ -364,38 +341,39 @@ void DIALOG_PRINT_GENERIC::onSetCustomScale( wxCommandEvent& event )
void DIALOG_PRINT_GENERIC::initPrintData()
{
if( !s_PrintData ) // First print
if( !s_printData ) // First print
{
s_PrintData = new wxPrintData();
s_printData = new wxPrintData();
if( !s_PrintData->Ok() )
if( !s_printData->Ok() )
DisplayError( this, _( "An error occurred initializing the printer information." ) );
s_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGH;
s_printData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGH;
}
if( !s_pageSetupData )
{
const PAGE_INFO& pageInfo = m_settings->m_pageInfo;
s_pageSetupData = new wxPageSetupDialogData( *s_PrintData );
s_pageSetupData = new wxPageSetupDialogData( *s_printData );
s_pageSetupData->SetPaperId( pageInfo.GetPaperId() );
s_pageSetupData->GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
if( pageInfo.IsCustom() )
{
if( pageInfo.IsPortrait() )
{
s_pageSetupData->SetPaperSize( wxSize( EDA_UNIT_UTILS::Mils2mm( pageInfo.GetWidthMils() ),
EDA_UNIT_UTILS::Mils2mm( pageInfo.GetHeightMils() ) ) );
}
else
{
s_pageSetupData->SetPaperSize( wxSize( EDA_UNIT_UTILS::Mils2mm( pageInfo.GetHeightMils() ),
EDA_UNIT_UTILS::Mils2mm( pageInfo.GetWidthMils() ) ) );
}
}
*s_PrintData = s_pageSetupData->GetPrintData();
*s_printData = s_pageSetupData->GetPrintData();
}
}
wxPrintData* DIALOG_PRINT_GENERIC::s_PrintData = nullptr;
wxPageSetupDialogData* DIALOG_PRINT_GENERIC::s_pageSetupData = nullptr;

View File

@ -85,8 +85,6 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
bSizerScaleCustom->Add( m_scaleCustom, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_scaleCustomText = new wxTextCtrl( bScaleSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_scaleCustomText->SetToolTip( _("Set X scale adjust for exact scale plotting") );
bSizerScaleCustom->Add( m_scaleCustomText, 1, wxEXPAND|wxRIGHT, 5 );

View File

@ -674,7 +674,7 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Set X scale adjust for exact scale plotting</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style"></property>
<property name="validator_type">wxDefaultValidator</property>

View File

@ -81,6 +81,12 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
bSizerBottom->Add( m_cbSchParity, 0, wxBOTTOM|wxLEFT, 5 );
bSizerBottom->Add( 0, 3, 0, wxEXPAND, 5 );
m_cbRefillZones = new wxCheckBox( this, wxID_ANY, _("Refill all zones before performing DRC"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerBottom->Add( m_cbRefillZones, 0, wxBOTTOM|wxLEFT, 5 );
bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
@ -95,7 +101,6 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );

View File

@ -50,7 +50,7 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_RC_JOB_BASE</property>
<property name="pos"></property>
<property name="size">443,239</property>
<property name="size">443,255</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h; forward_declare</property>
<property name="title"></property>
@ -774,6 +774,81 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="true">
<property name="height">3</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Refill all zones before performing DRC</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_cbRefillZones</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="false">

View File

@ -46,6 +46,7 @@ class KICOMMON_API DIALOG_RC_JOB_BASE : public DIALOG_SHIM
wxCheckBox* m_cbHaltOutput;
wxCheckBox* m_cbAllTrackViolations;
wxCheckBox* m_cbSchParity;
wxCheckBox* m_cbRefillZones;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
@ -56,7 +57,7 @@ class KICOMMON_API DIALOG_RC_JOB_BASE : public DIALOG_SHIM
public:
DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 443,239 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 443,255 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_RC_JOB_BASE();

View File

@ -22,12 +22,11 @@
*/
#include <dialogs/dialog_text_entry.h>
#include <string_utils.h>
WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent,
const wxString& aFieldLabel,
const wxString& aCaption,
const wxString& aDefaultValue,
WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent, const wxString& aFieldLabel,
const wxString& aCaption, const wxString& aDefaultValue,
bool aExtraWidth ) :
WX_TEXT_ENTRY_DIALOG_BASE( aParent, wxID_ANY, aCaption, wxDefaultPosition, wxDefaultSize )
{
@ -39,6 +38,10 @@ WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent,
m_textCtrl->SetValue( aDefaultValue );
m_textCtrl->SetMinSize( FromDIP( aExtraWidth ? wxSize( 700, -1 ) : wxSize( 300, -1 ) ) );
// DIALOG_SHIM needs a title- and label-specific hash_key so we don't save/restore state between
// usage cases.
m_hash_key = TO_UTF8( aCaption + aFieldLabel );
SetupStandardButtons();
SetInitialFocus( m_textCtrl );
@ -48,34 +51,6 @@ WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent,
}
WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent, const wxString& aLabel,
const wxString& aCaption,
const wxString& aDefaultValue,
const wxString& aChoiceCaption,
const std::vector<wxString>& aChoices,
int aDefaultChoice ) :
WX_TEXT_ENTRY_DIALOG( aParent, aLabel, aCaption, aDefaultValue )
{
m_choiceLabel->SetLabel( aChoiceCaption );
m_choiceLabel->Show( true );
for( const wxString& choice : aChoices )
m_choice->Append( choice );
m_choice->SetSelection( aDefaultChoice );
m_choice->Show( true );
this->Layout();
m_mainSizer->Fit( this );
}
void WX_TEXT_ENTRY_DIALOG::SetTextValidator( wxTextValidatorStyle style )
{
SetTextValidator( wxTextValidator(style) );
}
void WX_TEXT_ENTRY_DIALOG::SetTextValidator( const wxTextValidator& validator )
{
m_textCtrl->SetValidator( validator );
@ -88,8 +63,3 @@ wxString WX_TEXT_ENTRY_DIALOG::GetValue() const
}
int WX_TEXT_ENTRY_DIALOG::GetChoice() const
{
return m_choice->GetCurrentSelection();
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -26,25 +26,6 @@ WX_TEXT_ENTRY_DIALOG_BASE::WX_TEXT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindow
m_ContentSizer->Add( m_textCtrl, 0, wxEXPAND|wxALL, 5 );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
m_choiceLabel = new wxStaticText( this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
m_choiceLabel->Wrap( -1 );
m_choiceLabel->Hide();
bSizer3->Add( m_choiceLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
wxArrayString m_choiceChoices;
m_choice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceChoices, 0 );
m_choice->SetSelection( 0 );
m_choice->Hide();
bSizer3->Add( m_choice, 3, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_ContentSizer->Add( bSizer3, 1, wxEXPAND, 5 );
m_mainSizer->Add( m_ContentSizer, 1, wxALL|wxEXPAND, 5 );

View File

@ -1,34 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="17"/>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_text_entry_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">dialog_text_entry_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
@ -80,10 +82,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -142,10 +144,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -169,7 +171,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">300,-1</property>
@ -198,144 +200,6 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">1</property>
<property name="id">wxID_ANY</property>
<property name="label">MyLabel</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choiceLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
<property name="proportion">3</property>
<object class="wxChoice" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">1</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choice</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="false">

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -18,14 +18,12 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class WX_TEXT_ENTRY_DIALOG_BASE
///////////////////////////////////////////////////////////////////////////////
@ -37,8 +35,6 @@ class WX_TEXT_ENTRY_DIALOG_BASE : public DIALOG_SHIM
wxBoxSizer* m_mainSizer;
wxStaticText* m_label;
wxTextCtrl* m_textCtrl;
wxStaticText* m_choiceLabel;
wxChoice* m_choice;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;

View File

@ -24,6 +24,7 @@
#include <eda_draw_frame.h>
#include <dialogs/dialog_unit_entry.h>
#include <string_utils.h>
WX_UNIT_ENTRY_DIALOG::WX_UNIT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aCaption,
@ -34,6 +35,10 @@ WX_UNIT_ENTRY_DIALOG::WX_UNIT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxStr
m_label->SetLabel( aLabel );
m_unit_binder.SetValue( aDefaultValue );
// DIALOG_SHIM needs a title- and label-specific hash_key so we don't save/restore state between
// usage cases.
m_hash_key = TO_UTF8( aCaption + aLabel );
SetInitialFocus( m_textCtrl );
SetupStandardButtons();
@ -66,6 +71,10 @@ WX_PT_ENTRY_DIALOG::WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString&
m_unit_binder_x.SetValue( aDefaultValue.x );
m_unit_binder_y.SetValue( aDefaultValue.y );
// DIALOG_SHIM needs a title- and label-specific hash_key so we don't save/restore state between
// usage cases.
m_hash_key = TO_UTF8( aCaption + aLabelX + aLabelY );
SetInitialFocus( m_textCtrlX );
SetupStandardButtons();

View File

@ -27,6 +27,7 @@
#include <eda_draw_frame.h>
#include <string_utils.h>
#include <macros.h>
#include <wx/checkbox.h>
#include "lib_tree_model_adapter.h"
// wxWidgets spends *far* too long calculating column widths (most of it, believe it or
@ -78,6 +79,22 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( wxWindow* aParent, const wxString& aTitle, boo
}
void EDA_LIST_DIALOG::AddExtraCheckbox( const wxString& aLabel, bool* aValuePtr )
{
wxCHECK2_MSG( aValuePtr, return, wxT( "Null pointer for checkbox value." ) );
int flags = wxBOTTOM;
if( m_ExtrasSizer->GetItemCount() > 0 )
flags |= wxTOP;
wxCheckBox* cb = new wxCheckBox( this, wxID_ANY, aLabel );
cb->SetValue( *aValuePtr );
m_ExtrasSizer->Add( cb, 0, flags, 5 );
m_extraCheckboxMap[cb] = aValuePtr;
}
bool EDA_LIST_DIALOG::Show( bool show )
{
bool retVal = DIALOG_SHIM::Show( show );
@ -209,6 +226,13 @@ wxString EDA_LIST_DIALOG::GetTextSelection( int aColumn )
}
void EDA_LIST_DIALOG::GetExtraCheckboxValues()
{
for( const auto& [checkbox, valuePtr] : m_extraCheckboxMap )
*valuePtr = checkbox->GetValue();
}
void EDA_LIST_DIALOG::Append( const wxArrayString& itemList )
{
long itemIndex = m_listBox->InsertItem( m_listBox->GetItemCount(), itemList[0] );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -31,6 +31,11 @@ EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, con
m_filterBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bMargins->Add( m_filterBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_ExtrasSizer = new wxBoxSizer( wxVERTICAL );
bMargins->Add( m_ExtrasSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerMain->Add( bMargins, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );

View File

@ -1,41 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">eda_list_dialog_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">eda_list_dialog_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center">wxBOTH</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="event_handler">decl_pure_virtual</property>
<property name="extra_style"></property>
@ -57,33 +60,33 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnSize">onSize</event>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -96,6 +99,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -132,19 +136,19 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">3</property>
<object class="wxListCtrl" expanded="1">
<object class="wxListCtrl" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -157,6 +161,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -195,19 +200,19 @@
<event name="OnListItemActivated">onListItemActivated</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<object class="wxTextCtrl" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -220,6 +225,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -230,7 +236,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
@ -260,22 +266,33 @@
<event name="OnText">textChangeInFilterBox</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">m_ExtrasSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">public</property>
</object>
</object>
<object class="sizeritem" expanded="1">
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">m_ButtonsSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">public</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">1</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<object class="wxStdDialogButtonSizer" expanded="true">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -25,7 +25,6 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class EDA_LIST_DIALOG_BASE
///////////////////////////////////////////////////////////////////////////////
@ -48,6 +47,7 @@ class EDA_LIST_DIALOG_BASE : public DIALOG_SHIM
public:
wxBoxSizer* m_ExtrasSizer;
wxBoxSizer* m_ButtonsSizer;
EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );

Some files were not shown because too many files have changed in this diff Show More