Compare commits

...

188 Commits

Author SHA1 Message Date
Wayne Stambaugh e8553dcdf7 Tag stable version 8.0.5. 2024-09-06 12:28:40 -04:00
Alex Shvartzkop dc3012933a Restore a string in Altium parser. 2024-09-06 19:13:28 +03:00
Seth Hillbrand 291ff615bc Update translations 2024-09-06 09:03:13 -07:00
Hanna Breisand 26d1080e52 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Oliver0804 c1452a24d2 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 99.3% (9127 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hant/
2024-09-06 18:02:20 +02:00
Hanna Breisand 34c833966f Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Julio Dias f0e1bc3562 Translated using Weblate (Portuguese)
Currently translated at 99.1% (9111 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt/
2024-09-06 18:02:20 +02:00
Allan Nordhøy 6da9034322 Translated using Weblate (Norwegian Bokmål)
Currently translated at 48.6% (4467 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nb_NO/
2024-09-06 18:02:20 +02:00
김랑기 6887e8cbe3 Translated using Weblate (Korean)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-06 18:02:20 +02:00
Hanna Breisand 89ef5986e7 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
김랑기 5572a72bb3 Translated using Weblate (Korean)
Currently translated at 99.5% (9152 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ko/
2024-09-06 18:02:20 +02:00
Tokita, Hiroshi b40e446149 Translated using Weblate (Japanese)
Currently translated at 99.5% (9150 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-09-06 18:02:20 +02:00
Toni Laiho 757bfd7b32 Translated using Weblate (Finnish)
Currently translated at 99.7% (9165 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-09-06 18:02:20 +02:00
Henrik Kauhanen c5e1c3db62 Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
dsa-t b25ff44ff7 Translated using Weblate (Russian)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-09-06 18:02:20 +02:00
Jan Straka cad7a18fa0 Translated using Weblate (Czech)
Currently translated at 84.1% (7731 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-09-06 18:02:20 +02:00
CloverGit 1c3637cb33 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:20 +02:00
Hanna Breisand 3a5f84d1ec Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:20 +02:00
Henrik Kauhanen 44f8df592b Translated using Weblate (Swedish)
Currently translated at 99.9% (9190 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
CloverGit 17e19f8652 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:19 +02:00
Hanna Breisand 34fe104431 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Henrik Kauhanen 2bdb155838 Translated using Weblate (Swedish)
Currently translated at 99.9% (9189 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Andrej Valek 22ebade907 Translated using Weblate (Slovak)
Currently translated at 64.7% (5955 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sk/
2024-09-06 18:02:19 +02:00
Dmitry Mikhirev 9d594214fe Translated using Weblate (Russian)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-09-06 18:02:19 +02:00
Peter B 2c89717c0a Translated using Weblate (Romanian)
Currently translated at 27.1% (2491 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-09-06 18:02:19 +02:00
Grzegorz Szymaszek 7574a46a19 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:19 +02:00
ZbeeGin e5c4d75ce1 Translated using Weblate (Polish)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:19 +02:00
CJ van der Hoeven f038ee3083 Translated using Weblate (Dutch)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-09-06 18:02:19 +02:00
Pferd O e1ab2a0836 Translated using Weblate (German)
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-09-06 18:02:19 +02:00
CloverGit 9070d9ff22 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.8% (9181 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-09-06 18:02:19 +02:00
Henrik Kauhanen 606c19780d Translated using Weblate (Swedish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Hanna Breisand 8fecebb209 Translated using Weblate (Swedish)
Currently translated at 99.7% (9172 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-09-06 18:02:19 +02:00
Peter B da8e1be1c8 Translated using Weblate (Romanian)
Currently translated at 27.0% (2490 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ro/
2024-09-06 18:02:18 +02:00
Wellington Terumi Uemura e14a3caf18 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pt_BR/
2024-09-06 18:02:18 +02:00
Marek 5afb3ad5cc Translated using Weblate (Polish)
Currently translated at 99.9% (9188 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-09-06 18:02:18 +02:00
Ulices b29ca47f25 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9191 of 9191 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-09-06 18:02:18 +02:00
Alex Shvartzkop 5d1737d654 Fix compatibility with EasyEDA/LCEDA Pro v2.2.26
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18620

(cherry picked from commit 16d9fa7f25)
2024-09-06 16:04:24 +03:00
Alex Shvartzkop bdc371f057 Altium PCB import: fix textbox and text placement.
Especially when rotated and/or mirrored.

It's not perfect but it's close enough to being correct.

See https://gitlab.com/kicad/code/kicad/-/issues/18417
2024-09-05 03:52:22 +03:00
Alex Shvartzkop dc2dd20ec7 Altium PCB import: don't add stroke width to text height.
For stroke fonts, KiCad's metrics are very similar to Altium's,
so there's no need to add more height.
2024-09-05 03:52:18 +03:00
Alex Shvartzkop 057174caa0 Altium PCB import: don't override text alignment in ConvertTexts6ToEdaTextSettings.
It is set already at callsite, no need to override.
2024-09-05 03:52:12 +03:00
Alex Shvartzkop 4b035d5b5c Altium PCB import: convert arcs with very small angle to segments.
See mb1791_bdp.zip for example.
2024-09-05 03:52:08 +03:00
jean-pierre charras b22948988f Fix a side effect of commit 513d659c (master) or 55fafe34 (8.0 branch)
This commit modify the order of end points of flipped graphic lines, and
create a DRC issue for flipped footprints (if flipped before this commit).
For segments inside a footprint, the "old" way to flip a segment is now
reused. Expecting this ugly fix is only temporary.
2024-09-03 16:17:31 +02:00
Seth Hillbrand 7a05d58b3e Fix some textbox imports
We still don't know why some Altiums seem to save 0s for the textbox
size when dealing with text strings and some still save values.  There
must be another flag to differentiate between text strings and text
boxes but we haven't found it yet.  But until then, we still need to
link the correct string with the textbox that we generate and suppress
the border

(cherry picked from commit 5332d44bad)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18502
2024-09-02 16:23:28 -07:00
Jon Evans 695ab290e6 Add swig4.2 for linux platforms find
(cherry picked from commit 723fa57b84)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-08-30 15:28:00 +00:00
Jeff Young 54a373a7e2 Push thickness handling down into EDA_TEXT::SetBold().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17077

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

(cherry picked from commit aef87b9796)
2024-08-28 13:47:29 +01:00
jean-pierre charras 637f331724 French translation update 2024-08-28 14:17:35 +02:00
Wayne Stambaugh 931a9697ca Tag stable version 8.0.5 release candidate 1. 2024-08-26 17:15:42 -04:00
Seth Hillbrand 5ffc58844f Update translations 2024-08-26 14:05:46 -07:00
Hanna Breisand 3ea2c6f1ff Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-08-26 23:03:53 +02:00
Balázs Meskó 2cba724659 Translated using Weblate (Hungarian)
Currently translated at 3.3% (312 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/hu/
2024-08-26 23:03:52 +02:00
Ulices 254260a616 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-08-26 23:03:52 +02:00
Pferd O 45b13d513b Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:52 +02:00
CloverGit ba86c3ac75 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
YÜKSEL AÇIKGÖZ 19d4c31fcc Translated using Weblate (Turkish)
Currently translated at 59.4% (5470 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:52 +02:00
CloverGit 160f69d720 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 4fa42960e9 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 9c4ca6da14 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
Jan Straka c113385016 Translated using Weblate (Czech)
Currently translated at 83.8% (7710 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-08-26 23:03:52 +02:00
Henrik Kauhanen 68e37a93ec Translated using Weblate (Swedish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/sv/
2024-08-26 23:03:52 +02:00
109247019824 9b158e70f5 Translated using Weblate (Bulgarian)
Currently translated at 7.6% (704 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/bg/
2024-08-26 23:03:52 +02:00
Free_squire ab536192c3 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:52 +02:00
Tokita, Hiroshi bc87b0db60 Translated using Weblate (Japanese)
Currently translated at 99.4% (9140 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ja/
2024-08-26 23:03:52 +02:00
ivit VT 981f82db93 Translated using Weblate (Czech)
Currently translated at 82.9% (7624 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/cs/
2024-08-26 23:03:52 +02:00
CloverGit b6f5aeba1e Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:52 +02:00
CloverGit 4fa34677ea Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:51 +02:00
Ulices c67346991f Translated using Weblate (Spanish (Mexico))
Currently translated at 99.6% (9165 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/es_MX/
2024-08-26 23:03:51 +02:00
Laurens Holst 811de6a462 Translated using Weblate (Dutch)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/nl/
2024-08-26 23:03:51 +02:00
YÜKSEL AÇIKGÖZ cfe7992723 Translated using Weblate (Turkish)
Currently translated at 59.3% (5456 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:51 +02:00
Pferd O 8c84f2ac23 Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
YÜKSEL AÇIKGÖZ fb23d62b6b Translated using Weblate (Turkish)
Currently translated at 58.5% (5383 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/tr/
2024-08-26 23:03:51 +02:00
dsa-t 84f182ef03 Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:51 +02:00
Ignas Brašiškis 987d151977 Translated using Weblate (Lithuanian)
Currently translated at 50.7% (4670 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/lt/
2024-08-26 23:03:51 +02:00
Toni Laiho c622da5fbf Translated using Weblate (Finnish)
Currently translated at 99.8% (9182 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/fi/
2024-08-26 23:03:51 +02:00
Pferd O 19f163b724 Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
ZbeeGin 3fcf207443 Translated using Weblate (Polish)
Currently translated at 99.9% (9192 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/pl/
2024-08-26 23:03:51 +02:00
Pferd O 4814f29fbd Translated using Weblate (German)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
Alex Life 39f4ea5ffa Translated using Weblate (Russian)
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/ru/
2024-08-26 23:03:51 +02:00
tct123 5d08531ecb Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
Pferd O 4a0fdfd2ab Translated using Weblate (German)
Currently translated at 99.6% (9159 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/de/
2024-08-26 23:03:51 +02:00
CloverGit c88aab3a4f Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (9194 of 9194 strings)

Translation: KiCad EDA/v8
Translate-URL: https://hosted.weblate.org/projects/kicad/v8/zh_Hans/
2024-08-26 23:03:51 +02:00
Seth Hillbrand bf4aebff4d Update Altium importer to use textbox flag
Textboxes in Altium might have intrinsic borders that don't count in
their text width, so we need to buffer this in KiCad

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

(cherry picked from commit ecd27883b6)
2024-08-26 14:02:35 -07:00
Alex Shvartzkop 39627bfcfa Parse more Altium data related to Text6.
(cherry picked from commit 881d0184bb)
2024-08-26 13:22:23 -07:00
jean-pierre charras 55fafe3401 Fix incorrect flip for graphic segments.
For some obscure reason, the end points of segments were swapped.
Note graphic RECTANGLE shapes have still an issue when flipped, but this
is a very different issue.
From master branch
2024-08-26 19:50:39 +02:00
jean-pierre charras dd870deec5 RENDER_SETTINGS: try a slightly modified dot calculation. 2024-08-25 17:18:30 +02:00
jean-pierre charras 7ecf18ba80 EEschema, print: fix incorrect sheet order and uninitialized sheet number
The displayed sheet number was not updated.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18594
2024-08-25 16:14:43 +02:00
jean-pierre charras 68e4ccf196 RENDER_SETTINGS: fix issue when using dotted lines.
At some levels, these lines (drawn as dots) were not visible.
They are now drawn as short lines.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16757
2024-08-24 20:48:02 +02:00
jean-pierre charras 0a28398944 Gerbview: fix arc to segment approximation when drawing Regions (polygons)
The approx was 36 segments per 360 deg. But this is not good for arcs having
a small arc angle and a large radius.
The fix uses a max error (currently 5 microns) to calculate the approximation.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18587
2024-08-23 10:47:55 +02:00
jean-pierre charras 27002f568b BOARD::GetBoardPolygonOutlines(): Protect against malformed NPTH pads
In some cases, when modifying a pad (SMD -> NPTH from properties panel, one
can generate a NPTH pad with a zero sized hole. Pcbnew can crash with such a pad,
especially if the 3D viewer is shown during modification.
From master branch.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18585
2024-08-22 11:12:47 +02:00
Maciej Suminski 9b5840b7ee Text variable resolving in footprint text boxes
Mostly a code copy from PCB_TEXT::GetShownText() to
PCB_TEXTBOX::GetShownText().

Cherry-picked 5ad5be09 (sans m_ResolveTextRecursionDepth advanced
config, not present in 8.0).
2024-08-17 00:08:14 +00:00
Mark Roszko 5a3f8b4235 Disconnect events in ~ACTION_TOOLBAR 2024-08-16 07:13:39 -04:00
Mark Roszko 7be78d50a4 Unbind events in KISTATUSBAR destructor 2024-08-16 07:04:40 -04:00
Mark Roszko b1f861137e Add missing unbinds to STD_BITMAP_BUTTON 2024-08-16 07:04:35 -04:00
Mark Roszko 3e3a958d4f Add missing unbind to PANEL_KICAD_LAUNCHER 2024-08-16 07:04:30 -04:00
Mark Roszko cc5a3eb61f Disconnect events used in EDA_BASE_FRAME 2024-08-16 07:03:16 -04:00
Mark Roszko eabf2f57aa Don't see horizontal layout on the vertical toolbar
Wild glitching on arm64 Windows revealed this was set, lol.
2024-08-16 07:02:53 -04:00
Mark Roszko 1667b1312e Unbind the char events in KICAD_MANAGER_FRAME destructor 2024-08-16 07:02:15 -04:00
Mark Roszko 1123a25f04 unbind/disconnect in PROJECT_TREE_PANE destructor 2024-08-15 22:26:28 -04:00
Mark Roszko ef757ffd28 Unbind BITMAP_BUTTON events during destruct 2024-08-15 22:26:02 -04:00
JamesJCode f63d018f1c PNS: Use correct diff pair width / gap settings when starting route
(cherry picked from commit 364f6d4213)
2024-08-15 19:52:03 +01:00
Wayne Stambaugh 83de056de9 Fix missing schematic symbol instance data.
This fix adds missing symbol instance data that defaults the instance
data to no annotation which will will trigger a annotation request on
any operations that require a fully annotated schematic.

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

(cherry picked from commit 0cf1110367)
2024-08-15 07:31:25 -04:00
JamesJCode 015906d862 PNS: Include net when querying DRC for initial track width
(cherry picked from commit 67b9170146)
2024-08-15 09:09:06 +01:00
Jan Wichmann c288c469fb pcbnew: The checkbox 'Center on footprint' was not disabled when the actionButton was changed. 2024-08-14 21:40:18 +00:00
JamesJCode 7a8efc1d27 Report track clearance constraint from DRC rule if >= board minimum
(cherry picked from 013fa4824b)
2024-08-14 22:11:35 +01:00
JamesJCode aaaa8a8835 Use correct track width constraint when starting PNS from footprint
(cherry picked from a6a62b1be5)
2024-08-14 22:07:09 +01:00
JamesJCode 2891c580b1 Correctly handle track clearance constraints in router
(cherry picked from 72a0c41e3d)
2024-08-14 21:48:46 +01:00
Seth Hillbrand 97d75ae844 Remove last cherry-pick
Already existed in 8 branch.
2024-08-14 13:41:03 -07:00
Seth Hillbrand 7ccc89196b Avoid losing the last point when simplifying
line chains that are not closed should avoid simplifying between
beginning and end points.  Make sure that we keep the finishing point
for these chains

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

(cherry picked from commit b71eb1186f)
(cherry picked from commit 6ed537753c)
2024-08-14 13:05:40 -07:00
JamesJCode 7774145a8f Update message panel when placing a via with interactive router
(cherry picked from commit 41ff744f1e)
2024-08-14 17:40:19 +01:00
Kacper Słomiński 0bf2d2ca32 Fix build issue with experimental GCC version 15.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18539

(cherry picked from commit e6bcc6d0a6)
2024-08-14 07:48:02 -04:00
jean-pierre charras 6338a69f17 Pcbnew: fix 2 issues after removing a track, especially ending on a teardrop
- Message panel display not always correctly updated (shows an old data)
- Incorrect updated ratsnest is some cases when removing a track ending on
a teardrop.

From master branch.
2024-08-14 08:27:22 +02:00
Jeff Young 5f8ba6f9a1 Revert commit not meant for 8.0. 2024-08-13 21:30:20 -06:00
Jeff Young a53bbd92f5 Don't presume CreatePin/RepeatPin() return something.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18540

(cherry picked from commit 7c4fe35589)
2024-08-13 21:13:07 -06:00
Jeff Young aa71423d5f Fix missing parameter.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18530

(cherry picked from commit 8a487c2c86)
2024-08-13 21:11:23 -06:00
Jeff Young f3ae7afec2 Set sheetpath for ERCE_MISSING_UNIT errors.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18445

(cherry picked from commit 22d37f6c34)
2024-08-13 21:11:15 -06:00
Mark Roszko 29194761e5 Update vcpkg-configuration.json 2024-08-13 23:49:44 +00:00
Jon Evans f56c05ac3e Fix broken cherry-pick 2024-08-12 23:06:56 -04:00
Jon Evans 15256b379c Ensure constraints when changing pad hole properties
Also expose hole shape to properties system

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

(cherry picked from commit c9af2f318f)
2024-08-12 23:06:09 -04:00
Jon Evans b4113decc5 Fixes for snapping in free via placer
Support snapping to graphics at all
Don't skip snapping to pads with no net
Treat placing vias as placing tracks for magnetic settings

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


(cherry picked from commit 960a9ef7d5)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-08-13 02:49:34 +00:00
aris-kimi b249932888 Fixes cherry-pick for 2 previous commits 2024-08-11 21:54:18 +00:00
Jeff Young 6b6057b194 Clean up more exception processing in simulation GUI.
This allows us to more correctly report errors without
dialog issues, logs popping up, etc.

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

7f6ab7043b from master
2024-08-11 21:54:18 +00:00
aris-kimi b9623e9359 Fixes a crash when ctrl+x a kicad var from the field
and leave as a starting char '/'

Also fixes a typo and updates the wxFormBuilder file

e59417aff3 from master
2024-08-11 21:54:18 +00:00
Wayne Stambaugh 735b05ba30 Add '?' to list of forbidden file name characters.
(cherry picked from commit aace2271df)
2024-08-11 07:19:35 -04:00
jean-pierre charras 62724f9cb6 pcbnew, PCB_IO_ALTIUM_DESIGNER: fix issues when converting a lib to kicad format.
- add the patch from RigoLigoRLC
- fix issue with illegal chars in filename the char * was missing in list.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18452
2024-08-11 09:30:22 +02:00
Wayne Stambaugh 2e4dd4bc3f Fix CLI PCB drill export when output path does not end with path separator.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14438

(cherry picked from commit b6734c42f0)
2024-08-07 16:18:25 -04:00
jean-pierre charras 87139ce571 3E viewer: fix incorrect custom pad shape in some cases.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18495
2024-08-06 13:50:25 +02:00
jean-pierre charras 582d2e7bdb PCB_IO_GEDA: fix broken function GetEnumeratedFootprint().
The code was old and not updated to actual io code.
Just removed to use the generic code.
From master branch
2024-08-05 20:21:11 +02:00
Jeff Young 5c89937870 Make target length sticky within a session.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18109

(cherry picked from commit 937854c577)
2024-08-01 14:38:43 +01:00
Jeff Young 412e244d48 Text is a single-click-place.
Also, don't run normal undo code when in the middle of
placing an item.

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

(cherry picked from commit f6c723ba37)
2024-08-01 14:38:38 +01:00
jean-pierre charras 0940565025 DIALOG_SIM_MODEL: fix a focus issue (missing aEvent.Skip()).
From master branch.
2024-07-31 16:45:02 +02:00
jean-pierre charras c5b2e859c1 DRC test: Fix missing filter of DRCE_OVERLAPPING_FOOTPRINTS test.
When the DRCE_OVERLAPPING_FOOTPRINTS tests were disabled, the markers were
still created, because the code that created them did not test if the
DRCE_OVERLAPPING_FOOTPRINTS drc test is enabled or not.
From master branch
2024-07-30 14:21:36 +02:00
jean-pierre charras e06a8131c5 pcbnew: fix a bug when pasting a footprint (after a copy command)
The paste code removed items managed by the footprint when they are not on
an enabled layer.
This is a bug: all items must be kept in the parent footprint.
This is the only one command that tried to remove such items.
Other commands (Ctrl+D, load Footprint and read netlist) do not delete any item

Frm master branch
2024-07-28 20:08:18 +02:00
jean-pierre charras 16dee8608b DIALOG_FOOTPRINT_CHOOSER: fix some min sizes to avoid not visible widgets.
From master branch
2024-07-28 12:31:49 +02:00
Jeff Young 396e531e7c Cleanup. 2024-07-23 11:36:56 +01:00
Jeff Young 24c234fd93 Don't attempt to rename field more than once.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18330

(cherry picked from commit e9d376c912)
2024-07-23 11:36:56 +01:00
Jeff Young fdbe35e20c Give padstack warning violation a name.
Also regularises capitalisation & parens in some error
messages.

Also de-duplicates hole testing for PTH pads, and SMD
rationality testing.

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

(cherry picked from commit 8b948e7b9c)
2024-07-23 11:36:56 +01:00
Jeff Young cc3e3ee34c Clear fields when flag is set.
Also make sure we set aUpdated when deleting extra
text items or fields, and when updating fabrication
attributes or 3D models.

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

(cherry picked from commit dab3972165)
2024-07-23 11:36:56 +01:00
Jeff Young d0da1725ca Allow deleting text item out of parent footprint in PCB editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18425

(cherry picked from commit 87ee56b582)
2024-07-23 11:36:56 +01:00
Alex Shvartzkop 7e115249af Hide notification panel on focus loss.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17295
2024-07-22 13:33:08 +03:00
Jeff Young 07e8edfcdf Remove asserts for valid states.
(A pin won't have a connection until after the connection
graph has been rebuilt.)

KICAD-6S1

(cherry picked from commit c378e6f690)
2024-07-21 21:01:14 +01:00
Jeff Young cbb2c187bd Fix scoping of lock.
(cherry picked from commit d5c7ac5065)
2024-07-21 21:01:14 +01:00
Alex Shvartzkop 011018b002 Improve alignment of KiCad 16/24/32 px icons.
(cherry picked from commit 5b2ea411f8)
2024-07-21 21:29:42 +03:00
Alex Shvartzkop d3a44607e6 Generate hidpi variants for mid size (_24) application icons.
(cherry picked from commit 0e66adbca1)
2024-07-21 21:29:42 +03:00
Jeff Young 1ad3532740 Ooops. That commit wasn't for 8.0 (as the var doesn't exist there). 2024-07-21 13:40:14 +01:00
Jeff Young 26caad8b35 Tidy up string find API usages.
(cherry picked from commit bab97f91cc)
2024-07-21 13:40:14 +01:00
Alex Shvartzkop f1da2e90d7 Fix EasyEDA/JLCEDA Pro 2.2 footprint/symbol library import.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18250

(cherry picked from commit 1613816e77)
2024-07-21 15:38:57 +03:00
Alex Shvartzkop 59492bd947 Add mutex include.
(cherry picked from commit cc96de29e6)
2024-07-21 15:26:58 +03:00
Jeff Young 7b96cc3d0c Hand-cherry-pick some fixes from master. 2024-07-21 13:22:01 +01:00
Jeff Young df873158bc Slight increase to round-off error tolerance.
(It's now 2nm, which is still significantly below the
clearance DRC epsilon of 500nm.  It's also what we
already use in EDA_SHAPE.)

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

(cherry picked from commit c8e8545e47)
2024-07-21 13:22:01 +01:00
Jeff Young f88e1aa279 Fix uninitialized variable.
(cherry picked from commit 1833330e5c)
2024-07-21 13:22:01 +01:00
Alex Shvartzkop a02f12c68a std::set::contains is C++20-only, use find instead. 2024-07-21 15:18:44 +03:00
Alex Shvartzkop cc141e346d Tweak GRID_CELL_STC_EDITOR offset on GTK.
(cherry picked from commit ab531a33d9)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop f5954b0d7d Fix some warnings.
(cherry picked from commit affcfed677)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop 6bb1e59e10 Improve grid cell editors appearance.
(cherry picked from commit 76b7cdd128)
2024-07-21 15:18:44 +03:00
Alex Shvartzkop ced6b1cbb7 Improve custom grid cell editors' margins on MSW.
(cherry picked from commit 1516aaf163)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop d1d7d0eb05 Remove macOS size tweak in custom grid cell editors.
Since the text field now has the no-border flag, it shouldn't be needed.

(cherry picked from commit aa51cc5167)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop e1e196f1b1 Fix default cell alignment and FBP file for Configure Paths dialog.
(cherry picked from commit 49dcd5f4fc)
2024-07-21 13:44:15 +03:00
Alex Shvartzkop b55d760cd5 Make grid cell editors with extra button consistent with normal text cell editors.
(cherry picked from commit 5d22c1adee)
2024-07-21 13:40:21 +03:00
Alex Shvartzkop b0a0408528 Create STATUS_TEXT_POPUP on demand when moving PCB items.
So we don't have to spend 115 ms destroying it.

(cherry picked from commit 8d7c60eb3e)
2024-07-21 13:31:45 +03:00
Alex Shvartzkop d238a149a6 Send data to correct sch port when changing selection in PCB editor.
Not that cross-probing works like this though.
But this prevents the UpdateAllLayersColor call.
(-356 ms in https://gitlab.com/kicad/code/kicad/-/issues/18148)

(cherry picked from commit e2b5f4559e)
2024-07-21 13:31:03 +03:00
Alex Shvartzkop 57d2f7209a Use std::set::contains instead of alg::contains in UpdateTeardrops.
(-356 ms on https://gitlab.com/kicad/code/kicad/-/issues/18148 when placing)

(cherry picked from commit 70296107b4)
2024-07-21 13:30:39 +03:00
Alex Shvartzkop 8d08992c24 Shut down curl operations before global cleanup.
Fixes KICAD-7DP
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17103

(cherry picked from commit 0a53fc41a7)
2024-07-21 13:28:31 +03:00
Alex Shvartzkop 9938e7f723 Don't limit ngspice netlist lines to 1024 bytes.
Otherwise the loop just makes infinite 1-byte allocations
and keeps appending \n.

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

(cherry picked from commit a1b4e09cec)
2024-07-21 13:27:53 +03:00
Alex Shvartzkop 17ad578675 QA: add another test case for SHAPE_LINE_CHAIN::Slice.
This causes it to break on MSVC Release as well.

See https://gitlab.com/kicad/code/kicad/-/issues/18391

(cherry picked from commit 0e4ed5a032)
2024-07-21 13:25:57 +03:00
Alex Shvartzkop 044dd59c5c QA: add two more tests for SHAPE_LINE_CHAIN::Slice.
"Case 9: Start at middle of a 2nd arc, finish at end" should throw a fatal assert in Debug.

See https://gitlab.com/kicad/code/kicad/-/issues/18391

(cherry picked from commit 0b06ed987e)
2024-07-21 13:25:57 +03:00
Alex Shvartzkop 6ef90cfa18 Add bounds checking when slicing SHAPE_LINE_CHAIN from the middle of the last arc.
(and said arc is the last shape in the chain)

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

(cherry picked from commit 63eac0382c)
2024-07-21 13:24:17 +03:00
Jeff Young 7abf4c2d91 Save visible columns to correct settings.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18352

(cherry picked from commit 22321c93f0)
2024-07-21 11:16:57 +01:00
Jeff Young 896ff72019 Formatting.
(cherry picked from commit 8ae111bd82)
2024-07-21 11:16:57 +01:00
jean-pierre charras 9c2eeb54fc Ensure non handled text properties are never written in .kicad_pcb files
ctl_flags.h: fix two duplicate flag values.
From master branch
2024-07-21 08:46:44 +02:00
jean-pierre charras 69f583660f Move all CTL_OMIT_xxx flags definitions into a new file ctl_flags.h
Previously, they were defined in different files, and sometimes redefined.
This change should not create an actual code change.
However, this move shows there are the same value used for different flags,
so another fix should be made later.

From master branch
2024-07-21 08:46:44 +02:00
Mark Roszko 6334c733e1 Update 2 files
- /vcpkg-configuration.json
- /vcpkg.json
2024-07-21 01:19:06 +00:00
Mathieu Pilato a50144f889 Fix measurement format not saved when modified
Always update stored measurements name / format when updating measurement

(cherry picked from commit c8aa3f21aa)
2024-07-20 21:52:05 +01:00
Mathieu Pilato 1ed85d521d Move default format inside SPICE_VALUE_FORMAT
This ensures that the default format is the same, however the measurements are added

(cherry picked from commit 75141da53a)
2024-07-20 21:52:01 +01:00
Mathieu Pilato 793790b359 Fix spice errors when rerunning a simulation with measurements
Mark the simulation as not finished before starting it, preventing measurements from being requested
from spice right before simulation starts

(cherry picked from commit a5b7c65d7a)
2024-07-20 21:51:58 +01:00
Mathieu Pilato 154112d4cc Clear measurement grid while changing tab
Prevent a tab change while editing measurement from impacting measurements of target tab

(cherry picked from commit 98b4a58059)
2024-07-20 21:51:54 +01:00
Mathieu Pilato 97d8ddeb4f Fix measurements not being loaded with workbook
onPlotChanging() was overwriting loaded measurements. Do not read grid from onPlotChanging().

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

(cherry picked from commit c6e8838178)
2024-07-20 21:51:51 +01:00
Mathieu Pilato 4809b00206 Increase default measurement precision to 3 digits
(cherry picked from commit 414ac2b83c)
2024-07-20 21:51:47 +01:00
Jeff Young 5bc1040a8b Fix missing From_UTF8().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18406

(cherry picked from commit 756445dd19)
2024-07-20 21:26:52 +01:00
Jeff Young f6c8dbe81e Fix RecombinePad when pad is rotated.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18348

(cherry picked from commit 556efd836b)
2024-07-20 21:26:52 +01:00
Jeff Young 0280989920 Undo for Repeat Pin.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18261

(cherry picked from commit 0b4d0bcb6c)
2024-07-20 21:26:52 +01:00
Jeff Young 0b762fb804 Show footprint change/update immediately.
Also, don't deselect selected footprints.

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

(cherry picked from commit e450258c0f)
2024-07-20 21:26:52 +01:00
Seth Hillbrand b71eb1186f Avoid losing the last point when simplifying
line chains that are not closed should avoid simplifying between
beginning and end points.  Make sure that we keep the finishing point
for these chains

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18409
2024-07-20 13:02:01 -07:00
Seth Hillbrand c78273cb99 Avoid throwing spurious substitution warnings
If the original font is a bold singleton (not a mod on a face), then we
need to avoid the mismatch between the bold marker and the asked-for
boldness.

At the end, if the font name is the same within case differences, then
it is the same font and we should not warn

(cherry picked from commit 0f84ddaf39)
2024-07-20 11:41:44 -07:00
Seth Hillbrand 26b8978b3e Fix potentially incorrect libid when using save as
If you use save as into a different library and change the symbol name
while overwriting an existing symbol, the libid didn't get updated,
leading to an error message when trying to load the newly saved symbol.

(cherry picked from commit b38357a5ea)
2024-07-20 11:41:44 -07:00
Jon Evans 618bbfda8d Support SWIG 4.1
(cherry picked from commit 58a2159fa9)

Co-authored-by: Jon Evans <jon@craftyjon.com>
2024-07-19 22:49:52 +00:00
JamesJCode ee573a1480 Remove unnecessary erase of netclasses from netclass map
We start from an empty map now, so no need to delete entries
individually

(Cherry-picked from 90304e0639)
2024-07-16 20:37:22 +01:00
JamesJCode 20efc3b6e6 Resolve netclasses on vector buses embedded in buses
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16545

(Cherry-picked from 924b027503)
2024-07-16 19:57:54 +01:00
JamesJCode 8632e74c5c Update BOARD_LISTENERs after calculating connectivity
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18277
(For v8)
2024-07-16 19:57:54 +01:00
Wayne Stambaugh 6f35fd7058 Begin version 8.0.5 development. 2024-07-16 14:42:07 -04:00
317 changed files with 44338 additions and 42919 deletions
@@ -374,6 +374,13 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
// Remove group membership from dummy item before deleting
dummy.SetParentGroup( nullptr );
}
else if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
{
// A custom pad can have many complex subshape items. To avoid issues, use its
// final polygon shape, not its basic shape set. One cannot apply the clearance
// to each subshape: it does no work
aPad->TransformShapeToPolygon( poly, aLayer, 0, maxError );
}
else
{
auto padShapes = std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
@@ -422,7 +429,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
break;
case SH_POLY_SET:
poly = *(SHAPE_POLY_SET*) shape;
poly.Append( *static_cast<const SHAPE_POLY_SET*>( shape ) );
break;
case SH_ARC:
+1 -1
View File
@@ -55,7 +55,7 @@
# (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_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
find_program(SWIG_EXECUTABLE NAMES swig4.2 swig4.1 swig4.0 swig3.0 swig2.0 swig)
if(SWIG_EXECUTABLE)
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
+1 -1
View File
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "8.0.4" )
set( KICAD_SEMANTIC_VERSION "8.0.5" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+1 -1
View File
@@ -209,7 +209,7 @@ void BACKGROUND_JOB_REPORTER::AdvancePhase()
}
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR() : m_jobListDialog( nullptr )
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR()
{
}
+80 -18
View File
@@ -524,9 +524,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_24.png" ), 24, wxT( "light" ) );
@@ -926,9 +934,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_24.png" ), 24, wxT( "dark" ) );
@@ -1328,9 +1344,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_16.png" ), 16, wxT( "light" ) );
@@ -1730,9 +1754,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_16.png" ), 16, wxT( "dark" ) );
@@ -2132,9 +2164,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_32.png" ), 32, wxT( "light" ) );
@@ -2534,9 +2574,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_32.png" ), 32, wxT( "dark" ) );
@@ -2936,9 +2984,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_48.png" ), 48, wxT( "light" ) );
@@ -3338,9 +3394,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_48.png" ), 48, wxT( "dark" ) );
@@ -3740,9 +3804,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_64.png" ), 64, wxT( "light" ) );
@@ -4142,9 +4214,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_64.png" ), 64, wxT( "dark" ) );
@@ -4394,24 +4474,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_32].emplace_back( BITMAPS::icon_pagelayout_editor_32, wxT( "icon_pagelayout_editor_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_32].emplace_back( BITMAPS::icon_pcbcalculator_32, wxT( "icon_pcbcalculator_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_32].emplace_back( BITMAPS::icon_pcbnew_32, wxT( "icon_pcbnew_32_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::icon_cvpcb].emplace_back( BITMAPS::icon_cvpcb, wxT( "icon_cvpcb_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_eeschema].emplace_back( BITMAPS::icon_eeschema, wxT( "icon_eeschema_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::icon_gerbview].emplace_back( BITMAPS::icon_gerbview, wxT( "icon_gerbview_64.png" ), 64, wxT( "light" ) );
+5 -2
View File
@@ -147,7 +147,8 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
wxString strResult;
strResult.Alloc( strlen ); // best guess (improves performance)
auto getVersionedEnvVar = []( const wxString& aMatch, wxString& aResult ) -> bool
auto getVersionedEnvVar =
[]( const wxString& aMatch, wxString& aResult ) -> bool
{
for ( const wxString& var : ENV_VAR::GetPredefinedEnvVars() )
{
@@ -180,7 +181,9 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
Bracket bracket;
#ifdef __WINDOWS__
if( str_n == wxT( '%' ) )
bracket = Bracket_Windows;
{
bracket = Bracket_Windows;
}
else
#endif // __WINDOWS__
if( n == strlen - 1 )
@@ -34,6 +34,7 @@
#include <pgm_base.h>
#include <widgets/wx_grid.h>
#include <widgets/grid_text_button_helpers.h>
#include <widgets/grid_text_helpers.h>
#include <widgets/std_bitmap_button.h>
#include <algorithm>
@@ -49,7 +49,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
// Label Appearance
// Cell Defaults
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
m_EnvVars->SetMinSize( wxSize( 604,170 ) );
sbEnvVars->Add( m_EnvVars, 1, wxALL|wxEXPAND, 5 );
@@ -70,7 +70,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
sbEnvVars->Add( bSizerEnvVarBtns, 0, wxEXPAND, 5 );
bSizerMain->Add( sbEnvVars, 1, wxEXPAND|wxALL, 5 );
bSizerMain->Add( sbEnvVars, 1, wxALL|wxEXPAND, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
+210 -254
View File
@@ -62,109 +62,23 @@
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<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="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">wxGRID_AUTOSIZE</property>
<property name="col_label_values">&quot;Environment Variables&quot; &quot;Path&quot; &quot;&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">2</property>
<property name="column_sizes">150,454</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_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">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">604,170</property>
<property name="moveable">1</property>
<property name="name">m_EnvVars</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="row_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="row_label_size">0</property>
<property name="row_label_values"></property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property>
<property name="rows">1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">WX_GRID; widgets/wx_grid.h; 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>
<event name="OnSize">OnGridSize</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Environment Variables</property>
<property name="minimum_size"></property>
<property name="name">bSizerEnvVarBtns</property>
<property name="orient">wxHORIZONTAL</property>
<property name="name">sbEnvVars</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -173,209 +87,251 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">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="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">wxGRID_AUTOSIZE</property>
<property name="col_label_values">&quot;Name&quot; &quot;Path&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">2</property>
<property name="column_sizes">150,454</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_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</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="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Add Environment Variable</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">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">-1,-1</property>
<property name="minimum_size">604,170</property>
<property name="moveable">1</property>
<property name="name">m_btnAddEnvVar</property>
<property name="name">m_EnvVars</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="row_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="row_label_size">0</property>
<property name="row_label_values"></property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property>
<property name="rows">1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
<property name="subclass">WX_GRID; widgets/wx_grid.h; 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>
<event name="OnButtonClick">OnAddEnvVar</event>
<event name="OnSize">OnGridSize</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerEnvVarBtns</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<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="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="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">Add Environment Variable</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">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_btnAddEnvVar</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">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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>
<event name="OnButtonClick">OnAddEnvVar</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<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="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="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">Delete Environment Variable</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">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_btnDeleteEnvVar</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">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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>
<event name="OnButtonClick">OnRemoveEnvVar</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<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="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="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">Delete Environment Variable</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">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_btnDeleteEnvVar</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">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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>
<event name="OnButtonClick">OnRemoveEnvVar</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<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="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_staticline1</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">wxLI_HORIZONTAL</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="1">
+1
View File
@@ -29,6 +29,7 @@
#include <project.h>
#include <grid_tricks.h>
#include <widgets/std_bitmap_button.h>
#include <widgets/grid_text_helpers.h>
#include <algorithm>
+4
View File
@@ -265,6 +265,10 @@ void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event )
EDA_BASE_FRAME::~EDA_BASE_FRAME()
{
Disconnect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER,
wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) );
Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_BASE_FRAME::windowClosing ) );
delete m_autoSaveTimer;
delete m_fileHistory;
-2
View File
@@ -401,8 +401,6 @@ void EDA_SHAPE::flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
m_start.y = aCentre.y - ( m_start.y - aCentre.y );
m_end.y = aCentre.y - ( m_end.y - aCentre.y );
}
std::swap( m_start, m_end );
break;
case SHAPE_T::CIRCLE:
+19 -2
View File
@@ -48,6 +48,7 @@
#include <font/outline_font.h>
#include <geometry/shape_poly_set.h>
#include <properties/property_validators.h>
#include <ctl_flags.h> // for CTL_OMIT_HIDE definition
#include <wx/debug.h> // for wxASSERT
#include <wx/string.h>
@@ -219,6 +220,22 @@ void EDA_TEXT::SetItalic( bool aItalic )
void EDA_TEXT::SetBold( bool aBold )
{
if( m_attributes.m_Bold != aBold )
{
int size = std::min( m_attributes.m_Size.x, m_attributes.m_Size.y );
if( aBold )
m_attributes.m_StrokeWidth = GetPenSizeForBold( size );
else
m_attributes.m_StrokeWidth = GetPenSizeForNormal( size );
}
SetBoldFlag( aBold );
}
void EDA_TEXT::SetBoldFlag( bool aBold )
{
m_attributes.m_Bold = aBold;
ClearRenderCache();
@@ -918,7 +935,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
if( IsItalic() )
aFormatter->Print( 0, " (italic yes)" );
if( GetTextColor() != COLOR4D::UNSPECIFIED )
if( !( aControlBits & CTL_OMIT_COLOR ) && GetTextColor() != COLOR4D::UNSPECIFIED )
{
aFormatter->Print( 0, " (color %d %d %d %s)",
KiROUND( GetTextColor().r * 255.0 ),
@@ -949,7 +966,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
if( !( aControlBits & CTL_OMIT_HIDE ) && !IsVisible() )
aFormatter->Print( 0, " (hide yes)" );
if( HasHyperlink() )
if( !( aControlBits & CTL_OMIT_HYPERLINK ) && HasHyperlink() )
{
aFormatter->Print( 0, " (href %s)", aFormatter->Quotew( GetHyperlink() ).c_str() );
}
+15 -1
View File
@@ -204,6 +204,17 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
if( !g_fcInitSuccess )
return retval;
// If the original font name contains any of these, then it is bold, regardless
// of whether we are looking for bold or not
if( aFontName.Lower().Contains( wxS( "bold" ) ) // also catches ultrabold
|| aFontName.Lower().Contains( wxS( "heavy" ) )
|| aFontName.Lower().Contains( wxS( "black" ) ) // also catches extrablack
|| aFontName.Lower().Contains( wxS( "thick" ) )
|| aFontName.Lower().Contains( wxS( "dark" ) ) )
{
aBold = true;
}
wxString qualifiedFontName = aFontName;
wxScopedCharBuffer const fcBuffer = qualifiedFontName.ToUTF8();
@@ -333,7 +344,10 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
{
fontName.Replace( ':', ' ' );
if( s_reporter )
// If we missed a case but the matching found the original font name, then we are not substituting
if( fontName.CmpNoCase( qualifiedFontName ) == 0 )
retval = FF_RESULT::FF_OK;
else if( s_reporter )
s_reporter->Report( wxString::Format( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ) );
}
@@ -140,7 +140,8 @@ EASYEDAPRO::ProjectToSelectorDialog( const nlohmann::json& aProject, bool aPcbOn
}
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
nlohmann::json EASYEDAPRO::FindJsonFile( const wxString& aZipFileName,
const std::set<wxString>& aFileNames )
{
std::shared_ptr<wxZipEntry> entry;
wxFFileInputStream in( aZipFileName );
@@ -152,7 +153,7 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
try
{
if( name == wxS( "project.json" ) || name == wxS( "device.json" ) )
if( aFileNames.find( name ) != aFileNames.end() )
{
wxMemoryOutputStream memos;
memos << zip;
@@ -175,6 +176,20 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
}
}
return nlohmann::json{};
}
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
{
static const std::set<wxString> c_files = { wxS( "project.json" ), wxS( "device.json" ),
wxS( "footprint.json" ), wxS( "symbol.json" ) };
nlohmann::json j = FindJsonFile( aZipFileName, c_files );
if( !j.is_null() )
return j;
THROW_IO_ERROR( wxString::Format(
_( "'%s' does not appear to be a valid EasyEDA (JLCEDA) Pro "
"project or library file. Cannot find project.json or device.json." ),
@@ -230,8 +245,17 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
{
try
{
nlohmann::json js = nlohmann::json::parse( txt.ReadLine() );
lines.emplace_back( js );
wxString line = txt.ReadLine();
if( !line.IsEmpty() )
{
nlohmann::json js = nlohmann::json::parse( line );
lines.emplace_back( js );
}
else
{
lines.emplace_back( nlohmann::json() );
}
}
catch( nlohmann::json::exception& e )
{
@@ -244,3 +268,42 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
return lines;
}
std::vector<std::vector<nlohmann::json>>
EASYEDAPRO::ParseJsonLinesWithSeparation( wxInputStream& aInput, const wxString& aSource )
{
wxTextInputStream txt( aInput, wxS( " " ), wxConvUTF8 );
int currentLine = 1;
std::vector<std::vector<nlohmann::json>> lineBlocks;
lineBlocks.emplace_back();
while( aInput.CanRead() )
{
try
{
wxString line = txt.ReadLine();
if( !line.IsEmpty() )
{
nlohmann::json js = nlohmann::json::parse( line );
lineBlocks.back().emplace_back( js );
}
else
{
lineBlocks.emplace_back();
}
}
catch( nlohmann::json::exception& e )
{
wxLogWarning( wxString::Format( _( "Cannot parse JSON line %d in '%s': %s" ),
currentLine, aSource, e.what() ) );
}
currentLine++;
}
return lineBlocks;
}
@@ -25,6 +25,7 @@
#ifndef EASYEDAPRO_IMPORT_UTILS_H_
#define EASYEDAPRO_IMPORT_UTILS_H_
#include <set>
#include <wx/stream.h>
#include <wx/string.h>
#include <lib_id.h>
@@ -46,6 +47,8 @@ std::vector<IMPORT_PROJECT_DESC> ProjectToSelectorDialog( const nlohmann::json&
bool aPcbOnly = false,
bool aSchOnly = false );
nlohmann::json FindJsonFile( const wxString& aZipFileName, const std::set<wxString>& aFileNames );
nlohmann::json ReadProjectOrDeviceFile( const wxString& aZipFileName );
void IterateZipFiles(
@@ -54,6 +57,12 @@ void IterateZipFiles(
std::vector<nlohmann::json> ParseJsonLines( wxInputStream& aInput, const wxString& aSource );
/**
* Multiple document types (e.g. footprint and PCB) can be put into a single file, separated by empty line.
*/
std::vector<std::vector<nlohmann::json>> ParseJsonLinesWithSeparation( wxInputStream& aInput,
const wxString& aSource );
} // namespace EASYEDAPRO
+3 -1
View File
@@ -36,7 +36,9 @@ void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::SCH_ATTR& d )
d.id = j.at( 1 ).get<wxString>();
d.parentId = j.at( 2 ).get<wxString>();
d.key = j.at( 3 ).get<wxString>();
d.value = j.at( 4 ).get<wxString>();
if( j.at( 4 ).is_string() )
d.value = j.at( 4 ).get<wxString>();
if( j.at( 5 ).is_number() )
d.keyVisible = j.at( 5 ).get<int>();
+24 -1
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2024 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
@@ -27,11 +27,18 @@
// conflicts for some defines, at least on Windows
#include <kicad_curl/kicad_curl.h>
#include <mutex>
#include <ki_exception.h> // THROW_IO_ERROR
static std::shared_mutex s_curlMutex;
static bool s_curlShuttingDown = false;
void KICAD_CURL::Init()
{
s_curlShuttingDown = false;
if( curl_global_init( CURL_GLOBAL_ALL ) != CURLE_OK )
{
THROW_IO_ERROR( "curl_global_init() failed." );
@@ -41,10 +48,26 @@ void KICAD_CURL::Init()
void KICAD_CURL::Cleanup()
{
s_curlShuttingDown = true;
std::unique_lock lock( s_curlMutex );
curl_global_cleanup();
}
std::shared_mutex& KICAD_CURL::Mutex()
{
return s_curlMutex;
}
bool KICAD_CURL::IsShuttingDown()
{
return s_curlShuttingDown;
}
std::string GetKicadCurlVersion()
{
return KICAD_CURL::GetVersion();
+11 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2024 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
@@ -33,6 +33,7 @@
#include <cstddef>
#include <exception>
#include <sstream>
#include <shared_mutex>
#include <wx/app.h>
#include <build_version.h>
@@ -88,6 +89,9 @@ static size_t stream_write_callback( void* aContents, size_t aSize, size_t aNmem
static int xferinfo( void* aProgress, curl_off_t aDLtotal, curl_off_t aDLnow, curl_off_t aULtotal,
curl_off_t aULnow )
{
if( KICAD_CURL::IsShuttingDown() )
return 1; // Should abort the operation
CURL_PROGRESS* progress = static_cast<CURL_PROGRESS*>( aProgress );
curl_off_t curtime = 0;
@@ -190,6 +194,12 @@ KICAD_CURL_EASY::~KICAD_CURL_EASY()
int KICAD_CURL_EASY::Perform()
{
std::shared_lock lock( KICAD_CURL::Mutex(), std::try_to_lock );
// If can't lock, we should be in the process of tearing down.
if( !lock )
return CURLE_ABORTED_BY_CALLBACK;
if( m_headers )
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
+1 -10
View File
@@ -199,16 +199,7 @@ LIB_TABLE_ROW* LIB_TABLE::findRow( const wxString& aNickName, bool aCheckIfEnabl
do
{
try
{
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
}
catch( std::system_error& e )
{
wxASSERT_MSG( false, wxString::Format( wxS( "Failed to lock lib table mutex: %s" ),
e.what() ) );
continue;
}
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
if( cur->m_rowsMap.count( aNickName ) )
row = &*cur->m_rowsMap.at( aNickName );
+1
View File
@@ -178,6 +178,7 @@ public:
m_contentSizer->Add( m_noNotificationsText, 1, wxALL | wxEXPAND, 5 );
Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
m_scrolledWindow->Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
SetSizer( bSizer1 );
Layout();
+9 -4
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 2024 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
@@ -55,9 +55,12 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
#if 0
constexpr double correction = 0.8; // Looks best visually
constexpr double correction = 0.8; // Looks best visually
#else
constexpr double correction = 1.0; // Matches ISO 128-2
constexpr double correction = 1.0; // Matches ISO 128-2, but can creates issues on GTK and MSW:
// "dots" are not always visible depending on the zoom level
// because they create 0 lenght lines
// So they will drawn as segments, even with correction = 1.0
#endif
@@ -69,7 +72,9 @@ double RENDER_SETTINGS::GetDashLength( int aLineWidth ) const
double RENDER_SETTINGS::GetDotLength( int aLineWidth ) const
{
return ( 1.0 - correction ) * aLineWidth;
// The minimal length scale is arbitrary set to 0.2 after trials
// 0 lenght can create drawing issues
return std::max( ( 1.0 - correction ), 0.2 ) * aLineWidth;
}
+2 -2
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2023, 2024 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
@@ -42,7 +42,7 @@
* platforms. This is the list of illegal file name characters for Windows which includes
* the illegal file name characters for Linux and OSX.
*/
static const char illegalFileNameChars[] = "\\/:\"<>|";
static const char illegalFileNameChars[] = "\\/:\"<>|*?";
wxString ConvertToNewOverbarNotation( const wxString& aOldStr )
+15
View File
@@ -212,6 +212,21 @@ ACTION_TOOLBAR::ACTION_TOOLBAR( EDA_BASE_FRAME* parent, wxWindowID id, const wxP
ACTION_TOOLBAR::~ACTION_TOOLBAR()
{
Disconnect( wxEVT_COMMAND_TOOL_CLICKED, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolEvent ),
nullptr, this );
Disconnect( wxEVT_AUITOOLBAR_RIGHT_CLICK,
wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolRightClick ), nullptr, this );
Disconnect( wxEVT_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onItemDrag ),
nullptr, this );
Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr,
this );
Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr, this );
Disconnect( m_paletteTimer->GetId(), wxEVT_TIMER,
wxTimerEventHandler( ACTION_TOOLBAR::onTimerDone ), nullptr, this );
Unbind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( ACTION_TOOLBAR::onThemeChanged ), this );
delete m_paletteTimer;
// Clear all the maps keeping track of our items on the toolbar
-29
View File
@@ -39,35 +39,6 @@
#include <wx/log.h>
#include <wx/combo.h>
GRID_CELL_TEXT_EDITOR::GRID_CELL_TEXT_EDITOR() : wxGridCellTextEditor()
{
}
void GRID_CELL_TEXT_EDITOR::SetValidator( const wxValidator& validator )
{
// keep our own copy because wxGridCellTextEditor's is annoyingly private
m_validator.reset( static_cast<wxValidator*>( validator.Clone() ) );
wxGridCellTextEditor::SetValidator( *m_validator );
}
void GRID_CELL_TEXT_EDITOR::StartingKey( wxKeyEvent& event )
{
if( m_validator )
{
m_validator.get()->SetWindow( Text() );
m_validator.get()->ProcessEvent( event );
}
if( event.GetSkipped() )
{
wxGridCellTextEditor::StartingKey( event );
event.Skip( false );
}
}
FOOTPRINT_NAME_VALIDATOR::FOOTPRINT_NAME_VALIDATOR( wxString* aValue ) :
wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, aValue )
+7
View File
@@ -92,6 +92,13 @@ void BITMAP_BUTTON::setupEvents()
BITMAP_BUTTON::~BITMAP_BUTTON()
{
Unbind( wxEVT_PAINT, &BITMAP_BUTTON::OnPaint, this );
Unbind( wxEVT_LEFT_UP, &BITMAP_BUTTON::OnLeftButtonUp, this );
Unbind( wxEVT_LEFT_DOWN, &BITMAP_BUTTON::OnLeftButtonDown, this );
Unbind( wxEVT_LEAVE_WINDOW, &BITMAP_BUTTON::OnMouseLeave, this );
Unbind( wxEVT_ENTER_WINDOW, &BITMAP_BUTTON::OnMouseEnter, this );
Unbind( wxEVT_KILL_FOCUS, &BITMAP_BUTTON::OnKillFocus, this );
Unbind( wxEVT_SET_FOCUS, &BITMAP_BUTTON::OnSetFocus, this );
}
+11 -17
View File
@@ -60,20 +60,9 @@ wxString GRID_CELL_TEXT_BUTTON::GetValue() const
void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect )
{
wxRect rect( aRect );
WX_GRID::CellEditorTransformSizeRect( rect );
#if defined( __WXMAC__ )
rect.Inflate( 2 ); // ignore FOCUS_RING
#elif defined( __WXGTK__ )
rect.Inflate( -3 ); // The -3 is a very sad hack here. Some GTK themes overrun the
// default -1, preventing display. Unfortunately, we don't appear to
// have a good method of finding the current margin needed.
// Some GTK resize events seem to update the cell size but not all and
// not consistently.
#else
rect.Inflate( -1 );
#endif
Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE );
wxGridCellEditor::SetSize( rect );
}
@@ -233,6 +222,7 @@ void GRID_CELL_SYMBOL_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
wxEvtHandler* aEventHandler )
{
m_control = new TEXT_BUTTON_SYMBOL_CHOOSER( aParent, m_dlg, m_preselect );
WX_GRID::CellEditorSetMargins( Combo() );
wxGridCellEditor::Create( aParent, aId, aEventHandler );
}
@@ -244,7 +234,7 @@ public:
TEXT_BUTTON_FP_CHOOSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg,
const wxString& aSymbolNetlist, const wxString& aPreselect ) :
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER ),
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
m_dlg( aParentDlg ),
m_preselect( aPreselect ),
m_symbolNetlist( aSymbolNetlist.ToStdString() )
@@ -316,6 +306,7 @@ void GRID_CELL_FPID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
wxEvtHandler* aEventHandler )
{
m_control = new TEXT_BUTTON_FP_CHOOSER( aParent, m_dlg, m_symbolNetlist, m_preselect );
WX_GRID::CellEditorSetMargins( Combo() );
#if wxUSE_VALIDATORS
// validate text in textctrl, if validator is set
@@ -334,7 +325,7 @@ class TEXT_BUTTON_URL : public wxComboCtrl
public:
TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg, SEARCH_STACK* aSearchStack ) :
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER ),
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
m_dlg( aParentDlg ),
m_searchStack( aSearchStack )
{
@@ -367,6 +358,7 @@ void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
wxEvtHandler* aEventHandler )
{
m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack );
WX_GRID::CellEditorSetMargins( Combo() );
#if wxUSE_VALIDATORS
// validate text in textctrl, if validator is set
@@ -388,7 +380,7 @@ public:
bool aNormalize = false,
const wxString& aNormalizeBasePath = wxEmptyString ) :
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER ),
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
m_dlg( aParentDlg ),
m_grid( aGrid ),
m_currentDir( aCurrentDir ),
@@ -408,7 +400,7 @@ public:
bool aNormalize = false,
const wxString& aNormalizeBasePath = wxEmptyString ) :
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER ),
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
m_dlg( aParentDlg ),
m_grid( aGrid ),
m_currentDir( aCurrentDir ),
@@ -524,6 +516,8 @@ void GRID_CELL_PATH_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_grid, m_currentDir, m_fileFilter,
m_normalize, m_normalizeBasePath );
WX_GRID::CellEditorSetMargins( Combo() );
#if wxUSE_VALIDATORS
// validate text in textctrl, if validator is set
if ( m_validator )
+64 -1
View File
@@ -21,9 +21,56 @@
#include <string_utils.h>
#include <wx/stc/stc.h>
#include <widgets/grid_text_helpers.h>
#include <widgets/wx_grid.h>
#include <scintilla_tricks.h>
//-------- GRID_CELL_TEXT_EDITOR ------------------------------------------------------
//
GRID_CELL_TEXT_EDITOR::GRID_CELL_TEXT_EDITOR() : wxGridCellTextEditor()
{
}
void GRID_CELL_TEXT_EDITOR::SetValidator( const wxValidator& validator )
{
// keep our own copy because wxGridCellTextEditor's is annoyingly private
m_validator.reset( static_cast<wxValidator*>( validator.Clone() ) );
wxGridCellTextEditor::SetValidator( *m_validator );
}
void GRID_CELL_TEXT_EDITOR::StartingKey( wxKeyEvent& event )
{
if( m_validator )
{
m_validator.get()->SetWindow( Text() );
m_validator.get()->ProcessEvent( event );
}
if( event.GetSkipped() )
{
wxGridCellTextEditor::StartingKey( event );
event.Skip( false );
}
}
void GRID_CELL_TEXT_EDITOR::SetSize( const wxRect& aRect )
{
wxRect rect( aRect );
WX_GRID::CellEditorTransformSizeRect( rect );
#if defined( __WXMSW__ )
rect.Offset( 0, 1 );
#endif
wxGridCellEditor::SetSize( rect );
}
//-------- GRID_CELL_ESCAPED_TEXT_RENDERER ------------------------------------------------------
//
@@ -69,9 +116,25 @@ GRID_CELL_STC_EDITOR::GRID_CELL_STC_EDITOR( bool aIgnoreCase,
{ }
void GRID_CELL_STC_EDITOR::SetSize( const wxRect& aRect )
{
wxRect rect( aRect );
WX_GRID::CellEditorTransformSizeRect( rect );
#if defined( __WXMSW__ )
rect.Offset( -1, 1 );
#elif defined( __WXGTK__ )
rect.Offset( -1, 3 );
#endif
wxGridCellEditor::SetSize( rect );
}
void GRID_CELL_STC_EDITOR::Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
{
m_control = new wxStyledTextCtrl( aParent );
m_control = new wxStyledTextCtrl( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxBORDER_NONE );
stc_ctrl()->SetTabIndents( false );
stc_ctrl()->SetBackSpaceUnIndents( false );
+9
View File
@@ -107,6 +107,15 @@ KISTATUSBAR::KISTATUSBAR( int aNumberFields, wxWindow* parent, wxWindowID id ) :
}
KISTATUSBAR::~KISTATUSBAR()
{
m_notificationsButton->Unbind( wxEVT_BUTTON, &KISTATUSBAR::onNotificationsIconClick, this );
Unbind( wxEVT_SIZE, &KISTATUSBAR::onSize, this );
m_backgroundProgressBar->Unbind( wxEVT_LEFT_DOWN, &KISTATUSBAR::onBackgroundProgressClick,
this );
}
void KISTATUSBAR::onNotificationsIconClick( wxCommandEvent& aEvent )
{
wxPoint pos = m_notificationsButton->GetScreenPosition();
+9
View File
@@ -73,6 +73,15 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId,
STD_BITMAP_BUTTON::~STD_BITMAP_BUTTON()
{
Unbind( wxEVT_PAINT, &STD_BITMAP_BUTTON::OnPaint, this );
Unbind( wxEVT_LEFT_UP, &STD_BITMAP_BUTTON::OnLeftButtonUp, this );
Unbind( wxEVT_LEFT_DOWN, &STD_BITMAP_BUTTON::OnLeftButtonDown, this );
Unbind( wxEVT_KILL_FOCUS, &STD_BITMAP_BUTTON::OnKillFocus, this );
Unbind( wxEVT_LEAVE_WINDOW, &STD_BITMAP_BUTTON::OnMouseLeave, this );
Unbind( wxEVT_ENTER_WINDOW, &STD_BITMAP_BUTTON::OnMouseEnter, this );
Unbind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( STD_BITMAP_BUTTON::onThemeChanged ), this );
}
+17
View File
@@ -24,6 +24,8 @@
#include <wx/tokenzr.h>
#include <wx/dc.h>
#include <wx/settings.h>
#include <wx/event.h> // Needed for textentry.h on MSW
#include <wx/textentry.h>
#include <widgets/wx_grid.h>
#include <widgets/ui_common.h>
@@ -34,6 +36,21 @@
#define MIN_GRIDCELL_MARGIN FromDIP( 3 )
void WX_GRID::CellEditorSetMargins( wxTextEntryBase* aEntry )
{
// This is consistent with wxGridCellTextEditor. But works differently across platforms or course.
aEntry->SetMargins( 0, 0 );
}
void WX_GRID::CellEditorTransformSizeRect( wxRect& aRect )
{
#if defined( __WXMSW__ ) || defined( __WXGTK__ )
aRect.Deflate( 2 );
#endif
}
wxColour getBorderColour()
{
KIGFX::COLOR4D bg = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
+4 -1
View File
@@ -159,7 +159,10 @@ void WX_INFOBAR::ShowMessage( const wxString& aMessage, int aFlags )
m_updateLock = true;
wxInfoBarGeneric::ShowMessage( aMessage, aFlags );
wxString msg = aMessage;
msg.Trim();
wxInfoBarGeneric::ShowMessage( msg, aFlags );
if( m_auiManager )
updateAuiLayout( true );
+8 -8
View File
@@ -154,15 +154,15 @@ wxString BOM_GENERATOR_HANDLER::readHeader( const wxString& aEndSection )
const wxString header( wxS( "@package" ) );
// Extract substring between @package and endsection
int strstart = data.Find( header );
size_t strstart = data.find( header );
if( strstart == wxNOT_FOUND )
if( strstart == wxString::npos )
return wxEmptyString;
strstart += header.Length();
int strend = data.find( aEndSection, strstart );
size_t strend = data.find( aEndSection, strstart );
if( strend == wxNOT_FOUND )
if( strend == wxString::npos )
return wxEmptyString;
// Remove empty line if any
@@ -179,15 +179,15 @@ wxString BOM_GENERATOR_HANDLER::getOutputExtension( const wxString& aHeader )
// looks for output argument of the form `"%O.extension"`
const wxString outputarg( wxS( "\"%O" ) );
int strstart = aHeader.Find( outputarg );
size_t strstart = aHeader.find( outputarg );
if( strstart == wxNOT_FOUND )
if( strstart == wxString::npos )
return wxEmptyString;
strstart += outputarg.Length();
int strend = aHeader.find( wxS( "\"" ), strstart );
size_t strend = aHeader.find( wxS( "\"" ), strstart );
if( strend == wxNOT_FOUND )
if( strend == wxString::npos )
return wxEmptyString;
return aHeader.SubString( strstart, strend - 1 );
+67 -18
View File
@@ -2338,6 +2338,12 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
netSettings->m_NetClassLabelAssignments.clear();
// Used to track where netclasses are assigned to a net from a bus netclass
// definition. Without this tracking, depending on the order of testing for
// netclasses, an already-assigned netclass on a bus member can be deleted
// if an explicitly labelled member net does not have a netclass assigned.
std::unordered_set<wxString> netclassAssignedFromBus;
auto dirtySubgraphs =
[&]( const std::vector<CONNECTION_SUBGRAPH*>& subgraphs )
{
@@ -2381,40 +2387,83 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
const wxString netname = driverSubgraph->GetNetName();
// Handle netclass assignments on buses
if( driverSubgraph->m_driver_connection->IsBus() )
{
for( const auto& member : driverSubgraph->m_driver_connection->Members() )
auto processBusMember = [&, this]( const SCH_CONNECTION* member )
{
if( netclass.IsEmpty() )
netSettings->m_NetClassLabelAssignments.erase( member->Name() );
else
if( !netclass.IsEmpty() )
{
netSettings->m_NetClassLabelAssignments[member->Name()] = netclass;
netclassAssignedFromBus.insert( member->Name() );
}
auto ii = m_net_name_to_subgraphs_map.find( member->Name() );
if( ii != m_net_name_to_subgraphs_map.end() )
dirtySubgraphs( ii->second );
if( oldAssignments.count( member->Name() ) )
{
if( oldAssignments[member->Name()] != netclass )
{
affectedNetclassNetAssignments.insert( member->Name() );
if( ii != m_net_name_to_subgraphs_map.end() )
dirtySubgraphs( ii->second );
}
}
else if( !netclass.IsEmpty() )
{
affectedNetclassNetAssignments.insert( member->Name() );
if( ii != m_net_name_to_subgraphs_map.end() )
dirtySubgraphs( ii->second );
}
};
for( const std::shared_ptr<SCH_CONNECTION>& member :
driverSubgraph->m_driver_connection->Members() )
{
// Check if this member itself is a bus (which can be the case
// for vector buses as members of a bus, see
// https://gitlab.com/kicad/code/kicad/-/issues/16545
if( member->IsBus() )
{
for( const std::shared_ptr<SCH_CONNECTION>& nestedMember :
member->Members() )
{
processBusMember( nestedMember.get() );
}
}
else
{
processBusMember( member.get() );
}
}
}
if( netclass.IsEmpty() )
netSettings->m_NetClassLabelAssignments.erase( netname );
else
netSettings->m_NetClassLabelAssignments[netname] = netclass;
if( oldAssignments.count( netname ) )
// Handle netclass assignments on nets / overarching bus definitions.
// Note: currently a netclass definition on a bus will override any
// on a net. This will be resolved with multiple netclasses.
if( !netclassAssignedFromBus.count( netname ) )
{
if( oldAssignments[netname] != netclass )
if( !netclass.IsEmpty() )
{
netSettings->m_NetClassLabelAssignments[netname] = netclass;
}
if( oldAssignments.count( netname ) )
{
if( oldAssignments[netname] != netclass )
{
affectedNetclassNetAssignments.insert( netname );
dirtySubgraphs( subgraphs );
}
}
else if( !netclass.IsEmpty() )
{
affectedNetclassNetAssignments.insert( netname );
dirtySubgraphs( subgraphs );
}
}
else if( !netclass.IsEmpty() )
{
affectedNetclassNetAssignments.insert( netname );
dirtySubgraphs( subgraphs );
}
};
for( const auto& [ netname, subgraphs ] : m_net_name_to_subgraphs_map )
@@ -293,10 +293,11 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( SCH_COMMIT* aCommit,
if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED )
eda_text->SetItalic( m_italic->GetValue() );
// Must come after SetTextSize()
if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
eda_text->SetBold( m_bold->GetValue() );
// Must come after bold & italic
// Must come after SetBold() & SetItalic()
if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
{
eda_text->SetFont( m_fontCtrl->GetFontSelection( eda_text->IsBold(),
+2 -14
View File
@@ -553,20 +553,8 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
else if( m_currentLabel->GetTextWidth() != m_textSize.GetValue() )
m_currentLabel->SetTextSize( VECTOR2I( m_textSize.GetValue(), m_textSize.GetValue() ) );
if( m_bold->IsChecked() != m_currentLabel->IsBold() )
{
if( m_bold->IsChecked() )
{
m_currentLabel->SetBold( true );
m_currentLabel->SetTextThickness( GetPenSizeForBold( m_currentLabel->GetTextWidth() ) );
}
else
{
m_currentLabel->SetBold( false );
m_currentLabel->SetTextThickness( 0 ); // Use default pen width
}
}
// Must come after SetTextSize()
m_currentLabel->SetBold( m_bold->IsChecked() );
m_currentLabel->SetItalic( m_italic->IsChecked() );
m_currentLabel->SetTextColor( m_textColorSwatch->GetSwatchColor() );
@@ -262,8 +262,9 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
else
m_graphicText->SetBodyStyle( 0 );
m_graphicText->SetItalic( m_italic->IsChecked() );
// Must come after SetTextSize()
m_graphicText->SetBold( m_bold->IsChecked() );
m_graphicText->SetItalic( m_italic->IsChecked() );
m_graphicText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
if( m_hAlignLeft->IsChecked() )
@@ -279,21 +279,10 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow()
m_italic->IsChecked() ) );
}
if( m_bold->IsChecked() != m_currentText->IsBold() )
{
if( m_bold->IsChecked() )
{
m_currentText->SetBold( true );
m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
}
else
{
m_currentText->SetBold( false );
m_currentText->SetTextThickness( 0 ); // Use default pen width
}
}
// Must come after SetTextSize()
m_currentText->SetBold( m_italic->IsChecked() );
m_currentText->SetItalic( m_italic->IsChecked() );
m_currentText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
if( m_hAlignRight->IsChecked() )
@@ -147,26 +147,14 @@ bool DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow()
m_italic->IsChecked() ) );
}
if( m_bold->IsChecked() != m_sheetPin->IsBold() )
{
if( m_bold->IsChecked() )
{
m_sheetPin->SetBold( true );
m_sheetPin->SetTextThickness( GetPenSizeForBold( m_sheetPin->GetTextWidth() ) );
}
else
{
m_sheetPin->SetBold( false );
m_sheetPin->SetTextThickness( 0 ); // Use default pen width
}
}
m_sheetPin->SetItalic( m_italic->IsChecked() );
// Currently, eeschema uses only the text width as text size,
// and expects text width = text height
m_sheetPin->SetTextSize( VECTOR2I( m_textSize.GetIntValue(), m_textSize.GetIntValue() ) );
// Must come after SetTextSize()
m_sheetPin->SetBold( m_bold->IsChecked() );
m_sheetPin->SetItalic( m_italic->IsChecked() );
m_sheetPin->SetTextColor( m_textColorSwatch->GetSwatchColor() );
if( m_input->GetValue() ) m_sheetPin->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
+50 -51
View File
@@ -46,6 +46,7 @@
#include <sch_edit_frame.h>
#include <sim/sim_model_l_mutual.h>
#include <sim/spice_circuit_model.h>
#include <wx/log.h>
using CATEGORY = SIM_MODEL::PARAM::CATEGORY;
@@ -77,8 +78,7 @@ DIALOG_SIM_MODEL<T_symbol, T_field>::DIALOG_SIM_MODEL( wxWindow* aParent, EDA_BA
m_scintillaTricksSubckt( nullptr ),
m_firstCategory( nullptr ),
m_prevParamGridSelection( nullptr ),
m_lastParamGridWidth( 0 ),
m_inKillFocus( false )
m_lastParamGridWidth( 0 )
{
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
@@ -219,12 +219,14 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
// The model is sourced from a library, optionally with instance overrides.
m_rbLibraryModel->SetValue( true );
if( !loadLibrary( libraryFilename ) )
if( !loadLibrary( libraryFilename, reporter ) )
{
if( reporter.HasMessage() )
m_infoBar->ShowMessage( msg );
m_libraryPathText->ChangeValue( libraryFilename );
m_curModelType = SIM_MODEL::ReadTypeFromFields( m_fields, reporter );
// load library will mangle the set reporter
m_libraryModelsMgr.CreateModel( nullptr, m_sortedPartPins, m_fields, reporter );
m_modelNameChoice->Append( _( "<unknown>" ) );
@@ -237,14 +239,15 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
if( modelIdx == wxNOT_FOUND )
{
DisplayErrorMessage( this, wxString::Format( _( "No model named '%s' in library." ),
modelName ) );
m_infoBar->ShowMessage( wxString::Format( _( "No model named '%s' in library." ),
modelName ) );
// Default to first item in library
m_modelNameChoice->SetSelection( 0 );
}
else
{
m_infoBar->Hide();
m_modelNameChoice->SetSelection( modelIdx );
}
@@ -807,37 +810,28 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::removeOrphanedPinAssignments( SIM_MODE
template <typename T_symbol, typename T_field>
bool DIALOG_SIM_MODEL<T_symbol, T_field>::loadLibrary( const wxString& aLibraryPath,
bool aForceReload )
bool DIALOG_SIM_MODEL<T_symbol, T_field>::loadLibrary( const wxString& aLibraryPath, REPORTER& aReporter,
bool aForceReload )
{
if( m_prevLibrary == aLibraryPath && !aForceReload )
return true;
wxString msg;
WX_STRING_REPORTER reporter( &msg );
m_libraryModelsMgr.SetForceFullParse();
m_libraryModelsMgr.SetLibrary( aLibraryPath, reporter );
m_libraryModelsMgr.SetLibrary( aLibraryPath, aReporter );
if( reporter.HasMessage() )
{
DisplayErrorMessage( this, msg );
if( aReporter.HasMessage() )
return false;
}
std::string modelName = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::NAME_FIELD );
for( const auto& [baseModelName, baseModel] : library()->GetModels() )
{
if( baseModelName == modelName )
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, m_fields, reporter );
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, m_fields, aReporter );
else
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, reporter );
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, aReporter );
}
if( reporter.HasMessage() )
DisplayErrorMessage( this, msg );
m_rbLibraryModel->SetValue( true );
m_libraryPathText->ChangeValue( aLibraryPath );
@@ -1088,16 +1082,16 @@ SIM_MODEL& DIALOG_SIM_MODEL<T_symbol, T_field>::curModel() const
{
int sel = m_modelNameChoice->GetSelection();
if( sel >= 0 && sel < (int) m_libraryModelsMgr.GetModels().size() )
if( sel >= 0 && sel < static_cast<int>( m_libraryModelsMgr.GetModels().size() ) )
return m_libraryModelsMgr.GetModels().at( sel ).get();
}
else
{
if( (int) m_curModelType < (int) m_builtinModelsMgr.GetModels().size() )
return m_builtinModelsMgr.GetModels().at( (int) m_curModelType );
if( static_cast<int>( m_curModelType ) < static_cast<int>( m_builtinModelsMgr.GetModels().size() ) )
return m_builtinModelsMgr.GetModels().at( static_cast<int>( m_curModelType ) );
}
return m_builtinModelsMgr.GetModels().at( (int) SIM_MODEL::TYPE::NONE );
return m_builtinModelsMgr.GetModels().at( static_cast<int>( SIM_MODEL::TYPE::NONE ) );
}
@@ -1174,49 +1168,47 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onRadioButton( wxCommandEvent& aEvent
}
template <typename T_symbol, typename T_field>
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibrarayPathText( wxCommandEvent& aEvent )
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathText( wxCommandEvent& aEvent )
{
m_rbLibraryModel->SetValue( true );
updateWidgets();
}
template <typename T_symbol, typename T_field>
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathTextEnter( wxCommandEvent& aEvent )
{
if( m_rbLibraryModel->GetValue() )
{
wxString path = m_libraryPathText->GetValue();
m_rbLibraryModel->SetValue( true );
if( !path.IsEmpty() )
{
try
{
loadLibrary( path );
updateWidgets();
}
catch( const IO_ERROR& )
{
// TODO: Add an infobar to report the error?
}
}
}
wxString msg;
WX_STRING_REPORTER reporter( &msg );
wxString path = m_libraryPathText->GetValue();
if( loadLibrary( path, reporter, true ) )
m_infoBar->Hide();
else if( reporter.HasMessage() )
m_infoBar->ShowMessage( msg );
updateWidgets();
}
template <typename T_symbol, typename T_field>
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathTextKillFocus( wxFocusEvent& aEvent )
{
if( !m_inKillFocus )
{
m_inKillFocus = true;
CallAfter(
[this]()
{
// Disable logging -- otherwise we'll end up in an endless loop of show-log,
// kill-focus, show-log, kill-focus, etc.
wxLogNull doNotLog;
wxCommandEvent dummy;
onLibraryPathTextEnter( dummy );
wxCommandEvent dummy;
onLibraryPathTextEnter( dummy );
} );
m_inKillFocus = false;
}
aEvent.Skip(); // mandatory in wxFocusEvent events
}
@@ -1241,7 +1233,14 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onBrowseButtonClick( wxCommandEvent& a
if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS( ".." ) ) )
path = fn.GetFullPath();
loadLibrary( path, true );
wxString msg;
WX_STRING_REPORTER reporter( &msg );
if( loadLibrary( path, reporter, true ) )
m_infoBar->Hide();
else
m_infoBar->ShowMessage( msg );
updateWidgets();
}
+4 -4
View File
@@ -79,7 +79,8 @@ private:
void removeOrphanedPinAssignments( SIM_MODEL* aModel );
bool loadLibrary( const wxString& aLibraryPath, bool aForceReload = false );
bool loadLibrary( const wxString& aLibraryPath, REPORTER& aReporter,
bool aForceReload = false );
void addParamPropertyIfRelevant( SIM_MODEL* aModel, int aParamIndex );
wxPGProperty* newParamProperty( SIM_MODEL* aModel, int aParamIndex ) const;
@@ -94,7 +95,7 @@ private:
int getModelPinIndex( const wxString& aModelPinString ) const;
void onRadioButton( wxCommandEvent& aEvent ) override;
void onLibrarayPathText( wxCommandEvent& aEvent ) override;
void onLibraryPathText( wxCommandEvent& aEvent ) override;
void onLibraryPathTextEnter( wxCommandEvent& aEvent ) override;
void onLibraryPathTextKillFocus( wxFocusEvent& aEvent ) override;
void onBrowseButtonClick( wxCommandEvent& aEvent ) override;
@@ -140,8 +141,7 @@ private:
wxPGProperty* m_firstCategory; // Used to add principal parameters to root.
wxPGProperty* m_prevParamGridSelection;
int m_lastParamGridWidth;
bool m_inKillFocus;
int m_lastParamGridWidth;
};
#endif /* DIALOG_SIM_MODEL_H */
+10 -2
View File
@@ -7,6 +7,7 @@
#include "widgets/std_bitmap_button.h"
#include "widgets/wx_grid.h"
#include "widgets/wx_infobar.h"
#include "dialog_sim_model_base.h"
@@ -19,6 +20,13 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );
m_infoBar = new WX_INFOBAR( this );
m_infoBar->SetShowHideEffects( wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_NONE );
m_infoBar->SetEffectDuration( 500 );
m_infoBar->Hide();
bSizer8->Add( m_infoBar, 0, wxEXPAND, 5 );
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_modelPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerPanel;
@@ -330,7 +338,7 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
m_rbLibraryModel->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
m_pathLabel->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathLabelUpdate ), NULL, this );
m_libraryPathText->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextKillFocus ), NULL, this );
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibrarayPathText ), NULL, this );
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathText ), NULL, this );
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextEnter ), NULL, this );
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonClick ), NULL, this );
m_browseButton->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonUpdate ), NULL, this );
@@ -367,7 +375,7 @@ DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE()
m_rbLibraryModel->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
m_pathLabel->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathLabelUpdate ), NULL, this );
m_libraryPathText->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextKillFocus ), NULL, this );
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibrarayPathText ), NULL, this );
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathText ), NULL, this );
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextEnter ), NULL, this );
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonClick ), NULL, this );
m_browseButton->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonUpdate ), NULL, this );
+154 -93
View File
@@ -63,10 +63,10 @@
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxNotebook" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxInfoBar" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -77,6 +77,67 @@
<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="duration">500</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="hide_effect">wxSHOW_EFFECT_NONE</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_infoBar</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="show_effect">wxSHOW_EFFECT_NONE</property>
<property name="size"></property>
<property name="subclass">WX_INFOBAR; widgets/wx_infobar.h; 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">10</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxNotebook" 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="bitmapsize"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
@@ -129,10 +190,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>
@@ -199,10 +260,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>
@@ -283,10 +344,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>
@@ -358,10 +419,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>
@@ -385,7 +446,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">-1,-1</property>
@@ -413,7 +474,7 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnKillFocus">onLibraryPathTextKillFocus</event>
<event name="OnText">onLibrarayPathText</event>
<event name="OnText">onLibraryPathText</event>
<event name="OnTextEnter">onLibraryPathTextEnter</event>
</object>
</object>
@@ -426,10 +487,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="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
@@ -507,10 +568,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>
@@ -573,10 +634,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>
@@ -655,10 +716,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>
@@ -721,10 +782,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>
@@ -794,10 +855,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>
@@ -864,10 +925,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>
@@ -930,10 +991,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>
@@ -1003,10 +1064,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>
@@ -1068,10 +1129,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>
@@ -1146,10 +1207,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>
@@ -1228,10 +1289,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>
@@ -1291,10 +1352,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>
@@ -1358,10 +1419,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>
@@ -1421,10 +1482,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>
@@ -1499,10 +1560,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="bitmapsize"></property>
@@ -1558,10 +1619,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>
@@ -1619,10 +1680,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>
@@ -1690,10 +1751,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>
@@ -1751,10 +1812,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="backspace_unindents">1</property>
<property name="best_size"></property>
<property name="bg"></property>
@@ -1834,10 +1895,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>
@@ -1914,10 +1975,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>
@@ -1975,10 +2036,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="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
@@ -2066,10 +2127,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>
@@ -2128,10 +2189,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="backspace_unindents">1</property>
<property name="best_size"></property>
<property name="bg"></property>
+6 -3
View File
@@ -12,14 +12,16 @@
#include <wx/intl.h>
class STD_BITMAP_BUTTON;
class WX_GRID;
class WX_INFOBAR;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/radiobut.h>
#include <wx/infobar.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/bmpbuttn.h>
@@ -52,6 +54,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
private:
protected:
WX_INFOBAR* m_infoBar;
wxNotebook* m_notebook;
wxPanel* m_modelPanel;
wxRadioButton* m_rbLibraryModel;
@@ -91,7 +94,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
virtual void onRadioButton( wxCommandEvent& event ) { event.Skip(); }
virtual void onLibraryPathLabelUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void onLibraryPathTextKillFocus( wxFocusEvent& event ) { event.Skip(); }
virtual void onLibrarayPathText( wxCommandEvent& event ) { event.Skip(); }
virtual void onLibraryPathText( wxCommandEvent& event ) { event.Skip(); }
virtual void onLibraryPathTextEnter( wxCommandEvent& event ) { event.Skip(); }
virtual void onBrowseButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onBrowseButtonUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
+3 -14
View File
@@ -471,21 +471,10 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
m_italic->IsChecked() ) );
}
if( m_bold->IsChecked() != m_currentText->IsBold() )
{
if( m_bold->IsChecked() )
{
m_currentText->SetBold( true );
m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
}
else
{
m_currentText->SetBold( false );
m_currentText->SetTextThickness( 0 ); // Use default pen width
}
}
// Must come after SetTextSize()
m_currentText->SetBold( m_bold->IsChecked() );
m_currentText->SetItalic( m_italic->IsChecked() );
m_currentText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
if( m_hAlignRight->IsChecked() )
+2
View File
@@ -449,6 +449,8 @@ int ERC_TESTER::TestMissingUnits()
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( aErrorCode );
ercItem->SetErrorMessage( msg );
ercItem->SetItems( unit );
ercItem->SetSheetSpecificPath( base_ref.GetSheetPath() );
ercItem->SetItemsSheetPaths( base_ref.GetSheetPath() );
SCH_MARKER* marker = new SCH_MARKER( ercItem, unit->GetPosition() );
base_ref.GetSheetPath().LastScreen()->Append( marker );
+6 -3
View File
@@ -84,9 +84,12 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RenameColumn( int aCol, const wxString& newN
{
SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol();
auto node = m_dataStore[symbol->m_Uuid].extract( m_cols[aCol].m_fieldName );
node.key() = newName;
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
// Careful; field may have already been renamed from another sheet instance
if( auto node = m_dataStore[symbol->m_Uuid].extract( m_cols[aCol].m_fieldName ) )
{
node.key() = newName;
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
}
}
m_cols[aCol].m_fieldName = newName;
-4
View File
@@ -131,7 +131,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
WX_GRID* aGrid, LIB_SYMBOL* aSymbol ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_grid( aGrid ),
m_parentType( SCH_SYMBOL_T ),
m_mandatoryFieldCount( MANDATORY_FIELDS ),
m_part( aSymbol ),
@@ -152,7 +151,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_EDIT_FRAME* a
WX_GRID* aGrid, SCH_SYMBOL* aSymbol ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_grid( aGrid ),
m_parentType( SCH_SYMBOL_T ),
m_mandatoryFieldCount( MANDATORY_FIELDS ),
m_part( aSymbol->GetLibSymbolRef().get() ),
@@ -173,7 +171,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_EDIT_FRAME* a
WX_GRID* aGrid, SCH_SHEET* aSheet ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_grid( aGrid ),
m_parentType( SCH_SHEET_T ),
m_mandatoryFieldCount( SHEET_MANDATORY_FIELDS ),
m_part( nullptr ),
@@ -193,7 +190,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_EDIT_FRAME* a
WX_GRID* aGrid, SCH_LABEL_BASE* aLabel ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_grid( aGrid ),
m_parentType( SCH_LABEL_LOCATE_ANY_T ),
m_mandatoryFieldCount( aLabel->GetMandatoryFieldCount() ),
m_part( nullptr ),
-1
View File
@@ -118,7 +118,6 @@ protected:
private:
SCH_BASE_FRAME* m_frame;
DIALOG_SHIM* m_dialog;
WX_GRID* m_grid;
KICAD_T m_parentType;
int m_mandatoryFieldCount;
LIB_SYMBOL* m_part;
+8 -5
View File
@@ -181,7 +181,8 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
CreateScreens();
}
SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName, KICTL_KICAD_ONLY );
SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName,
KICTL_KICAD_ONLY );
if( schFileType == SCH_IO_MGR::SCH_LEGACY )
{
@@ -492,13 +493,14 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// Restore all of the loaded symbol and sheet instances from the root sheet.
if( Schematic().RootScreen()->GetFileFormatVersionAtLoad() < 20221002 )
sheetList.UpdateSymbolInstanceData( Schematic().RootScreen()->GetSymbolInstances());
sheetList.UpdateSymbolInstanceData( Schematic().RootScreen()->GetSymbolInstances() );
if( Schematic().RootScreen()->GetFileFormatVersionAtLoad() < 20221110 )
sheetList.UpdateSheetInstanceData( Schematic().RootScreen()->GetSheetInstances());
if( Schematic().RootScreen()->GetFileFormatVersionAtLoad() < 20230221 )
for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
for( SCH_SCREEN* screen = schematic.GetFirst(); screen;
screen = schematic.GetNext() )
screen->FixLegacyPowerSymbolMismatches();
for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
@@ -511,8 +513,9 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
}
}
schematic.PruneOrphanedSymbolInstances( Prj().GetProjectName(), Schematic().GetSheets() );
schematic.PruneOrphanedSheetInstances( Prj().GetProjectName(), Schematic().GetSheets() );
schematic.PruneOrphanedSymbolInstances( Prj().GetProjectName(), sheetList );
schematic.PruneOrphanedSheetInstances( Prj().GetProjectName(), sheetList );
sheetList.CheckForMissingSymbolInstances( Prj().GetProjectName() );
Schematic().ConnectionGraph()->Reset();
+15 -2
View File
@@ -33,6 +33,8 @@
#include <gal/graphics_abstraction_layer.h>
#include <gal/painter.h>
#include <zoom_defines.h>
#include <drawing_sheet/ds_proxy_view_item.h>
#include <string_utils.h>
SCH_PRINTOUT::SCH_PRINTOUT( SCH_EDIT_FRAME* aParent, const wxString& aTitle, bool aUseCairo ) :
@@ -70,6 +72,7 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
bool SCH_PRINTOUT::OnPrintPage( int page )
{
SCH_SHEET_LIST sheetList = m_parent->Schematic().GetSheets();
sheetList.SortByPageNumbers( false );
wxCHECK_MSG( page >= 1 && page <= (int)sheetList.size(), false,
wxT( "Cannot print invalid page number." ) );
@@ -81,17 +84,26 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
msg.Printf( _( "Print page %d" ), page );
m_parent->SetMsgPanel( msg, wxEmptyString );
SCH_SCREEN* screen = m_parent->GetScreen();
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
// Switch to the new current sheet
m_parent->SetCurrentSheet( sheetList[ page - 1 ] );
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
m_parent->SetSheetNumberAndCount();
m_parent->RecomputeIntersheetRefs();
screen = m_parent->GetCurrentSheet().LastScreen();
SCH_SCREEN* screen = m_parent->GetCurrentSheet().LastScreen();
// Ensure the displayed page number is updated:
KIGFX::SCH_VIEW* sch_view = m_parent->GetCanvas()->GetView();
sch_view->GetDrawingSheet()->SetPageNumber( TO_UTF8( screen->GetPageNumber() ) );
PrintPage( screen );
// Restore the initial current sheet
m_parent->SetCurrentSheet( oldsheetpath );
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
m_parent->SetSheetNumberAndCount();
screen = m_parent->GetCurrentSheet().LastScreen();
sch_view->GetDrawingSheet()->SetPageNumber( TO_UTF8( screen->GetPageNumber() ) );
return true;
}
@@ -102,6 +114,7 @@ int SCH_PRINTOUT::milsToIU( int aMils )
return KiROUND( aMils * schIUScale.IU_PER_MILS );
}
/*
* This is the real print function: print the active screen
*/
+2 -2
View File
@@ -28,7 +28,7 @@ class SCH_SCREEN;
namespace KIGFX
{
class GAL;
class VIEW;
class SCH_VIEW;
class PAINTER;
};
@@ -49,7 +49,7 @@ public:
private:
SCH_EDIT_FRAME* m_parent;
///< Source VIEW object (note that actual printing only refers to this object)
const KIGFX::VIEW* m_view;
const KIGFX::SCH_VIEW* m_view;
bool m_useCairo;
int milsToIU( int aMils );
+17 -10
View File
@@ -1487,9 +1487,11 @@ void SCH_IO_ALTIUM::ParseLabel( const std::map<wxString, wxString>& aProperties,
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
{
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
textItem->SetItalic( font.Italic );
textItem->SetBold( font.Bold );
textItem->SetTextSize( { font.Size / 2, font.Size / 2 } );
// Must come after SetTextSize()
textItem->SetBold( font.Bold );
textItem->SetItalic( font.Italic );
}
textItem->SetFlags(IS_NEW );
@@ -1541,9 +1543,11 @@ void SCH_IO_ALTIUM::ParseLabel( const std::map<wxString, wxString>& aProperties,
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
{
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
textItem->SetItalic( font.Italic );
textItem->SetBold( font.Bold );
textItem->SetTextSize( { font.Size / 2, font.Size / 2 } );
// Must come after SetTextSize()
textItem->SetBold( font.Bold );
textItem->SetItalic( font.Italic );
}
else if( fontId > 0 && fontId <= aFontSizes.size() )
{
@@ -1621,11 +1625,12 @@ void SCH_IO_ALTIUM::AddTextBox( const ASCH_TEXT_FRAME *aElem )
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
{
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
textBox->SetItalic( font.Italic );
textBox->SetBold( font.Bold );
textBox->SetTextSize( { font.Size / 2, font.Size / 2 } );
//textBox->SetFont( //how to set font, we have a font mane here: ( font.fontname );
// Must come after SetTextSize()
textBox->SetBold( font.Bold );
textBox->SetItalic( font.Italic );
//textBox->SetFont( //how to set font, we have a font name here: ( font.fontname );
}
textBox->SetFlags( IS_NEW );
@@ -3422,10 +3427,12 @@ void SCH_IO_ALTIUM::ParseHarnessPort( const ASCH_PORT& aElem )
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
{
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
textBox->SetItalic( font.Italic );
textBox->SetBold( font.Bold );
textBox->SetTextSize( { font.Size / 2, font.Size / 2 } );
//textBox->SetFont( //how to set font, we have a font mane here: ( font.fontname );
// Must come after SetTextSize()
textBox->SetBold( font.Bold );
textBox->SetItalic( font.Italic );
//textBox->SetFont( //how to set font, we have a font name here: ( font.fontname );
}
textBox->SetFlags( IS_NEW );
@@ -2992,6 +2992,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::applyTextCodeIfExists( EDA_TEXT* aKiCa
aKiCadTextItem->SetTextThickness( getKiCadLength( textCode.LineWidth ) );
#endif
// Must come after SetTextSize()
aKiCadTextItem->SetBold( textCode.Font.Modifier1 == FONT_BOLD );
aKiCadTextItem->SetItalic( textCode.Font.Italic );
}
+7 -8
View File
@@ -2773,14 +2773,9 @@ void SCH_IO_EAGLE::loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttribs )
{
aText->SetTextSize( aAttribs.ConvertSize() );
if( aAttribs.ratio )
{
if( aAttribs.ratio.CGet() > 12 )
{
aText->SetBold( true );
aText->SetTextThickness( GetPenSizeForBold( aText->GetTextWidth() ) );
}
}
// Must come after SetTextSize()
if( aAttribs.ratio && aAttribs.ratio.CGet() > 12 )
aText->SetBold( true );
int align = aAttribs.align ? *aAttribs.align : ETEXT::BOTTOM_LEFT;
int degrees = aAttribs.rot ? aAttribs.rot->degrees : 0;
@@ -2796,7 +2791,11 @@ void SCH_IO_EAGLE::loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* aText
aField->SetTextPos( aText->GetPosition() );
aField->SetTextSize( aText->GetTextSize() );
aField->SetTextAngle( aText->GetTextAngle() );
// Must come after SetTextSize()
aField->SetBold( aText->IsBold() );
aField->SetItalic( false );
aField->SetVertJustify( aText->GetVertJustify() );
aField->SetHorizJustify( aText->GetHorizJustify() );
}
@@ -144,8 +144,14 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
|| libFname.GetExt() == wxS( "zip" ) )
{
std::map<wxString, EASYEDAPRO::PRJ_SYMBOL> prjSymbols = project.at( "symbols" );
std::map<wxString, EASYEDAPRO::PRJ_FOOTPRINT> prjFootprints = project.at( "footprints" );
std::map<wxString, EASYEDAPRO::PRJ_DEVICE> prjDevices = project.at( "devices" );
std::map<wxString, EASYEDAPRO::PRJ_FOOTPRINT> prjFootprints;
std::map<wxString, EASYEDAPRO::PRJ_DEVICE> prjDevices;
if( project.contains( "footprints" ) )
prjFootprints = project.at( "footprints" );
if( project.contains( "devices" ) )
prjDevices = project.at( "devices" );
auto prjSymIt = std::find_if( prjSymbols.begin(), prjSymbols.end(),
[&]( const auto& pair )
@@ -1086,7 +1086,7 @@ SCH_TEXT* SCH_IO_KICAD_LEGACY::loadText( LINE_READER& aReader )
penWidth = parseInt( aReader, line, &line );
}
text->SetBold( penWidth != 0 );
text->SetBoldFlag( penWidth != 0 );
text->SetTextThickness( penWidth != 0 ? GetPenSizeForBold( size ) : 0 );
// Read the text string for the text.
@@ -1097,9 +1097,9 @@ SCH_TEXT* SCH_IO_KICAD_LEGACY::loadText( LINE_READER& aReader )
for( ; ; )
{
int i = val.find( wxT( "\\n" ) );
size_t i = val.find( wxT( "\\n" ) );
if( i == wxNOT_FOUND )
if( i == wxString::npos )
break;
val.erase( i, 2 );
@@ -1369,7 +1369,7 @@ SCH_SYMBOL* SCH_IO_KICAD_LEGACY::loadSymbol( LINE_READER& aReader )
if( textAttrs[2] == 'B' )
{
field.SetBold( true );
field.SetBoldFlag( true );
}
else if( textAttrs[2] != 'N' )
{
@@ -652,7 +652,7 @@ void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSym
SCH_PARSE_ERROR( "invalid field text italic parameter", aReader, line );
if ( attr_2 == 'B' ) // Bold
field->SetBold( true );
field->SetBoldFlag( true );
else if( attr_2 != 'N' ) // No bold is default, check for error.
SCH_PARSE_ERROR( "invalid field text bold parameter", aReader, line );
}
@@ -1020,7 +1020,7 @@ LIB_TEXT* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText( std::unique_ptr<LIB_SYMBOL>&
SCH_PARSE_ERROR( "invalid text stype, expected 'Normal' or 'Italic'", aReader, line );
if( parseInt( aReader, line, &line ) > 0 )
text->SetBold( true );
text->SetBoldFlag( true );
// Some old libaries version > 2.0 do not have these options for text justification:
if( !is_eol( *line ) )
@@ -737,7 +737,7 @@ void SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT( EDA_TEXT* aText, bool aConvertOve
case T_bold:
{
bool bold = parseMaybeAbsentBool( true );
aText->SetBold( bold );
aText->SetBoldFlag( bold );
break;
}
+36 -1
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 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
@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <refdes_utils.h>
#include <sch_screen.h>
#include <sch_item.h>
#include <sch_marker.h>
@@ -630,6 +631,33 @@ void SCH_SHEET_PATH::RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPa
}
void SCH_SHEET_PATH::CheckForMissingSymbolInstances( const wxString& aProjectName )
{
wxCHECK( !aProjectName.IsEmpty() && LastScreen(), /* void */ );
for( SCH_ITEM* item : LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
wxCHECK2( symbol, continue );
SCH_SYMBOL_INSTANCE symbolInstance;
if( !symbol->GetInstance( symbolInstance, Path() ) )
{
wxLogTrace( traceSchSheetPaths, "Adding missing symbol \"%s\" instance data for "
"sheet path '%s'.",
symbol->m_Uuid.AsString(), PathHumanReadable( false ) );
symbolInstance.m_Reference = UTIL::GetRefDesUnannotated( symbol->GetPrefix() );
symbolInstance.m_ProjectName = aProjectName;
symbolInstance.m_Path = Path();
symbol->AddHierarchicalReference( symbolInstance );
}
}
}
void SCH_SHEET_PATH::MakeFilePathRelativeToParentSheet()
{
wxCHECK( m_sheets.size() > 1, /* void */ );
@@ -1338,6 +1366,13 @@ void SCH_SHEET_LIST::AddNewSheetInstances( const SCH_SHEET_PATH& aPrefixSheetPat
}
void SCH_SHEET_LIST::CheckForMissingSymbolInstances( const wxString& aProjectName )
{
for( SCH_SHEET_PATH& sheetPath : *this )
sheetPath.CheckForMissingSymbolInstances( aProjectName );
}
int SCH_SHEET_LIST::GetLastVirtualPageNumber() const
{
int lastVirtualPageNumber = 1;
+5 -1
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 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
@@ -408,6 +408,8 @@ public:
void RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath );
void CheckForMissingSymbolInstances( const wxString& aProjectName );
bool operator==( const SCH_SHEET_PATH& d1 ) const;
bool operator!=( const SCH_SHEET_PATH& d1 ) const { return !( *this == d1 ) ; }
@@ -690,6 +692,8 @@ public:
void RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath );
void CheckForMissingSymbolInstances( const wxString& aProjectName );
bool HasPath( const KIID_PATH& aPath ) const;
bool ContainsSheet( const SCH_SHEET* aSheet ) const;
+5 -6
View File
@@ -303,14 +303,13 @@ bool NGSPICE::LoadNetlist( const std::string& aNetlist )
std::vector<char*> lines;
std::stringstream ss( aNetlist );
m_netlist = "";
m_netlist.erase();
while( !ss.eof() )
for( std::string line; std::getline( ss, line ); )
{
char line[1024];
ss.getline( line, sizeof( line ) );
lines.push_back( strdup( line ) );
m_netlist += std::string( line ) + std::string( "\n" );
lines.push_back( strdup( line.data() ) );
m_netlist += line;
m_netlist += '\n';
}
lines.push_back( nullptr ); // sentinel, as requested in ngSpice_Circ description
+44 -60
View File
@@ -53,7 +53,8 @@ void SIM_LIB_MGR::Clear()
}
wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject )
wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject,
REPORTER& aReporter )
{
wxString expandedPath = ExpandEnvVarSubstitutions( aLibraryPath, aProject );
@@ -80,20 +81,23 @@ wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PR
if( spiceLibDir.IsEmpty() || spiceLibFn.GetFullPath() == projectFn.GetFullPath() )
{
THROW_IO_ERROR( wxString::Format( _( "Simulation model library not found at '%s'" ),
projectFn.GetFullPath() ) );
aReporter.Report( wxString::Format( _( "Simulation model library not found at '%s'" ),
projectFn.GetFullPath() ) );
}
else
{
THROW_IO_ERROR( wxString::Format( _( "Simulation model library not found at '%s' or '%s'" ),
projectFn.GetFullPath(),
spiceLibFn.GetFullPath() ) );
aReporter.Report( wxString::Format( _( "Simulation model library not found at '%s' or '%s'" ),
projectFn.GetFullPath(),
spiceLibFn.GetFullPath() ) );
}
return aLibraryPath;
}
wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
const wxString& aRelativeLib )
const wxString& aRelativeLib,
REPORTER& aReporter )
{
wxFileName testPath( aLibPath );
wxString fullPath( aLibPath );
@@ -102,12 +106,7 @@ wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
{
wxString relLib( aRelativeLib );
try
{
relLib = ResolveLibraryPath( relLib, m_project );
}
catch( ... )
{}
relLib = ResolveLibraryPath( relLib, m_project, aReporter );
wxFileName fn( relLib );
@@ -115,17 +114,12 @@ wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
fullPath = testPath.GetFullPath();
}
try
{
wxFileName fn( fullPath );
wxFileName fn( fullPath );
if( !fn.Exists() )
fullPath = aLibPath;
if( !fn.Exists() )
fullPath = aLibPath;
fullPath = ResolveLibraryPath( fullPath, m_project );
}
catch( ... )
{}
fullPath = ResolveLibraryPath( fullPath, m_project, aReporter );
return fullPath;
}
@@ -133,23 +127,26 @@ wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
void SIM_LIB_MGR::SetLibrary( const wxString& aLibraryPath, REPORTER& aReporter )
{
try
wxString path = ResolveLibraryPath( aLibraryPath, m_project, aReporter );
if( aReporter.HasMessage() )
return;
if( !wxFileName::Exists( path ) )
{
wxString path = ResolveLibraryPath( aLibraryPath, m_project );
std::function<wxString(const wxString&, const wxString&)> f2 =
std::bind( &SIM_LIB_MGR::ResolveEmbeddedLibraryPath, this, _1, _2 );
std::unique_ptr<SIM_LIBRARY> library = SIM_LIBRARY::Create( path, m_forceFullParse,
aReporter, &f2 );
Clear();
m_libraries[path] = std::move( library );
}
catch( const IO_ERROR& e )
{
aReporter.Report( e.What() );
aReporter.Report( wxString::Format( _( "Simulation model library not found at '%s'" ),
path ) );
return;
}
std::unique_ptr<SIM_LIBRARY> library = SIM_LIBRARY::Create( path, m_forceFullParse, aReporter,
[&]( const wxString& libPath, const wxString& relativeLib ) -> wxString
{
return ResolveEmbeddedLibraryPath( libPath, relativeLib, aReporter );
} );
Clear();
m_libraries[path] = std::move( library );
}
@@ -299,37 +296,24 @@ SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel( const wxString& aLibraryPath,
const std::vector<LIB_PIN*>& aPins,
REPORTER& aReporter )
{
wxString path;
wxString msg;
SIM_LIBRARY* library = nullptr;
SIM_MODEL* baseModel = nullptr;
std::string modelName;
wxString path = ResolveLibraryPath( aLibraryPath, m_project, aReporter );
try
auto it = m_libraries.find( path );
if( it == m_libraries.end() )
{
path = ResolveLibraryPath( aLibraryPath, m_project );
auto it = m_libraries.find( path );
if( it == m_libraries.end() )
{
std::function<wxString( const wxString&, const wxString& )> f2 =
std::bind( &SIM_LIB_MGR::ResolveEmbeddedLibraryPath, this, _1, _2 );
it = m_libraries.emplace( path, SIM_LIBRARY::Create( path, m_forceFullParse,
aReporter, &f2 ) ).first;
}
library = &*it->second;
it = m_libraries.emplace( path, SIM_LIBRARY::Create( path, m_forceFullParse, aReporter,
[&]( const wxString& libPath, const wxString& relativeLib ) -> wxString
{
return ResolveEmbeddedLibraryPath( libPath, relativeLib, aReporter );
} ) ).first;
}
catch( const IO_ERROR& e )
{
msg.Printf( _( "Error loading simulation model library '%s': %s" ),
path,
e.What() );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
}
library = &*it->second;
if( aBaseModelName == "" )
{
+4 -2
View File
@@ -79,8 +79,10 @@ public:
std::map<wxString, std::reference_wrapper<const SIM_LIBRARY>> GetLibraries() const;
std::vector<std::reference_wrapper<SIM_MODEL>> GetModels() const;
static wxString ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject );
wxString ResolveEmbeddedLibraryPath( const wxString& aLibPath, const wxString& aRelativeLib );
static wxString ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject,
REPORTER& aReporter );
wxString ResolveEmbeddedLibraryPath( const wxString& aLibPath, const wxString& aRelativeLib,
REPORTER& aReporter );
private:
const PROJECT* m_project;
+1 -1
View File
@@ -31,7 +31,7 @@
std::unique_ptr<SIM_LIBRARY>
SIM_LIBRARY::Create( const wxString& aFilePath, bool aForceFullParse, REPORTER& aReporter,
std::function<wxString( const wxString&, const wxString& )>* aResolver )
const std::function<wxString( const wxString&, const wxString& )>& aResolver )
{
std::unique_ptr<SIM_LIBRARY> library;
+2 -2
View File
@@ -56,7 +56,7 @@ public:
*/
static std::unique_ptr<SIM_LIBRARY>
Create( const wxString& aFilePath, bool aForceFullParse, REPORTER& aReporter,
std::function<wxString( const wxString&, const wxString& )>* aResolver );
const std::function<wxString( const wxString&, const wxString& )>& aResolver );
/**
* Read library from a source file. Must be in the format appropriate to the subclass, e.g.
@@ -77,7 +77,7 @@ protected:
std::vector<std::string> m_modelNames;
std::vector<std::unique_ptr<SIM_MODEL>> m_models;
std::function<wxString( const wxString&, const wxString& )>* m_pathResolver;
std::function<wxString( const wxString&, const wxString& )> m_pathResolver;
std::string m_filePath;
};
+6 -1
View File
@@ -68,7 +68,12 @@ std::string SPICE_GENERATOR_KIBIS::IbisDevice( const SPICE_ITEM& aItem, const PR
std::string ibisModelName = SIM_MODEL::GetFieldValue( &aItem.fields, SIM_LIBRARY_KIBIS::MODEL_FIELD );
bool diffMode = SIM_MODEL::GetFieldValue( &aItem.fields, SIM_LIBRARY_KIBIS::DIFF_FIELD ) == "1";
wxString path = SIM_LIB_MGR::ResolveLibraryPath( ibisLibFilename, &aProject );
wxString msg;
WX_STRING_REPORTER reporter( &msg );
wxString path = SIM_LIB_MGR::ResolveLibraryPath( ibisLibFilename, &aProject, reporter );
if( reporter.HasMessage() )
THROW_IO_ERROR( msg );
KIBIS kibis( std::string( path.c_str() ) );
kibis.m_cacheDir = std::string( aCacheDir.c_str() );
+2
View File
@@ -457,6 +457,8 @@ void SIMULATOR_FRAME::StartSimulation()
if( simulatorLock.owns_lock() )
{
m_simFinished = false;
m_ui->OnSimUpdate();
m_simulator->Run();
+5 -2
View File
@@ -1214,6 +1214,7 @@ void SIMULATOR_FRAME_UI::onMeasurementsGridCellChanged( wxGridEvent& aEvent )
if( col == COL_MEASUREMENT )
{
UpdateMeasurement( row );
updateMeasurementsFromGrid();
OnModify();
}
else
@@ -1365,6 +1366,8 @@ void SIMULATOR_FRAME_UI::UpdateMeasurement( int aRow )
fmt.UpdateUnits( units );
SetMeasureFormat( aRow, fmt );
updateMeasurementsFromGrid();
}
if( m_simulatorFrame->SimFinished() )
@@ -1493,9 +1496,9 @@ void SIMULATOR_FRAME_UI::AddMeasurement( const wxString& aCmd )
}
m_measurementsGrid->SetCellValue( row, COL_MEASUREMENT, aCmd );
SetMeasureFormat( row, { 2, wxS( "~V" ) } );
UpdateMeasurement( row );
updateMeasurementsFromGrid();
OnModify();
// Always leave at least one empty row for type-in:
@@ -2397,7 +2400,7 @@ void SIMULATOR_FRAME_UI::updateMeasurementsFromGrid()
void SIMULATOR_FRAME_UI::onPlotChanging( wxAuiNotebookEvent& event )
{
updateMeasurementsFromGrid();
m_measurementsGrid->ClearRows();
event.Skip();
}
+2 -8
View File
@@ -118,10 +118,7 @@ void SPICE_LIBRARY_PARSER::readFallbacks( const wxString& aFilePath, REPORTER& a
}
else if( token == wxS( ".inc" ) )
{
wxString lib = tokenizer.GetNextToken();
if( m_library.m_pathResolver )
lib = ( *m_library.m_pathResolver )( lib, aFilePath );
wxString lib = m_library.m_pathResolver( tokenizer.GetNextToken(), aFilePath );
parseFile( lib, aReporter );
}
@@ -170,13 +167,10 @@ void SPICE_LIBRARY_PARSER::parseFile( const wxString &aFilePath, REPORTER& aRepo
}
else if( node->is_type<SIM_LIBRARY_SPICE_PARSER::dotInclude>() )
{
wxString lib = node->children.at( 0 )->string();
wxString lib = m_library.m_pathResolver( node->children.at( 0 )->string(), aFilePath );
try
{
if( m_library.m_pathResolver )
lib = ( *m_library.m_pathResolver )( lib, aFilePath );
parseFile( lib, aReporter );
}
catch( const IO_ERROR& e )
+12 -4
View File
@@ -40,10 +40,18 @@
void SPICE_VALUE_FORMAT::FromString( const wxString& aString )
{
long val;
aString.Left( 1 ).ToLong( &val );
Precision = (int) val;
Range = aString.Right( aString.Length() - 1 );
if( aString.IsEmpty() )
{
Precision = 3;
Range = wxS( "~V" );
}
else
{
long val;
aString.Left( 1 ).ToLong( &val );
Precision = (int) val;
Range = aString.Right( aString.Length() - 1 );
}
}
@@ -29,6 +29,7 @@
#include <tool/tool_manager.h>
#include <tools/ee_actions.h>
#include <tools/ee_selection_tool.h>
#include <tools/symbol_editor_drawing_tools.h>
void SYMBOL_EDIT_FRAME::PushSymbolToUndoList( const wxString& aDescription, LIB_SYMBOL* aSymbolCopy,
@@ -37,6 +38,8 @@ void SYMBOL_EDIT_FRAME::PushSymbolToUndoList( const wxString& aDescription, LIB_
if( !aSymbolCopy )
return;
auto* drawingTool = GetToolManager()->GetTool<SYMBOL_EDITOR_DRAWING_TOOLS>();
PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST();
// Clear current flags (which can be temporary set by a current edit command).
@@ -45,6 +48,7 @@ void SYMBOL_EDIT_FRAME::PushSymbolToUndoList( const wxString& aDescription, LIB_
aSymbolCopy->SetFlags( UR_TRANSIENT );
ITEM_PICKER wrapper( GetScreen(), aSymbolCopy, aUndoType );
wrapper.SetGroupId( drawingTool->GetLastPin() );
lastcmd->PushItem( wrapper );
lastcmd->SetDescription( aDescription );
PushCommandToUndoList( lastcmd );
@@ -67,6 +71,8 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
if( GetRedoCommandCount() <= 0 )
return;
auto* drawingTool = GetToolManager()->GetTool<SYMBOL_EDITOR_DRAWING_TOOLS>();
// Load the last redo entry
PICKED_ITEMS_LIST* redoCommand = PopCommandFromRedoList();
ITEM_PICKER redoWrapper = redoCommand->PopItem();
@@ -75,6 +81,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
delete redoCommand;
LIB_SYMBOL* symbol = (LIB_SYMBOL*) redoWrapper.GetItem();
KIID lastPin = redoWrapper.GetGroupId();
UNDO_REDO undoRedoType = redoWrapper.GetStatus();
wxCHECK( symbol, /* void */ );
symbol->ClearFlags( UR_TRANSIENT );
@@ -85,6 +92,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
oldSymbol->SetFlags( UR_TRANSIENT );
ITEM_PICKER undoWrapper( GetScreen(), oldSymbol, undoRedoType );
undoWrapper.SetGroupId( drawingTool->GetLastPin() );
undoCommand->SetDescription( description );
undoCommand->PushItem( undoWrapper );
PushCommandToUndoList( undoCommand );
@@ -94,6 +102,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
// <previous symbol> is now put in undo list and is owned by this list
// Just set the current symbol to the symbol which come from the redo list
m_symbol = symbol;
drawingTool->SetLastPin( lastPin );
if( undoRedoType == UNDO_REDO::LIB_RENAME )
{
@@ -118,6 +127,8 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
if( GetUndoCommandCount() <= 0 )
return;
auto* drawingTool = GetToolManager()->GetTool<SYMBOL_EDITOR_DRAWING_TOOLS>();
// Load the last undo entry
PICKED_ITEMS_LIST* undoCommand = PopCommandFromUndoList();
wxString description = undoCommand->GetDescription();
@@ -126,6 +137,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
delete undoCommand;
LIB_SYMBOL* symbol = (LIB_SYMBOL*) undoWrapper.GetItem();
KIID lastPin = undoWrapper.GetGroupId();
UNDO_REDO undoRedoType = undoWrapper.GetStatus();
wxCHECK( symbol, /* void */ );
symbol->ClearFlags( UR_TRANSIENT );
@@ -136,6 +148,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
oldSymbol->SetFlags( UR_TRANSIENT );
ITEM_PICKER redoWrapper( GetScreen(), oldSymbol, undoRedoType );
redoWrapper.SetGroupId( drawingTool->GetLastPin() );
redoCommand->PushItem( redoWrapper );
redoCommand->SetDescription( description );
PushCommandToRedoList( redoCommand );
@@ -145,6 +158,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
// <previous symbol> is now put in redo list and is owned by this list.
// Just set the current symbol to the symbol which come from the undo list
m_symbol = symbol;
drawingTool->SetLastPin( lastPin );
if( undoRedoType == UNDO_REDO::LIB_RENAME )
{
+4
View File
@@ -480,7 +480,11 @@ bool SYMBOL_LIBRARY_MANAGER::UpdateSymbol( LIB_SYMBOL* aSymbol, const wxString&
wxCHECK( bufferedSymbol, false );
// If we are coming from a different library, the library ID needs to be preserved
auto libId = bufferedSymbol->GetLibId();
*bufferedSymbol = *aSymbol;
bufferedSymbol->SetLibId( libId );
symbolBuf->GetScreen()->SetContentModified();
}
else // New symbol
+8 -3
View File
@@ -1248,8 +1248,11 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
textItem->SetParent( schematic );
textItem->SetTextSize( VECTOR2I( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
if( aType != LAYER_NETCLASS_REFS )
{
// Must be after SetTextSize()
textItem->SetBold( m_lastTextBold );
textItem->SetItalic( m_lastTextItalic );
}
@@ -1265,7 +1268,6 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
textItem->SetTextAngle( m_lastTextAngle );
}
textItem->SetTextSize( VECTOR2I( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) );
textItem->SetFlags( IS_NEW | IS_MOVING );
if( !labelItem )
@@ -1862,10 +1864,13 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
{
SCH_TEXTBOX* textbox = new SCH_TEXTBOX( 0, m_lastTextboxFillStyle );
textbox->SetBold( m_lastTextBold );
textbox->SetItalic( m_lastTextItalic );
textbox->SetTextSize( VECTOR2I( sch_settings.m_DefaultTextSize,
sch_settings.m_DefaultTextSize ) );
// Must come after SetTextSize()
textbox->SetBold( m_lastTextBold );
textbox->SetItalic( m_lastTextItalic );
textbox->SetTextAngle( m_lastTextboxAngle );
textbox->SetHorizJustify( m_lastTextboxHJustify );
textbox->SetVertJustify( m_lastTextboxVJustify );
+3 -1
View File
@@ -2316,8 +2316,10 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
new_eda_text->SetFont( eda_text->GetFont() );
new_eda_text->SetTextSize( eda_text->GetTextSize() );
new_eda_text->SetTextThickness( eda_text->GetTextThickness() );
new_eda_text->SetItalic( eda_text->IsItalic() );
// Must be after SetTextSize()
new_eda_text->SetBold( eda_text->IsBold() );
new_eda_text->SetItalic( eda_text->IsItalic() );
newtext->AutoplaceFields( m_frame->GetScreen(), false );
+56 -67
View File
@@ -1080,14 +1080,13 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
{
wxCHECK2( item, continue );
SCH_CONNECTION* connection = item->Connection();
wxCHECK2( connection, continue );
for( const std::shared_ptr<SCH_CONNECTION>& member : connection->AllMembers() )
if( SCH_CONNECTION* connection = item->Connection() )
{
if( member )
connNames.emplace( member->Name() );
for( const std::shared_ptr<SCH_CONNECTION>& member : connection->AllMembers() )
{
if( member )
connNames.emplace( member->Name() );
}
}
}
}
@@ -1106,50 +1105,44 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
wxCHECK2( symbol, continue );
for( SCH_PIN* pin : symbol->GetPins() )
{
SCH_CONNECTION* pin_conn = pin->Connection();
wxCHECK2( pin_conn, continue );
if( !pin->IsBrightened() && connNames.count( pin_conn->Name() ) )
if( SCH_CONNECTION* pin_conn = pin->Connection() )
{
pin->SetBrightened();
redrawItem = symbol;
}
else if( pin->IsBrightened() && !connNames.count( pin_conn->Name() ) )
{
pin->ClearBrightened();
redrawItem = symbol;
if( !pin->IsBrightened() && connNames.count( pin_conn->Name() ) )
{
pin->SetBrightened();
redrawItem = symbol;
}
else if( pin->IsBrightened() && !connNames.count( pin_conn->Name() ) )
{
pin->ClearBrightened();
redrawItem = symbol;
}
}
}
if( symbol->IsPower() )
if( symbol->IsPower() && symbol->GetPins().size() )
{
wxCHECK2( symbol->GetPins().size(), continue );
SCH_CONNECTION* pinConn = symbol->GetPins()[0]->Connection();
wxCHECK2( pinConn, continue );
std::vector<SCH_FIELD>& fields = symbol->GetFields();
for( int id : { REFERENCE_FIELD, VALUE_FIELD } )
if( SCH_CONNECTION* pinConn = symbol->GetPins()[0]->Connection() )
{
if( !fields[id].IsVisible() )
continue;
std::vector<SCH_FIELD>& fields = symbol->GetFields();
if( !fields[id].IsBrightened() && connNames.count( pinConn->Name() ) )
for( int id : { REFERENCE_FIELD, VALUE_FIELD } )
{
fields[id].SetBrightened();
redrawItem = symbol;
}
else if( fields[id].IsBrightened() && !connNames.count( pinConn->Name() ) )
{
fields[id].ClearBrightened();
redrawItem = symbol;
if( !fields[id].IsVisible() )
continue;
if( !fields[id].IsBrightened() && connNames.count( pinConn->Name() ) )
{
fields[id].SetBrightened();
redrawItem = symbol;
}
else if( fields[id].IsBrightened() && !connNames.count( pinConn->Name() ) )
{
fields[id].ClearBrightened();
redrawItem = symbol;
}
}
}
}
@@ -1158,43 +1151,39 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
{
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
wxCHECK2( sheet, continue );
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
{
wxCHECK2( pin, continue );
SCH_CONNECTION* pin_conn = pin->Connection();
wxCHECK2( pin_conn, continue );
if( !pin->IsBrightened() && connNames.count( pin_conn->Name() ) )
if( SCH_CONNECTION* pin_conn = pin->Connection() )
{
pin->SetBrightened();
redrawItem = sheet;
}
else if( pin->IsBrightened() && !connNames.count( pin_conn->Name() ) )
{
pin->ClearBrightened();
redrawItem = sheet;
if( !pin->IsBrightened() && connNames.count( pin_conn->Name() ) )
{
pin->SetBrightened();
redrawItem = sheet;
}
else if( pin->IsBrightened() && !connNames.count( pin_conn->Name() ) )
{
pin->ClearBrightened();
redrawItem = sheet;
}
}
}
}
else
{
SCH_CONNECTION* itemConn = item->Connection();
wxCHECK2( itemConn, continue );
if( !item->IsBrightened() && connNames.count( itemConn->Name() ) )
if( SCH_CONNECTION* itemConn = item->Connection() )
{
item->SetBrightened();
redrawItem = item;
}
else if( item->IsBrightened() && !connNames.count( itemConn->Name() ) )
{
item->ClearBrightened();
redrawItem = item;
if( !item->IsBrightened() && connNames.count( itemConn->Name() ) )
{
item->SetBrightened();
redrawItem = item;
}
else if( item->IsBrightened() && !connNames.count( itemConn->Name() ) )
{
item->ClearBrightened();
redrawItem = item;
}
}
}
+15 -7
View File
@@ -43,7 +43,8 @@
#include <import_gfx/dialog_import_gfx_sch.h>
#include "dialog_lib_textbox_properties.h"
static void* g_lastPinWeakPtr;
KIID SYMBOL_EDITOR_DRAWING_TOOLS::g_lastPin;
SYMBOL_EDITOR_DRAWING_TOOLS::SYMBOL_EDITOR_DRAWING_TOOLS() :
@@ -214,7 +215,10 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
case LIB_PIN_T:
{
item = pinTool->CreatePin( VECTOR2I( cursorPos.x, -cursorPos.y ), symbol );
g_lastPinWeakPtr = item;
if( item )
g_lastPin = item->m_Uuid;
break;
}
case LIB_TEXT_T:
@@ -463,10 +467,13 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape( const TOOL_EVENT& aEvent, std::opt
{
LIB_TEXTBOX* textbox = new LIB_TEXTBOX( symbol, lineWidth, m_lastFillStyle );
textbox->SetBold( m_lastTextBold );
textbox->SetItalic( m_lastTextItalic );
textbox->SetTextSize( VECTOR2I( schIUScale.MilsToIU( settings->m_Defaults.text_size ),
schIUScale.MilsToIU( settings->m_Defaults.text_size ) ) );
// Must be after SetTextSize()
textbox->SetBold( m_lastTextBold );
textbox->SetItalic( m_lastTextItalic );
textbox->SetTextAngle( m_lastTextAngle );
textbox->SetHorizJustify( m_lastTextJust );
@@ -830,12 +837,11 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent )
if( !symbol )
return 0;
// See if we have a pin matching our weak ptr
std::vector<LIB_PIN*> pins = symbol->GetAllLibPins();
for( LIB_PIN* test : pins )
{
if( (void*) test == g_lastPinWeakPtr )
if( test->m_Uuid == g_lastPin )
{
sourcePin = test;
break;
@@ -845,7 +851,9 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent )
if( sourcePin )
{
LIB_PIN* pin = pinTool->RepeatPin( sourcePin );
g_lastPinWeakPtr = pin;
if( pin )
g_lastPin = pin->m_Uuid;
m_toolMgr->RunAction( EE_ACTIONS::clearSelection );
@@ -65,6 +65,9 @@ public:
void SetDrawSpecificUnit( bool aSpecific ) { m_drawSpecificUnit = aSpecific; }
bool GetDrawSpecificUnit() const { return m_drawSpecificUnit; }
KIID GetLastPin() { return g_lastPin; }
void SetLastPin( KIID aPin ) { g_lastPin = aPin; }
private:
int doDrawShape( const TOOL_EVENT& aEvent, std::optional<SHAPE_T> aDrawingShape );
@@ -84,6 +87,9 @@ private:
///< Re-entrancy guards
bool m_inDrawShape;
bool m_inTwoClickPlace;
private:
static KIID g_lastPin;
};
#endif /* SYMBOL_EDITOR_DRAWING_TOOLS_H */
@@ -409,6 +409,11 @@ int SYMBOL_EDITOR_PIN_TOOL::PushPinProperties( const TOOL_EVENT& aEvent )
// Create a new pin based on the previous pin with an incremented pin number.
LIB_PIN* SYMBOL_EDITOR_PIN_TOOL::RepeatPin( const LIB_PIN* aSourcePin )
{
SCH_COMMIT commit( m_frame );
LIB_SYMBOL* symbol = m_frame->GetCurSymbol();
commit.Modify( symbol );
LIB_PIN* pin = (LIB_PIN*) aSourcePin->Duplicate();
VECTOR2I step;
@@ -439,7 +444,10 @@ LIB_PIN* SYMBOL_EDITOR_PIN_TOOL::RepeatPin( const LIB_PIN* aSourcePin )
pin->SetFlags( IS_LINKED );
if( PlacePin( pin ) )
{
commit.Push( _( "Repeat Pin" ) );
return pin;
}
return nullptr;
}
+8 -5
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2024 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
@@ -298,7 +298,7 @@ void fillArcGBRITEM( GERBER_DRAW_ITEM* aGbrItem, int Dcode_index, const VECTOR2I
aGbrItem->SetLayerPolarity( aLayerNegative );
}
#include <wx/log.h>
/**
* Create an arc G code when found in polygon outlines.
*
@@ -368,9 +368,12 @@ static void fillArcPOLY( GERBER_DRAW_ITEM* aGbrItem, const VECTOR2I& aStart, con
EDA_ANGLE arc_angle = start_angle - end_angle;
// Approximate arc by 36 segments per 360 degree
EDA_ANGLE increment_angle = ANGLE_360 / 36;
int count = std::abs( arc_angle.AsDegrees() / increment_angle.AsDegrees() );
// Approximate arc by segments with a approximation error = err_max
// a max err = 5 microns looks good
const int approx_err_max = gerbIUScale.mmToIU( 0.005 );
int radius = VECTOR2I( aStart - rel_center ).EuclideanNorm();
int count = GetArcToSegmentCount( radius, approx_err_max, arc_angle );
EDA_ANGLE increment_angle = std::abs( arc_angle ) / count;
if( aGbrItem->m_ShapeAsPolygon.OutlineCount() == 0 )
aGbrItem->m_ShapeAsPolygon.NewOutline();
-2
View File
@@ -127,8 +127,6 @@ private:
*/
void jobUpdated( std::shared_ptr<BACKGROUND_JOB> aJob );
BACKGROUND_JOB_LIST* m_jobListDialog;
/**
* Holds a reference to all active background jobs
* Access to this vector should be protected by locks since threads may Create or Remove at will
+47
View File
@@ -0,0 +1,47 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Jean-Pierre Charras.
* Copyright (C) 2024 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/>.
*/
#pragma once
// These flags are used to control the data items that must be disabled when creating
// mainly a netlist but also some other kicad files.
// They allow skipping specified data in these files.
#define CTL_OMIT_EXTRA (1 << 0)
#define CTL_OMIT_NETS (1 << 1)
#define CTL_OMIT_PAD_NETS (1 << 1) ///< Omit pads net names (useless in library)
#define CTL_OMIT_UUIDS (1 << 2) ///< Omit component unique ids (useless in library)
#define CTL_OMIT_FP_UUID (1 << 3) ///< Don't prefix the footprint UUID to the sheet path.
#define CTL_OMIT_PATH (1 << 4) ///< Omit component sheet time stamp (useless in library)
#define CTL_OMIT_AT (1 << 5) ///< Omit position and rotation. (always saved
///< with position 0,0 and rotation = 0 in library).
// If set, when calling EDA_TEXT::Format, disable writing the "hide" keyword in save file
#define CTL_OMIT_HIDE (1 << 6) ///< Omit the hide attribute in .kicad_xxx files
#define CTL_OMIT_LIBNAME (1 << 7) ///< Omit lib alias when saving (used for
///< board/not library).
#define CTL_OMIT_FOOTPRINT_VERSION (1 << 8) ///< Omit the version string from the (footprint)
///< sexpr group
#define CTL_OMIT_FILTERS (1 << 9) ///< Omit the ki_fp_filters attribute in .kicad_xxx files
#define CTL_OMIT_INITIAL_COMMENTS (1 << 10) ///< omit FOOTPRINT initial comments
#define CTL_OMIT_COLOR (1 << 11) ///< Omit the color attribute in .kicad_xxx files
#define CTL_OMIT_HYPERLINK (1 << 12) ///< Omit the hyperlink attribute in .kicad_xxx files
+2 -5
View File
@@ -33,6 +33,7 @@
#include <font/glyph.h>
#include <font/text_attributes.h>
class OUTPUTFORMATTER;
class SHAPE_COMPOUND;
class SHAPE_POLY_SET;
@@ -60,11 +61,6 @@ namespace KIFONT
using KIGFX::RENDER_SETTINGS;
using KIGFX::COLOR4D;
// part of the kicad_plugin.h family of defines.
// See kicad_plugin.h for the choice of the value
// When set when calling EDA_TEXT::Format, disable writing the "hide" keyword in save file
#define CTL_OMIT_HIDE (1 << 6)
/**
* This is the "default-of-the-default" hardcoded text size; individual application define their
@@ -144,6 +140,7 @@ public:
bool IsItalic() const { return m_attributes.m_Italic; }
void SetBold( bool aBold );
void SetBoldFlag( bool aBold );
bool IsBold() const { return m_attributes.m_Bold; }
virtual void SetVisible( bool aVisible );
+13 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 2015, 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2024 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
@@ -44,6 +44,7 @@
#include <kicommon.h>
#include <curl/curl.h>
#include <string>
#include <shared_mutex>
// CURL_EXTERN expands to dllimport on MinGW which causes gcc warnings. This really should
// expand to nothing on MinGW.
@@ -75,6 +76,17 @@ public:
*/
static void Cleanup();
/**
* Returns the mutex for shared locking when performing curl operations.
* Unique locking is performed when shutting down.
*/
static std::shared_mutex& Mutex();
/**
* Returns true if all curl operations should terminate.
*/
static bool IsShuttingDown();
/**
* Wrapper for curl_version(). Reports back a short string of loaded libraries.
*
+1
View File
@@ -38,6 +38,7 @@
#include <memory>
#include <ostream>
#include <string>
#include <cstdint>
typedef void CURL;
struct curl_slist;
-17
View File
@@ -50,23 +50,6 @@
#define LABELUSERFIELD_V 200
/**
* This class works around a bug in wxGrid where the first keystroke doesn't get sent through
* the validator if the editor wasn't already open.
*/
class GRID_CELL_TEXT_EDITOR : public wxGridCellTextEditor
{
public:
GRID_CELL_TEXT_EDITOR();
virtual void SetValidator( const wxValidator& validator ) override;
virtual void StartingKey( wxKeyEvent& event ) override;
protected:
std::unique_ptr<wxValidator> m_validator;
};
/**
* This class provides a custom wxValidator object for limiting the allowable characters when
* defining footprint names. Since the introduction of the PRETTY footprint library format,
+22
View File
@@ -22,6 +22,7 @@
#define KICAD_GRID_TEXT_HELPERS_H
#include <functional>
#include <memory>
#include <wx/generic/gridctrl.h>
class wxGrid;
@@ -29,6 +30,26 @@ class wxStyledTextCtrl;
class wxStyledTextEvent;
class SCINTILLA_TRICKS;
/**
* This class works around a bug in wxGrid where the first keystroke doesn't get sent through
* the validator if the editor wasn't already open.
*/
class GRID_CELL_TEXT_EDITOR : public wxGridCellTextEditor
{
public:
GRID_CELL_TEXT_EDITOR();
void SetSize( const wxRect& aRect ) override;
virtual void SetValidator( const wxValidator& validator ) override;
virtual void StartingKey( wxKeyEvent& event ) override;
protected:
std::unique_ptr<wxValidator> m_validator;
};
/**
* A text renderer that can unescape text for display
* This is useful where it's desired to keep the underlying storage escaped.
@@ -51,6 +72,7 @@ public:
GRID_CELL_STC_EDITOR( bool aIgnoreCase,
std::function<void( wxStyledTextEvent&, SCINTILLA_TRICKS* )> aOnChar );
void SetSize( const wxRect& aRect ) override;
void Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler ) override;
wxGridCellEditor* Clone() const override
+2 -1
View File
@@ -44,7 +44,8 @@ class KISTATUSBAR : public wxStatusBar
public:
KISTATUSBAR( int aNumberFields, wxWindow* parent, wxWindowID id );
public:
~KISTATUSBAR();
/**
* Set the text in a field using wxELLIPSIZE_MIDDLE option to adjust the text size
* to the field size (unfortunately, setting the wxStatusBar style to wxELLIPSIZE_MIDDLE
+12
View File
@@ -34,6 +34,8 @@
#include <units_provider.h>
#include <libeval/numeric_evaluator.h>
class wxTextEntryBase;
class WX_GRID : public wxGrid
{
@@ -150,6 +152,16 @@ public:
DeleteRows( 0, GetNumberRows() );
}
/**
* A helper function to set OS-specific margins for text-based cell editors.
*/
static void CellEditorSetMargins( wxTextEntryBase* aEntry );
/**
* A helper function to tweak sizes of text-based cell editors depending on OS.
*/
static void CellEditorTransformSizeRect( wxRect& aRect );
protected:
/**
* A re-implementation of wxGrid::DrawColLabel which left-aligns the first column and draws
+5 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2022 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023, 2024 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
@@ -41,6 +41,7 @@
#define ARG_MAP_FORMAT "--map-format"
#define ARG_DRILL_ORIGIN "--drill-origin"
CLI::PCB_EXPORT_DRILL_COMMAND::PCB_EXPORT_DRILL_COMMAND() : PCB_EXPORT_BASE_COMMAND( "drill",
false, true )
{
@@ -109,7 +110,8 @@ int CLI::PCB_EXPORT_DRILL_COMMAND::doPerform( KIWAY& aKiway )
if( !drillJob->m_outputDir.IsEmpty() )
{
wxFileName fn( drillJob->m_outputDir );
wxFileName fn( drillJob->m_outputDir, wxEmptyString );
if( !fn.IsDir() )
{
wxFprintf( stderr, _( "Output must be a directory\n" ) );
@@ -175,6 +177,7 @@ int CLI::PCB_EXPORT_DRILL_COMMAND::doPerform( KIWAY& aKiway )
wxString drillFormat =
From_UTF8( m_argParser.get<std::string>( ARG_EXCELLON_OVAL_FORMAT ).c_str() );
if( drillFormat == wxS( "route" ) )
{
drillJob->m_excellonOvalDrillRoute = true;
+7
View File
@@ -42,6 +42,13 @@ PANEL_KICAD_LAUNCHER::PANEL_KICAD_LAUNCHER( wxWindow* aParent ) :
}
PANEL_KICAD_LAUNCHER::~PANEL_KICAD_LAUNCHER()
{
Unbind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( PANEL_KICAD_LAUNCHER::onThemeChanged ), this );
}
void PANEL_KICAD_LAUNCHER::CreateLaunchers()
{
m_frame->SetPcmButton( nullptr );
+1 -1
View File
@@ -30,7 +30,7 @@ class PANEL_KICAD_LAUNCHER : public PANEL_KICAD_LAUNCHER_BASE
public:
PANEL_KICAD_LAUNCHER( wxWindow* aParent );
virtual ~PANEL_KICAD_LAUNCHER() = default;
~PANEL_KICAD_LAUNCHER();
void CreateLaunchers();
+3
View File
@@ -260,6 +260,9 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl
KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME()
{
Unbind( wxEVT_CHAR, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
Unbind( wxEVT_CHAR_HOOK, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
Pgm().GetBackgroundJobMonitor().UnregisterStatusBar( (KISTATUSBAR*) GetStatusBar() );
Pgm().GetNotificationsManager().UnregisterStatusBar( (KISTATUSBAR*) GetStatusBar() );
+1 -1
View File
@@ -242,7 +242,7 @@ void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
else
{
m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
KICAD_AUI_TB_STYLE | wxAUI_TB_VERTICAL );
m_mainToolBar->SetAuiManager( &m_auimgr );
}
+4
View File
@@ -210,6 +210,10 @@ PROJECT_TREE_PANE::PROJECT_TREE_PANE( KICAD_MANAGER_FRAME* parent ) :
PROJECT_TREE_PANE::~PROJECT_TREE_PANE()
{
Disconnect( wxEVT_FSWATCHER,
wxFileSystemWatcherEventHandler( PROJECT_TREE_PANE::onFileSystemEvent ) );
Unbind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( PROJECT_TREE_PANE::onThemeChanged ), this );
shutdownFileWatcher();
}
+11 -1
View File
@@ -1223,7 +1223,7 @@ const SHAPE_LINE_CHAIN SHAPE_LINE_CHAIN::Slice( int aStartIndex, int aEndIndex )
const SHAPE_ARC& arcToSplit = Arc( arcToSplitIndex );
// Copy the points as arc points
for( size_t i = aStartIndex; arcToSplitIndex == ArcIndex( i ); i++ )
for( size_t i = aStartIndex; i < m_points.size() && arcToSplitIndex == ArcIndex( i ); i++ )
{
rv.m_points.push_back( m_points[i] );
rv.m_shapes.push_back( { rv.m_arcs.size(), SHAPE_IS_PT } );
@@ -1320,6 +1320,8 @@ const SHAPE_LINE_CHAIN SHAPE_LINE_CHAIN::Slice( int aStartIndex, int aEndIndex )
}
wxASSERT( rv.m_points.size() == rv.m_shapes.size() );
return rv;
}
@@ -2196,6 +2198,14 @@ void SHAPE_LINE_CHAIN::Simplify( int aMaxError )
new_shapes.push_back( m_shapes.back() );
}
// If we are not closed, then the start and end points of the original line need to
// be the start and end points of the new line.
if( !m_closed && m_points.back() != new_points.back() )
{
new_points.push_back( m_points.back() );
new_shapes.push_back( m_shapes.back() );
}
m_points.clear();
m_shapes.clear();
m_points = new_points;
+3 -3
View File
@@ -78,8 +78,8 @@ namespace SEXPR
return str;
}
std::unique_ptr<SEXPR> PARSER::parseString(
const std::string& aString, std::string::const_iterator& it )
std::unique_ptr<SEXPR> PARSER::parseString( const std::string& aString,
std::string::const_iterator& it )
{
for( ; it != aString.end(); ++it )
{
@@ -101,7 +101,7 @@ namespace SEXPR
if( *it == '\n' )
m_lineNumber++;
if( whitespaceCharacters.find(*it) != std::string::npos )
if( whitespaceCharacters.find( *it ) != std::string::npos )
{
std::advance( it, 1 );
continue;
+27 -7
View File
@@ -115,10 +115,12 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
setCursor();
cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() )
if( evt->IsCancelInteractive() || ( item && evt->IsAction( &ACTIONS::undo ) ) )
{
if( item )
{
cleanup();
}
else
{
m_frame->PopTool( aEvent );
@@ -143,7 +145,8 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_LEFT ) )
{
// First click creates...
bool placeItem = true;
if( !item )
{
DS_DATA_ITEM* dataItem = m_frame->AddDrawingSheetItem( type );
@@ -163,10 +166,14 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
// update the cursor so it looks correct before another event
setCursor();
// Text is a single-click-place; all others are first-click-creates,
// second-click-places.
placeItem = dataItem->GetType() == DS_DATA_ITEM::DS_TEXT;
}
}
// ... and second click places:
else
if( item && placeItem )
{
item->GetPeer()->MoveStartPointToIU( cursorPos );
item->SetPosition( item->GetPeer()->GetStartPosIU( 0 ) );
@@ -249,7 +256,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() || evt->IsActivate() )
if( evt->IsCancelInteractive() || ( item && evt->IsAction( &ACTIONS::undo ) ) )
{
m_toolMgr->RunAction( PL_ACTIONS::clearSelection );
@@ -260,13 +267,26 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
// Pop the undo stack and delete the item being placed
m_frame->RollbackFromUndo();
}
else if( evt->IsCancelInteractive() )
else
{
break;
}
}
else if( evt->IsActivate() )
{
if( item )
{
item = nullptr;
if( evt->IsActivate() && !evt->IsPointEditor() && !evt->IsMoveTool() )
// Pop the undo stack and delete the item being placed
m_frame->RollbackFromUndo();
}
if( evt->IsPointEditor() || evt->IsMoveTool() )
{
// leave ourselves on the stack so we come back after the move
break;
}
}
else if( evt->IsClick( BUT_LEFT ) )
{
+13 -10
View File
@@ -2208,18 +2208,21 @@ bool BOARD::GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines,
SHAPE_POLY_SET hole;
pad->TransformHoleToPolygon( hole, 0, GetDesignSettings().m_MaxError, ERROR_INSIDE );
// Add this pad hole to the main outline
// But we can have more than one main outline (i.e. more than one board), so
// search the right main outline i.e. the outline that contains the pad hole
SHAPE_LINE_CHAIN& pad_hole = hole.Outline( 0 );
const VECTOR2I holePt = pad_hole.CPoint( 0 );
for( int jj = 0; jj < aOutlines.OutlineCount(); ++jj )
if( hole.OutlineCount() > 0 ) // can be not the case for malformed NPTH holes
{
if( aOutlines.Outline( jj ).PointInside( holePt ) )
// Add this pad hole to the main outline
// But we can have more than one main outline (i.e. more than one board), so
// search the right main outline i.e. the outline that contains the pad hole
SHAPE_LINE_CHAIN& pad_hole = hole.Outline( 0 );
const VECTOR2I holePt = pad_hole.CPoint( 0 );
for( int jj = 0; jj < aOutlines.OutlineCount(); ++jj )
{
aOutlines.AddHole( pad_hole, jj );
break;
if( aOutlines.Outline( jj ).PointInside( holePt ) )
{
aOutlines.AddHole( pad_hole, jj );
break;
}
}
}
}
+24 -10
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2024 KiCad Developers, see AUTHORS.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@@ -464,15 +464,6 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
} );
}
if( bulkAddedItems.size() > 0 )
board->FinalizeBulkAdd( bulkAddedItems );
if( bulkRemovedItems.size() > 0 )
board->FinalizeBulkRemove( bulkRemovedItems );
if( itemsChanged.size() > 0 )
board->OnItemsChanged( itemsChanged );
if( m_isBoardEditor )
{
size_t num_changes = m_changes.size();
@@ -501,8 +492,13 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
}
if( !staleTeardropPadsAndVias.empty() || !staleTeardropTracks.empty() )
{
teardropMgr.UpdateTeardrops( *this, &staleTeardropPadsAndVias, &staleTeardropTracks );
// UpdateTeardrops() can modify the ratsnest data. So rebuild this ratsnest data
connectivity->RecalculateRatsnest( this );
}
// Log undo items for any connectivity or teardrop changes
for( size_t i = num_changes; i < m_changes.size(); ++i )
{
@@ -535,6 +531,15 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
}
}
if( bulkAddedItems.size() > 0 )
board->FinalizeBulkAdd( bulkAddedItems );
if( bulkRemovedItems.size() > 0 )
board->FinalizeBulkRemove( bulkRemovedItems );
if( itemsChanged.size() > 0 )
board->OnItemsChanged( itemsChanged );
if( frame )
{
if( !( aCommitFlags & SKIP_UNDO ) )
@@ -563,6 +568,15 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
frame->OnModify();
else
frame->Update3DView( true, frame->GetPcbNewSettings()->m_Display.m_Live3DRefresh );
// Ensure the message panel is updated after committing changes.
// By default (i.e. if no event posted), display the updated board info
if( !itemsDeselected && !autofillZones && !selectedModified )
{
std::vector<MSG_PANEL_ITEM> msg_list;
board->GetMsgPanelInfo( frame, msg_list );
frame->SetMsgPanel( msg_list );
}
}
clear();

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