mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Compare commits
974 Commits
c0a98e3f7c
...
f089e33544
Author | SHA1 | Date | |
---|---|---|---|
|
f089e33544 | ||
|
18b56539a6 | ||
|
9b006c4f3b | ||
|
8035a66152 | ||
|
45166bf5c3 | ||
|
6ab6283e2e | ||
|
fc7d91214d | ||
|
dcbadb5857 | ||
|
3b97804cb6 | ||
|
e72def55a9 | ||
|
fcf40deae2 | ||
|
ef602be91f | ||
|
bd5cb76fcd | ||
|
de26550b5a | ||
|
7deff606be | ||
|
6e2b20ed0e | ||
|
2f1a91279f | ||
|
6e316d9faa | ||
|
3c5fb9d90d | ||
|
11cc86e586 | ||
|
5e2fd084b9 | ||
|
a1f816e8be | ||
|
abf3438ed6 | ||
|
cb4c8e6647 | ||
|
d356073798 | ||
|
b38d9d7f81 | ||
|
297ca1bb7b | ||
|
f9e25c2e06 | ||
|
b0a6dc4acf | ||
|
59dcdb4a4f | ||
|
39889f8446 | ||
|
3f8abe3744 | ||
|
0acc659676 | ||
|
78c93ee0fb | ||
|
9622cf8ff1 | ||
|
3cca1e87d8 | ||
|
aac15f4596 | ||
|
ceed9ca5f8 | ||
|
6c4edd178e | ||
|
cfa87cfc2c | ||
|
b3b75270ce | ||
|
f1db857804 | ||
|
cdd43fe5fa | ||
|
836b3267bb | ||
|
66930ea703 | ||
|
0e60722c4b | ||
|
2b3f21b9ff | ||
|
dd8a059925 | ||
|
63fe36847e | ||
|
99a16e4306 | ||
|
5ca8fdb7cd | ||
|
88ee07e910 | ||
|
71907f0888 | ||
|
6397b6d3c6 | ||
|
d1356140fa | ||
|
30d158a60f | ||
|
c674e1749e | ||
|
c783218f93 | ||
|
07885145b3 | ||
|
500da3c15d | ||
|
fbd2e36b79 | ||
|
61fd5e7413 | ||
|
bf8d2d7bf6 | ||
|
2a93e1bfb1 | ||
|
9f097d5ae8 | ||
|
80996e70f8 | ||
|
ec8131c7bf | ||
|
2ad7c345ec | ||
|
a2e0d07c87 | ||
|
4e1dd875ae | ||
|
c737e0b360 | ||
|
c29aa7643c | ||
|
58b2ccb3d5 | ||
|
a05f8b9e36 | ||
|
9f2b84ba52 | ||
|
b345e34423 | ||
|
081b414ad5 | ||
|
58caa5c496 | ||
|
f0f5472e4d | ||
|
0b174b5227 | ||
|
765838ecf7 | ||
|
2276ae05e3 | ||
|
6838d55051 | ||
|
95abb3be8b | ||
|
41425ac32d | ||
|
0b47169387 | ||
|
7b98a8d697 | ||
|
4184e60e24 | ||
|
36eb0e4a11 | ||
|
49c7f62548 | ||
|
35f0213011 | ||
|
cb87f83dfc | ||
|
ead7de69ca | ||
|
dedc10a163 | ||
|
330361d0cb | ||
|
01d32211ba | ||
|
09c40a0e0f | ||
|
fdbf740ee2 | ||
|
93b0004175 | ||
|
0a162ded84 | ||
|
01f6776226 | ||
|
adbc80aade | ||
|
0b102fc085 | ||
|
22288e02a2 | ||
|
58f4ca7ed6 | ||
|
8ae2ad3586 | ||
|
0f97f51ba1 | ||
|
0c35068e8d | ||
|
f66cbaf43a | ||
|
ac1b44715b | ||
|
b98621c8c8 | ||
|
28141ed350 | ||
|
c33da162d6 | ||
|
288c93198a | ||
|
46c8a6ee95 | ||
|
bbecc4eaa8 | ||
|
fef84a2c6a | ||
|
963ec84587 | ||
|
4a87dbe472 | ||
|
7d67f82217 | ||
|
b7fee045e3 | ||
|
0e5a87546b | ||
|
5489daf279 | ||
|
922699f388 | ||
|
702f774a1f | ||
|
264029c8e9 | ||
|
c889a7fa16 | ||
|
fb558eee3c | ||
|
6f352ccd96 | ||
|
c163f0a24c | ||
|
fd7da138fd | ||
|
3bdf44d4a4 | ||
|
168975b0a8 | ||
|
03b3b642b0 | ||
|
f9f5bb9ed1 | ||
|
4254673be5 | ||
|
0ce952e705 | ||
|
9ffb0c8b96 | ||
|
44cc5b8e93 | ||
|
a857ea77d9 | ||
|
bae5d43c45 | ||
|
2cbd441042 | ||
|
9a7088c03c | ||
|
7a09960b46 | ||
|
05d04e665a | ||
|
9f1aa612ec | ||
|
9de2548064 | ||
|
825585847b | ||
|
6c8f25b418 | ||
|
a899da7cb7 | ||
|
a49e3b9cc5 | ||
|
9bc1cf006f | ||
|
dc7e0665c3 | ||
|
344fab5741 | ||
|
9342aea7fa | ||
|
11c5e03890 | ||
|
3deb06bf82 | ||
|
5c865cab36 | ||
|
f7fd832c67 | ||
|
62e220a8db | ||
|
622ddd3a37 | ||
|
9f06d1f66b | ||
|
f84ba3004d | ||
|
e85a8056f5 | ||
|
173e02eff7 | ||
|
876c905e2b | ||
|
5914b5aaa8 | ||
|
2346be9768 | ||
|
d4b08f0a8a | ||
|
f18c4a05fd | ||
|
ad80113f47 | ||
|
8f0b3b59f0 | ||
|
bf82217217 | ||
|
d9741fd46a | ||
|
826f15a103 | ||
|
edf8f45351 | ||
|
202619cd43 | ||
|
8709f73b98 | ||
|
e76b2089bb | ||
|
2e0088593e | ||
|
b34746e06b | ||
|
9b14434fc3 | ||
|
1f1f8699e0 | ||
|
0ede830f54 | ||
|
de8c4d4b01 | ||
|
e01dfd3158 | ||
|
cff261ce2e | ||
|
6a171e11fb | ||
|
1e272ca21b | ||
|
60a5c8b742 | ||
|
9cba910d53 | ||
|
35ffb28335 | ||
|
98b63389c1 | ||
|
ce140d8dfc | ||
|
5e2ec53165 | ||
|
d5e342b64d | ||
|
eedfb7a573 | ||
|
c95c15dd4e | ||
|
4a4725c906 | ||
|
667dccb163 | ||
|
4fb76404bc | ||
|
267ee811a7 | ||
|
e016dc52fd | ||
|
c4d9338097 | ||
|
5d967289ee | ||
|
262f1fdabb | ||
|
c9476caebf | ||
|
a8d6292d61 | ||
|
4953e80122 | ||
|
bd04d508e0 | ||
|
82c61efcbd | ||
|
4024a15a17 | ||
|
0c8e7a7137 | ||
|
1f44417ad0 | ||
|
5b31b11731 | ||
|
5fb55ccb30 | ||
|
2eb7ba2fb9 | ||
|
2c4d792358 | ||
|
77a2330a33 | ||
|
7b4f4540b4 | ||
|
1885f4bdee | ||
|
eba8d0748c | ||
|
f5904cf2ac | ||
|
bbc762a546 | ||
|
c6c8e19e39 | ||
|
1309b436da | ||
|
c47b7459aa | ||
|
a2e98fb53c | ||
|
2321285c16 | ||
|
2cdeb0cd7c | ||
|
4af585c531 | ||
|
8c6f057f6c | ||
|
9d7db3d135 | ||
|
b22f259ccb | ||
|
b86cddbbe9 | ||
|
053c46aa72 | ||
|
4610a49323 | ||
|
68f9b74ae9 | ||
|
814f78f2b2 | ||
|
be57c1a380 | ||
|
194b7f9dc5 | ||
|
c6fcf7e0b8 | ||
|
cf09e8ae88 | ||
|
1ff5f09c3a | ||
|
7610c02fed | ||
|
7fd8b515b5 | ||
|
ba84f50997 | ||
|
acc7b1e508 | ||
|
67feb2e139 | ||
|
6f59821930 | ||
|
6592c75345 | ||
|
1a3f6028f8 | ||
|
fe4ddc66eb | ||
|
e3b550dd13 | ||
|
1baa28a1e6 | ||
|
0f1b514964 | ||
|
aeafbe48fe | ||
|
2b8542861c | ||
|
9dd642b66c | ||
|
d5c0d040b4 | ||
|
b3de964eff | ||
|
8acf5c1a25 | ||
|
e282dca102 | ||
|
a811f61c39 | ||
|
50274352b1 | ||
|
ec7b831be3 | ||
|
9525fae7c8 | ||
|
e8cec41355 | ||
|
8a60893249 | ||
|
7115f9e716 | ||
|
736d87aa35 | ||
|
eb6b2de648 | ||
|
83fab7b02c | ||
|
af852ea15d | ||
|
fd57f637ac | ||
|
5c240efd75 | ||
|
b01c1f39c1 | ||
|
3e019ee4ae | ||
|
4f32146f9a | ||
|
9bc463606a | ||
|
747106ea37 | ||
|
94d83773d0 | ||
|
3a8dd87db4 | ||
|
2cf6ec2411 | ||
|
408e1feae2 | ||
|
ea8206eca5 | ||
|
6dd4e01f16 | ||
|
3eb6caaec6 | ||
|
9725ac2215 | ||
|
b349f1988a | ||
|
963aa47778 | ||
|
2f21414186 | ||
|
8bd6da3ec9 | ||
|
19e4c3f498 | ||
|
57ad779797 | ||
|
46084c04b9 | ||
|
635445c096 | ||
|
394f6be509 | ||
|
fe4de09d71 | ||
|
b832ae7f45 | ||
|
8592b2ee70 | ||
|
1e76f1a11d | ||
|
0a767acb3a | ||
|
29c4d9b197 | ||
|
2db8c6eca0 | ||
|
9c577a4f4c | ||
|
0f0527bd03 | ||
|
3d8803f579 | ||
|
4bebd09bd0 | ||
|
7f4a1bf64a | ||
|
ab93dd8a68 | ||
|
cb620338db | ||
|
dad60f99c0 | ||
|
4660c72c69 | ||
|
b5f3d4cf7b | ||
|
412fc1e6d9 | ||
|
8997b7bcf7 | ||
|
5b86f20476 | ||
|
7841476ed6 | ||
|
a034c30563 | ||
|
6dd03bc735 | ||
|
1df5ad0e4c | ||
|
9013ddae43 | ||
|
bfe805a221 | ||
|
843eea259d | ||
|
cc9ec7c01c | ||
|
537ea6ee0c | ||
|
cc9402ac9d | ||
|
20a80a5f94 | ||
|
ef0ca4840e | ||
|
4e7fa189aa | ||
|
87ee9c4b49 | ||
|
9cabceb773 | ||
|
ba9e9a2368 | ||
|
b709439b65 | ||
|
ad7235e386 | ||
|
3058bc6355 | ||
|
9808889c9c | ||
|
8c3026cf1a | ||
|
0477fb65ec | ||
|
613db94679 | ||
|
04dab54825 | ||
|
85397f6edc | ||
|
626e9d9d1b | ||
|
5442e5050e | ||
|
eb753b8a1b | ||
|
3ef862f7b6 | ||
|
66c42f396c | ||
|
71a6d26054 | ||
|
c842f2700f | ||
|
9dc76f658d | ||
|
f3c222f5ba | ||
|
e346139301 | ||
|
a7772e3b91 | ||
|
8520bfefa0 | ||
|
8ce0bf7623 | ||
|
7fa9aabead | ||
|
11f9817ebc | ||
|
cac334bb45 | ||
|
8acdcafe90 | ||
|
f415ba78fa | ||
|
26f0c03e61 | ||
|
d02358da2f | ||
|
61aeea9237 | ||
|
8330cf5d12 | ||
|
206dfa2883 | ||
|
1dc278488d | ||
|
83427c38aa | ||
|
a77e1027d6 | ||
|
679ee7e4d1 | ||
|
2e1910ca86 | ||
|
4da77e046c | ||
|
03c230dd64 | ||
|
01991fed53 | ||
|
5576d1ed9c | ||
|
424807da03 | ||
|
7fbca40dd8 | ||
|
59af606a5c | ||
|
1a9993d764 | ||
|
d2f852504a | ||
|
a467727503 | ||
|
c47641f454 | ||
|
637902f43f | ||
|
66a1e268d7 | ||
|
3e58b34843 | ||
|
26b5e89640 | ||
|
ec2d9c9d4c | ||
|
29a818218a | ||
|
3f85071f91 | ||
|
73bb65b802 | ||
|
42735b775d | ||
|
d636eec643 | ||
|
937d53b77c | ||
|
7201918383 | ||
|
90621947bf | ||
|
f896417ed4 | ||
|
81864057d2 | ||
|
f005d9e688 | ||
|
ba7d9efb49 | ||
|
441032d914 | ||
|
b1e6298473 | ||
|
40f1aaa0c1 | ||
|
3e93d3f5d9 | ||
|
80d20dd3a1 | ||
|
d92e2e5a62 | ||
|
5c9fead65c | ||
|
08a3bac912 | ||
|
67dc1d3c3b | ||
|
44228bd580 | ||
|
c2f503774b | ||
|
29317ace77 | ||
|
0f0c2ea494 | ||
|
7e4133b9ec | ||
|
1e3c95a1d5 | ||
|
ef50c31584 | ||
|
2abeb5cb49 | ||
|
6ab9faa83e | ||
|
3127bec9c4 | ||
|
cdc8435fd8 | ||
|
6f5aad159a | ||
|
e30b325433 | ||
|
36ee61dfe4 | ||
|
92ef03cf15 | ||
|
2f88ee9dee | ||
|
3151d97010 | ||
|
4df013cf13 | ||
|
fbb9b296e3 | ||
|
5da6e482ed | ||
|
97af2af779 | ||
|
986c1a597a | ||
|
c6df815935 | ||
|
2347b290cb | ||
|
fa566b8061 | ||
|
8c0cf3550b | ||
|
2a3b758e82 | ||
|
f31a109ab4 | ||
|
c1cd4dd157 | ||
|
b2039c1293 | ||
|
f24aba4093 | ||
|
bd86f979ed | ||
|
09cdca876c | ||
|
8b06071aad | ||
|
1ceac1dafd | ||
|
105b9fcfe8 | ||
|
54349c5845 | ||
|
b0945ee697 | ||
|
e9f8b72666 | ||
|
6d325e067a | ||
|
0788ff3849 | ||
|
03fa5fdebc | ||
|
776881fb96 | ||
|
0586f02f00 | ||
|
cea77b7e9b | ||
|
b6b8a6d465 | ||
|
81ceb8d123 | ||
|
c995d47c87 | ||
|
811745ff96 | ||
|
9173d11398 | ||
|
941ea9edbb | ||
|
5fa635602b | ||
|
57044fc89f | ||
|
c287d9a222 | ||
|
de1c6c86ab | ||
|
e841ca1906 | ||
|
ddcd1ade28 | ||
|
dfee657456 | ||
|
3021d0241c | ||
|
4f96c45dff | ||
|
c715a1c574 | ||
|
a0940b10d4 | ||
|
c51d26e70a | ||
|
34a73a3d77 | ||
|
ed01324c1d | ||
|
8e45f03bd3 | ||
|
91139fe24f | ||
|
ee9e94df04 | ||
|
599be6ec34 | ||
|
6f389fd320 | ||
|
30637e65b0 | ||
|
c2f953e3f7 | ||
|
bf8809c841 | ||
|
8faf1b4d0e | ||
|
54085c4e50 | ||
|
c87211e1df | ||
|
df86056f99 | ||
|
eb89d7ffcc | ||
|
614f4ddc05 | ||
|
1af8722b0f | ||
|
a93803cfd7 | ||
|
e4aa8278c5 | ||
|
4c5b44545f | ||
|
bce3e7340f | ||
|
c072133fa4 | ||
|
90e10a2910 | ||
|
35ac6bdeb4 | ||
|
98a8f8678a | ||
|
25da9e4c2a | ||
|
23c1a68da8 | ||
|
911e1630a8 | ||
|
0df00c2755 | ||
|
9adb0183b4 | ||
|
9783912344 | ||
|
533071c6ab | ||
|
f283c58b48 | ||
|
634d71bb80 | ||
|
7b30c09298 | ||
|
f454f879b9 | ||
|
5cd8eec039 | ||
|
6fae1bebb0 | ||
|
617b08a867 | ||
|
3bf34a7609 | ||
|
818c709077 | ||
|
6332b28768 | ||
|
ae5050e699 | ||
|
2957004474 | ||
|
c9c6ca7d3d | ||
|
f434156a3c | ||
|
dcd55a375a | ||
|
c65a4ec6bb | ||
|
a018b9729f | ||
|
923ea61a99 | ||
|
6368d6222f | ||
|
600eec45a4 | ||
|
9f2b04c7e2 | ||
|
fcd2da354d | ||
|
2ff3f1fac1 | ||
|
6d576a11a8 | ||
|
e08c7799fa | ||
|
c5d5a718aa | ||
|
85dcdd5cb2 | ||
|
2ded7b87af | ||
|
1166cacc64 | ||
|
ddae938aa4 | ||
|
d5f16adde1 | ||
|
9ff30873fc | ||
|
3ec380d93c | ||
|
8bf7975440 | ||
|
53e8d051e3 | ||
|
49a1323945 | ||
|
a45cb0015a | ||
|
17d9ff4fe7 | ||
|
7c499f499d | ||
|
de47d89e41 | ||
|
33c73d7db4 | ||
|
dafc9dd05a | ||
|
4ac43a212e | ||
|
e97fab9aee | ||
|
98d77db5ae | ||
|
d27d80ab80 | ||
|
c85e5c08e4 | ||
|
a0e768dd0e | ||
|
8ed367f8cd | ||
|
2afd752bbc | ||
|
20d8c9c7f9 | ||
|
60b4202766 | ||
|
9883c798fe | ||
|
8d37fc8e80 | ||
|
188ffda029 | ||
|
5375e27415 | ||
|
87ccb2abc0 | ||
|
87c86c04fd | ||
|
3382cf3152 | ||
|
cd86cadc35 | ||
|
f969a87ce5 | ||
|
516cfb7a74 | ||
|
8a081f60b1 | ||
|
899cf0bebc | ||
|
0a5de5010f | ||
|
b2fbb326b0 | ||
|
2445b481c3 | ||
|
803a25792f | ||
|
6c648c5ea6 | ||
|
d1aa7b148a | ||
|
7239862202 | ||
|
6ad1a5bd61 | ||
|
299a6c6c7b | ||
|
10ca84470c | ||
|
845c67fca3 | ||
|
1a7a97a496 | ||
|
563489d612 | ||
|
c1d4b537c5 | ||
|
a7e6fa8198 | ||
|
833a5ee3ab | ||
|
1b0ed24558 | ||
|
7cd9260a92 | ||
|
92e139f64b | ||
|
ac7ae87495 | ||
|
09e1fca7e4 | ||
|
98f8afd41f | ||
|
38023a33b2 | ||
|
6947b3b233 | ||
|
cd325198c1 | ||
|
af9fdbcd33 | ||
|
8f625086b1 | ||
|
da92279436 | ||
|
ea8d0519bd | ||
|
aa4bba3c94 | ||
|
77b99968ed | ||
|
02e9dd697b | ||
|
c4d78d2bce | ||
|
88e97566c3 | ||
|
cf5c00bcf2 | ||
|
892f9031d7 | ||
|
567c7aa96b | ||
|
8d26313d8d | ||
|
44bd29d592 | ||
|
2909e984b6 | ||
|
661be06168 | ||
|
a45f8bc2f7 | ||
|
5805f67459 | ||
|
5a358d99bb | ||
|
5dabfaf26e | ||
|
d1dd446e4e | ||
|
9fcee70827 | ||
|
58c9893a3f | ||
|
a9121d4cd1 | ||
|
b207ec8817 | ||
|
5df10e23b9 | ||
|
9930e3b252 | ||
|
69ab015d19 | ||
|
33826b4af3 | ||
|
db97d77544 | ||
|
88c09517f2 | ||
|
69c4526358 | ||
|
373d91336b | ||
|
4819487ea2 | ||
|
60dbfd3eec | ||
|
66ee17cdcd | ||
|
ac867f6aa7 | ||
|
9c051a8138 | ||
|
5895c27f4a | ||
|
1a4eba56a7 | ||
|
d8a99ea38f | ||
|
a07db6763a | ||
|
37ba83a44b | ||
|
9e326c29db | ||
|
6bdfe2bce6 | ||
|
0fccd846e6 | ||
|
762aa66d62 | ||
|
d2293ab56a | ||
|
241d9a4c30 | ||
|
3f8709ff55 | ||
|
3f1f9e8e72 | ||
|
1e9da4684a | ||
|
4f8a4e4e2b | ||
|
3f549748e9 | ||
|
990caa1988 | ||
|
8f34543569 | ||
|
1a8dac9296 | ||
|
73aa437259 | ||
|
065748213e | ||
|
c73d555fe2 | ||
|
1306cb337d | ||
|
da1495cd67 | ||
|
b87a050bd8 | ||
|
7dc83fbffd | ||
|
fa02553d53 | ||
|
a8d69c856f | ||
|
8023227829 | ||
|
e82d19eeb7 | ||
|
71750aa87e | ||
|
bbe5280d57 | ||
|
4f629e2d6d | ||
|
1832aba14e | ||
|
2bf2e30af6 | ||
|
0eaedb770b | ||
|
9ccc47cf0b | ||
|
de208b3f00 | ||
|
54d8cf10fc | ||
|
e16c8fdba0 | ||
|
43a1134397 | ||
|
400fd96ee2 | ||
|
d7cf008397 | ||
|
8e534449af | ||
|
b2ecaf1ddc | ||
|
ece58909ba | ||
|
29eee9f126 | ||
|
fb6bc9ca11 | ||
|
2e629ca55c | ||
|
fa9df08f94 | ||
|
5a70fc0bd5 | ||
|
d3f2bec6a6 | ||
|
d340fa1a12 | ||
|
9063c1bbe7 | ||
|
5e5ce91400 | ||
|
c977640b90 | ||
|
175c6f5e62 | ||
|
12a1a3c028 | ||
|
ed7892d5b6 | ||
|
c062908b8f | ||
|
f4c356a4f8 | ||
|
188e0fc545 | ||
|
f145d8750d | ||
|
416e54f0d5 | ||
|
dd889ddac9 | ||
|
dc7312efd6 | ||
|
321b5793a2 | ||
|
ea84879b06 | ||
|
7240128130 | ||
|
2c3408aad5 | ||
|
724e44d5a0 | ||
|
43a9c760b1 | ||
|
50c7aff3ff | ||
|
4aa2047f45 | ||
|
06d5503db1 | ||
|
e379e91081 | ||
|
b67b467483 | ||
|
82124c9cef | ||
|
2b69e118e0 | ||
|
6eb68aaf6e | ||
|
af8491e788 | ||
|
bf16dcfbe8 | ||
|
11d0bb466b | ||
|
39978ab2e2 | ||
|
95da436ddd | ||
|
918f0ec6af | ||
|
34e075e112 | ||
|
a8df4b16e2 | ||
|
558627289b | ||
|
cef8e77eed | ||
|
52f8bf83f6 | ||
|
f632bad576 | ||
|
82ea895ed9 | ||
|
b21e3e45d9 | ||
|
15ca4b1ba2 | ||
|
e1c56c71ef | ||
|
7102b2d5e5 | ||
|
8c4c3b7e5e | ||
|
3606d25ab6 | ||
|
16d2d1573d | ||
|
57f3f22aa4 | ||
|
70d1950bbe | ||
|
55097b9539 | ||
|
5160bfb212 | ||
|
1a25f07c76 | ||
|
9ea088f83f | ||
|
c5545d202d | ||
|
c9e9a4e073 | ||
|
b76ef4e239 | ||
|
25ad1f051e | ||
|
91b7bc0843 | ||
|
e6e44d08fc | ||
|
5accdc2d94 | ||
|
dc3cd81a2a | ||
|
a75fd2bb23 | ||
|
8c85cd43f3 | ||
|
a7ab02224e | ||
|
d91cce930f | ||
|
ed40391bde | ||
|
ac3eac9ed0 | ||
|
6c6c02a329 | ||
|
bf21edb7ce | ||
|
275bbf1aef | ||
|
eadce8852f | ||
|
f462301dc7 | ||
|
02e404c121 | ||
|
6fdf45a6e9 | ||
|
bc273768c2 | ||
|
1743cba006 | ||
|
a9e2c4c73f | ||
|
5b5b6bb2f0 | ||
|
2b93e04b9f | ||
|
b38e8ecd24 | ||
|
8ef498158e | ||
|
216222b962 | ||
|
4cb72f1076 | ||
|
4d62baa094 | ||
|
aa42ea15cf | ||
|
d0be07c367 | ||
|
0f51432d37 | ||
|
c9e547e21b | ||
|
b644a52d0d | ||
|
778c8e8ce5 | ||
|
875c5e2423 | ||
|
49f5947c45 | ||
|
63d622443e | ||
|
859297ea56 | ||
|
16b06f8094 | ||
|
ac95356c56 | ||
|
f2e7aeef8f | ||
|
e5bee14033 | ||
|
8e749c166b | ||
|
f83663b798 | ||
|
7e8d805e62 | ||
|
aff2420102 | ||
|
c053b6164e | ||
|
c70246ebec | ||
|
69ace50a6f | ||
|
5416cbe704 | ||
|
cd9ccb7ebf | ||
|
23e37afcfb | ||
|
6eda1e2220 | ||
|
a12dba078d | ||
|
db5a44bafc | ||
|
943fa562e8 | ||
|
f2b6ac5d18 | ||
|
01cf01981f | ||
|
261d31c9e8 | ||
|
7af404af43 | ||
|
736d3c2d26 | ||
|
b0663d84cb | ||
|
6ac5ca7fc4 | ||
|
3fe806d7c9 | ||
|
b1e686be97 | ||
|
fdba4cf406 | ||
|
e6ab1194ed | ||
|
eaac9a6465 | ||
|
29c733c651 | ||
|
4b70e20250 | ||
|
5b3d4fc91d | ||
|
2aad11e3e7 | ||
|
3d4afcc051 | ||
|
da19b87cb1 | ||
|
949021dc35 | ||
|
3eb66e1b3d | ||
|
15468c86b9 | ||
|
0b90d941d3 | ||
|
b0b07bbc41 | ||
|
707d668a01 | ||
|
fa7d67d80a | ||
|
7a4107b985 | ||
|
606a5c7d21 | ||
|
0128fb2eaf | ||
|
ff5a309386 | ||
|
7616b7aed8 | ||
|
d7b5456dfb | ||
|
875fcffdf9 | ||
|
8de16736d3 | ||
|
51e244d7d4 | ||
|
325570eeec | ||
|
59caea4344 | ||
|
6cfe5ecc94 | ||
|
37b0ba6273 | ||
|
7b5603503e | ||
|
32afe5285e | ||
|
65f4524164 | ||
|
ff9d2e616b | ||
|
25616cdeed | ||
|
76c5e256a7 | ||
|
66f37beff7 | ||
|
7f46f2a8d1 | ||
|
0271047b26 | ||
|
a191d4e6e5 | ||
|
046c36d060 | ||
|
8a1669dc53 | ||
|
755537ad8c | ||
|
4a07154ba3 | ||
|
53f8ccef22 | ||
|
42ed78cf69 | ||
|
7a94a61cfb | ||
|
6b44c4cbae | ||
|
267b21d81c | ||
|
1b8119056f | ||
|
60ec152d90 | ||
|
c58b1146de | ||
|
f875fd1d60 | ||
|
dd41e2b00b | ||
|
15166a9f14 | ||
|
9fff1d955e | ||
|
fd7abdfdd5 | ||
|
0e83bf9bc4 | ||
|
61bb922077 | ||
|
2dfacd648f | ||
|
93d90962e5 | ||
|
dc6e0223c7 | ||
|
d538f8d848 | ||
|
322c08d5f0 | ||
|
f14ba983d6 | ||
|
e6f06456db | ||
|
e064a3481d | ||
|
16f82d1de5 | ||
|
40125c73d0 | ||
|
14c9ed1fda | ||
|
f877425e62 | ||
|
8d65217fda | ||
|
d195e93ebe | ||
|
094870e7a4 | ||
|
740f55fd30 | ||
|
8c72711662 | ||
|
e387953490 | ||
|
410a43a602 | ||
|
998806b814 | ||
|
4248f26bae | ||
|
eb473012a6 | ||
|
ec155c00f3 | ||
|
c63e2edfff | ||
|
60d9713baf | ||
|
b3ce6f26bb | ||
|
4221c1d93b | ||
|
4dab336f95 | ||
|
32f083e066 | ||
|
2aeecec9bd | ||
|
8c7dca7532 | ||
|
c49156fb35 | ||
|
da8abffea4 | ||
|
f1686cc568 | ||
|
ff41ab9d8a | ||
|
faeaee824a | ||
|
4c03ab8ebb | ||
|
0459c54a92 | ||
|
9d074c1679 | ||
|
d0fe69bcda | ||
|
3774d77cc7 | ||
|
7cf028b457 | ||
|
55a36c1ce7 | ||
|
d8cbafe858 | ||
|
f2ecf87d1e | ||
|
d53cbe638f | ||
|
cb1bf5613e | ||
|
3a06de0076 | ||
|
21b9200744 | ||
|
53b659dadc | ||
|
4f2c4f97c8 | ||
|
9bc45805b1 | ||
|
134c595f8c | ||
|
a2eae47400 | ||
|
a19f62a903 | ||
|
d67f1be88a | ||
|
995ff08826 | ||
|
f61f5f946a | ||
|
ba8bb5f021 | ||
|
0512c6ce6d | ||
|
2f2bb4c96d | ||
|
cd184656f0 | ||
|
ca2d58a4a5 | ||
|
b35a357b6b | ||
|
319bfd73b1 | ||
|
dded4b3cae | ||
|
c0c00bdb91 | ||
|
cdb46a6699 | ||
|
1b62aa0b52 | ||
|
32874a795d | ||
|
f92f679056 | ||
|
a01e8fd644 | ||
|
b107694c04 | ||
|
8aa2b2ad49 | ||
|
092c055d77 | ||
|
eb8cd1ec51 | ||
|
79e448a649 | ||
|
56150f8d37 | ||
|
efc3316cd2 | ||
|
d087c87e9f | ||
|
ae6a807575 | ||
|
e2db0cb713 | ||
|
ec3b0c7b7f | ||
|
0085eefae9 | ||
|
10b02e2de1 | ||
|
d82e34cbe2 | ||
|
db59c8b23e | ||
|
99c27133dd | ||
|
9459d28c5f | ||
|
8783bb6ec0 | ||
|
2a2d851ec6 | ||
|
0d3d97744e | ||
|
6834c0d3bc | ||
|
c8e9b9d7b1 | ||
|
5c7c3e9fda | ||
|
38bcbc9804 | ||
|
48190ac3f9 | ||
|
c6b5fb4bfd | ||
|
be0da70839 | ||
|
8556bd45c2 | ||
|
e8219c4300 | ||
|
5fb40f152c | ||
|
e1a6261df5 | ||
|
beb83e87ea | ||
|
b5df0ad3eb | ||
|
50923b7a64 | ||
|
b4dcb05208 | ||
|
582012e8d9 | ||
|
e6c36703d0 | ||
|
e230d5164d | ||
|
0495828a55 | ||
|
7cbf86f864 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,7 +24,6 @@ common/template_fieldnames_lexer.h
|
||||
eeschema/schematic_keywords.*
|
||||
pcbnew/pcb_plot_params_keywords.cpp
|
||||
pcbnew/pcb_plot_params_lexer.h
|
||||
pcbnew/dialogs/panel_setup_rules_help_*.h
|
||||
Makefile
|
||||
CMakeUserPresets.json
|
||||
CMakeCache.txt
|
||||
|
@ -4,7 +4,7 @@ stages:
|
||||
- report
|
||||
|
||||
variables:
|
||||
DEFAULT_FEDORA_IMAGE: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:40
|
||||
DEFAULT_FEDORA_IMAGE: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:41
|
||||
|
||||
default:
|
||||
image:
|
||||
|
@ -8,6 +8,8 @@ win64_build:
|
||||
interruptible: false
|
||||
image: registry.gitlab.com/kicad/kicad-ci/windows-build-image/ltsc2022-msvc:latest
|
||||
variables:
|
||||
VCPKG_BINARY_SOURCES: 'nuget,gitlab,readwrite'
|
||||
VCPKG_DISABLE_COMPILER_TRACKING: '1'
|
||||
# Switch the compressor to fastzip and reduce the compression level
|
||||
FF_USE_FASTZIP: "true"
|
||||
CACHE_COMPRESSION_LEVEL: "fast"
|
||||
@ -23,6 +25,7 @@ win64_build:
|
||||
script:
|
||||
- C:\builder\build.ps1 -Env -Arch x64
|
||||
- $vcpkgCache=Join-Path -Path (Get-Location) -ChildPath ".vcpkgCache";$env:VCPKG_DEFAULT_BINARY_CACHE=$vcpkgCache;New-Item -ItemType Directory -Force -Path $vcpkgCache
|
||||
- nuget.exe sources add -Name gitlab -Source "https://gitlab.com/api/v4/projects/27426693/packages/nuget/index.json" -UserName gitlab-ci-token -Password $env:CI_JOB_TOKEN
|
||||
- mkdir -p build/windows -Force
|
||||
- cd build/windows
|
||||
- cmake `
|
||||
@ -37,8 +40,6 @@ win64_build:
|
||||
../../
|
||||
- cmake --build . 2>&1 | tee compilation_log.txt
|
||||
- cd ../../
|
||||
after_script:
|
||||
- Get-Content -Path C:\builder\vcpkg\buildtrees\wxpython-33\python3-tool-post-install-err.log
|
||||
artifacts:
|
||||
# Only save the artifacts that are needed for running the tests in the next stage
|
||||
# and the compilation log. The entire build directory is too large to save as an
|
||||
|
@ -42,7 +42,7 @@ Coverity:
|
||||
tags:
|
||||
- coverity
|
||||
stage: build
|
||||
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:40
|
||||
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:41
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_JOB_NAME == "coverity"
|
||||
cache:
|
||||
|
@ -20,6 +20,7 @@
|
||||
variables:
|
||||
BOOST_TEST_LOGGER: 'JUNIT,warning,test_results.${TEST}.xml:HRF,message'
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
BOOST_TEST_CATCH_SYSTEM_ERRORS: 'no'
|
||||
script:
|
||||
- cd build/linux/qa
|
||||
- ctest -R qa_${TEST}
|
||||
|
@ -485,26 +485,18 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
|
||||
|
||||
// Fill not copper layers zpos
|
||||
for( int layer_id = 0; layer_id < PCB_LAYER_ID_COUNT; layer_id++ )
|
||||
for( int layer = 0; layer < PCB_LAYER_ID_COUNT; layer++ )
|
||||
{
|
||||
if( IsCopperLayer( (PCB_LAYER_ID)layer_id ) )
|
||||
PCB_LAYER_ID layer_id = ToLAYER_ID( layer );
|
||||
|
||||
if( IsCopperLayer( layer_id ) )
|
||||
continue;
|
||||
|
||||
float zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
|
||||
float zposTop = zposBottom + m_frontCopperThickness3DU;
|
||||
float zposBottom;
|
||||
float zposTop;
|
||||
|
||||
switch( layer_id )
|
||||
{
|
||||
case B_Adhes:
|
||||
zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
|
||||
zposTop = zposBottom - m_nonCopperLayerThickness3DU;
|
||||
break;
|
||||
|
||||
case F_Adhes:
|
||||
zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
|
||||
zposTop = zposBottom + m_nonCopperLayerThickness3DU;
|
||||
break;
|
||||
|
||||
case B_Mask:
|
||||
zposBottom = zpos_copperTop_back;
|
||||
zposTop = zpos_copperTop_back - m_backMaskThickness3DU;
|
||||
@ -536,11 +528,21 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
break;
|
||||
|
||||
default:
|
||||
if( m_board->IsBackLayer( layer_id ) )
|
||||
{
|
||||
zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
|
||||
zposTop = zposBottom - m_nonCopperLayerThickness3DU;
|
||||
}
|
||||
else
|
||||
{
|
||||
zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
|
||||
zposTop = zposBottom + m_nonCopperLayerThickness3DU;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
m_layerZcoordTop[(PCB_LAYER_ID)layer_id] = zposTop;
|
||||
m_layerZcoordBottom[(PCB_LAYER_ID)layer_id] = zposBottom;
|
||||
m_layerZcoordTop[layer_id] = zposTop;
|
||||
m_layerZcoordBottom[layer_id] = zposBottom;
|
||||
}
|
||||
|
||||
m_boardCenter = SFVEC3F( m_boardPos.x * m_biuTo3Dunits, m_boardPos.y * m_biuTo3Dunits, 0.0f );
|
||||
@ -757,6 +759,7 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
|
||||
void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
|
||||
{
|
||||
m_Cfg->m_Render.show_board_body = aLayers.test( LAYER_3D_BOARD );
|
||||
m_Cfg->m_Render.show_plated_barrels = aLayers.test( LAYER_3D_PLATED_BARRELS );
|
||||
m_Cfg->m_Render.show_copper_top = aLayers.test( LAYER_3D_COPPER_TOP );
|
||||
m_Cfg->m_Render.show_copper_bottom = aLayers.test( LAYER_3D_COPPER_BOTTOM );
|
||||
m_Cfg->m_Render.show_silkscreen_top = aLayers.test( LAYER_3D_SILKSCREEN_TOP );
|
||||
@ -804,6 +807,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
ret.set( LAYER_3D_ADHESIVE, m_Cfg->m_Render.show_adhesive );
|
||||
}
|
||||
|
||||
ret.set( LAYER_3D_PLATED_BARRELS, true );
|
||||
ret.set( LAYER_3D_COPPER_TOP, true );
|
||||
ret.set( LAYER_3D_COPPER_BOTTOM, true );
|
||||
ret.set( LAYER_3D_SILKSCREEN_TOP, true );
|
||||
@ -834,6 +838,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
}
|
||||
|
||||
ret.set( LAYER_3D_BOARD, m_Cfg->m_Render.show_board_body );
|
||||
ret.set( LAYER_3D_PLATED_BARRELS, m_Cfg->m_Render.show_plated_barrels );
|
||||
ret.set( LAYER_3D_COPPER_TOP, m_Cfg->m_Render.show_copper_top );
|
||||
ret.set( LAYER_3D_COPPER_BOTTOM, m_Cfg->m_Render.show_copper_bottom );
|
||||
ret.set( LAYER_3D_SILKSCREEN_TOP, m_Cfg->m_Render.show_silkscreen_top );
|
||||
@ -932,6 +937,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
|
||||
std::bitset<LAYER_3D_END> ret;
|
||||
|
||||
ret.set( LAYER_3D_BOARD, true );
|
||||
ret.set( LAYER_3D_PLATED_BARRELS, true );
|
||||
ret.set( LAYER_3D_COPPER_TOP, true );
|
||||
ret.set( LAYER_3D_COPPER_BOTTOM, true );
|
||||
ret.set( LAYER_3D_SILKSCREEN_TOP, true );
|
||||
|
@ -368,11 +368,12 @@ private:
|
||||
void createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDstContainer,
|
||||
PCB_LAYER_ID aLayer, int aMargin = 0 );
|
||||
|
||||
// Generate the pad shape on board layers. The pad hole is not generated by createPadWithMargin
|
||||
void createPadWithMargin( const PAD *aPad, CONTAINER_2D_BASE* aDstContainer,
|
||||
PCB_LAYER_ID aLayer, const VECTOR2I& aMargin ) const;
|
||||
|
||||
void createPadWithHole( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
|
||||
int aInflateValue );
|
||||
// Generate the hole shape of aPad, stored in aDstContainer
|
||||
void createPadHoleShape( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer, int aInflateValue );
|
||||
|
||||
void addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDstContainer,
|
||||
PCB_LAYER_ID aLayerId );
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include <geometry/shape_segment.h>
|
||||
#include <geometry/geometry_utils.h>
|
||||
#include <geometry/shape_circle.h>
|
||||
#include <geometry/roundrect.h>
|
||||
#include <geometry/shape_rect.h>
|
||||
#include <geometry/shape_simple.h>
|
||||
#include <utility>
|
||||
@ -473,12 +474,12 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::createPadWithHole( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
|
||||
void BOARD_ADAPTER::createPadHoleShape( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
|
||||
int aInflateValue )
|
||||
{
|
||||
if( !aPad->HasHole() )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::createPadWithHole - found an invalid pad" ) );
|
||||
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::createPadHole pad has no hole" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -648,6 +649,29 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( aShape->GetCornerRadius() > 0 )
|
||||
{
|
||||
ROUNDRECT rr( SHAPE_RECT( aShape->GetPosition(),
|
||||
aShape->GetRectangleWidth(),
|
||||
aShape->GetRectangleHeight() ),
|
||||
aShape->GetCornerRadius() );
|
||||
SHAPE_POLY_SET poly;
|
||||
rr.TransformToPolygon( poly );
|
||||
SHAPE_LINE_CHAIN& r_outline = poly.Outline( 0 );
|
||||
r_outline.SetClosed( true );
|
||||
|
||||
for( int ii = 0; ii < r_outline.PointCount(); ii++ )
|
||||
{
|
||||
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( r_outline.CPoint( ii ) ),
|
||||
TO_SFVEC2F( r_outline.CPoint( ii+1 ) ),
|
||||
linewidth3DU, *aOwner );
|
||||
}
|
||||
|
||||
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( r_outline.CLastPoint() ),
|
||||
TO_SFVEC2F( r_outline.CPoint( 0 ) ), linewidth3DU, *aOwner );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<VECTOR2I> pts = aShape->GetRectCorners();
|
||||
|
||||
@ -660,6 +684,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
|
||||
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( pts[3] ), TO_SFVEC2F( pts[0] ),
|
||||
linewidth3DU, *aOwner );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SHAPE_T::ARC:
|
||||
|
@ -507,27 +507,32 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
const VECTOR2I padHole = pad->GetDrillSize();
|
||||
|
||||
if( !padHole.x ) // Not drilled pad like SMD pad
|
||||
// Note: holes of NPTH are already built by GetBoardPolygonOutlines
|
||||
if( !pad->HasHole() )
|
||||
continue;
|
||||
|
||||
// The hole in the body is inflated by copper thickness, if not plated, no copper
|
||||
int inflate = 0;
|
||||
|
||||
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
|
||||
inflate = KiROUND( GetHolePlatingThickness() / 2.0 );
|
||||
|
||||
m_holeCount++;
|
||||
double holeDiameter = ( pad->GetDrillSize().x + pad->GetDrillSize().y ) / 2.0;
|
||||
m_averageHoleDiameter += static_cast<float>( holeDiameter * m_biuTo3Dunits );
|
||||
|
||||
createPadWithHole( pad, &m_TH_ODs, inflate );
|
||||
if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
|
||||
{
|
||||
// Ensure the silk drawings are clipped to the NPTH hole, like other pad/via holes
|
||||
// even if the clip to board body is not activated (remember NPTH holes are part of
|
||||
// the board body)
|
||||
createPadHoleShape( pad, &m_TH_ODs, 0 );
|
||||
continue;
|
||||
}
|
||||
|
||||
// The hole in the body is inflated by copper thickness
|
||||
int inflate = KiROUND( GetHolePlatingThickness() / 2.0 );
|
||||
|
||||
createPadHoleShape( pad, &m_TH_ODs, inflate );
|
||||
|
||||
if( cfg.clip_silk_on_via_annuli )
|
||||
createPadWithHole( pad, &m_viaAnnuli, inflate );
|
||||
createPadHoleShape( pad, &m_viaAnnuli, inflate );
|
||||
|
||||
createPadWithHole( pad, &m_TH_IDs, 0 );
|
||||
createPadHoleShape( pad, &m_TH_IDs, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
@ -539,9 +544,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
const VECTOR2I padHole = pad->GetDrillSize();
|
||||
|
||||
if( !padHole.x ) // Not drilled pad like SMD pad
|
||||
if( !pad->HasHole() )
|
||||
continue;
|
||||
|
||||
// The hole in the body is inflated by copper thickness.
|
||||
|
@ -35,14 +35,22 @@
|
||||
#include <advanced_config.h>
|
||||
#include <build_version.h>
|
||||
#include <board.h>
|
||||
#include <pad.h>
|
||||
#include <pcb_field.h>
|
||||
#include <reporter.h>
|
||||
#include <gal/opengl/gl_context_mgr.h>
|
||||
#include <core/profile.h> // To use GetRunningMicroSecs or another profiling utility
|
||||
#include <bitmaps.h>
|
||||
#include <kiway_holder.h>
|
||||
#include <kiway.h>
|
||||
#include <macros.h>
|
||||
#include <pgm_base.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <tool/tool_dispatcher.h>
|
||||
#include <string_utils.h>
|
||||
#include <mail_type.h>
|
||||
#include <kiway_express.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <widgets/wx_busy_indicator.h>
|
||||
|
||||
@ -69,6 +77,8 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, HIDPI_GL_3D_CANVAS )
|
||||
EVT_LEFT_UP( EDA_3D_CANVAS::OnLeftUp )
|
||||
EVT_MIDDLE_UP( EDA_3D_CANVAS::OnMiddleUp )
|
||||
EVT_MIDDLE_DOWN( EDA_3D_CANVAS::OnMiddleDown)
|
||||
EVT_RIGHT_DOWN( EDA_3D_CANVAS::OnRightDown )
|
||||
EVT_RIGHT_UP( EDA_3D_CANVAS::OnRightUp )
|
||||
EVT_MOUSEWHEEL( EDA_3D_CANVAS::OnMouseWheel )
|
||||
EVT_MOTION( EDA_3D_CANVAS::OnMouseMove )
|
||||
EVT_MAGNIFY( EDA_3D_CANVAS::OnMagnify )
|
||||
@ -93,25 +103,9 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttrib
|
||||
HIDPI_GL_3D_CANVAS( EDA_DRAW_PANEL_GAL::GetVcSettings(), aCamera, aParent, aGLAttribs,
|
||||
EDA_3D_CANVAS_ID, wxDefaultPosition,
|
||||
wxDefaultSize, wxFULL_REPAINT_ON_RESIZE ),
|
||||
m_eventDispatcher( nullptr ),
|
||||
m_parentStatusBar( nullptr ),
|
||||
m_parentInfoBar( nullptr ),
|
||||
m_glRC( nullptr ),
|
||||
m_is_opengl_initialized( false ),
|
||||
m_is_opengl_version_supported( true ),
|
||||
m_editing_timeout_timer( this, wxID_HIGHEST + 1 ),
|
||||
m_redraw_trigger_timer( this, wxID_HIGHEST + 2 ),
|
||||
m_render_pivot( false ),
|
||||
m_camera_moving_speed( 1.0f ),
|
||||
m_strtime_camera_movement( 0 ),
|
||||
m_animation_enabled( true ),
|
||||
m_moving_speed_multiplier( 3 ),
|
||||
m_boardAdapter( aBoardAdapter ),
|
||||
m_3d_render( nullptr ),
|
||||
m_opengl_supports_raytracing( true ),
|
||||
m_render_raytracing_was_requested( false ),
|
||||
m_accelerator3DShapes( nullptr ),
|
||||
m_currentRollOverItem( nullptr )
|
||||
m_boardAdapter( aBoardAdapter )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::EDA_3D_CANVAS" ) );
|
||||
|
||||
@ -480,7 +474,9 @@ void EDA_3D_CANVAS::DoRePaint()
|
||||
if( m_camera_is_moving )
|
||||
{
|
||||
const int64_t curtime_delta = GetRunningMicroSecs() - m_strtime_camera_movement;
|
||||
curtime_delta_s = ( curtime_delta / 1e6 ) * m_camera_moving_speed;
|
||||
// Convert microseconds to seconds as float and apply speed multiplier
|
||||
curtime_delta_s = static_cast<float>( static_cast<double>( curtime_delta ) / 1e6 )
|
||||
* m_camera_moving_speed;
|
||||
m_camera.Interpolate( curtime_delta_s );
|
||||
|
||||
if( curtime_delta_s > 1.0f )
|
||||
@ -600,6 +596,216 @@ void EDA_3D_CANVAS::DoRePaint()
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::RenderToFrameBuffer( unsigned char* buffer, int width, int height )
|
||||
{
|
||||
if( m_is_currently_painting.test_and_set() )
|
||||
return;
|
||||
|
||||
// Validate input parameters
|
||||
if( !buffer || width <= 0 || height <= 0 )
|
||||
{
|
||||
m_is_currently_painting.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
// Because the board to draw is handled by the parent viewer frame,
|
||||
// ensure this parent is still alive
|
||||
if( !GetParent() || !GetParent()->GetParent() || !GetParent()->GetParent()->IsShownOnScreen() )
|
||||
{
|
||||
m_is_currently_painting.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
wxString err_messages;
|
||||
int64_t start_time = GetRunningMicroSecs();
|
||||
GL_CONTEXT_MANAGER* gl_mgr = Pgm().GetGLContextManager();
|
||||
|
||||
// Create OpenGL context if needed
|
||||
if( m_glRC == nullptr )
|
||||
m_glRC = gl_mgr->CreateCtx( this );
|
||||
|
||||
if( m_glRC == nullptr )
|
||||
{
|
||||
wxLogError( _( "OpenGL context creation error" ) );
|
||||
m_is_currently_painting.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
gl_mgr->LockCtx( m_glRC, this );
|
||||
|
||||
// Set up framebuffer objects for off-screen rendering
|
||||
GLuint framebuffer = 0;
|
||||
GLuint colorTexture = 0;
|
||||
GLuint depthBuffer = 0;
|
||||
GLint oldFramebuffer = 0;
|
||||
GLint oldViewport[4];
|
||||
|
||||
// Save current state
|
||||
glGetIntegerv( GL_FRAMEBUFFER_BINDING, &oldFramebuffer );
|
||||
glGetIntegerv( GL_VIEWPORT, oldViewport );
|
||||
|
||||
// Create and bind framebuffer
|
||||
glGenFramebuffers( 1, &framebuffer );
|
||||
glBindFramebuffer( GL_FRAMEBUFFER, framebuffer );
|
||||
|
||||
// Create color texture attachment
|
||||
glGenTextures( 1, &colorTexture );
|
||||
glBindTexture( GL_TEXTURE_2D, colorTexture );
|
||||
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
|
||||
glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0 );
|
||||
|
||||
// Create depth renderbuffer attachment
|
||||
glGenRenderbuffers( 1, &depthBuffer );
|
||||
glBindRenderbuffer( GL_RENDERBUFFER, depthBuffer );
|
||||
glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height );
|
||||
glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer );
|
||||
|
||||
auto resetState = std::unique_ptr<void, std::function<void(void*)>>(
|
||||
reinterpret_cast<void*>(1),
|
||||
[&](void*) {
|
||||
glBindFramebuffer( GL_FRAMEBUFFER, oldFramebuffer );
|
||||
glViewport( oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3] );
|
||||
glDeleteFramebuffers( 1, &framebuffer );
|
||||
glDeleteTextures( 1, &colorTexture );
|
||||
glDeleteRenderbuffers( 1, &depthBuffer );
|
||||
gl_mgr->UnlockCtx( m_glRC );
|
||||
m_is_currently_painting.clear();
|
||||
}
|
||||
);
|
||||
|
||||
// Check framebuffer completeness
|
||||
GLenum framebufferStatus = glCheckFramebufferStatus( GL_FRAMEBUFFER );
|
||||
|
||||
if( framebufferStatus != GL_FRAMEBUFFER_COMPLETE )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer Framebuffer incomplete: 0x%04X" ),
|
||||
framebufferStatus );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Set viewport for off-screen rendering
|
||||
glViewport( 0, 0, width, height );
|
||||
|
||||
// Set window size for camera and rendering
|
||||
wxSize clientSize( width, height );
|
||||
const bool windows_size_changed = m_camera.SetCurWindowSize( clientSize );
|
||||
|
||||
// Initialize OpenGL if needed
|
||||
if( !m_is_opengl_initialized )
|
||||
{
|
||||
if( !initializeOpenGL() )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer OpenGL initialization failed." ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !m_is_opengl_version_supported )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer OpenGL version not supported." ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( !m_is_opengl_version_supported )
|
||||
{
|
||||
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
// Read black screen to buffer
|
||||
glReadPixels( 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer );
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle raytracing/OpenGL renderer selection
|
||||
if( !m_opengl_supports_raytracing )
|
||||
{
|
||||
m_3d_render = m_3d_render_opengl;
|
||||
m_render_raytracing_was_requested = false;
|
||||
m_boardAdapter.m_Cfg->m_Render.engine = RENDER_ENGINE::OPENGL;
|
||||
}
|
||||
|
||||
if( m_boardAdapter.m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL )
|
||||
{
|
||||
const bool was_camera_changed = m_camera.ParametersChanged();
|
||||
|
||||
if( ( m_mouse_is_moving || m_camera_is_moving || was_camera_changed || windows_size_changed )
|
||||
&& m_render_raytracing_was_requested )
|
||||
{
|
||||
m_render_raytracing_was_requested = false;
|
||||
m_3d_render = m_3d_render_opengl;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle camera animation (simplified for off-screen rendering)
|
||||
float curtime_delta_s = 0.0f;
|
||||
if( m_camera_is_moving )
|
||||
{
|
||||
const int64_t curtime_delta = GetRunningMicroSecs() - m_strtime_camera_movement;
|
||||
curtime_delta_s = static_cast<float>( static_cast<double>( curtime_delta ) / 1e6 )
|
||||
* m_camera_moving_speed;
|
||||
m_camera.Interpolate( curtime_delta_s );
|
||||
|
||||
if( curtime_delta_s > 1.0f )
|
||||
{
|
||||
m_render_pivot = false;
|
||||
m_camera_is_moving = false;
|
||||
m_mouse_was_moved = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the actual rendering
|
||||
bool requested_redraw = false;
|
||||
if( m_3d_render )
|
||||
{
|
||||
try
|
||||
{
|
||||
m_3d_render->SetCurWindowSize( clientSize );
|
||||
|
||||
bool reloadRaytracingForCalculations = false;
|
||||
if( m_boardAdapter.m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL
|
||||
&& m_3d_render_opengl->IsReloadRequestPending() )
|
||||
{
|
||||
reloadRaytracingForCalculations = true;
|
||||
}
|
||||
|
||||
requested_redraw = m_3d_render->Redraw( false, nullptr, nullptr );
|
||||
|
||||
if( reloadRaytracingForCalculations )
|
||||
m_3d_render_raytracing->Reload( nullptr, nullptr, true );
|
||||
}
|
||||
catch( std::runtime_error& )
|
||||
{
|
||||
m_is_opengl_version_supported = false;
|
||||
m_opengl_supports_raytracing = false;
|
||||
m_is_opengl_initialized = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Read pixels from framebuffer to the provided buffer
|
||||
// Note: This reads RGB format. Adjust format as needed.
|
||||
glReadPixels( 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer );
|
||||
|
||||
// Check for OpenGL errors
|
||||
GLenum error = glGetError();
|
||||
if( error != GL_NO_ERROR )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::RenderToFrameBuffer OpenGL error: 0x%04X" ), error );
|
||||
err_messages += wxString::Format( _( "OpenGL error during off-screen rendering: 0x%04X\n" ), error );
|
||||
}
|
||||
|
||||
// Reset camera parameters changed flag
|
||||
m_camera.ParametersChanged();
|
||||
|
||||
if( !err_messages.IsEmpty() )
|
||||
wxLogMessage( err_messages );
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher )
|
||||
{
|
||||
m_eventDispatcher = aEventDispatcher;
|
||||
@ -676,7 +882,7 @@ void EDA_3D_CANVAS::OnZoomGesture( wxZoomGestureEvent& aEvent )
|
||||
m_camera.Pan( aEvent.GetPosition() );
|
||||
m_camera.SetCurMousePosition( aEvent.GetPosition() );
|
||||
|
||||
m_camera.Zoom( aEvent.GetZoomFactor() / m_gestureLastZoomFactor );
|
||||
m_camera.Zoom( static_cast<float>( aEvent.GetZoomFactor() / m_gestureLastZoomFactor ) );
|
||||
|
||||
m_gestureLastZoomFactor = aEvent.GetZoomFactor();
|
||||
|
||||
@ -719,7 +925,7 @@ void EDA_3D_CANVAS::OnRotateGesture( wxRotateGestureEvent& aEvent )
|
||||
if( m_camera_is_moving )
|
||||
return;
|
||||
|
||||
m_camera.RotateScreen( m_gestureLastAngle - aEvent.GetRotationAngle() );
|
||||
m_camera.RotateScreen( static_cast<float>( m_gestureLastAngle - aEvent.GetRotationAngle() ) );
|
||||
m_gestureLastAngle = aEvent.GetRotationAngle();
|
||||
|
||||
DisplayStatus();
|
||||
@ -857,7 +1063,43 @@ void EDA_3D_CANVAS::OnLeftDown( wxMouseEvent& event )
|
||||
|
||||
BOARD_ITEM* intersectedBoardItem = m_3d_render_raytracing->IntersectBoardItem( mouseRay );
|
||||
|
||||
// !TODO: send a selection item to pcbnew, eg: via kiway?
|
||||
if( intersectedBoardItem )
|
||||
{
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
|
||||
switch( intersectedBoardItem->Type() )
|
||||
{
|
||||
case PCB_FOOTPRINT_T:
|
||||
footprint = static_cast<FOOTPRINT*>( intersectedBoardItem );
|
||||
break;
|
||||
|
||||
case PCB_PAD_T:
|
||||
footprint = static_cast<PAD*>( intersectedBoardItem )->GetParentFootprint();
|
||||
break;
|
||||
|
||||
case PCB_FIELD_T:
|
||||
footprint = static_cast<PCB_FIELD*>( intersectedBoardItem )->GetParentFootprint();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
std::string command =
|
||||
fmt::format( "$SELECT: 0,F{}",
|
||||
EscapeString( footprint->GetReference(), CTX_IPC ).ToStdString() );
|
||||
|
||||
EDA_3D_VIEWER_FRAME* frame = static_cast<EDA_3D_VIEWER_FRAME*>( GetParent() );
|
||||
|
||||
if( frame )
|
||||
{
|
||||
frame->Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_SELECTION, command, frame );
|
||||
frame->Kiway().ExpressMail( FRAME_SCH, MAIL_SELECTION, command, frame );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -877,20 +1119,43 @@ void EDA_3D_CANVAS::OnLeftUp( wxMouseEvent& event )
|
||||
int logicalW = logicalSize.GetWidth();
|
||||
int logicalH = logicalSize.GetHeight();
|
||||
|
||||
int gizmo_x, gizmo_y, gizmo_width, gizmo_height;
|
||||
int gizmo_x = 0, gizmo_y = 0, gizmo_width = 0, gizmo_height = 0;
|
||||
std::tie( gizmo_x, gizmo_y, gizmo_width, gizmo_height ) = m_3d_render_opengl->getGizmoViewport();
|
||||
|
||||
float scaleX = static_cast<float>( gizmo_width ) / logicalW;
|
||||
float scaleY = static_cast<float>( gizmo_height ) / logicalH;
|
||||
float scaleX = static_cast<float>( static_cast<double>( gizmo_width ) / static_cast<double>( logicalW ) );
|
||||
float scaleY = static_cast<float>( static_cast<double>( gizmo_height ) / static_cast<double>( logicalH ) );
|
||||
|
||||
int scaledMouseX = static_cast<int>( event.GetX() * scaleX );
|
||||
int scaledMouseY = static_cast<int>( ( logicalH - event.GetY() ) * scaleY );
|
||||
int scaledMouseX = static_cast<int>( static_cast<float>( event.GetX() ) * scaleX );
|
||||
int scaledMouseY = static_cast<int>( static_cast<float>( logicalH - event.GetY() ) * scaleY );
|
||||
|
||||
m_3d_render_opengl->handleGizmoMouseInput( scaledMouseX, scaledMouseY );
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::OnRightDown( wxMouseEvent& event )
|
||||
{
|
||||
SetFocus();
|
||||
stop_editingTimeOut_Timer();
|
||||
|
||||
// Ensure m_camera.m_lastPosition is up to date for future drag events.
|
||||
OnMouseMoveCamera( event );
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::OnRightUp( wxMouseEvent& event )
|
||||
{
|
||||
if( m_camera_is_moving )
|
||||
return;
|
||||
|
||||
if( m_mouse_is_moving )
|
||||
{
|
||||
m_mouse_is_moving = false;
|
||||
restart_editingTimeOut_Timer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::OnMiddleDown( wxMouseEvent& event )
|
||||
{
|
||||
SetFocus();
|
||||
@ -995,7 +1260,7 @@ void EDA_3D_CANVAS::request_start_moving_camera( float aMovingSpeed, bool aRende
|
||||
|
||||
// Map speed multiplier option to actual multiplier value
|
||||
// [1,2,3,4,5] -> [0.25, 0.5, 1, 2, 4]
|
||||
aMovingSpeed *= ( 1 << m_moving_speed_multiplier ) / 8.0f;
|
||||
aMovingSpeed *= static_cast<float>( ( 1 << m_moving_speed_multiplier ) ) / 8.0f;
|
||||
|
||||
m_render_pivot = aRenderPivot;
|
||||
m_camera_moving_speed = aMovingSpeed;
|
||||
@ -1015,7 +1280,7 @@ void EDA_3D_CANVAS::move_pivot_based_on_cur_mouse_position()
|
||||
{
|
||||
RAY mouseRay = getRayAtCurrentMousePosition();
|
||||
|
||||
float hit_t;
|
||||
float hit_t = 0.0f;
|
||||
|
||||
// Test it with the board bounding box
|
||||
if( m_boardAdapter.GetBBox().Intersect( mouseRay, &hit_t ) )
|
||||
|
@ -42,7 +42,7 @@ class RENDER_3D_RAYTRACE_GL;
|
||||
class RENDER_3D_OPENGL;
|
||||
|
||||
|
||||
#define EDA_3D_CANVAS_ID wxID_HIGHEST + 1321
|
||||
#define EDA_3D_CANVAS_ID (wxID_HIGHEST + 1321)
|
||||
|
||||
/**
|
||||
* Implement a canvas based on a wxGLCanvas
|
||||
@ -61,7 +61,7 @@ public:
|
||||
EDA_3D_CANVAS( wxWindow* aParent, const wxGLAttributes& aGLAttribs, BOARD_ADAPTER& aSettings,
|
||||
CAMERA& aCamera, S3D_CACHE* a3DCachePointer );
|
||||
|
||||
~EDA_3D_CANVAS();
|
||||
~EDA_3D_CANVAS() override;
|
||||
|
||||
/**
|
||||
* Set a dispatcher that processes events and forwards them to tools.
|
||||
@ -218,6 +218,8 @@ public:
|
||||
*/
|
||||
void DoRePaint();
|
||||
|
||||
void RenderToFrameBuffer( unsigned char* aBuffer, int aWidth, int aHeight );
|
||||
|
||||
void OnCloseWindow( wxCloseEvent& event );
|
||||
|
||||
private:
|
||||
@ -236,6 +238,9 @@ private:
|
||||
void OnLeftUp( wxMouseEvent& event );
|
||||
void OnMiddleUp( wxMouseEvent& event );
|
||||
void OnMiddleDown( wxMouseEvent& event );
|
||||
void OnRightUp( wxMouseEvent& event );
|
||||
void OnRightDown( wxMouseEvent& event );
|
||||
|
||||
void OnTimerTimeout_Editing( wxTimerEvent& event );
|
||||
void OnResize( wxSizeEvent& event );
|
||||
void OnTimerTimeout_Redraw( wxTimerEvent& event );
|
||||
@ -297,36 +302,36 @@ private:
|
||||
RAY getRayAtCurrentMousePosition();
|
||||
|
||||
private:
|
||||
TOOL_DISPATCHER* m_eventDispatcher;
|
||||
wxStatusBar* m_parentStatusBar; // Parent statusbar to report progress
|
||||
WX_INFOBAR* m_parentInfoBar;
|
||||
TOOL_DISPATCHER* m_eventDispatcher = nullptr;
|
||||
wxStatusBar* m_parentStatusBar = nullptr; // Parent statusbar to report progress
|
||||
WX_INFOBAR* m_parentInfoBar = nullptr;
|
||||
|
||||
wxGLContext* m_glRC; // Current OpenGL context
|
||||
bool m_is_opengl_initialized;
|
||||
bool m_is_opengl_version_supported;
|
||||
wxGLContext* m_glRC = nullptr; // Current OpenGL context
|
||||
bool m_is_opengl_initialized = false;
|
||||
bool m_is_opengl_version_supported = true;
|
||||
|
||||
wxTimer m_editing_timeout_timer; // Expires after some time signaling that
|
||||
// the mouse / keyboard movements are over
|
||||
wxTimer m_redraw_trigger_timer; // Used to schedule a redraw event
|
||||
std::atomic_flag m_is_currently_painting; // Avoid drawing twice at the same time
|
||||
std::atomic_flag m_is_currently_painting = ATOMIC_FLAG_INIT; // Avoid drawing twice at the same time
|
||||
|
||||
bool m_render_pivot; // Render the pivot while camera moving
|
||||
float m_camera_moving_speed; // 1.0f will be 1:1
|
||||
int64_t m_strtime_camera_movement; // Ticktime of camera movement start
|
||||
bool m_animation_enabled; // Camera animation enabled
|
||||
int m_moving_speed_multiplier; // Camera animation speed multiplier option
|
||||
bool m_render_pivot = false; // Render the pivot while camera moving
|
||||
float m_camera_moving_speed = 1.0f; // 1.0f will be 1:1
|
||||
int64_t m_strtime_camera_movement = 0; // Ticktime of camera movement start
|
||||
bool m_animation_enabled = true; // Camera animation enabled
|
||||
int m_moving_speed_multiplier = 3; // Camera animation speed multiplier option
|
||||
|
||||
BOARD_ADAPTER& m_boardAdapter; // Pre-computed 3D info and settings
|
||||
RENDER_3D_BASE* m_3d_render;
|
||||
RENDER_3D_BASE* m_3d_render = nullptr;
|
||||
RENDER_3D_RAYTRACE_GL* m_3d_render_raytracing;
|
||||
RENDER_3D_OPENGL* m_3d_render_opengl;
|
||||
|
||||
bool m_opengl_supports_raytracing;
|
||||
bool m_render_raytracing_was_requested;
|
||||
bool m_opengl_supports_raytracing = true;
|
||||
bool m_render_raytracing_was_requested = false;
|
||||
|
||||
ACCELERATOR_3D* m_accelerator3DShapes; // used for mouse over searching
|
||||
ACCELERATOR_3D* m_accelerator3DShapes = nullptr; // used for mouse over searching
|
||||
|
||||
BOARD_ITEM* m_currentRollOverItem;
|
||||
BOARD_ITEM* m_currentRollOverItem = nullptr;
|
||||
|
||||
bool m_render3dmousePivot = false; // Render the 3dmouse pivot
|
||||
SFVEC3F m_3dmousePivotPos; // The position of the 3dmouse pivot
|
||||
|
@ -544,9 +544,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetHitSelectionOnly( bool onlySelection )
|
||||
long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
|
||||
{
|
||||
if( commandId.empty() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
|
||||
TOOL_ACTION* context = nullptr;
|
||||
@ -557,10 +555,8 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
|
||||
std::string nm = action->GetName();
|
||||
|
||||
if( commandId == nm )
|
||||
{
|
||||
context = action;
|
||||
}
|
||||
}
|
||||
|
||||
if( context != nullptr )
|
||||
{
|
||||
@ -568,27 +564,21 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
|
||||
|
||||
// Only allow command execution if the window is enabled. i.e. there is not a modal dialog
|
||||
// currently active.
|
||||
TOOLS_HOLDER* tools_holder = nullptr;
|
||||
|
||||
if( parent->IsEnabled() && ( tools_holder = dynamic_cast<TOOLS_HOLDER*>( parent ) ) )
|
||||
if( parent && parent->IsEnabled() )
|
||||
{
|
||||
TOOL_MANAGER* tool_manager = tools_holder->GetToolManager();
|
||||
TOOLS_HOLDER* tools_holder = dynamic_cast<TOOLS_HOLDER*>( parent );
|
||||
TOOL_MANAGER* tool_manager = tools_holder ? tools_holder->GetToolManager() : nullptr;
|
||||
|
||||
if( tool_manager == nullptr )
|
||||
{
|
||||
if( !tool_manager )
|
||||
return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
|
||||
}
|
||||
|
||||
// Get the selection to use to test if the action is enabled
|
||||
SELECTION& sel = tool_manager->GetToolHolder()->GetCurrentSelection();
|
||||
|
||||
bool runAction = true;
|
||||
|
||||
if( const ACTION_CONDITIONS* aCond =
|
||||
tool_manager->GetActionManager()->GetCondition( *context ) )
|
||||
{
|
||||
if( const ACTION_CONDITIONS* aCond = tool_manager->GetActionManager()->GetCondition( *context ) )
|
||||
runAction = aCond->enableCondition( sel );
|
||||
}
|
||||
|
||||
if( runAction )
|
||||
{
|
||||
|
@ -771,10 +771,13 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
|
||||
wxASSERT( zbot < ztop );
|
||||
|
||||
if( m_boardAdapter.m_Cfg->m_Render.show_plated_barrels )
|
||||
{
|
||||
generateCylinder( via_center, hole_inner_radius, hole_inner_radius + platingThickness3d,
|
||||
ztop, zbot, nrSegments, layerTriangleVIA );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_microviaHoles = new OPENGL_RENDER_LIST( *layerTriangleVIA, 0, 0.0f, 0.0f );
|
||||
|
||||
@ -816,10 +819,7 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
{
|
||||
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
|
||||
{
|
||||
const VECTOR2I drillsize = pad->GetDrillSize();
|
||||
const bool hasHole = drillsize.x && drillsize.y;
|
||||
|
||||
if( !hasHole )
|
||||
if( !pad->HasHole() )
|
||||
continue;
|
||||
|
||||
pad->TransformHoleToPolygon( tht_outer_holes_poly, platingThickness,
|
||||
@ -842,7 +842,7 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
|
||||
const LIST_OBJECT2D& holes2D = holesContainer.GetList();
|
||||
|
||||
if( holes2D.size() > 0 )
|
||||
if( holes2D.size() > 0 && m_boardAdapter.m_Cfg->m_Render.show_plated_barrels )
|
||||
{
|
||||
float layer_z_top, layer_z_bot, dummy;
|
||||
|
||||
|
@ -115,6 +115,11 @@ public:
|
||||
|
||||
~BVH_PBRT();
|
||||
|
||||
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
|
||||
// will only land us in trouble.
|
||||
BVH_PBRT( const BVH_PBRT& ) = delete;
|
||||
BVH_PBRT& operator=( const BVH_PBRT& ) = delete;
|
||||
|
||||
bool Intersect( const RAY& aRay, HITINFO& aHitInfo ) const override;
|
||||
bool Intersect( const RAY& aRay, HITINFO& aHitInfo, unsigned int aAccNodeInfo ) const override;
|
||||
bool Intersect( const RAYPACKET& aRayPacket, HITINFO_PACKET* aHitInfoPacket ) const override;
|
||||
|
@ -22,12 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file container_2d.h
|
||||
*/
|
||||
|
||||
#ifndef _CONTAINER_2D_H_
|
||||
#define _CONTAINER_2D_H_
|
||||
#pragma once
|
||||
|
||||
#include "../shapes2D/object_2d.h"
|
||||
#include <list>
|
||||
@ -71,8 +66,7 @@ public:
|
||||
* @param aBBox The bounding box to test.
|
||||
* @param aOutList The list of objects that intersects the bounding box.
|
||||
*/
|
||||
virtual void GetIntersectingObjects( const BBOX_2D& aBBox,
|
||||
CONST_LIST_OBJECT2D& aOutList ) const = 0;
|
||||
virtual void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const = 0;
|
||||
|
||||
/**
|
||||
* Intersect and check if a segment ray hits a object or is inside it.
|
||||
@ -96,8 +90,7 @@ class CONTAINER_2D : public CONTAINER_2D_BASE
|
||||
public:
|
||||
CONTAINER_2D();
|
||||
|
||||
void GetIntersectingObjects( const BBOX_2D& aBBox,
|
||||
CONST_LIST_OBJECT2D& aOutList ) const override;
|
||||
void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const override;
|
||||
|
||||
bool IntersectAny( const RAYSEG2D& aSegRay ) const override;
|
||||
};
|
||||
@ -119,28 +112,30 @@ public:
|
||||
BVH_CONTAINER_2D();
|
||||
~BVH_CONTAINER_2D();
|
||||
|
||||
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
|
||||
// will only land us in trouble.
|
||||
BVH_CONTAINER_2D( const BVH_CONTAINER_2D& ) = delete;
|
||||
BVH_CONTAINER_2D& operator=( const BVH_CONTAINER_2D& ) = delete;
|
||||
|
||||
void BuildBVH();
|
||||
|
||||
void Clear() override;
|
||||
|
||||
void GetIntersectingObjects( const BBOX_2D& aBBox,
|
||||
CONST_LIST_OBJECT2D& aOutList ) const override;
|
||||
void GetIntersectingObjects( const BBOX_2D& aBBox, CONST_LIST_OBJECT2D& aOutList ) const override;
|
||||
|
||||
bool IntersectAny( const RAYSEG2D& aSegRay ) const override;
|
||||
|
||||
private:
|
||||
void destroy();
|
||||
void recursiveBuild_MIDDLE_SPLIT( BVH_CONTAINER_NODE_2D* aNodeParent );
|
||||
void recursiveGetListObjectsIntersects( const BVH_CONTAINER_NODE_2D* aNode,
|
||||
const BBOX_2D& aBBox,
|
||||
void recursiveGetListObjectsIntersects( const BVH_CONTAINER_NODE_2D* aNode, const BBOX_2D& aBBox,
|
||||
CONST_LIST_OBJECT2D& aOutList ) const;
|
||||
bool recursiveIntersectAny( const BVH_CONTAINER_NODE_2D* aNode,
|
||||
const RAYSEG2D& aSegRay ) const;
|
||||
bool recursiveIntersectAny( const BVH_CONTAINER_NODE_2D* aNode, const RAYSEG2D& aSegRay ) const;
|
||||
|
||||
private:
|
||||
bool m_isInitialized;
|
||||
std::list<BVH_CONTAINER_NODE_2D*> m_elementsToDelete;
|
||||
BVH_CONTAINER_NODE_2D* m_tree;
|
||||
|
||||
};
|
||||
|
||||
#endif // _CONTAINER_2D_H_
|
||||
|
@ -277,7 +277,7 @@ void RENDER_3D_RAYTRACE_BASE::renderTracing( uint8_t* ptrPBO, REPORTER* aStatusR
|
||||
BS::multi_future<void> futures;
|
||||
|
||||
for( size_t i = 0; i < tp.get_thread_count(); ++i )
|
||||
futures.push_back( tp.submit( processBlocks ) );
|
||||
futures.push_back( tp.submit_task( processBlocks ) );
|
||||
|
||||
futures.wait();
|
||||
|
||||
@ -486,9 +486,12 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( uint8_t* ptrPBO, signed int iB
|
||||
// Initialize ray packets
|
||||
const SFVEC2UI& blockPos = m_blockPositions[iBlock];
|
||||
const SFVEC2I blockPosI = SFVEC2I( blockPos.x + m_xoffset, blockPos.y + m_yoffset );
|
||||
const SFVEC2F randDisp = ( m_camera.GetProjection() == PROJECTION_TYPE::ORTHO ) ?
|
||||
SFVEC2F( 0.0f, 0.0f ) :
|
||||
SFVEC2F( DISP_FACTOR, DISP_FACTOR );
|
||||
|
||||
RAYPACKET blockPacket( m_camera, (SFVEC2F) blockPosI + SFVEC2F( DISP_FACTOR, DISP_FACTOR ),
|
||||
SFVEC2F( DISP_FACTOR, DISP_FACTOR ) /* Displacement random factor */ );
|
||||
RAYPACKET blockPacket( m_camera, (SFVEC2F) blockPosI + randDisp,
|
||||
randDisp /* Displacement random factor */ );
|
||||
|
||||
|
||||
HITINFO_PACKET hitPacket_X0Y0[RAYPACKET_RAYS_PER_PACKET];
|
||||
@ -566,7 +569,7 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( uint8_t* ptrPBO, signed int iB
|
||||
HITINFO_PACKET_init( hitPacket_AA_X1Y1 );
|
||||
|
||||
RAYPACKET blockPacket_AA_X1Y1( m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.5f, 0.5f ),
|
||||
SFVEC2F( DISP_FACTOR, DISP_FACTOR ) );
|
||||
randDisp );
|
||||
|
||||
if( !m_accelerator->Intersect( blockPacket_AA_X1Y1, hitPacket_AA_X1Y1 ) )
|
||||
{
|
||||
@ -603,16 +606,16 @@ void RENDER_3D_RAYTRACE_BASE::renderBlockTracing( uint8_t* ptrPBO, signed int iB
|
||||
RAY blockRayPck_AA_X1Y1_half[RAYPACKET_RAYS_PER_PACKET];
|
||||
|
||||
RAYPACKET_InitRays_with2DDisplacement(
|
||||
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.5f - DISP_FACTOR, DISP_FACTOR ),
|
||||
SFVEC2F( DISP_FACTOR, DISP_FACTOR ), blockRayPck_AA_X1Y0 );
|
||||
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.5f - randDisp.x, randDisp.y ),
|
||||
randDisp, blockRayPck_AA_X1Y0 );
|
||||
|
||||
RAYPACKET_InitRays_with2DDisplacement(
|
||||
m_camera, (SFVEC2F) blockPosI + SFVEC2F( DISP_FACTOR, 0.5f - DISP_FACTOR ),
|
||||
SFVEC2F( DISP_FACTOR, DISP_FACTOR ), blockRayPck_AA_X0Y1 );
|
||||
m_camera, (SFVEC2F) blockPosI + SFVEC2F( randDisp.x, 0.5f - randDisp.y ),
|
||||
randDisp, blockRayPck_AA_X0Y1 );
|
||||
|
||||
RAYPACKET_InitRays_with2DDisplacement(
|
||||
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.25f - DISP_FACTOR, 0.25f - DISP_FACTOR ),
|
||||
SFVEC2F( DISP_FACTOR, DISP_FACTOR ), blockRayPck_AA_X1Y1_half );
|
||||
m_camera, (SFVEC2F) blockPosI + SFVEC2F( 0.25f - randDisp.x, 0.25f - randDisp.y ),
|
||||
randDisp, blockRayPck_AA_X1Y1_half );
|
||||
|
||||
renderAntiAliasPackets( bgColor, hitPacket_X0Y0, hitPacket_AA_X1Y1, blockRayPck_AA_X1Y0,
|
||||
hitColor_AA_X1Y0 );
|
||||
|
@ -23,12 +23,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file layer_item_2d.h
|
||||
*/
|
||||
|
||||
#ifndef _LAYER_ITEM_2D_H_
|
||||
#define _LAYER_ITEM_2D_H_
|
||||
#pragma once
|
||||
|
||||
#include "object_2d.h"
|
||||
#include <vector>
|
||||
@ -84,6 +79,11 @@ public:
|
||||
|
||||
~LAYER_ITEM_2D();
|
||||
|
||||
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
|
||||
// will only land us in trouble.
|
||||
LAYER_ITEM_2D( const LAYER_ITEM_2D& ) = delete;
|
||||
LAYER_ITEM_2D& operator=( const LAYER_ITEM_2D& ) = delete;
|
||||
|
||||
// Imported from OBJECT_2D
|
||||
bool Overlaps( const BBOX_2D& aBBox ) const override;
|
||||
bool Intersects( const BBOX_2D& aBBox ) const override;
|
||||
@ -97,4 +97,3 @@ private:
|
||||
const OBJECT_2D* m_objectC;
|
||||
};
|
||||
|
||||
#endif // _LAYER_ITEM_2D_H_
|
||||
|
14
3d-viewer/3d_spacenav/CMakeLists.txt
Normal file
14
3d-viewer/3d_spacenav/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
if( UNIX AND NOT APPLE )
|
||||
add_library(3d-viewer_spacenav STATIC
|
||||
spnav_viewer_plugin.cpp
|
||||
)
|
||||
add_dependencies( 3d-viewer_spacenav pcbcommon )
|
||||
target_include_directories(3d-viewer_spacenav PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/common
|
||||
${CMAKE_SOURCE_DIR}/3d-viewer
|
||||
)
|
||||
target_link_libraries(3d-viewer_spacenav
|
||||
PRIVATE
|
||||
kicommon
|
||||
)
|
||||
endif()
|
111
3d-viewer/3d_spacenav/spnav_viewer_plugin.cpp
Normal file
111
3d-viewer/3d_spacenav/spnav_viewer_plugin.cpp
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see CHANGELOG.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 3 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "spnav_viewer_plugin.h"
|
||||
|
||||
#include <3d-viewer/3d_canvas/eda_3d_canvas.h>
|
||||
#include <3d-viewer/3d_rendering/track_ball.h>
|
||||
#include <pgm_base.h>
|
||||
#include <settings/common_settings.h>
|
||||
|
||||
SPNAV_VIEWER_PLUGIN::SPNAV_VIEWER_PLUGIN( EDA_3D_CANVAS* aCanvas )
|
||||
: m_timer( this ), m_canvas( aCanvas ), m_camera( nullptr ), m_focused( true )
|
||||
{
|
||||
m_camera = dynamic_cast<TRACK_BALL*>( aCanvas->GetCamera() );
|
||||
m_driver = std::make_unique<LIBSPNAV_DRIVER>();
|
||||
|
||||
if( m_driver->Connect() )
|
||||
{
|
||||
m_driver->SetHandler( this );
|
||||
Bind( wxEVT_TIMER, &SPNAV_VIEWER_PLUGIN::onPollTimer, this );
|
||||
m_timer.Start( 10 );
|
||||
}
|
||||
}
|
||||
|
||||
SPNAV_VIEWER_PLUGIN::~SPNAV_VIEWER_PLUGIN()
|
||||
{
|
||||
m_timer.Stop();
|
||||
|
||||
if( m_driver )
|
||||
m_driver->Disconnect();
|
||||
}
|
||||
|
||||
void SPNAV_VIEWER_PLUGIN::SetFocus( bool aFocus )
|
||||
{
|
||||
m_focused = aFocus;
|
||||
}
|
||||
|
||||
void SPNAV_VIEWER_PLUGIN::onPollTimer( wxTimerEvent& )
|
||||
{
|
||||
if( m_driver && m_focused )
|
||||
m_driver->Poll();
|
||||
}
|
||||
|
||||
void SPNAV_VIEWER_PLUGIN::OnPan( double x, double y, double z )
|
||||
{
|
||||
if( const COMMON_SETTINGS* cfg = Pgm().GetCommonSettings() )
|
||||
{
|
||||
float scale = 0.0005f * ( cfg->m_SpaceMouse.pan_speed / 5.0f );
|
||||
|
||||
if( cfg->m_SpaceMouse.reverse_pan_x )
|
||||
x = -x;
|
||||
|
||||
if( cfg->m_SpaceMouse.reverse_pan_y )
|
||||
y = -y;
|
||||
|
||||
if( cfg->m_SpaceMouse.reverse_zoom )
|
||||
z = -z;
|
||||
|
||||
if( m_camera )
|
||||
{
|
||||
m_camera->Pan( SFVEC3F( x * scale, -y * scale, z * scale ) );
|
||||
m_canvas->Request_refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SPNAV_VIEWER_PLUGIN::OnRotate( double rx, double ry, double rz )
|
||||
{
|
||||
if( const COMMON_SETTINGS* cfg = Pgm().GetCommonSettings() )
|
||||
{
|
||||
float scale = 0.001f * ( cfg->m_SpaceMouse.rotate_speed / 5.0f );
|
||||
|
||||
if( cfg->m_SpaceMouse.reverse_rotate )
|
||||
scale = -scale;
|
||||
|
||||
if( m_camera )
|
||||
{
|
||||
m_camera->RotateX( ry * scale );
|
||||
m_camera->RotateY( rx * scale );
|
||||
m_camera->RotateZ( rz * scale );
|
||||
m_canvas->Request_refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SPNAV_VIEWER_PLUGIN::OnButton( int button, bool pressed )
|
||||
{
|
||||
// Buttons are ignored for now
|
||||
(void) button;
|
||||
(void) pressed;
|
||||
}
|
57
3d-viewer/3d_spacenav/spnav_viewer_plugin.h
Normal file
57
3d-viewer/3d_spacenav/spnav_viewer_plugin.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see CHANGELOG.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 3 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef SPNAV_VIEWER_PLUGIN_H
|
||||
#define SPNAV_VIEWER_PLUGIN_H
|
||||
|
||||
#include <memory>
|
||||
#include <wx/timer.h>
|
||||
#include "common/spacenav/spacenav_driver.h"
|
||||
#include "common/spacenav/libspnav_driver.h"
|
||||
|
||||
class EDA_3D_CANVAS;
|
||||
class TRACK_BALL;
|
||||
|
||||
class SPNAV_VIEWER_PLUGIN : public wxEvtHandler, public SPACEMOUSE_HANDLER
|
||||
{
|
||||
public:
|
||||
explicit SPNAV_VIEWER_PLUGIN( EDA_3D_CANVAS* aCanvas );
|
||||
~SPNAV_VIEWER_PLUGIN();
|
||||
|
||||
void SetFocus( bool aFocus = true );
|
||||
|
||||
void OnPan( double x, double y, double z ) override;
|
||||
void OnRotate( double rx, double ry, double rz ) override;
|
||||
void OnButton( int button, bool pressed ) override;
|
||||
|
||||
private:
|
||||
void onPollTimer( wxTimerEvent& evt );
|
||||
|
||||
std::unique_ptr<SPACENAV_DRIVER> m_driver;
|
||||
wxTimer m_timer;
|
||||
EDA_3D_CANVAS* m_canvas;
|
||||
TRACK_BALL* m_camera;
|
||||
bool m_focused;
|
||||
};
|
||||
|
||||
#endif // SPNAV_VIEWER_PLUGIN_H
|
@ -48,8 +48,7 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
|
||||
//
|
||||
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
fileMenu->Add( EDA_3D_ACTIONS::exportAsPNG );
|
||||
fileMenu->Add( EDA_3D_ACTIONS::exportAsJPEG );
|
||||
fileMenu->Add( EDA_3D_ACTIONS::exportImage );
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->AddClose( _( "3D Viewer" ) );
|
||||
@ -87,22 +86,39 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
|
||||
viewMenu->Add( gridSubmenu );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->Add( EDA_3D_ACTIONS::rotateXCW );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::rotateXCCW );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::viewTop );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::viewBottom );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::viewRight );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::viewLeft );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::viewFront );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::viewBack );
|
||||
|
||||
ACTION_MENU* rotateSubmenu = new ACTION_MENU( false, tool );
|
||||
rotateSubmenu->SetTitle( _( "Rotate Board" ) );
|
||||
rotateSubmenu->SetIcon( BITMAPS::rotate_cw );
|
||||
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCW );
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCCW );
|
||||
rotateSubmenu->AppendSeparator();
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCW );
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCCW );
|
||||
rotateSubmenu->AppendSeparator();
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCW );
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCCW );
|
||||
|
||||
ACTION_MENU* moveSubmenu = new ACTION_MENU( false, tool );
|
||||
moveSubmenu->SetTitle( _( "Move Board" ) );
|
||||
moveSubmenu->SetIcon( BITMAPS::move );
|
||||
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveLeft );
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveRight );
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveUp );
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveDown );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->Add( EDA_3D_ACTIONS::rotateYCW );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::rotateYCCW );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->Add( EDA_3D_ACTIONS::rotateZCW );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::rotateZCCW );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->Add( EDA_3D_ACTIONS::moveLeft );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::moveRight );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::moveUp );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::moveDown );
|
||||
viewMenu->Add( rotateSubmenu );
|
||||
viewMenu->Add( EDA_3D_ACTIONS::flipView );
|
||||
viewMenu->Add( moveSubmenu );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->Add( EDA_3D_ACTIONS::showLayersManager, ACTION_MENU::CHECK );
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "dialogs/appearance_controls_3D.h"
|
||||
#include <dialogs/eda_view_switcher.h>
|
||||
#include <eda_3d_viewer_settings.h>
|
||||
#include <3d_rendering/raytracing/render_3d_raytrace_ram.h>
|
||||
#include <3d_viewer_id.h>
|
||||
#include <3d_viewer/tools/eda_3d_actions.h>
|
||||
#include <3d_viewer/tools/eda_3d_controller.h>
|
||||
@ -60,7 +61,12 @@
|
||||
#include <project_pcb.h>
|
||||
#include <toolbars_3d.h>
|
||||
|
||||
#ifdef __linux__
|
||||
#include <spacenav/libspnav_driver.h>
|
||||
#include <3d_spacenav/spnav_viewer_plugin.h>
|
||||
#else
|
||||
#include <3d_navlib/nl_3d_viewer_plugin.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Flag to enable 3D viewer main frame window debug tracing.
|
||||
@ -191,7 +197,11 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
|
||||
|
||||
try
|
||||
{
|
||||
#ifdef __linux__
|
||||
m_spaceMouse = std::make_unique<SPNAV_VIEWER_PLUGIN>( m_canvas );
|
||||
#else
|
||||
m_spaceMouse = std::make_unique<NL_3D_VIEWER_PLUGIN>( m_canvas );
|
||||
#endif
|
||||
}
|
||||
catch( const std::system_error& e )
|
||||
{
|
||||
@ -656,80 +666,304 @@ void EDA_3D_VIEWER_FRAME::OnDarkModeToggle()
|
||||
void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
|
||||
{
|
||||
wxString fullFileName;
|
||||
bool fmt_is_jpeg = false;
|
||||
|
||||
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG )
|
||||
fmt_is_jpeg = true;
|
||||
|
||||
if( aFormat != EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
|
||||
{
|
||||
// Remember path between saves during this session only.
|
||||
const wxString wildcard =
|
||||
fmt_is_jpeg ? FILEEXT::JpegFileWildcard() : FILEEXT::PngFileWildcard();
|
||||
const wxString ext = fmt_is_jpeg ? FILEEXT::JpegFileExtension : FILEEXT::PngFileExtension;
|
||||
if( !getExportFileName( aFormat, fullFileName ) )
|
||||
return;
|
||||
}
|
||||
|
||||
wxImage screenshotImage = captureCurrentViewScreenshot();
|
||||
|
||||
if( screenshotImage.IsOk() )
|
||||
{
|
||||
saveOrCopyImage( screenshotImage, aFormat, fullFileName );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxImage EDA_3D_VIEWER_FRAME::captureCurrentViewScreenshot()
|
||||
{
|
||||
// Ensure we have the latest 3D view (remember 3D view is buffered)
|
||||
// Also ensure any highlighted item is not highlighted when creating screen shot
|
||||
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS& cfg = m_boardAdapter.m_Cfg->m_Render;
|
||||
bool original_highlight = cfg.highlight_on_rollover;
|
||||
cfg.highlight_on_rollover = false;
|
||||
|
||||
m_canvas->DoRePaint(); // init first buffer
|
||||
m_canvas->DoRePaint(); // init second buffer
|
||||
|
||||
wxImage screenshotImage;
|
||||
|
||||
if( m_canvas )
|
||||
{
|
||||
// Build image from the 3D buffer
|
||||
wxWindowUpdateLocker noUpdates( this );
|
||||
m_canvas->GetScreenshot( screenshotImage );
|
||||
}
|
||||
|
||||
// Restore highlight setting
|
||||
cfg.highlight_on_rollover = original_highlight;
|
||||
|
||||
return screenshotImage;
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::ExportImage( EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxSize& aSize )
|
||||
{
|
||||
wxString fullFileName;
|
||||
|
||||
if( aFormat != EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
|
||||
{
|
||||
if( !getExportFileName( aFormat, fullFileName ) )
|
||||
return;
|
||||
}
|
||||
|
||||
wxImage screenshotImage = captureScreenshot( aSize );
|
||||
|
||||
if( screenshotImage.IsOk() )
|
||||
{
|
||||
saveOrCopyImage( screenshotImage, aFormat, fullFileName );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool EDA_3D_VIEWER_FRAME::getExportFileName( EDA_3D_VIEWER_EXPORT_FORMAT& aFormat, wxString& fullFileName )
|
||||
{
|
||||
// Create combined wildcard for both formats
|
||||
const wxString wildcard = FILEEXT::JpegFileWildcard() + "|" + FILEEXT::PngFileWildcard();
|
||||
|
||||
// First time path is set to the project path.
|
||||
if( !m_defaultSaveScreenshotFileName.IsOk() )
|
||||
m_defaultSaveScreenshotFileName = Parent()->Prj().GetProjectFullName();
|
||||
|
||||
m_defaultSaveScreenshotFileName.SetExt( ext );
|
||||
// Set default extension based on current format
|
||||
const wxString defaultExt = ( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) ?
|
||||
FILEEXT::JpegFileExtension : FILEEXT::PngFileExtension;
|
||||
m_defaultSaveScreenshotFileName.SetExt( defaultExt );
|
||||
|
||||
wxFileDialog dlg( this, _( "3D Image File Name" ),
|
||||
m_defaultSaveScreenshotFileName.GetPath(),
|
||||
m_defaultSaveScreenshotFileName.GetFullName(), wildcard,
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
|
||||
// Set initial filter index based on current format
|
||||
dlg.SetFilterIndex( ( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) ? 0 : 1 );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
return false;
|
||||
|
||||
m_defaultSaveScreenshotFileName = dlg.GetPath();
|
||||
|
||||
if( m_defaultSaveScreenshotFileName.GetExt().IsEmpty() )
|
||||
// Determine format based on file extension first
|
||||
wxString fileExt = m_defaultSaveScreenshotFileName.GetExt().Lower();
|
||||
EDA_3D_VIEWER_EXPORT_FORMAT detectedFormat;
|
||||
bool formatDetected = false;
|
||||
|
||||
if( fileExt == wxT("jpg") || fileExt == wxT("jpeg") )
|
||||
{
|
||||
detectedFormat = EDA_3D_VIEWER_EXPORT_FORMAT::JPEG;
|
||||
formatDetected = true;
|
||||
}
|
||||
else if( fileExt == wxT("png") )
|
||||
{
|
||||
detectedFormat = EDA_3D_VIEWER_EXPORT_FORMAT::PNG;
|
||||
formatDetected = true;
|
||||
}
|
||||
|
||||
// If format can't be determined from extension, use dropdown selection
|
||||
if( !formatDetected )
|
||||
{
|
||||
int filterIndex = dlg.GetFilterIndex();
|
||||
detectedFormat = ( filterIndex == 0 ) ? EDA_3D_VIEWER_EXPORT_FORMAT::JPEG :
|
||||
EDA_3D_VIEWER_EXPORT_FORMAT::PNG;
|
||||
|
||||
// Append appropriate extension
|
||||
const wxString ext = ( detectedFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) ?
|
||||
FILEEXT::JpegFileExtension : FILEEXT::PngFileExtension;
|
||||
m_defaultSaveScreenshotFileName.SetExt( ext );
|
||||
}
|
||||
|
||||
fullFileName = m_defaultSaveScreenshotFileName.GetFullPath();
|
||||
// Update the format parameter
|
||||
aFormat = detectedFormat;
|
||||
|
||||
wxFileName fn = fullFileName;
|
||||
// Check directory permissions using the updated filename
|
||||
wxFileName fn = m_defaultSaveScreenshotFileName;
|
||||
|
||||
if( !fn.IsDirWritable() )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "Insufficient permissions to save file '%s'." ), fullFileName );
|
||||
msg.Printf( _( "Insufficient permissions to save file '%s'." ),
|
||||
m_defaultSaveScreenshotFileName.GetFullPath() );
|
||||
wxMessageBox( msg, _( "Error" ), wxOK | wxICON_ERROR, this );
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Be sure the screen area destroyed by the file dialog is redrawn
|
||||
// before making a screen copy.
|
||||
// Without this call, under Linux the screen refresh is made to late.
|
||||
wxYield();
|
||||
fullFileName = m_defaultSaveScreenshotFileName.GetFullPath();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Be sure we have the latest 3D view (remember 3D view is buffered)
|
||||
// Also ensure any highlighted item is not highlighted when creating screen shot
|
||||
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS& cfg = m_boardAdapter.m_Cfg->m_Render;
|
||||
bool allow_highlight = cfg.highlight_on_rollover;
|
||||
cfg.highlight_on_rollover = false;
|
||||
|
||||
m_canvas->DoRePaint(); // init first buffer
|
||||
m_canvas->DoRePaint(); // init second buffer
|
||||
wxImage EDA_3D_VIEWER_FRAME::captureScreenshot( const wxSize& aSize )
|
||||
{
|
||||
TRACK_BALL camera = m_trackBallCamera;
|
||||
camera.SetCurWindowSize( aSize );
|
||||
|
||||
// Build image from the 3D buffer
|
||||
wxWindowUpdateLocker noUpdates( this );
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
EDA_3D_VIEWER_SETTINGS* backupCfg = m_boardAdapter.m_Cfg;
|
||||
|
||||
auto configRestorer = std::unique_ptr<void, std::function<void(void*)>>(
|
||||
reinterpret_cast<void*>(1),
|
||||
[&](void*) { m_boardAdapter.m_Cfg = backupCfg; }
|
||||
);
|
||||
|
||||
if( cfg )
|
||||
m_boardAdapter.m_Cfg = cfg;
|
||||
|
||||
if( cfg && cfg->m_Render.engine == RENDER_ENGINE::RAYTRACING )
|
||||
return captureRaytracingScreenshot( m_boardAdapter, camera, aSize );
|
||||
else
|
||||
return captureOpenGLScreenshot( m_boardAdapter, camera, aSize );
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::setupRenderingConfig( BOARD_ADAPTER& aAdapter )
|
||||
{
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
if( cfg )
|
||||
aAdapter.m_Cfg = cfg;
|
||||
}
|
||||
|
||||
|
||||
wxImage EDA_3D_VIEWER_FRAME::captureRaytracingScreenshot( BOARD_ADAPTER& aAdapter, TRACK_BALL& aCamera, const wxSize& aSize )
|
||||
{
|
||||
BOARD_ADAPTER tempadapter;
|
||||
tempadapter.SetBoard( GetBoard() );
|
||||
tempadapter.m_Cfg = aAdapter.m_Cfg;
|
||||
tempadapter.InitSettings( nullptr, nullptr );
|
||||
tempadapter.Set3dCacheManager( aAdapter.Get3dCacheManager() );
|
||||
|
||||
RENDER_3D_RAYTRACE_RAM raytrace( tempadapter, aCamera );
|
||||
raytrace.SetCurWindowSize( aSize );
|
||||
|
||||
while( raytrace.Redraw( false, nullptr, nullptr ) );
|
||||
|
||||
uint8_t* rgbaBuffer = raytrace.GetBuffer();
|
||||
wxSize realSize = raytrace.GetRealBufferSize();
|
||||
|
||||
if( !rgbaBuffer )
|
||||
return wxImage();
|
||||
|
||||
return convertRGBAToImage( rgbaBuffer, realSize );
|
||||
}
|
||||
|
||||
|
||||
wxImage EDA_3D_VIEWER_FRAME::convertRGBAToImage( uint8_t* aRGBABuffer, const wxSize& aRealSize )
|
||||
{
|
||||
const unsigned int wxh = aRealSize.x * aRealSize.y;
|
||||
|
||||
unsigned char* rgbBuffer = (unsigned char*) malloc( wxh * 3 );
|
||||
unsigned char* alphaBuffer = (unsigned char*) malloc( wxh );
|
||||
|
||||
unsigned char* rgbaPtr = aRGBABuffer;
|
||||
unsigned char* rgbPtr = rgbBuffer;
|
||||
unsigned char* alphaPtr = alphaBuffer;
|
||||
|
||||
for( int y = 0; y < aRealSize.y; y++ )
|
||||
{
|
||||
for( int x = 0; x < aRealSize.x; x++ )
|
||||
{
|
||||
rgbPtr[0] = rgbaPtr[0];
|
||||
rgbPtr[1] = rgbaPtr[1];
|
||||
rgbPtr[2] = rgbaPtr[2];
|
||||
alphaPtr[0] = rgbaPtr[3];
|
||||
|
||||
rgbaPtr += 4;
|
||||
rgbPtr += 3;
|
||||
alphaPtr += 1;
|
||||
}
|
||||
}
|
||||
|
||||
wxImage screenshotImage;
|
||||
screenshotImage.Create( aRealSize );
|
||||
screenshotImage.SetData( rgbBuffer );
|
||||
screenshotImage.SetAlpha( alphaBuffer );
|
||||
return screenshotImage.Mirror( false );
|
||||
}
|
||||
|
||||
if( m_canvas )
|
||||
m_canvas->GetScreenshot( screenshotImage );
|
||||
|
||||
cfg.highlight_on_rollover = allow_highlight;
|
||||
wxImage EDA_3D_VIEWER_FRAME::captureOpenGLScreenshot( BOARD_ADAPTER& aAdapter, TRACK_BALL& aCamera, const wxSize& aSize )
|
||||
{
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = aAdapter.m_Cfg;
|
||||
ANTIALIASING_MODE aaMode = cfg ? static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode )
|
||||
: ANTIALIASING_MODE::AA_NONE;
|
||||
|
||||
wxFrame temp( this, wxID_ANY, wxEmptyString, wxDefaultPosition, aSize, wxFRAME_NO_TASKBAR );
|
||||
temp.Hide();
|
||||
BOARD_ADAPTER tempadapter;
|
||||
tempadapter.SetBoard( GetBoard() );
|
||||
tempadapter.m_Cfg = aAdapter.m_Cfg;
|
||||
tempadapter.InitSettings( nullptr, nullptr );
|
||||
tempadapter.Set3dCacheManager( aAdapter.Get3dCacheManager() );
|
||||
|
||||
auto canvas = std::make_unique<EDA_3D_CANVAS>( &temp,
|
||||
OGL_ATT_LIST::GetAttributesList( aaMode, true ),
|
||||
tempadapter, aCamera,
|
||||
aAdapter.Get3dCacheManager() );
|
||||
|
||||
canvas->SetSize( aSize );
|
||||
configureCanvas( canvas, cfg );
|
||||
wxWindowUpdateLocker noUpdates( this );
|
||||
|
||||
// Temporarily disable highlight during screenshot
|
||||
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS& renderCfg = aAdapter.m_Cfg->m_Render;
|
||||
bool original_highlight = renderCfg.highlight_on_rollover;
|
||||
bool original_navigator = renderCfg.show_navigator;
|
||||
renderCfg.show_navigator = false;
|
||||
renderCfg.highlight_on_rollover = false;
|
||||
|
||||
std::vector<unsigned char> buffer(aSize.x * aSize.y * 4); // RGBA format
|
||||
canvas->RenderToFrameBuffer( buffer.data(), aSize.x, aSize.y );
|
||||
wxImage result = convertRGBAToImage( buffer.data(), aSize );
|
||||
|
||||
// Restore highlight setting
|
||||
renderCfg.highlight_on_rollover = original_highlight;
|
||||
renderCfg.show_navigator = original_navigator;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::configureCanvas( std::unique_ptr<EDA_3D_CANVAS>& aCanvas, EDA_3D_VIEWER_SETTINGS* aCfg )
|
||||
{
|
||||
if( aCfg )
|
||||
{
|
||||
aCanvas->SetAnimationEnabled( aCfg->m_Camera.animation_enabled );
|
||||
aCanvas->SetMovingSpeedMultiplier( aCfg->m_Camera.moving_speed_multiplier );
|
||||
aCanvas->SetProjectionMode( aCfg->m_Camera.projection_mode );
|
||||
}
|
||||
|
||||
aCanvas->SetVcSettings( EDA_DRAW_PANEL_GAL::GetVcSettings() );
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::saveOrCopyImage( const wxImage& aScreenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& aFullFileName )
|
||||
{
|
||||
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
|
||||
{
|
||||
wxBitmap bitmap( screenshotImage );
|
||||
copyImageToClipboard( aScreenshotImage );
|
||||
}
|
||||
else
|
||||
{
|
||||
saveImageToFile( aScreenshotImage, aFormat, aFullFileName );
|
||||
}
|
||||
}
|
||||
|
||||
wxLogNull doNotLog; // disable logging of failed clipboard actions
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::copyImageToClipboard( const wxImage& aScreenshotImage )
|
||||
{
|
||||
wxBitmap bitmap( aScreenshotImage );
|
||||
wxLogNull doNotLog;
|
||||
|
||||
if( wxTheClipboard->Open() )
|
||||
{
|
||||
@ -738,18 +972,19 @@ void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
|
||||
if( !wxTheClipboard->SetData( dobjBmp ) )
|
||||
wxMessageBox( _( "Failed to copy image to clipboard" ) );
|
||||
|
||||
wxTheClipboard->Flush(); /* the data in clipboard will stay
|
||||
* available after the application exits */
|
||||
wxTheClipboard->Flush();
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !screenshotImage.SaveFile( fullFileName,
|
||||
fmt_is_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
|
||||
wxMessageBox( _( "Can't save file" ) );
|
||||
|
||||
screenshotImage.Destroy();
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::saveImageToFile( const wxImage& aScreenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& aFullFileName )
|
||||
{
|
||||
bool fmt_is_jpeg = ( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG );
|
||||
|
||||
if( !aScreenshotImage.SaveFile( aFullFileName, fmt_is_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
|
||||
{
|
||||
wxMessageBox( _( "Can't save file" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,11 @@
|
||||
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
|
||||
|
||||
// Forward declarations
|
||||
#ifdef __linux__
|
||||
class SPNAV_VIEWER_PLUGIN;
|
||||
#else
|
||||
class NL_3D_VIEWER_PLUGIN;
|
||||
#endif
|
||||
class APPEARANCE_CONTROLS_3D;
|
||||
|
||||
|
||||
@ -60,6 +64,7 @@ enum EDA_3D_VIEWER_STATUSBAR
|
||||
enum class EDA_3D_VIEWER_EXPORT_FORMAT
|
||||
{
|
||||
CLIPBOARD,
|
||||
IMAGE,
|
||||
PNG,
|
||||
JPEG
|
||||
};
|
||||
@ -136,6 +141,13 @@ public:
|
||||
*/
|
||||
void TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat );
|
||||
|
||||
/**
|
||||
* Export 3D viewer image to file or clipboard
|
||||
* @param aFormat - Export format (JPEG, PNG, or CLIPBOARD)
|
||||
* @param aSize - Size of the exported image
|
||||
*/
|
||||
void ExportImage( EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxSize& aSize );
|
||||
|
||||
protected:
|
||||
void setupUIConditions() override;
|
||||
|
||||
@ -174,6 +186,90 @@ private:
|
||||
|
||||
void applySettings( EDA_3D_VIEWER_SETTINGS* aSettings );
|
||||
|
||||
/**
|
||||
* Get export filename through file dialog
|
||||
* @param aFormat - [in/out] Export format to determine default file extension and wildcard.
|
||||
* Will be updated to the selected format.
|
||||
* @param fullFileName - [out] Full path of selected file
|
||||
* @return true if filename was successfully obtained, false if cancelled
|
||||
*/
|
||||
bool getExportFileName( EDA_3D_VIEWER_EXPORT_FORMAT& aFormat, wxString& fullFileName );
|
||||
|
||||
/**
|
||||
* Capture screenshot using appropriate rendering method
|
||||
* @param aSize - Size of the screenshot
|
||||
* @return wxImage containing the screenshot
|
||||
*/
|
||||
wxImage captureScreenshot( const wxSize& aSize );
|
||||
|
||||
/**
|
||||
* Setup rendering configuration for screenshot capture
|
||||
* @param adapter - Board adapter to configure
|
||||
*/
|
||||
void setupRenderingConfig( BOARD_ADAPTER& adapter );
|
||||
|
||||
/**
|
||||
* Capture screenshot of the current view using the configured renderer.
|
||||
* This function handles both ray tracing and OpenGL rendering methods.
|
||||
* @return wxImage containing the screenshot of the current view.
|
||||
*/
|
||||
wxImage captureCurrentViewScreenshot();
|
||||
|
||||
/**
|
||||
* Capture screenshot using raytracing renderer
|
||||
* @param adapter - Configured board adapter
|
||||
* @param camera - Camera settings
|
||||
* @param aSize - Size of the screenshot
|
||||
* @return wxImage containing the screenshot
|
||||
*/
|
||||
wxImage captureRaytracingScreenshot( BOARD_ADAPTER& adapter, TRACK_BALL& camera, const wxSize& aSize );
|
||||
|
||||
/**
|
||||
* Convert RGBA buffer to wxImage format
|
||||
* @param rgbaBuffer - Source RGBA buffer
|
||||
* @param realSize - Size of the buffer
|
||||
* @return wxImage with RGB data and alpha channel
|
||||
*/
|
||||
wxImage convertRGBAToImage( uint8_t* rgbaBuffer, const wxSize& realSize );
|
||||
|
||||
/**
|
||||
* Capture screenshot using OpenGL renderer
|
||||
* @param adapter - Configured board adapter
|
||||
* @param camera - Camera settings
|
||||
* @param aSize - Size of the screenshot
|
||||
* @return wxImage containing the screenshot
|
||||
*/
|
||||
wxImage captureOpenGLScreenshot( BOARD_ADAPTER& adapter, TRACK_BALL& camera, const wxSize& aSize );
|
||||
|
||||
/**
|
||||
* Configure canvas settings for screenshot capture
|
||||
* @param canvas - Canvas to configure
|
||||
* @param cfg - Configuration settings (can be nullptr)
|
||||
*/
|
||||
void configureCanvas( std::unique_ptr<EDA_3D_CANVAS>& canvas, EDA_3D_VIEWER_SETTINGS* cfg );
|
||||
|
||||
/**
|
||||
* Save image to file or copy to clipboard based on format
|
||||
* @param screenshotImage - Image to save/copy
|
||||
* @param aFormat - Export format
|
||||
* @param fullFileName - Full path for file save (ignored for clipboard)
|
||||
*/
|
||||
void saveOrCopyImage( const wxImage& screenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& fullFileName );
|
||||
|
||||
/**
|
||||
* Copy image to system clipboard
|
||||
* @param screenshotImage - Image to copy
|
||||
*/
|
||||
void copyImageToClipboard( const wxImage& screenshotImage );
|
||||
|
||||
/**
|
||||
* Save image to file
|
||||
* @param screenshotImage - Image to save
|
||||
* @param aFormat - Export format (JPEG or PNG)
|
||||
* @param fullFileName - Full path of target file
|
||||
*/
|
||||
void saveImageToFile( const wxImage& screenshotImage, EDA_3D_VIEWER_EXPORT_FORMAT aFormat, const wxString& fullFileName );
|
||||
|
||||
private:
|
||||
wxFileName m_defaultSaveScreenshotFileName;
|
||||
|
||||
@ -184,7 +280,11 @@ private:
|
||||
|
||||
bool m_disable_ray_tracing;
|
||||
|
||||
#ifdef __linux__
|
||||
std::unique_ptr<SPNAV_VIEWER_PLUGIN> m_spaceMouse;
|
||||
#else
|
||||
std::unique_ptr<NL_3D_VIEWER_PLUGIN> m_spaceMouse;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Trace mask used to enable or disable the trace output of this class.
|
||||
|
@ -38,6 +38,7 @@ LAYER_PRESET_3D::LAYER_PRESET_3D( const wxString& aName ) :
|
||||
name( aName )
|
||||
{
|
||||
layers.set( LAYER_3D_BOARD );
|
||||
layers.set( LAYER_3D_PLATED_BARRELS );
|
||||
layers.set( LAYER_3D_COPPER_TOP );
|
||||
layers.set( LAYER_3D_COPPER_BOTTOM );
|
||||
layers.set( LAYER_3D_SILKSCREEN_TOP );
|
||||
@ -59,6 +60,7 @@ LAYER_PRESET_3D::LAYER_PRESET_3D( const wxString& aName ) :
|
||||
colors[ LAYER_3D_BACKGROUND_TOP ] = BOARD_ADAPTER::g_DefaultBackgroundTop;
|
||||
colors[ LAYER_3D_BACKGROUND_BOTTOM ] = BOARD_ADAPTER::g_DefaultBackgroundBot;
|
||||
colors[ LAYER_3D_BOARD ] = BOARD_ADAPTER::g_DefaultBoardBody;
|
||||
colors[ LAYER_3D_PLATED_BARRELS ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
|
||||
colors[ LAYER_3D_COPPER_TOP ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
|
||||
colors[ LAYER_3D_COPPER_BOTTOM ] = BOARD_ADAPTER::g_DefaultSurfaceFinish;
|
||||
colors[ LAYER_3D_SILKSCREEN_TOP ] = BOARD_ADAPTER::g_DefaultSilkscreen;
|
||||
@ -91,6 +93,7 @@ PARAM_LAYER_PRESET_3D::PARAM_LAYER_PRESET_3D( const std::string& aPath,
|
||||
LAYER( "background_bottom", LAYER_3D_BACKGROUND_BOTTOM );
|
||||
LAYER( "background_top", LAYER_3D_BACKGROUND_TOP );
|
||||
LAYER( "board", LAYER_3D_BOARD );
|
||||
LAYER( "plated_barrels", LAYER_3D_PLATED_BARRELS );
|
||||
LAYER( "copper", LAYER_3D_COPPER_TOP );
|
||||
LAYER( "copper_bottom", LAYER_3D_COPPER_BOTTOM );
|
||||
LAYER( "silkscreen_bottom", LAYER_3D_SILKSCREEN_BOTTOM );
|
||||
@ -346,6 +349,8 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
|
||||
&m_Render.show_navigator, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_board_body",
|
||||
&m_Render.show_board_body, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_plated_barrels",
|
||||
&m_Render.show_plated_barrels, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_comments",
|
||||
&m_Render.show_comments, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_drawings",
|
||||
|
@ -128,6 +128,7 @@ public:
|
||||
bool show_adhesive;
|
||||
bool show_navigator;
|
||||
bool show_board_body;
|
||||
bool show_plated_barrels;
|
||||
bool show_comments;
|
||||
bool show_drawings;
|
||||
bool show_eco1;
|
||||
|
@ -65,21 +65,13 @@ TOOL_ACTION EDA_3D_ACTIONS::copyToClipboard( TOOL_ACTION_ARGS()
|
||||
.Icon( BITMAPS::copy )
|
||||
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::exportAsPNG( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.exportAsPNG" )
|
||||
TOOL_ACTION EDA_3D_ACTIONS::exportImage( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.exportImage" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Export Current View as PNG..." ) )
|
||||
.Tooltip( _( "Export the Current View as a PNG image" ) )
|
||||
.Icon( BITMAPS::export_png )
|
||||
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::PNG ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::exportAsJPEG( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.exportAsJPEG" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Export Current View as JPEG..." ) )
|
||||
.Tooltip( _( "Export the Current View as a JPEG image" ) )
|
||||
.FriendlyName( _( "Export Image..." ) )
|
||||
.Tooltip( _( "Export the Current View as an image file" ) )
|
||||
.Icon( BITMAPS::export_file )
|
||||
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) );
|
||||
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::IMAGE ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::pivotCenter( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.pivotCenter" )
|
||||
|
@ -46,8 +46,7 @@ public:
|
||||
static TOOL_ACTION toggleRaytacing;
|
||||
|
||||
static TOOL_ACTION copyToClipboard;
|
||||
static TOOL_ACTION exportAsPNG;
|
||||
static TOOL_ACTION exportAsJPEG;
|
||||
static TOOL_ACTION exportImage;
|
||||
|
||||
static TOOL_ACTION pivotCenter;
|
||||
static TOOL_ACTION rotateXCW;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <kiface_base.h>
|
||||
#include <tools/eda_3d_controller.h>
|
||||
#include <tools/eda_3d_actions.h>
|
||||
#include <dialogs/dialog_export_3d_image.h>
|
||||
#include <dialogs/panel_preview_3d_model.h>
|
||||
#include <dialogs/appearance_controls_3D.h>
|
||||
#include <3d_rendering/opengl/render_3d_opengl.h>
|
||||
@ -37,6 +38,30 @@
|
||||
|
||||
bool EDA_3D_CONTROLLER::Init()
|
||||
{
|
||||
std::shared_ptr<ACTION_MENU> rotateSubmenu = std::make_shared<ACTION_MENU>( true, this );
|
||||
rotateSubmenu->SetTitle( _( "Rotate Board" ) );
|
||||
rotateSubmenu->SetIcon( BITMAPS::rotate_cw );
|
||||
m_menu->RegisterSubMenu( rotateSubmenu );
|
||||
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCW );
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateXCCW );
|
||||
rotateSubmenu->AppendSeparator();
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCW );
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateYCCW );
|
||||
rotateSubmenu->AppendSeparator();
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCW );
|
||||
rotateSubmenu->Add( EDA_3D_ACTIONS::rotateZCCW );
|
||||
|
||||
std::shared_ptr<ACTION_MENU> moveSubmenu = std::make_shared<ACTION_MENU>( true, this );
|
||||
moveSubmenu->SetTitle( _( "Move Board" ) );
|
||||
moveSubmenu->SetIcon( BITMAPS::move );
|
||||
m_menu->RegisterSubMenu( moveSubmenu );
|
||||
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveLeft );
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveRight );
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveUp );
|
||||
moveSubmenu->Add( EDA_3D_ACTIONS::moveDown );
|
||||
|
||||
CONDITIONAL_MENU& ctxMenu = m_menu->GetMenu();
|
||||
|
||||
ctxMenu.AddItem( ACTIONS::zoomInCenter, SELECTION_CONDITIONS::ShowAlways );
|
||||
@ -45,23 +70,15 @@ bool EDA_3D_CONTROLLER::Init()
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewTop, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewBottom, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewRight, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewLeft, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewFront, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewBack, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddMenu( rotateSubmenu.get(), SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::flipView, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::moveLeft, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::moveRight, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::moveUp, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::moveDown, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddMenu( moveSubmenu.get(), SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -137,8 +154,13 @@ int EDA_3D_CONTROLLER::Main( const TOOL_EVENT& aEvent )
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
else if( evt->IsMouseDown() )
|
||||
{
|
||||
}
|
||||
else if( evt->IsClick() && ( evt->Buttons() & BUT_RIGHT ) )
|
||||
{
|
||||
|
||||
if( !m_canvas->m_mouse_was_moved )
|
||||
m_menu->ShowContextMenu();
|
||||
}
|
||||
else
|
||||
@ -235,8 +257,7 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent )
|
||||
auto flipLayer =
|
||||
[&]( int layer )
|
||||
{
|
||||
appearanceManager->OnLayerVisibilityChanged( layer,
|
||||
!visibilityFlags.test( layer ) );
|
||||
appearanceManager->OnLayerVisibilityChanged( layer, !visibilityFlags.test( layer ) );
|
||||
};
|
||||
|
||||
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
|
||||
@ -246,20 +267,13 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( appearanceManager )
|
||||
{
|
||||
if( aEvent.IsAction( &EDA_3D_ACTIONS::showTHT ) )
|
||||
flipLayer( LAYER_3D_TH_MODELS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showSMD ) )
|
||||
flipLayer( LAYER_3D_SMD_MODELS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showVirtual ) )
|
||||
flipLayer( LAYER_3D_VIRTUAL_MODELS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNotInPosFile ) )
|
||||
flipLayer( LAYER_3D_MODELS_NOT_IN_POS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showDNP ) )
|
||||
flipLayer( LAYER_3D_MODELS_MARKED_DNP );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNavigator ) )
|
||||
flipLayer( LAYER_3D_NAVIGATOR );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showBBoxes ) )
|
||||
flipLayer( LAYER_3D_BOUNDING_BOXES );
|
||||
if( aEvent.IsAction( &EDA_3D_ACTIONS::showTHT ) ) flipLayer( LAYER_3D_TH_MODELS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showSMD ) ) flipLayer( LAYER_3D_SMD_MODELS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showVirtual ) ) flipLayer( LAYER_3D_VIRTUAL_MODELS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNotInPosFile ) ) flipLayer( LAYER_3D_MODELS_NOT_IN_POS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showDNP ) ) flipLayer( LAYER_3D_MODELS_MARKED_DNP );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNavigator ) ) flipLayer( LAYER_3D_NAVIGATOR );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showBBoxes ) ) flipLayer( LAYER_3D_BOUNDING_BOXES );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -313,8 +327,7 @@ int EDA_3D_CONTROLLER::doZoomInOut( bool aDirection, bool aCenterOnCursor )
|
||||
{
|
||||
if( m_canvas )
|
||||
{
|
||||
m_canvas->SetView3D( aDirection ? VIEW3D_TYPE::VIEW3D_ZOOM_IN
|
||||
: VIEW3D_TYPE::VIEW3D_ZOOM_OUT );
|
||||
m_canvas->SetView3D( aDirection ? VIEW3D_TYPE::VIEW3D_ZOOM_IN : VIEW3D_TYPE::VIEW3D_ZOOM_OUT );
|
||||
m_canvas->DisplayStatus();
|
||||
}
|
||||
|
||||
@ -374,8 +387,26 @@ int EDA_3D_CONTROLLER::ExportImage( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
|
||||
|
||||
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
|
||||
static_cast<EDA_3D_VIEWER_FRAME*>( frame )->TakeScreenshot( aEvent.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>() );
|
||||
if( !frame || frame->GetFrameType() != FRAME_PCB_DISPLAY3D )
|
||||
return 0;
|
||||
|
||||
EDA_3D_VIEWER_FRAME* viewer = static_cast<EDA_3D_VIEWER_FRAME*>( frame );
|
||||
EDA_3D_VIEWER_EXPORT_FORMAT fmt = aEvent.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>();
|
||||
|
||||
wxSize currentSize = viewer->GetCanvas()->GetClientSize();
|
||||
|
||||
if( fmt == EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
|
||||
{
|
||||
viewer->ExportImage( fmt, currentSize );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static wxSize lastSize( viewer->GetCanvas()->GetClientSize() );
|
||||
static EDA_3D_VIEWER_EXPORT_FORMAT lastFormat = EDA_3D_VIEWER_EXPORT_FORMAT::PNG;
|
||||
DIALOG_EXPORT_3D_IMAGE dlg( viewer, currentSize );
|
||||
|
||||
if( dlg.ShowModal() == wxID_OK )
|
||||
viewer->ExportImage( lastFormat, dlg.GetSize() );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -390,8 +421,7 @@ void EDA_3D_CONTROLLER::setTransitions()
|
||||
Go( &EDA_3D_CONTROLLER::ReloadBoard, EDA_3D_ACTIONS::reloadBoard.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ToggleRaytracing, EDA_3D_ACTIONS::toggleRaytacing.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::copyToClipboard.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsPNG.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsJPEG.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportImage.MakeEvent() );
|
||||
|
||||
// Pan control
|
||||
Go( &EDA_3D_CONTROLLER::PanControl, ACTIONS::panUp.MakeEvent() );
|
||||
|
@ -22,8 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef _3D_VIEWER_CONTROL_H
|
||||
#define _3D_VIEWER_CONTROL_H
|
||||
#pragma once
|
||||
|
||||
#include <tool/tool_interactive.h>
|
||||
|
||||
@ -38,8 +37,8 @@ class BOARD_ADAPTER;
|
||||
class EDA_3D_CONTROLLER : public TOOL_INTERACTIVE
|
||||
{
|
||||
public:
|
||||
EDA_3D_CONTROLLER()
|
||||
: TOOL_INTERACTIVE( "3DViewer.Control" ),
|
||||
EDA_3D_CONTROLLER() :
|
||||
TOOL_INTERACTIVE( "3DViewer.Control" ),
|
||||
m_canvas( nullptr ),
|
||||
m_boardAdapter( nullptr ),
|
||||
m_camera( nullptr ),
|
||||
@ -63,20 +62,8 @@ public:
|
||||
*
|
||||
* @param aRotIncrement is the rotation increment in degrees
|
||||
*/
|
||||
void SetRotationIncrement( double aRotIncrement )
|
||||
{
|
||||
m_rotationIncrement = aRotIncrement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the increment used by the RotateView actions.
|
||||
*
|
||||
* @return the rotation increment in degrees
|
||||
*/
|
||||
double GetRotationIncrement()
|
||||
{
|
||||
return m_rotationIncrement;
|
||||
}
|
||||
void SetRotationIncrement( double aRotIncrement ) { m_rotationIncrement = aRotIncrement; }
|
||||
double GetRotationIncrement() { return m_rotationIncrement; }
|
||||
|
||||
// View controls
|
||||
int ZoomRedraw( const TOOL_EVENT& aEvent );
|
||||
@ -112,5 +99,3 @@ private:
|
||||
CAMERA* m_camera;
|
||||
double m_rotationIncrement; ///< Rotation increment for the rotate actions (degrees)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -98,6 +98,7 @@ set(3D-VIEWER_SRCS
|
||||
dialogs/dialog_select_3d_model.cpp
|
||||
dialogs/panel_preview_3d_model_base.cpp
|
||||
dialogs/panel_preview_3d_model.cpp
|
||||
dialogs/dialog_export_3d_image.cpp
|
||||
dialogs/panel_3D_display_options.cpp
|
||||
dialogs/panel_3D_display_options_base.cpp
|
||||
dialogs/panel_3D_opengl_options.cpp
|
||||
@ -123,6 +124,13 @@ target_link_libraries( 3d-viewer
|
||||
|
||||
add_subdirectory( 3d_cache )
|
||||
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
message( STATUS "Including libspnav support in 3d-viewer" )
|
||||
add_subdirectory( 3d_spacenav )
|
||||
target_link_libraries( 3d-viewer PRIVATE 3d-viewer_spacenav )
|
||||
else()
|
||||
message( STATUS "Including 3Dconnexion SpaceMouse navigation support in 3d-viewer" )
|
||||
add_subdirectory( 3d_navlib )
|
||||
target_link_libraries( 3d-viewer PRIVATE 3d-viewer_navlib)
|
||||
endif()
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <wx/checkbox.h>
|
||||
|
||||
#include <../3d_rendering/opengl/render_3d_opengl.h>
|
||||
#include <algorithm>
|
||||
|
||||
/// Render Row abbreviation to reduce source width.
|
||||
#define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D
|
||||
@ -52,6 +53,7 @@ const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_la
|
||||
|
||||
// text id tooltip
|
||||
RR( _HKI( "Board Body" ), LAYER_3D_BOARD, _HKI( "Show board body" ) ),
|
||||
RR( _HKI( "Plated Barrels" ),LAYER_3D_PLATED_BARRELS, _HKI( "Show barrels of plated through-holes and vias" ) ),
|
||||
RR( wxS( "F.Cu" ), LAYER_3D_COPPER_TOP, _HKI( "Show front copper / surface finish color" ) ),
|
||||
RR( wxS( "B.Cu" ), LAYER_3D_COPPER_BOTTOM, _HKI( "Show back copper / surface finish color" ) ),
|
||||
RR( _HKI( "Adhesive" ), LAYER_3D_ADHESIVE, _HKI( "Show adhesive" ) ),
|
||||
@ -428,6 +430,7 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
|
||||
case LAYER_3D_BOARD:
|
||||
case LAYER_3D_COPPER_TOP:
|
||||
case LAYER_3D_COPPER_BOTTOM:
|
||||
case LAYER_3D_PLATED_BARRELS:
|
||||
case LAYER_3D_SILKSCREEN_BOTTOM:
|
||||
case LAYER_3D_SILKSCREEN_TOP:
|
||||
case LAYER_3D_SOLDERMASK_BOTTOM:
|
||||
@ -499,15 +502,23 @@ void APPEARANCE_CONTROLS_3D::onColorSwatchChanged( COLOR_SWATCH* aSwatch )
|
||||
// be applied to all copper layers.
|
||||
COLOR_SWATCH* otherSwatch = nullptr;
|
||||
|
||||
if( layer == LAYER_3D_COPPER_TOP )
|
||||
const std::vector<int> copperIndices{
|
||||
LAYER_3D_COPPER_TOP,
|
||||
LAYER_3D_COPPER_BOTTOM,
|
||||
LAYER_3D_PLATED_BARRELS,
|
||||
};
|
||||
|
||||
// If the changed swatch is one of the copper layers, we need to update the other copper layers
|
||||
if( std::find( copperIndices.begin(), copperIndices.end(), layer ) != copperIndices.end() )
|
||||
{
|
||||
colors[ LAYER_3D_COPPER_BOTTOM ] = newColor;
|
||||
otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_BOTTOM]->m_Ctl_color;
|
||||
for( int index : copperIndices )
|
||||
{
|
||||
if( layer != index && colors.count( index ) )
|
||||
{
|
||||
colors[index] = newColor;
|
||||
otherSwatch = m_layerSettingsMap[index]->m_Ctl_color;
|
||||
}
|
||||
}
|
||||
else if( layer == LAYER_3D_COPPER_BOTTOM )
|
||||
{
|
||||
colors[ LAYER_3D_COPPER_TOP ] = newColor;
|
||||
otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_TOP]->m_Ctl_color;
|
||||
}
|
||||
|
||||
if( otherSwatch )
|
||||
@ -872,7 +883,7 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent )
|
||||
if( m_cbLayerPresets->FindString( name ) != wxNOT_FOUND )
|
||||
m_cbLayerPresets->Delete( m_cbLayerPresets->FindString( name ) );
|
||||
|
||||
alg::delete_if( cfg->m_LayerPresets,
|
||||
std::erase_if( cfg->m_LayerPresets,
|
||||
[name]( const LAYER_PRESET_3D& preset )
|
||||
{
|
||||
return preset.name == name;
|
||||
@ -965,7 +976,9 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
|
||||
|
||||
if( !viewport->name.IsEmpty() )
|
||||
{
|
||||
if( m_viewportMRU.Index( viewport->name ) != wxNOT_FOUND )
|
||||
m_viewportMRU.Remove( viewport->name );
|
||||
|
||||
m_viewportMRU.Insert( viewport->name, 0 );
|
||||
}
|
||||
}
|
||||
@ -1000,6 +1013,8 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_viewports[name].matrix = m_frame->GetCurrentCamera().GetViewMatrix();
|
||||
index = m_cbViewports->FindString( name );
|
||||
|
||||
if( m_viewportMRU.Index( name ) != wxNOT_FOUND )
|
||||
m_viewportMRU.Remove( name );
|
||||
}
|
||||
|
||||
@ -1035,8 +1050,10 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_viewports.erase( viewportName );
|
||||
m_cbViewports->Delete( idx );
|
||||
m_viewportMRU.Remove( viewportName );
|
||||
}
|
||||
|
||||
if( m_viewportMRU.Index( viewportName ) != wxNOT_FOUND )
|
||||
m_viewportMRU.Remove( viewportName );
|
||||
}
|
||||
|
||||
if( m_lastSelectedViewport )
|
||||
@ -1083,5 +1100,3 @@ void APPEARANCE_CONTROLS_3D::passOnFocus()
|
||||
{
|
||||
m_focusOwner->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,8 +18,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef APPEARANCE_CONTROLS_3D_H
|
||||
#define APPEARANCE_CONTROLS_3D_H
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -113,6 +112,11 @@ public:
|
||||
APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wxWindow* aFocusOwner );
|
||||
~APPEARANCE_CONTROLS_3D();
|
||||
|
||||
// We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
|
||||
// will only land us in trouble.
|
||||
APPEARANCE_CONTROLS_3D( const APPEARANCE_CONTROLS_3D& ) = delete;
|
||||
APPEARANCE_CONTROLS_3D& operator=( const APPEARANCE_CONTROLS_3D& ) = delete;
|
||||
|
||||
wxSize GetBestSize() const;
|
||||
void OnDarkModeToggle();
|
||||
void OnLayerVisibilityChanged( int aLayer, bool isVisible );
|
||||
@ -189,5 +193,3 @@ private:
|
||||
wxCheckBox* m_cbUseBoardStackupColors;
|
||||
wxCheckBox* m_cbUseBoardEditorCopperColors;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
397
3d-viewer/dialogs/dialog_export_3d_image.cpp
Normal file
397
3d-viewer/dialogs/dialog_export_3d_image.cpp
Normal file
@ -0,0 +1,397 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 3 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "dialog_export_3d_image.h"
|
||||
#include <bitmaps/bitmap_types.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/statline.h>
|
||||
|
||||
DIALOG_EXPORT_3D_IMAGE::DIALOG_EXPORT_3D_IMAGE( wxWindow* aParent, const wxSize& aSize ) :
|
||||
DIALOG_SHIM( aParent, wxID_ANY, _( "Export 3D View" ), wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE ),
|
||||
m_format( EDA_3D_VIEWER_EXPORT_FORMAT::PNG ),
|
||||
m_originalSize( aSize ),
|
||||
m_width( aSize.GetWidth() ),
|
||||
m_height( aSize.GetHeight() ),
|
||||
m_xResolution( 300.0 ),
|
||||
m_yResolution( 300.0 ),
|
||||
m_lockAspectRatio( true ),
|
||||
m_sizeUnits( SIZE_UNITS::PIXELS ),
|
||||
m_resolutionUnits( RESOLUTION_UNITS::PIXELS_PER_INCH )
|
||||
{
|
||||
m_aspectRatio = static_cast<double>(m_width) / static_cast<double>(m_height);
|
||||
|
||||
wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
// Image Size section
|
||||
wxStaticText* imageSizeHeader = new wxStaticText( this, wxID_ANY, _( "Image Size" ) );
|
||||
imageSizeHeader->SetFont( imageSizeHeader->GetFont().Bold() );
|
||||
mainSizer->Add( imageSizeHeader, 0, wxLEFT | wxTOP, 10 );
|
||||
|
||||
wxFlexGridSizer* sizeGrid = new wxFlexGridSizer( 2, 4, 5, 5 );
|
||||
sizeGrid->AddGrowableCol( 1 );
|
||||
|
||||
// Width row
|
||||
sizeGrid->Add( new wxStaticText( this, wxID_ANY, _( "Width:" ) ), 0, wxALIGN_CENTER_VERTICAL );
|
||||
m_spinWidth = new wxSpinCtrlDouble( this, wxID_ANY );
|
||||
m_spinWidth->SetRange( 1, 50000 );
|
||||
m_spinWidth->SetDigits( 0 );
|
||||
sizeGrid->Add( m_spinWidth, 1, wxEXPAND );
|
||||
|
||||
// Lock button - will span 2 rows
|
||||
m_lockButton = new wxBitmapButton( this, wxID_ANY, KiBitmapBundle( BITMAPS::locked ) );
|
||||
sizeGrid->Add( m_lockButton, 0, wxALIGN_CENTER | wxALL, 2 );
|
||||
|
||||
// Size units choice
|
||||
m_choiceSizeUnits = new wxChoice( this, wxID_ANY );
|
||||
m_choiceSizeUnits->Append( _( "pixels" ) );
|
||||
m_choiceSizeUnits->Append( _( "%" ) );
|
||||
m_choiceSizeUnits->Append( _( "mm" ) );
|
||||
m_choiceSizeUnits->Append( _( "in" ) );
|
||||
m_choiceSizeUnits->SetSelection( 0 ); // pixels
|
||||
sizeGrid->Add( m_choiceSizeUnits, 0, wxEXPAND );
|
||||
|
||||
// Height row
|
||||
sizeGrid->Add( new wxStaticText( this, wxID_ANY, _( "Height:" ) ), 0, wxALIGN_CENTER_VERTICAL );
|
||||
m_spinHeight = new wxSpinCtrlDouble( this, wxID_ANY );
|
||||
m_spinHeight->SetRange( 1, 50000 );
|
||||
m_spinHeight->SetDigits( 0 );
|
||||
sizeGrid->Add( m_spinHeight, 1, wxEXPAND );
|
||||
|
||||
sizeGrid->AddSpacer( 0 ); // Empty space where lock button is
|
||||
sizeGrid->AddSpacer( 0 ); // Empty space for units column
|
||||
|
||||
mainSizer->Add( sizeGrid, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
|
||||
|
||||
// Pixel size display
|
||||
m_pixelSizeLabel = new wxStaticText( this, wxID_ANY, wxEmptyString );
|
||||
m_pixelSizeLabel->SetFont( m_pixelSizeLabel->GetFont().Smaller() );
|
||||
mainSizer->Add( m_pixelSizeLabel, 0, wxLEFT | wxTOP, 10 );
|
||||
|
||||
// Separator
|
||||
wxStaticLine* line = new wxStaticLine( this );
|
||||
mainSizer->Add( line, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
|
||||
|
||||
// Resolution section
|
||||
wxStaticText* resolutionHeader = new wxStaticText( this, wxID_ANY, _( "Resolution" ) );
|
||||
resolutionHeader->SetFont( resolutionHeader->GetFont().Bold() );
|
||||
mainSizer->Add( resolutionHeader, 0, wxLEFT | wxTOP, 10 );
|
||||
|
||||
wxFlexGridSizer* resGrid = new wxFlexGridSizer( 2, 3, 5, 5 );
|
||||
resGrid->AddGrowableCol( 1 );
|
||||
|
||||
// X Resolution row
|
||||
resGrid->Add( new wxStaticText( this, wxID_ANY, _( "X resolution:" ) ), 0, wxALIGN_CENTER_VERTICAL );
|
||||
m_spinXResolution = new wxSpinCtrlDouble( this, wxID_ANY );
|
||||
m_spinXResolution->SetRange( 1, 10000 );
|
||||
m_spinXResolution->SetDigits( 3 );
|
||||
resGrid->Add( m_spinXResolution, 1, wxEXPAND );
|
||||
|
||||
// Resolution units choice
|
||||
m_choiceResolutionUnits = new wxChoice( this, wxID_ANY );
|
||||
m_choiceResolutionUnits->Append( _( "pixels/in" ) );
|
||||
m_choiceResolutionUnits->Append( _( "pixels/mm" ) );
|
||||
m_choiceResolutionUnits->SetSelection( 0 ); // pixels/in
|
||||
resGrid->Add( m_choiceResolutionUnits, 0, wxEXPAND );
|
||||
|
||||
// Y Resolution row
|
||||
resGrid->Add( new wxStaticText( this, wxID_ANY, _( "Y resolution:" ) ), 0, wxALIGN_CENTER_VERTICAL );
|
||||
m_spinYResolution = new wxSpinCtrlDouble( this, wxID_ANY );
|
||||
m_spinYResolution->SetRange( 1, 10000 );
|
||||
m_spinYResolution->SetDigits( 3 );
|
||||
resGrid->Add( m_spinYResolution, 1, wxEXPAND );
|
||||
resGrid->AddSpacer( 0 ); // Empty space for units column
|
||||
|
||||
mainSizer->Add( resGrid, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10 );
|
||||
|
||||
// Dialog buttons
|
||||
wxStdDialogButtonSizer* btnSizer = CreateStdDialogButtonSizer( wxOK | wxCANCEL );
|
||||
mainSizer->Add( btnSizer, 0, wxEXPAND | wxALL, 10 );
|
||||
|
||||
SetSizerAndFit( mainSizer );
|
||||
Centre();
|
||||
|
||||
// Set initial values AFTER creating all controls
|
||||
m_spinWidth->SetValue( m_width );
|
||||
m_spinHeight->SetValue( m_height );
|
||||
m_spinXResolution->SetValue( m_xResolution );
|
||||
m_spinYResolution->SetValue( m_yResolution );
|
||||
UpdatePixelSize();
|
||||
|
||||
// Bind events AFTER setting initial values
|
||||
m_lockButton->Bind( wxEVT_BUTTON, &DIALOG_EXPORT_3D_IMAGE::OnLockToggle, this );
|
||||
m_spinWidth->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnWidthChange, this );
|
||||
m_spinHeight->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnHeightChange, this );
|
||||
m_spinXResolution->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnXResolutionChange, this );
|
||||
m_spinYResolution->Bind( wxEVT_SPINCTRLDOUBLE, &DIALOG_EXPORT_3D_IMAGE::OnYResolutionChange, this );
|
||||
m_choiceSizeUnits->Bind( wxEVT_CHOICE, &DIALOG_EXPORT_3D_IMAGE::OnSizeUnitChange, this );
|
||||
m_choiceResolutionUnits->Bind( wxEVT_CHOICE, &DIALOG_EXPORT_3D_IMAGE::OnResolutionUnitChange, this );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_EXPORT_3D_IMAGE::TransferDataFromWindow()
|
||||
{
|
||||
// Convert current values back to pixels if needed
|
||||
double width = m_spinWidth->GetValue();
|
||||
double height = m_spinHeight->GetValue();
|
||||
|
||||
switch( m_sizeUnits )
|
||||
{
|
||||
case SIZE_UNITS::PIXELS:
|
||||
m_width = static_cast<int>( width );
|
||||
m_height = static_cast<int>( height );
|
||||
break;
|
||||
case SIZE_UNITS::PERCENT:
|
||||
// Assume 100% = original size
|
||||
m_width = static_cast<int>( width * m_originalSize.GetWidth() / 100.0 );
|
||||
m_height = static_cast<int>( height * m_originalSize.GetHeight() / 100.0 );
|
||||
break;
|
||||
case SIZE_UNITS::MM:
|
||||
// Convert mm to pixels using resolution
|
||||
m_width = static_cast<int>( width * m_xResolution / 25.4 );
|
||||
m_height = static_cast<int>( height * m_yResolution / 25.4 );
|
||||
break;
|
||||
case SIZE_UNITS::INCHES:
|
||||
// Convert inches to pixels using resolution
|
||||
m_width = static_cast<int>( width * m_xResolution );
|
||||
m_height = static_cast<int>( height * m_yResolution );
|
||||
break;
|
||||
}
|
||||
|
||||
m_xResolution = m_spinXResolution->GetValue();
|
||||
m_yResolution = m_spinYResolution->GetValue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::OnLockToggle( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_lockAspectRatio = !m_lockAspectRatio;
|
||||
|
||||
if( m_lockAspectRatio )
|
||||
{
|
||||
m_lockButton->SetBitmap( KiBitmapBundle( BITMAPS::locked ) );
|
||||
UpdateAspectRatio();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lockButton->SetBitmap( KiBitmapBundle( BITMAPS::unlocked ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::OnWidthChange( wxSpinDoubleEvent& aEvent )
|
||||
{
|
||||
if( m_lockAspectRatio )
|
||||
{
|
||||
double width = m_spinWidth->GetValue();
|
||||
double height;
|
||||
|
||||
if( m_sizeUnits == SIZE_UNITS::PERCENT )
|
||||
height = m_originalSize.GetWidth() * width / 100.0 / m_aspectRatio;
|
||||
else
|
||||
height = width / m_aspectRatio;
|
||||
|
||||
// Ensure height is not less than 1
|
||||
if( height < 1 )
|
||||
height = 1;
|
||||
|
||||
m_spinHeight->SetValue( height );
|
||||
}
|
||||
|
||||
UpdatePixelSize();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::OnHeightChange( wxSpinDoubleEvent& aEvent )
|
||||
{
|
||||
if( m_lockAspectRatio )
|
||||
{
|
||||
double height = m_spinHeight->GetValue();
|
||||
double width;
|
||||
|
||||
if( m_sizeUnits == SIZE_UNITS::PERCENT )
|
||||
width = m_originalSize.GetHeight() * height / 100.0 * m_aspectRatio;
|
||||
else
|
||||
width = height * m_aspectRatio;
|
||||
|
||||
// Ensure width is not less than 1
|
||||
if( width < 1 )
|
||||
width = 1;
|
||||
|
||||
m_spinWidth->SetValue( width );
|
||||
}
|
||||
|
||||
UpdatePixelSize();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::OnXResolutionChange( wxSpinDoubleEvent& aEvent )
|
||||
{
|
||||
UpdatePixelSize();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::OnYResolutionChange( wxSpinDoubleEvent& aEvent )
|
||||
{
|
||||
UpdatePixelSize();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::OnSizeUnitChange( wxCommandEvent& aEvent )
|
||||
{
|
||||
SIZE_UNITS oldUnits = m_sizeUnits;
|
||||
m_sizeUnits = static_cast<SIZE_UNITS>( m_choiceSizeUnits->GetSelection() );
|
||||
ConvertSizeUnits( oldUnits, m_sizeUnits );
|
||||
UpdatePixelSize();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::OnResolutionUnitChange( wxCommandEvent& aEvent )
|
||||
{
|
||||
RESOLUTION_UNITS oldUnits = m_resolutionUnits;
|
||||
m_resolutionUnits = static_cast<RESOLUTION_UNITS>( m_choiceResolutionUnits->GetSelection() );
|
||||
ConvertResolutionUnits( oldUnits, m_resolutionUnits );
|
||||
UpdatePixelSize();
|
||||
}
|
||||
|
||||
|
||||
wxSize DIALOG_EXPORT_3D_IMAGE::GetPixelSize( double aWidth, double aHeight, double aXResolution, double aYResolution, SIZE_UNITS aSizeUnits ) const
|
||||
{
|
||||
switch( aSizeUnits )
|
||||
{
|
||||
case SIZE_UNITS::PIXELS:
|
||||
return wxSize( static_cast<int>( aWidth ), static_cast<int>( aHeight ) );
|
||||
case SIZE_UNITS::PERCENT:
|
||||
return wxSize( static_cast<int>( 100.0 * m_originalSize.GetWidth() ),
|
||||
static_cast<int>( 100.0 * m_originalSize.GetHeight() ) );
|
||||
case SIZE_UNITS::MM:
|
||||
return wxSize( static_cast<int>( aWidth * aXResolution / 25.4 ),
|
||||
static_cast<int>( aHeight * aYResolution / 25.4 ) );
|
||||
case SIZE_UNITS::INCHES:
|
||||
return wxSize( static_cast<int>( aWidth * aXResolution ),
|
||||
static_cast<int>( aHeight * aYResolution ) );
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return wxSize( 10, 10 ); // Should not happen
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::UpdatePixelSize()
|
||||
{
|
||||
double width = m_spinWidth->GetValue();
|
||||
double height = m_spinHeight->GetValue();
|
||||
double xRes = m_spinXResolution->GetValue();
|
||||
double yRes = m_spinYResolution->GetValue();
|
||||
|
||||
// Convert resolution to standard pixels/inch
|
||||
if( m_resolutionUnits == RESOLUTION_UNITS::PIXELS_PER_MM )
|
||||
{
|
||||
xRes *= 25.4; // Convert mm to inches
|
||||
yRes *= 25.4;
|
||||
}
|
||||
|
||||
wxSize pixelSize = GetPixelSize( width, height, xRes, yRes, m_sizeUnits );
|
||||
|
||||
m_pixelSizeLabel->SetLabel( wxString::Format( _( "%d × %d pixels" ), pixelSize.GetWidth(), pixelSize.GetHeight() ) );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::UpdateAspectRatio()
|
||||
{
|
||||
m_aspectRatio = m_spinWidth->GetValue() / m_spinHeight->GetValue();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::ConvertSizeUnits( SIZE_UNITS aFromUnit, SIZE_UNITS aToUnit )
|
||||
{
|
||||
if( aFromUnit == aToUnit )
|
||||
return;
|
||||
|
||||
double width = m_spinWidth->GetValue();
|
||||
double height = m_spinHeight->GetValue();
|
||||
double xRes = m_spinXResolution->GetValue();
|
||||
double yRes = m_spinYResolution->GetValue();
|
||||
|
||||
// Convert resolution to standard pixels/inch
|
||||
if( m_resolutionUnits == RESOLUTION_UNITS::PIXELS_PER_MM )
|
||||
{
|
||||
xRes *= 25.4; // Convert mm to inches
|
||||
yRes *= 25.4;
|
||||
}
|
||||
|
||||
// Convert to pixels first
|
||||
wxSize pixelSize = GetPixelSize( width, height, xRes, yRes, aFromUnit );
|
||||
|
||||
// Convert from pixels to target unit
|
||||
switch( aToUnit )
|
||||
{
|
||||
case SIZE_UNITS::PIXELS:
|
||||
m_spinWidth->SetValue( pixelSize.GetWidth() );
|
||||
m_spinHeight->SetValue( pixelSize.GetHeight() );
|
||||
break;
|
||||
case SIZE_UNITS::PERCENT:
|
||||
m_spinWidth->SetValue( pixelSize.GetWidth() * 100.0 / m_originalSize.GetWidth() );
|
||||
m_spinHeight->SetValue( pixelSize.GetHeight() * 100.0 / m_originalSize.GetHeight() );
|
||||
break;
|
||||
case SIZE_UNITS::MM:
|
||||
m_spinWidth->SetValue( pixelSize.GetWidth() * 25.4 / xRes );
|
||||
m_spinHeight->SetValue( pixelSize.GetHeight() * 25.4 / yRes );
|
||||
break;
|
||||
case SIZE_UNITS::INCHES:
|
||||
m_spinWidth->SetValue( pixelSize.GetWidth() / xRes );
|
||||
m_spinHeight->SetValue( pixelSize.GetHeight() / yRes );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXPORT_3D_IMAGE::ConvertResolutionUnits( RESOLUTION_UNITS aFromUnit, RESOLUTION_UNITS aToUnit )
|
||||
{
|
||||
if( aFromUnit == aToUnit )
|
||||
return;
|
||||
|
||||
double xRes = m_spinXResolution->GetValue();
|
||||
double yRes = m_spinYResolution->GetValue();
|
||||
|
||||
if( aFromUnit == RESOLUTION_UNITS::PIXELS_PER_INCH && aToUnit == RESOLUTION_UNITS::PIXELS_PER_MM )
|
||||
{
|
||||
// Convert from pixels/inch to pixels/mm
|
||||
m_spinXResolution->SetValue( xRes / 25.4 );
|
||||
m_spinYResolution->SetValue( yRes / 25.4 );
|
||||
}
|
||||
else if( aFromUnit == RESOLUTION_UNITS::PIXELS_PER_MM && aToUnit == RESOLUTION_UNITS::PIXELS_PER_INCH )
|
||||
{
|
||||
// Convert from pixels/mm to pixels/inch
|
||||
m_spinXResolution->SetValue( xRes * 25.4 );
|
||||
m_spinYResolution->SetValue( yRes * 25.4 );
|
||||
}
|
||||
}
|
95
3d-viewer/dialogs/dialog_export_3d_image.h
Normal file
95
3d-viewer/dialogs/dialog_export_3d_image.h
Normal file
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 3
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 3 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <3d_viewer/eda_3d_viewer_frame.h> // for EDA_3D_VIEWER_EXPORT_FORMAT
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
|
||||
enum class SIZE_UNITS
|
||||
{
|
||||
PIXELS,
|
||||
PERCENT,
|
||||
MM,
|
||||
INCHES
|
||||
};
|
||||
|
||||
enum class RESOLUTION_UNITS
|
||||
{
|
||||
PIXELS_PER_INCH,
|
||||
PIXELS_PER_MM
|
||||
};
|
||||
|
||||
class DIALOG_EXPORT_3D_IMAGE : public DIALOG_SHIM
|
||||
{
|
||||
public:
|
||||
DIALOG_EXPORT_3D_IMAGE( wxWindow* aParent,
|
||||
const wxSize& aSize );
|
||||
|
||||
wxSize GetSize() const { return wxSize( m_width, m_height ); }
|
||||
double GetXResolution() const { return m_xResolution; }
|
||||
double GetYResolution() const { return m_yResolution; }
|
||||
|
||||
private:
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
void OnLockToggle( wxCommandEvent& aEvent );
|
||||
void OnWidthChange( wxSpinDoubleEvent& aEvent );
|
||||
void OnHeightChange( wxSpinDoubleEvent& aEvent );
|
||||
void OnXResolutionChange( wxSpinDoubleEvent& aEvent );
|
||||
void OnYResolutionChange( wxSpinDoubleEvent& aEvent );
|
||||
void OnSizeUnitChange( wxCommandEvent& aEvent );
|
||||
void OnResolutionUnitChange( wxCommandEvent& aEvent );
|
||||
|
||||
wxSize GetPixelSize( double aWidth, double aHeight, double aXResolution, double aYResolution, SIZE_UNITS aSizeUnits ) const;
|
||||
void UpdatePixelSize();
|
||||
void UpdateAspectRatio();
|
||||
void ConvertSizeUnits( SIZE_UNITS aFromUnit, SIZE_UNITS aToUnit );
|
||||
void ConvertResolutionUnits( RESOLUTION_UNITS aFromUnit, RESOLUTION_UNITS aToUnit );
|
||||
|
||||
private:
|
||||
EDA_3D_VIEWER_EXPORT_FORMAT m_format;
|
||||
wxSize m_originalSize;
|
||||
int m_width;
|
||||
int m_height;
|
||||
double m_xResolution;
|
||||
double m_yResolution;
|
||||
double m_aspectRatio;
|
||||
bool m_lockAspectRatio;
|
||||
|
||||
SIZE_UNITS m_sizeUnits;
|
||||
RESOLUTION_UNITS m_resolutionUnits;
|
||||
|
||||
wxSpinCtrlDouble* m_spinWidth;
|
||||
wxSpinCtrlDouble* m_spinHeight;
|
||||
wxSpinCtrlDouble* m_spinXResolution;
|
||||
wxSpinCtrlDouble* m_spinYResolution;
|
||||
wxChoice* m_choiceSizeUnits;
|
||||
wxChoice* m_choiceResolutionUnits;
|
||||
wxBitmapButton* m_lockButton;
|
||||
wxStaticText* m_pixelSizeLabel;
|
||||
};
|
@ -47,7 +47,11 @@
|
||||
#include <eda_3d_viewer_settings.h>
|
||||
#include <board_design_settings.h>
|
||||
|
||||
#ifndef __linux__
|
||||
#include <3d_navlib/nl_footprint_properties_plugin.h>
|
||||
#else
|
||||
#include <3d_spacenav/spnav_viewer_plugin.h>
|
||||
#endif
|
||||
|
||||
PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
|
||||
FOOTPRINT* aFootprint,
|
||||
@ -132,7 +136,11 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
|
||||
|
||||
try
|
||||
{
|
||||
#ifndef __linux__
|
||||
m_spaceMouse = std::make_unique<NL_FOOTPRINT_PROPERTIES_PLUGIN>( m_previewPane );
|
||||
#else
|
||||
m_spaceMouse = std::make_unique<SPNAV_VIEWER_PLUGIN>( m_previewPane );
|
||||
#endif
|
||||
m_spaceMouse->SetFocus( true );
|
||||
}
|
||||
catch( const std::system_error& e )
|
||||
@ -654,6 +662,12 @@ void PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint( bool aReloadRequired )
|
||||
}
|
||||
|
||||
|
||||
void PANEL_PREVIEW_3D_MODEL::SetEmbeddedFilesDelegate( EMBEDDED_FILES* aDelegate )
|
||||
{
|
||||
m_dummyBoard->SetEmbeddedFilesDelegate( aDelegate );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_PREVIEW_3D_MODEL::onModify()
|
||||
{
|
||||
KIWAY_HOLDER* kiwayHolder = dynamic_cast<KIWAY_HOLDER*>( wxGetTopLevelParent( this ) );
|
||||
|
@ -59,10 +59,15 @@ wxDECLARE_EVENT( wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent );
|
||||
class WX_INFOBAR;
|
||||
class S3D_CACHE;
|
||||
class FILENAME_RESOLVER;
|
||||
class EMBEDDED_FILES;
|
||||
class BOARD;
|
||||
class BOARD_ADAPTER;
|
||||
class FOOTPRINT;
|
||||
#ifndef __linux__
|
||||
class NL_FOOTPRINT_PROPERTIES_PLUGIN;
|
||||
#else
|
||||
class SPNAV_VIEWER_PLUGIN;
|
||||
#endif
|
||||
|
||||
#define PANEL_PREVIEW_3D_MODEL_ID wxID_HIGHEST + 1244
|
||||
|
||||
@ -97,6 +102,8 @@ public:
|
||||
*/
|
||||
void UpdateDummyFootprint( bool aRelaodRequired = true );
|
||||
|
||||
void SetEmbeddedFilesDelegate( EMBEDDED_FILES* aDelegate );
|
||||
|
||||
/**
|
||||
* Get the dummy footprint that is used for previewing the 3D model.
|
||||
* We use this to hold the temporary 3D model shapes.
|
||||
@ -226,7 +233,11 @@ private:
|
||||
/// The 3d viewer Render initial settings (must be saved and restored)
|
||||
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender;
|
||||
|
||||
#ifndef __linux__
|
||||
std::unique_ptr<NL_FOOTPRINT_PROPERTIES_PLUGIN> m_spaceMouse;
|
||||
#else
|
||||
std::unique_ptr<SPNAV_VIEWER_PLUGIN> m_spaceMouse;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // PANEL_PREVIEW_3D_MODEL_H
|
||||
|
@ -359,7 +359,7 @@
|
||||
Eryk Michalak
|
||||
Michal Jahelka
|
||||
Dmitry Mikhirev
|
||||
Mojca Miklavec
|
||||
Mojca Miklavec Groenhuis
|
||||
Ashley Mills
|
||||
Michael Misirlis
|
||||
Michail Misirlis
|
||||
|
@ -48,6 +48,7 @@ project( kicad )
|
||||
|
||||
# Create a default build type for our QA that doesn't include `NDEBUG`
|
||||
set(CMAKE_CXX_FLAGS_QABUILD "-Os -g1 -ggdb1")
|
||||
string( APPEND CMAKE_EXE_LINKER_FLAGS_QABUILD " -rdynamic" )
|
||||
|
||||
include( GNUInstallDirs )
|
||||
include( CMakeDependentOption )
|
||||
@ -193,7 +194,12 @@ option( KICAD_I18N_UNIX_STRICT_PATH
|
||||
cmake_dependent_option( KICAD_WIN32_INSTALL_PDBS
|
||||
"Installs debug pdb to the bin folder, DO NOT USE (NOR REQUIRED) FOR DEBUGGING THE SOURCE ON MSVC. This is purely for release building.
|
||||
MSVC can find the PDBs without this."
|
||||
OFF "WIN32"
|
||||
OFF "MSVC"
|
||||
OFF )
|
||||
|
||||
cmake_dependent_option( KICAD_MSVC_DYNDEOPT
|
||||
"Builds release builds with /dynamicdeopt for dynamic debugging."
|
||||
OFF "MSVC"
|
||||
OFF )
|
||||
|
||||
####################################
|
||||
@ -233,6 +239,10 @@ cmake_dependent_option( KICAD_WIN32_LTCG
|
||||
OFF "WIN32"
|
||||
OFF )
|
||||
|
||||
option( KICAD_USE_PCH
|
||||
"Enable precompiled header support"
|
||||
ON )
|
||||
|
||||
# Advanced option to make link maps (only available on linux)
|
||||
cmake_dependent_option( KICAD_MAKE_LINK_MAPS
|
||||
"Create link maps for artifacts"
|
||||
@ -553,6 +563,11 @@ if( MSVC )
|
||||
# but we want to turn it on to enable debug performance improvements available under C++17 in MSVC 17.5+
|
||||
string( APPEND CMAKE_CXX_FLAGS " /permissive-" )
|
||||
|
||||
if( KICAD_MSVC_DYNDEOPT )
|
||||
string( APPEND CMAKE_CXX_FLAGS_RELEASE " /dynamicdeopt" )
|
||||
string( APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " /dynamicdeopt" )
|
||||
endif()
|
||||
|
||||
# Exception handling
|
||||
# Remove the potential default EHsc option cmake doesn't allow us to remove easily
|
||||
string( REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
|
||||
@ -581,11 +596,20 @@ if( MSVC )
|
||||
# /DEBUG: create PDB
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS " /DEBUG /MANIFEST:NO" )
|
||||
# /OPT:REF: omit unreferenced code
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:REF /MANIFEST:NO" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:REF /MANIFEST:NO" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:REF" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:REF" )
|
||||
# /MANIFEST:NO
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /MANIFEST:NO" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /MANIFEST:NO" )
|
||||
|
||||
if( KICAD_MSVC_DYNDEOPT )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /dynamicdeopt" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /dynamicdeopt" )
|
||||
else()
|
||||
# /OPT:ICF: fold common data
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:ICF /MANIFEST:NO" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:ICF /MANIFEST:NO" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELEASE " /OPT:ICF" )
|
||||
string( APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO " /OPT:ICF" )
|
||||
endif()
|
||||
|
||||
if( KICAD_WIN32_LTCG )
|
||||
# we are implementing this manually because CMake's LTCG option is incomplete
|
||||
@ -594,6 +618,11 @@ if( MSVC )
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if( KICAD_MSVC_DYNDEOPT )
|
||||
string( APPEND CMAKE_STATIC_LINKER_FLAGS_RELEASE " /dynamicdeopt" )
|
||||
string( APPEND CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO " /dynamicdeopt" )
|
||||
endif()
|
||||
|
||||
# Let cl.exe parallelize builds
|
||||
if( KICAD_WIN32_BUILD_PARALLEL_CL_MP )
|
||||
string( APPEND CMAKE_CXX_FLAGS " /MP" )
|
||||
@ -776,6 +805,11 @@ find_package(ZSTD REQUIRED)
|
||||
#
|
||||
find_package( CURL REQUIRED )
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
find_package( SPNAV REQUIRED )
|
||||
include_directories( SYSTEM ${SPNAV_INCLUDE_DIR} )
|
||||
endif()
|
||||
|
||||
#
|
||||
# Find Cairo library, required
|
||||
#
|
||||
@ -1028,7 +1062,7 @@ endif()
|
||||
# See line 49 of cmake/FindwxWidgets.cmake
|
||||
set( wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --static=no )
|
||||
|
||||
find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core net base propgrid xml stc richtext REQUIRED )
|
||||
find_package( wxWidgets ${wxWidgets_REQ_VERSION} COMPONENTS gl aui adv html core net base propgrid xml stc richtext webview REQUIRED )
|
||||
|
||||
# Include wxWidgets macros.
|
||||
include( ${wxWidgets_USE_FILE} )
|
||||
|
@ -196,6 +196,10 @@ enum UnconnectedLayerRemoval
|
||||
|
||||
// Remove annular rings on unconnected layers, but preserve start and end layers even if unconnected.
|
||||
ULR_REMOVE_EXCEPT_START_AND_END = 3;
|
||||
|
||||
// Keep annular rings only on the start and end layers regardless of connections.
|
||||
// Since: 10.0.0
|
||||
ULR_START_END_ONLY = 4;
|
||||
}
|
||||
|
||||
// The shape of a pad on a given layer
|
||||
@ -517,6 +521,12 @@ message Pad
|
||||
|
||||
// Copper-to-copper clearance override
|
||||
kiapi.common.types.Distance copper_clearance_override = 8;
|
||||
|
||||
// Since: 9.0.4
|
||||
kiapi.common.types.Distance pad_to_die_length = 9;
|
||||
|
||||
// Since: 10.0.0
|
||||
kiapi.common.types.Time pad_to_die_delay = 10;
|
||||
}
|
||||
|
||||
enum ZoneType
|
||||
@ -610,6 +620,7 @@ enum PlacementRuleSourceType
|
||||
PRST_SHEET_NAME = 1;
|
||||
PRST_COMPONENT_CLASS = 2;
|
||||
PRST_GROUP = 3;
|
||||
PRST_DESIGN_BLOCK = 4;
|
||||
}
|
||||
|
||||
message RuleAreaSettings
|
||||
|
@ -223,6 +223,12 @@ message Ratio
|
||||
double value = 1;
|
||||
}
|
||||
|
||||
// Represents a time delay in attoseconds. Since 10.0.0.
|
||||
message Time
|
||||
{
|
||||
int64 value_as = 1;
|
||||
}
|
||||
|
||||
// Corresponds to COLOR4D. Each color channel is a double from 0.0 to 1.0.
|
||||
message Color
|
||||
{
|
||||
@ -365,6 +371,7 @@ message GraphicRectangleAttributes
|
||||
{
|
||||
kiapi.common.types.Vector2 top_left = 1;
|
||||
kiapi.common.types.Vector2 bottom_right = 2;
|
||||
kiapi.common.types.Distance corner_radius = 3;
|
||||
}
|
||||
|
||||
message GraphicArcAttributes
|
||||
|
@ -387,8 +387,6 @@ void BITMAPCONV_INFO::createOutputData( const wxString& aLayer )
|
||||
|
||||
potrace_dpoint_t( *c )[3];
|
||||
|
||||
LOCALE_IO toggle; // Temporary switch the locale to standard C to r/w floats
|
||||
|
||||
// The layer name has meaning only for .kicad_mod files.
|
||||
// For these files the header creates 2 invisible texts: value and ref
|
||||
// (needed but not useful) on silk screen layer
|
||||
|
99
cmake/BuildSteps/CreateResourceCpp.cmake
Normal file
99
cmake/BuildSteps/CreateResourceCpp.cmake
Normal file
@ -0,0 +1,99 @@
|
||||
#
|
||||
# Used as a standalone cmake script to process a given file into binary arrays
|
||||
# at compile-time
|
||||
#
|
||||
# Include CreateResourceCppFunction.cmake to get access to the add_compiled_resource
|
||||
# function
|
||||
#
|
||||
# This file is structured to be invoked from add_custom_command in order
|
||||
# to have GENERATED marked output files that can be rebuilt on change.
|
||||
#
|
||||
# Required Arguments:
|
||||
# SOURCE_FILE - Path to source shader file
|
||||
# OUT_CPP_DIR - Destination path for cpp file
|
||||
# OUT_HEADER_DIR - Destination path for header file
|
||||
# OUT_CPP_FILENAME - cpp filename
|
||||
# OUT_HEADER_FILENAME - header filename
|
||||
# OUT_VAR_NAME - Name of variable containing shader to be created
|
||||
#
|
||||
# Parts taken from https://github.com/sivachandran/cmake-bin2h
|
||||
# Copyright 2020 Sivachandran Paramasivam
|
||||
#
|
||||
|
||||
# Function to wrap a given string into multiple lines at the given column position.
|
||||
# Parameters:
|
||||
# VARIABLE - The name of the CMake variable holding the string.
|
||||
# AT_COLUMN - The column position at which string will be wrapped.
|
||||
function(WRAP_STRING)
|
||||
set(oneValueArgs VARIABLE AT_COLUMN)
|
||||
cmake_parse_arguments(WRAP_STRING "${options}" "${oneValueArgs}" "" ${ARGN})
|
||||
|
||||
string(LENGTH ${${WRAP_STRING_VARIABLE}} stringLength)
|
||||
math(EXPR offset "0")
|
||||
|
||||
while(stringLength GREATER 0)
|
||||
|
||||
if(stringLength GREATER ${WRAP_STRING_AT_COLUMN})
|
||||
math(EXPR length "${WRAP_STRING_AT_COLUMN}")
|
||||
else()
|
||||
math(EXPR length "${stringLength}")
|
||||
endif()
|
||||
|
||||
string(SUBSTRING ${${WRAP_STRING_VARIABLE}} ${offset} ${length} line)
|
||||
set(lines "${lines}\n${line}")
|
||||
|
||||
math(EXPR stringLength "${stringLength} - ${length}")
|
||||
math(EXPR offset "${offset} + ${length}")
|
||||
endwhile()
|
||||
|
||||
set(${WRAP_STRING_VARIABLE} "${lines}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
file( READ ${SOURCE_FILE} _SOURCE_BINARY HEX )
|
||||
string(LENGTH ${_SOURCE_BINARY} _SOURCE_BINARY_LENGTH)
|
||||
|
||||
set(SOURCE_BINARY "${_SOURCE_BINARY}00") # null terminate for the sake of it
|
||||
|
||||
wrap_string(VARIABLE _SOURCE_BINARY AT_COLUMN 32)
|
||||
math(EXPR _ARRAY_SIZE "${_SOURCE_BINARY_LENGTH} / 2")
|
||||
|
||||
|
||||
# adds '0x' prefix and comma suffix before and after every byte respectively
|
||||
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1, " _ARRAY_VALUES ${_SOURCE_BINARY})
|
||||
# removes trailing comma
|
||||
string(REGEX REPLACE ", $" "" _ARRAY_VALUES ${_ARRAY_VALUES})
|
||||
|
||||
set( outCppTextByteArray "unsigned char ${OUT_VAR_NAME}_bytes[] = { ${_ARRAY_VALUES} };")
|
||||
set( outCppTextByteSize "size_t ${OUT_VAR_NAME}_size = ${_ARRAY_SIZE};")
|
||||
|
||||
set( outCppText
|
||||
"
|
||||
#include <stddef.h>
|
||||
#include <${OUT_HEADER_FILENAME}>
|
||||
|
||||
namespace RESOURCE {
|
||||
${outCppTextByteArray}
|
||||
${outCppTextByteSize}
|
||||
}
|
||||
" )
|
||||
|
||||
file(
|
||||
WRITE ${OUT_CPP_DIR}/${OUT_CPP_FILENAME}
|
||||
"${outCppText}"
|
||||
)
|
||||
|
||||
|
||||
set( outHeaderText
|
||||
"namespace RESOURCE {
|
||||
extern unsigned char ${OUT_VAR_NAME}_bytes[];
|
||||
extern size_t ${OUT_VAR_NAME}_size;
|
||||
}"
|
||||
)
|
||||
|
||||
file(
|
||||
WRITE ${OUT_HEADER_DIR}/${OUT_HEADER_FILENAME}
|
||||
"${outHeaderText}"
|
||||
)
|
||||
|
||||
message(STATUS "Resource ${SOURCE_FILE} converted to ${OUT_CPP_DIR}/${OUT_CPP_FILENAME}")
|
39
cmake/BuildSteps/CreateResourceCppFunction.cmake
Normal file
39
cmake/BuildSteps/CreateResourceCppFunction.cmake
Normal file
@ -0,0 +1,39 @@
|
||||
#
|
||||
# Used to mark and generate resource files to conversion to binary arrays
|
||||
#
|
||||
# Usage example:
|
||||
# add_compiled_resource( pcbnew ${CMAKE_SOURCE_DIR}/resources/html/about.html about_html)
|
||||
#
|
||||
# The source file about.html above will be converted to about_html.cpp/.h and placed into
|
||||
# the /resources/cpp cmake binary directory folder. The include directories for the target are also
|
||||
# expanded to cover including about_html.h
|
||||
#
|
||||
# The output is marked as depends so changes to about.html will trigger a update of the about_html.cpp/.h
|
||||
#
|
||||
# The CreateResourceCpp.cmake helper script is also marked a depends so any changes to our output writing
|
||||
# will cause updates.
|
||||
#
|
||||
|
||||
|
||||
function( add_compiled_resource outTarget inFile resourceName )
|
||||
set(outCppName "${resourceName}.cpp")
|
||||
set(outHeaderName "${resourceName}.h")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/resources/cpp/${outCppName}
|
||||
${CMAKE_BINARY_DIR}/resources/cpp/${outHeaderName}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DSOURCE_FILE="${inFile}"
|
||||
-DOUT_CPP_DIR="${CMAKE_BINARY_DIR}/resources/cpp"
|
||||
-DOUT_HEADER_DIR="${CMAKE_BINARY_DIR}/resources/cpp"
|
||||
-DOUT_CPP_FILENAME="${outCppName}"
|
||||
-DOUT_HEADER_FILENAME="${outHeaderName}"
|
||||
-DOUT_VAR_NAME="${resourceName}"
|
||||
-P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/CreateResourceCpp.cmake
|
||||
DEPENDS ${inFile}
|
||||
${KICAD_CMAKE_MODULE_PATH}/BuildSteps/CreateResourceCpp.cmake
|
||||
)
|
||||
|
||||
target_sources( ${outTarget} PRIVATE ${CMAKE_BINARY_DIR}/resources/cpp/${outCppName} )
|
||||
target_include_directories( ${outTarget} PUBLIC ${CMAKE_BINARY_DIR}/resources/cpp )
|
||||
endfunction()
|
277
cmake/ECMFindModuleHelpers.cmake
Normal file
277
cmake/ECMFindModuleHelpers.cmake
Normal file
@ -0,0 +1,277 @@
|
||||
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
ECMFindModuleHelpers
|
||||
--------------------
|
||||
|
||||
Helper macros for find modules: ``ecm_find_package_version_check()``,
|
||||
``ecm_find_package_parse_components()`` and
|
||||
``ecm_find_package_handle_library_components()``.
|
||||
|
||||
::
|
||||
|
||||
ecm_find_package_version_check(<name>)
|
||||
|
||||
Prints warnings if the CMake version or the project's required CMake version
|
||||
is older than that required by extra-cmake-modules.
|
||||
|
||||
::
|
||||
|
||||
ecm_find_package_parse_components(<name>
|
||||
RESULT_VAR <variable>
|
||||
KNOWN_COMPONENTS <component1> [<component2> [...]]
|
||||
[SKIP_DEPENDENCY_HANDLING])
|
||||
|
||||
This macro will populate <variable> with a list of components found in
|
||||
<name>_FIND_COMPONENTS, after checking that all those components are in the
|
||||
list of ``KNOWN_COMPONENTS``; if there are any unknown components, it will print
|
||||
an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
|
||||
``return()``.
|
||||
|
||||
The order of components in <variable> is guaranteed to match the order they
|
||||
are listed in the ``KNOWN_COMPONENTS`` argument.
|
||||
|
||||
If ``SKIP_DEPENDENCY_HANDLING`` is not set, for each component the variable
|
||||
<name>_<component>_component_deps will be checked for dependent components.
|
||||
If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
|
||||
dependencies will also be added to <variable>.
|
||||
|
||||
::
|
||||
|
||||
ecm_find_package_handle_library_components(<name>
|
||||
COMPONENTS <component> [<component> [...]]
|
||||
[SKIP_DEPENDENCY_HANDLING])
|
||||
[SKIP_PKG_CONFIG])
|
||||
|
||||
Creates an imported library target for each component. The operation of this
|
||||
macro depends on the presence of a number of CMake variables.
|
||||
|
||||
The <name>_<component>_lib variable should contain the name of this library,
|
||||
and <name>_<component>_header variable should contain the name of a header
|
||||
file associated with it (whatever relative path is normally passed to
|
||||
'#include'). <name>_<component>_header_subdir variable can be used to specify
|
||||
which subdirectory of the include path the headers will be found in.
|
||||
``ecm_find_package_components()`` will then search for the library
|
||||
and include directory (creating appropriate cache variables) and create an
|
||||
imported library target named <name>::<component>.
|
||||
|
||||
Additional variables can be used to provide additional information:
|
||||
|
||||
If ``SKIP_PKG_CONFIG``, the <name>_<component>_pkg_config variable is set, and
|
||||
pkg-config is found, the pkg-config module given by
|
||||
<name>_<component>_pkg_config will be searched for and used to help locate the
|
||||
library and header file. It will also be used to set
|
||||
<name>_<component>_VERSION.
|
||||
|
||||
Note that if version information is found via pkg-config,
|
||||
<name>_<component>_FIND_VERSION can be set to require a particular version
|
||||
for each component.
|
||||
|
||||
If ``SKIP_DEPENDENCY_HANDLING`` is not set, the ``INTERFACE_LINK_LIBRARIES`` property
|
||||
of the imported target for <component> will be set to contain the imported
|
||||
targets for the components listed in <name>_<component>_component_deps.
|
||||
<component>_FOUND will also be set to ``FALSE`` if any of the components in
|
||||
<name>_<component>_component_deps are not found. This requires the components
|
||||
in <name>_<component>_component_deps to be listed before <component> in the
|
||||
``COMPONENTS`` argument.
|
||||
|
||||
The following variables will be set:
|
||||
|
||||
``<name>_TARGETS``
|
||||
the imported targets
|
||||
``<name>_LIBRARIES``
|
||||
the found libraries
|
||||
``<name>_INCLUDE_DIRS``
|
||||
the combined required include directories for the components
|
||||
``<name>_DEFINITIONS``
|
||||
the "other" CFLAGS provided by pkg-config, if any
|
||||
``<name>_VERSION``
|
||||
the value of ``<name>_<component>_VERSION`` for the first component that
|
||||
has this variable set (note that components are searched for in the order
|
||||
they are passed to the macro), although if it is already set, it will not
|
||||
be altered
|
||||
|
||||
.. note::
|
||||
These variables are never cleared, so if
|
||||
``ecm_find_package_handle_library_components()`` is called multiple times with
|
||||
different components (typically because of multiple ``find_package()`` calls) then
|
||||
``<name>_TARGETS``, for example, will contain all the targets found in any
|
||||
call (although no duplicates).
|
||||
|
||||
Since pre-1.0.0.
|
||||
#]=======================================================================]
|
||||
|
||||
macro(ecm_find_package_version_check module_name)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.16.0)
|
||||
message(FATAL_ERROR "CMake 3.16.0 is required by Find${module_name}.cmake")
|
||||
endif()
|
||||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.16.0)
|
||||
message(AUTHOR_WARNING "Your project should require at least CMake 3.16.0 to use Find${module_name}.cmake")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_parse_components module_name)
|
||||
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fppc_oneValueArgs RESULT_VAR)
|
||||
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPPC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_RESULT_VAR)
|
||||
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
|
||||
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
endif()
|
||||
|
||||
if(${module_name}_FIND_COMPONENTS)
|
||||
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
|
||||
|
||||
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
|
||||
# Make sure deps are included
|
||||
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
|
||||
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
|
||||
if("${ecm_fppc_index}" STREQUAL "-1")
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
|
||||
endif()
|
||||
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
else()
|
||||
message(STATUS "Skipping dependency handling for ${module_name}")
|
||||
endif()
|
||||
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
|
||||
|
||||
# This makes sure components are listed in the same order as
|
||||
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
|
||||
set(${ECM_FPPC_RESULT_VAR})
|
||||
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
|
||||
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
|
||||
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
|
||||
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
|
||||
endif()
|
||||
endforeach()
|
||||
# if there are any left, they are unknown components
|
||||
if(ecm_fppc_requestedComps)
|
||||
set(ecm_fppc_msgType STATUS)
|
||||
if(${module_name}_FIND_REQUIRED)
|
||||
set(ecm_fppc_msgType FATAL_ERROR)
|
||||
endif()
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_handle_library_components module_name)
|
||||
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fpwc_oneValueArgs)
|
||||
set(ecm_fpwc_multiValueArgs COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPWC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPWC_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package(PkgConfig QUIET)
|
||||
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
|
||||
set(ecm_fpwc_dep_vars)
|
||||
set(ecm_fpwc_dep_targets)
|
||||
if(NOT SKIP_DEPENDENCY_HANDLING)
|
||||
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
|
||||
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
|
||||
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
|
||||
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
|
||||
${${module_name}_${ecm_fpwc_comp}_pkg_config})
|
||||
endif()
|
||||
|
||||
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
|
||||
)
|
||||
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
|
||||
if(NOT ${module_name}_VERSION)
|
||||
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
|
||||
endif()
|
||||
|
||||
set(FPHSA_NAME_MISMATCHED 1)
|
||||
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
|
||||
FOUND_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_FOUND
|
||||
REQUIRED_VARS
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
${ecm_fpwc_dep_vars}
|
||||
VERSION_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_VERSION
|
||||
)
|
||||
unset(FPHSA_NAME_MISMATCHED)
|
||||
|
||||
mark_as_advanced(
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(${module_name}_${ecm_fpwc_comp}_FOUND)
|
||||
list(APPEND ${module_name}_LIBRARIES
|
||||
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
|
||||
list(APPEND ${module_name}_INCLUDE_DIRS
|
||||
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
|
||||
set(${module_name}_DEFINITIONS
|
||||
${${module_name}_DEFINITIONS}
|
||||
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
|
||||
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
|
||||
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
|
||||
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
|
||||
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${module_name}_TARGETS
|
||||
"${module_name}::${ecm_fpwc_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(${module_name}_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
|
||||
endif()
|
||||
if(${module_name}_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
|
||||
endif()
|
||||
if(${module_name}_DEFINITIONS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
|
||||
endif()
|
||||
if(${module_name}_TARGETS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
|
||||
endif()
|
||||
endmacro()
|
132
cmake/FindPoppler.cmake
Normal file
132
cmake/FindPoppler.cmake
Normal file
@ -0,0 +1,132 @@
|
||||
# SPDX-FileCopyrightText: 2015 Alex Richardson <arichardson.kde@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindPoppler
|
||||
-----------
|
||||
|
||||
Try to find Poppler.
|
||||
|
||||
This is a component-based find module, which makes use of the COMPONENTS
|
||||
and OPTIONAL_COMPONENTS arguments to find_module. The following components
|
||||
are available::
|
||||
|
||||
Core Cpp Qt5 Qt4 Glib
|
||||
|
||||
If no components are specified, this module will act as though all components
|
||||
were passed to OPTIONAL_COMPONENTS.
|
||||
|
||||
This module will define the following variables, independently of the
|
||||
components searched for or found:
|
||||
|
||||
``Poppler_FOUND``
|
||||
TRUE if (the requested version of) Poppler is available
|
||||
``Poppler_VERSION``
|
||||
Found Poppler version
|
||||
``Poppler_TARGETS``
|
||||
A list of all targets imported by this module (note that there may be more
|
||||
than the components that were requested)
|
||||
``Poppler_LIBRARIES``
|
||||
This can be passed to target_link_libraries() instead of the imported
|
||||
targets
|
||||
``Poppler_INCLUDE_DIRS``
|
||||
This should be passed to target_include_directories() if the targets are
|
||||
not used for linking
|
||||
``Poppler_DEFINITIONS``
|
||||
This should be passed to target_compile_options() if the targets are not
|
||||
used for linking
|
||||
|
||||
For each searched-for components, ``Poppler_<component>_FOUND`` will be set to
|
||||
TRUE if the corresponding Poppler library was found, and FALSE otherwise. If
|
||||
``Poppler_<component>_FOUND`` is TRUE, the imported target
|
||||
``Poppler::<component>`` will be defined. This module will also attempt to
|
||||
determine ``Poppler_*_VERSION`` variables for each imported target, although
|
||||
``Poppler_VERSION`` should normally be sufficient.
|
||||
|
||||
In general we recommend using the imported targets, as they are easier to use
|
||||
and provide more control. Bear in mind, however, that if any target is in the
|
||||
link interface of an exported library, it must be made available by the
|
||||
package config file.
|
||||
|
||||
Since 5.19
|
||||
#]=======================================================================]
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake)
|
||||
|
||||
ecm_find_package_version_check(Poppler)
|
||||
|
||||
set(Poppler_known_components
|
||||
Cpp
|
||||
Qt4
|
||||
Qt5
|
||||
Qt6
|
||||
Glib
|
||||
)
|
||||
foreach(_comp ${Poppler_known_components})
|
||||
string(TOLOWER "${_comp}" _lc_comp)
|
||||
set(Poppler_${_comp}_component_deps "Core")
|
||||
set(Poppler_${_comp}_pkg_config "poppler-${_lc_comp}")
|
||||
set(Poppler_${_comp}_lib "poppler-${_lc_comp}")
|
||||
set(Poppler_${_comp}_header_subdir "poppler/${_lc_comp}")
|
||||
endforeach()
|
||||
set(Poppler_known_components Core ${Poppler_known_components})
|
||||
|
||||
set(Poppler_Core_component_deps "")
|
||||
set(Poppler_Core_pkg_config "poppler")
|
||||
# poppler-config.h header is only installed with --enable-xpdf-headers
|
||||
# fall back to using any header from a submodule with a path to make it work in that case too
|
||||
set(Poppler_Core_header "poppler-config.h" "cpp/poppler-version.h" "qt6/poppler-qt6.h" "qt5/poppler-qt5.h" "qt4/poppler-qt4.h" "glib/poppler.h")
|
||||
set(Poppler_Core_header_subdir "poppler")
|
||||
set(Poppler_Core_lib "poppler")
|
||||
|
||||
set(Poppler_Cpp_header "poppler-version.h")
|
||||
set(Poppler_Qt6_header "poppler-qt6.h")
|
||||
set(Poppler_Qt5_header "poppler-qt5.h")
|
||||
set(Poppler_Qt4_header "poppler-qt4.h")
|
||||
set(Poppler_Glib_header "poppler.h")
|
||||
|
||||
ecm_find_package_parse_components(Poppler
|
||||
RESULT_VAR Poppler_components
|
||||
KNOWN_COMPONENTS ${Poppler_known_components}
|
||||
)
|
||||
ecm_find_package_handle_library_components(Poppler
|
||||
COMPONENTS ${Poppler_components}
|
||||
)
|
||||
|
||||
# If pkg-config didn't provide us with version information,
|
||||
# try to extract it from poppler-version.h or poppler-config.h
|
||||
if(NOT Poppler_VERSION)
|
||||
find_file(Poppler_VERSION_HEADER
|
||||
NAMES "poppler-config.h" "cpp/poppler-version.h"
|
||||
HINTS ${Poppler_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ${Poppler_Core_header_subdir}
|
||||
)
|
||||
mark_as_advanced(Poppler_VERSION_HEADER)
|
||||
if(Poppler_VERSION_HEADER)
|
||||
file(READ ${Poppler_VERSION_HEADER} _poppler_version_header_contents)
|
||||
string(REGEX REPLACE
|
||||
"^.*[ \t]+POPPLER_VERSION[ \t]+\"([0-9d.]*)\".*$"
|
||||
"\\1"
|
||||
Poppler_VERSION
|
||||
"${_poppler_version_header_contents}"
|
||||
)
|
||||
unset(_poppler_version_header_contents)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(Poppler
|
||||
FOUND_VAR
|
||||
Poppler_FOUND
|
||||
REQUIRED_VARS
|
||||
Poppler_LIBRARIES
|
||||
VERSION_VAR
|
||||
Poppler_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(Poppler PROPERTIES
|
||||
DESCRIPTION "A PDF rendering library"
|
||||
URL "https://poppler.freedesktop.org/"
|
||||
)
|
63
cmake/FindSPNAV.cmake
Normal file
63
cmake/FindSPNAV.cmake
Normal file
@ -0,0 +1,63 @@
|
||||
# BSD 3-Clause License
|
||||
|
||||
# Copyright (c) 2008, Willow Garage, Inc.
|
||||
# Copyright (c) 2020, Nils Schulte
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
|
||||
# * Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
|
||||
# * Neither the name of the copyright holder nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Find the spnav library and header.
|
||||
#
|
||||
# Sets the usual variables expected for find_package scripts:
|
||||
#
|
||||
# SPNAV_INCLUDE_DIR - header location
|
||||
# SPNAV_LIBRARIES - library to link against
|
||||
# SPNAV_FOUND - true if pugixml was found.
|
||||
|
||||
if(UNIX)
|
||||
|
||||
find_path(SPNAV_INCLUDE_DIR spnav.h)
|
||||
|
||||
find_library(SPNAV_LIBRARY
|
||||
NAMES
|
||||
spnav libspnav
|
||||
)
|
||||
|
||||
# Support the REQUIRED and QUIET arguments, and set spnav_FOUND if found.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SPNAV DEFAULT_MSG
|
||||
SPNAV_LIBRARY
|
||||
SPNAV_INCLUDE_DIR)
|
||||
|
||||
if(SPNAV_FOUND)
|
||||
set(SPNAV_LIBRARIES ${SPNAV_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
SPNAV_LIBRARY
|
||||
SPNAV_INCLUDE_DIR)
|
||||
|
||||
endif()
|
@ -103,6 +103,8 @@ set( KICOMMON_SRCS
|
||||
jobs/job_sch_erc.cpp
|
||||
jobs/job_sym_export_svg.cpp
|
||||
jobs/job_sym_upgrade.cpp
|
||||
jobs/job_pcb_upgrade.cpp
|
||||
jobs/job_sch_upgrade.cpp
|
||||
|
||||
kicad_curl/kicad_curl.cpp
|
||||
kicad_curl/kicad_curl_easy.cpp
|
||||
@ -128,6 +130,9 @@ set( KICOMMON_SRCS
|
||||
project/project_local_settings.cpp
|
||||
project/time_domain_parameters.cpp
|
||||
|
||||
text_eval/text_eval_wrapper.cpp
|
||||
text_eval/text_eval_parser.cpp
|
||||
|
||||
# This is basically a settings object, but for the toolbar
|
||||
tool/ui/toolbar_configuration.cpp
|
||||
|
||||
@ -223,6 +228,12 @@ set( KICOMMON_SRCS
|
||||
api/api_utils.cpp
|
||||
)
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
list( APPEND KICOMMON_SRCS
|
||||
spacenav/libspnav_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if( KICAD_IPC_API )
|
||||
set( KICOMMON_SRCS
|
||||
${KICOMMON_SRCS}
|
||||
@ -239,6 +250,21 @@ add_library( kicommon SHARED
|
||||
${KICOMMON_SRCS}
|
||||
)
|
||||
|
||||
if( KICAD_USE_PCH )
|
||||
target_precompile_headers( kicommon
|
||||
PRIVATE
|
||||
<kicommon.h>
|
||||
<algorithm>
|
||||
<map>
|
||||
<memory>
|
||||
<optional>
|
||||
<set>
|
||||
<string>
|
||||
<vector>
|
||||
<wx/wx.h>
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(kicommon PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
target_link_libraries( kicommon
|
||||
@ -248,6 +274,7 @@ target_link_libraries( kicommon
|
||||
kiplatform
|
||||
nlohmann_json
|
||||
nlohmann_json_schema_validator
|
||||
FastFloat::fast_float
|
||||
fmt::fmt
|
||||
CURL::libcurl
|
||||
picosha2
|
||||
@ -255,6 +282,7 @@ target_link_libraries( kicommon
|
||||
${ZSTD_LIBRARY}
|
||||
${wxWidgets_LIBRARIES}
|
||||
${LIBGIT2_LIBRARIES}
|
||||
${SPNAV_LIBRARIES}
|
||||
|
||||
# needed by kiid to allow linking for Boost for the UUID against bcrypt (msys2 only)
|
||||
${EXTRA_LIBS}
|
||||
@ -368,7 +396,6 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/dialog_design_block_properties_base.cpp
|
||||
dialogs/dialog_display_html_text_base.cpp
|
||||
dialogs/dialog_edit_library_tables.cpp
|
||||
dialogs/dialog_embed_files.cpp
|
||||
dialogs/dialog_global_lib_table_config.cpp
|
||||
dialogs/dialog_global_lib_table_config_base.cpp
|
||||
dialogs/dialog_global_design_block_lib_table_config.cpp
|
||||
@ -380,8 +407,6 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/dialog_HTML_reporter_base.cpp
|
||||
dialogs/dialog_import_choose_project.cpp
|
||||
dialogs/dialog_import_choose_project_base.cpp
|
||||
dialogs/dialog_locked_items_query.cpp
|
||||
dialogs/dialog_locked_items_query_base.cpp
|
||||
dialogs/dialog_multi_unit_entry.cpp
|
||||
dialogs/dialog_page_settings_base.cpp
|
||||
dialogs/dialog_paste_special.cpp
|
||||
@ -411,14 +436,20 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/panel_design_block_lib_table.cpp
|
||||
dialogs/panel_embedded_files.cpp
|
||||
dialogs/panel_embedded_files_base.cpp
|
||||
dialogs/panel_gal_display_options.cpp
|
||||
dialogs/panel_base_display_options.cpp
|
||||
dialogs/panel_hotkeys_editor.cpp
|
||||
dialogs/panel_image_editor.cpp
|
||||
dialogs/panel_image_editor_base.cpp
|
||||
dialogs/panel_gal_options.cpp
|
||||
dialogs/panel_gal_options_base.cpp
|
||||
dialogs/panel_grid_settings.cpp
|
||||
dialogs/panel_grid_settings_base.cpp
|
||||
dialogs/panel_maintenance.cpp
|
||||
dialogs/panel_maintenance_base.cpp
|
||||
dialogs/panel_mouse_settings.cpp
|
||||
dialogs/panel_mouse_settings_base.cpp
|
||||
dialogs/panel_spacemouse.cpp
|
||||
dialogs/panel_spacemouse_base.cpp
|
||||
dialogs/panel_packages_and_updates.cpp
|
||||
dialogs/panel_packages_and_updates_base.cpp
|
||||
dialogs/panel_plugin_settings.cpp
|
||||
@ -454,8 +485,6 @@ set( COMMON_WIDGET_SRCS
|
||||
widgets/footprint_diff_widget.cpp
|
||||
widgets/footprint_preview_widget.cpp
|
||||
widgets/footprint_select_widget.cpp
|
||||
widgets/gal_options_panel.cpp
|
||||
widgets/gal_options_panel_base.cpp
|
||||
widgets/grid_bitmap_toggle.cpp
|
||||
widgets/grid_button.cpp
|
||||
widgets/grid_checkbox.cpp
|
||||
@ -499,6 +528,8 @@ set( COMMON_WIDGET_SRCS
|
||||
widgets/wx_progress_reporters.cpp
|
||||
widgets/wx_splitter_window.cpp
|
||||
widgets/wx_treebook.cpp
|
||||
widgets/webview_panel.cpp
|
||||
widgets/zoom_correction_ctrl.cpp
|
||||
)
|
||||
|
||||
set( COMMON_DRAWING_SHEET_SRCS
|
||||
@ -514,6 +545,7 @@ set( COMMON_DRAWING_SHEET_SRCS
|
||||
|
||||
set( COMMON_PREVIEW_ITEMS_SRCS
|
||||
preview_items/anchor_debug.cpp
|
||||
preview_items/angle_item.cpp
|
||||
preview_items/arc_assistant.cpp
|
||||
preview_items/arc_geom_manager.cpp
|
||||
preview_items/bezier_assistant.cpp
|
||||
@ -586,16 +618,23 @@ set( COMMON_IMPORT_GFX_SRCS
|
||||
|
||||
set( COMMON_GIT_SRCS
|
||||
git/git_add_to_index_handler.cpp
|
||||
git/git_branch_handler.cpp
|
||||
git/git_clone_handler.cpp
|
||||
git/git_commit_handler.cpp
|
||||
git/git_config_handler.cpp
|
||||
git/git_init_handler.cpp
|
||||
git/git_pull_handler.cpp
|
||||
git/git_push_handler.cpp
|
||||
git/git_remove_from_index_handler.cpp
|
||||
git/git_resolve_conflict_handler.cpp
|
||||
git/git_revert_handler.cpp
|
||||
git/git_status_handler.cpp
|
||||
git/git_sync_handler.cpp
|
||||
git/project_git_utils.cpp
|
||||
git/kicad_git_common.cpp
|
||||
git/kicad_git_errors.cpp
|
||||
git/git_backend.cpp
|
||||
git/libgit_backend.cpp
|
||||
)
|
||||
|
||||
set( COMMON_SRCS
|
||||
@ -724,6 +763,13 @@ set( COMMON_SRCS
|
||||
api/api_enums.cpp
|
||||
)
|
||||
|
||||
# This needs to be in the common library until draw_panel_gal is moved to kicommon
|
||||
if( UNIX AND NOT APPLE )
|
||||
list( APPEND COMMON_SRCS
|
||||
spacenav/spnav_2d_plugin.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if( KICAD_IPC_API )
|
||||
set( COMMON_SRCS
|
||||
${COMMON_SRCS}
|
||||
@ -736,6 +782,21 @@ add_library( common STATIC
|
||||
${COMMON_SRCS}
|
||||
)
|
||||
|
||||
if( KICAD_USE_PCH )
|
||||
target_precompile_headers( kicommon
|
||||
PRIVATE
|
||||
<kicommon.h>
|
||||
<algorithm>
|
||||
<map>
|
||||
<memory>
|
||||
<optional>
|
||||
<set>
|
||||
<string>
|
||||
<vector>
|
||||
<wx/wx.h>
|
||||
)
|
||||
endif()
|
||||
|
||||
add_dependencies( common version_header )
|
||||
add_dependencies( common compoundfilereader ) # used by altium_parser.cpp
|
||||
|
||||
@ -820,11 +881,13 @@ set( PCB_COMMON_SRCS
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_marker.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/footprint.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/fix_board_shape.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/layer_utils.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pad_utils.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/padstack.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_point.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_reference_image.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_field.cpp
|
||||
@ -900,13 +963,24 @@ set( PCB_COMMON_SRCS
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/api/api_pcb_utils.cpp
|
||||
)
|
||||
|
||||
# add -DPCBNEW to compilation of these PCBNEW sources
|
||||
set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
|
||||
COMPILE_DEFINITIONS "PCBNEW"
|
||||
)
|
||||
|
||||
add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
|
||||
|
||||
if( KICAD_USE_PCH )
|
||||
target_precompile_headers( pcbcommon
|
||||
PRIVATE
|
||||
<vector>
|
||||
<map>
|
||||
<memory>
|
||||
<unordered_map>
|
||||
<board.h>
|
||||
<footprint.h>
|
||||
<zone.h>
|
||||
<connectivity/connectivity_data.h>
|
||||
<drc/drc_engine.h> )
|
||||
endif()
|
||||
|
||||
target_compile_definitions(pcbcommon PRIVATE PCBNEW)
|
||||
|
||||
target_include_directories( pcbcommon PRIVATE
|
||||
)
|
||||
|
||||
@ -916,11 +990,15 @@ target_link_libraries( pcbcommon PUBLIC
|
||||
delaunator
|
||||
kimath
|
||||
kiplatform
|
||||
nanoflann
|
||||
)
|
||||
|
||||
if( APPLE OR NOT UNIX )
|
||||
# On Windows/MacOS, the SpaceMouse support is provided by the navlib subdirectory
|
||||
message( STATUS "Including 3Dconnexion SpaceMouse navigation support in pcbcommon" )
|
||||
add_subdirectory( ../pcbnew/navlib ./navlib)
|
||||
target_link_libraries( pcbcommon PUBLIC pcbnew_navlib)
|
||||
endif()
|
||||
|
||||
add_dependencies( pcbcommon delaunator )
|
||||
|
||||
@ -940,6 +1018,13 @@ generate_lemon_grammar(
|
||||
libeval_compiler/grammar.lemon
|
||||
)
|
||||
|
||||
generate_lemon_grammar(
|
||||
kicommon
|
||||
text_eval
|
||||
text_eval/text_eval_wrapper.cpp
|
||||
text_eval/text_eval.lemon
|
||||
)
|
||||
|
||||
# auto-generate stroke_params_lexer.h and stroke_params_keywords.cpp
|
||||
# Called twice one for common and one for gal, to ensure the files are created
|
||||
# on all devel tools ( Linux and msys2 )
|
||||
|
@ -84,6 +84,7 @@ static const wxChar ExtraZoneDisplayModes[] = wxT( "ExtraZoneDisplayModes" );
|
||||
static const wxChar MinPlotPenWidth[] = wxT( "MinPlotPenWidth" );
|
||||
static const wxChar DebugZoneFiller[] = wxT( "DebugZoneFiller" );
|
||||
static const wxChar DebugPDFWriter[] = wxT( "DebugPDFWriter" );
|
||||
static const wxChar UsePdfPrint[] = wxT( "UsePdfPrint" );
|
||||
static const wxChar SmallDrillMarkSize[] = wxT( "SmallDrillMarkSize" );
|
||||
static const wxChar HotkeysDumper[] = wxT( "HotkeysDumper" );
|
||||
static const wxChar DrawBoundingBoxes[] = wxT( "DrawBoundingBoxes" );
|
||||
@ -118,6 +119,7 @@ static const wxChar EnableExtensionSnaps[] = wxT( "EnableExtensionSnaps" );
|
||||
static const wxChar ExtensionSnapTimeoutMs[] = wxT( "ExtensionSnapTimeoutMs" );
|
||||
static const wxChar ExtensionSnapActivateOnHover[] = wxT( "ExtensionSnapActivateOnHover" );
|
||||
static const wxChar EnableSnapAnchorsDebug[] = wxT( "EnableSnapAnchorsDebug" );
|
||||
static const wxChar SnapHysteresis[] = wxT( "SnapHysteresis" );
|
||||
static const wxChar MinParallelAngle[] = wxT( "MinParallelAngle" );
|
||||
static const wxChar HoleWallPaintingMultiplier[] = wxT( "HoleWallPaintingMultiplier" );
|
||||
static const wxChar MsgPanelShowUuids[] = wxT( "MsgPanelShowUuids" );
|
||||
@ -129,6 +131,8 @@ static const wxChar GitIconRefreshInterval[] = wxT( "GitIconRefreshInterval" );
|
||||
static const wxChar ConfigurableToolbars[] = wxT( "ConfigurableToolbars" );
|
||||
static const wxChar MaxPastedTextLength[] = wxT( "MaxPastedTextLength" );
|
||||
static const wxChar PNSProcessClusterTimeout[] = wxT( "PNSProcessClusterTimeout" );
|
||||
static const wxChar ImportSkipComponentBodies[] = wxT( "ImportSkipComponentBodies" );
|
||||
static const wxChar ScreenDPI[] = wxT( "ScreenDPI" );
|
||||
|
||||
} // namespace KEYS
|
||||
|
||||
@ -186,13 +190,13 @@ wxString dumpParamCfg( const PARAM_CFG& aParam )
|
||||
/**
|
||||
* Dump the configs in the given array to trace.
|
||||
*/
|
||||
static void dumpCfg( const std::vector<PARAM_CFG*>& aArray )
|
||||
static void dumpCfg( const std::vector<std::unique_ptr<PARAM_CFG>>& aArray )
|
||||
{
|
||||
// only dump if we need to
|
||||
if( !wxLog::IsAllowedTraceMask( AdvancedConfigMask ) )
|
||||
return;
|
||||
|
||||
for( const PARAM_CFG* param : aArray )
|
||||
for( const auto& param : aArray )
|
||||
{
|
||||
wxLogTrace( AdvancedConfigMask, dumpParamCfg( *param ) );
|
||||
}
|
||||
@ -244,6 +248,7 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
|
||||
m_DebugZoneFiller = false;
|
||||
m_DebugPDFWriter = false;
|
||||
m_UsePdfPrint = false;
|
||||
m_SmallDrillMarkSize = 0.35;
|
||||
m_HotkeysDumper = false;
|
||||
m_DrawBoundingBoxes = false;
|
||||
@ -257,7 +262,7 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
m_CompactSave = false;
|
||||
m_UpdateUIEventInterval = 0;
|
||||
m_ShowRepairSchematic = false;
|
||||
m_EnablePcbDesignBlocks = false;
|
||||
m_EnablePcbDesignBlocks = true;
|
||||
m_EnableGenerators = false;
|
||||
m_EnableLibWithText = false;
|
||||
m_EnableLibDir = false;
|
||||
@ -295,6 +300,7 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
m_ExtensionSnapTimeoutMs = 500;
|
||||
m_ExtensionSnapActivateOnHover = true;
|
||||
m_EnableSnapAnchorsDebug = false;
|
||||
m_SnapHysteresis = 5;
|
||||
|
||||
m_MinParallelAngle = 0.001;
|
||||
m_HoleWallPaintingMultiplier = 1.5;
|
||||
@ -315,6 +321,10 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
|
||||
m_PNSProcessClusterTimeout = 100; // Default: 100 ms
|
||||
|
||||
m_ImportSkipComponentBodies = false;
|
||||
|
||||
m_ScreenDPI = 91;
|
||||
|
||||
loadFromConfigFile();
|
||||
}
|
||||
|
||||
@ -326,6 +336,21 @@ const ADVANCED_CFG& ADVANCED_CFG::GetCfg()
|
||||
}
|
||||
|
||||
|
||||
void ADVANCED_CFG::Reload()
|
||||
{
|
||||
loadFromConfigFile();
|
||||
}
|
||||
|
||||
|
||||
void ADVANCED_CFG::Save()
|
||||
{
|
||||
wxFileName k_advanced = getAdvancedCfgFilename();
|
||||
wxFileConfig file_cfg( wxS( "" ), wxS( "" ), k_advanced.GetFullPath() );
|
||||
|
||||
wxConfigSaveSetups( &file_cfg, m_entries );
|
||||
}
|
||||
|
||||
|
||||
void ADVANCED_CFG::loadFromConfigFile()
|
||||
{
|
||||
const wxFileName k_advanced = getAdvancedCfgFilename();
|
||||
@ -355,270 +380,283 @@ void ADVANCED_CFG::loadFromConfigFile()
|
||||
|
||||
void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
{
|
||||
std::vector<PARAM_CFG*> configParams;
|
||||
m_entries.clear();
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::ExtraFillMargin,
|
||||
&m_ExtraClearance,
|
||||
m_ExtraClearance, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableCreepageSlot,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableCreepageSlot,
|
||||
&m_EnableCreepageSlot, m_EnableCreepageSlot ) );
|
||||
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCEpsilon,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCEpsilon,
|
||||
&m_DRCEpsilon, m_DRCEpsilon, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverWidthTolerance,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCSliverWidthTolerance,
|
||||
&m_SliverWidthTolerance, m_SliverWidthTolerance,
|
||||
0.01, 0.25 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverMinimumLength,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCSliverMinimumLength,
|
||||
&m_SliverMinimumLength, m_SliverMinimumLength,
|
||||
1e-9, 10 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverAngleTolerance,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DRCSliverAngleTolerance,
|
||||
&m_SliverAngleTolerance, m_SliverAngleTolerance,
|
||||
1.0, 90.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::HoleWallThickness,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::HoleWallThickness,
|
||||
&m_HoleWallThickness, m_HoleWallThickness,
|
||||
0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::CoroutineStackSize,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::CoroutineStackSize,
|
||||
&m_CoroutineStackSize, AC_STACK::default_stack,
|
||||
AC_STACK::min_stack, AC_STACK::max_stack ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::UpdateUIEventInterval,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::UpdateUIEventInterval,
|
||||
&m_UpdateUIEventInterval, m_UpdateUIEventInterval,
|
||||
-1, 100000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowRouterDebugGraphics,
|
||||
&m_ShowRouterDebugGraphics,
|
||||
m_ShowRouterDebugGraphics ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableRouterDump,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableRouterDump,
|
||||
&m_EnableRouterDump, m_EnableRouterDump ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HyperZoom,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HyperZoom,
|
||||
&m_HyperZoom, m_HyperZoom ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::CompactFileSave,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::CompactFileSave,
|
||||
&m_CompactSave, m_CompactSave ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcAccuracy,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DrawArcAccuracy,
|
||||
&m_DrawArcAccuracy, m_DrawArcAccuracy,
|
||||
0.0, 100000.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcCenterStartEndMaxAngle,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::DrawArcCenterStartEndMaxAngle,
|
||||
&m_DrawArcCenterMaxAngle,
|
||||
m_DrawArcCenterMaxAngle, 0.0, 100000.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTangentTrackAngleDeviation,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MaxTangentTrackAngleDeviation,
|
||||
&m_MaxTangentAngleDeviation,
|
||||
m_MaxTangentAngleDeviation, 0.0, 90.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTrackLengthToKeep,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MaxTrackLengthToKeep,
|
||||
&m_MaxTrackLengthToKeep, m_MaxTrackLengthToKeep,
|
||||
0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ExtraZoneDisplayModes,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ExtraZoneDisplayModes,
|
||||
&m_ExtraZoneDisplayModes,
|
||||
m_ExtraZoneDisplayModes ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::StrokeTriangulation,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::StrokeTriangulation,
|
||||
&m_DrawTriangulationOutlines,
|
||||
m_DrawTriangulationOutlines ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinPlotPenWidth,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MinPlotPenWidth,
|
||||
&m_MinPlotPenWidth, m_MinPlotPenWidth,
|
||||
0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugZoneFiller,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DebugZoneFiller,
|
||||
&m_DebugZoneFiller, m_DebugZoneFiller ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugPDFWriter,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DebugPDFWriter,
|
||||
&m_DebugPDFWriter, m_DebugPDFWriter ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::SmallDrillMarkSize,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::UsePdfPrint,
|
||||
&m_UsePdfPrint, m_UsePdfPrint ) );
|
||||
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::SmallDrillMarkSize,
|
||||
&m_SmallDrillMarkSize, m_SmallDrillMarkSize,
|
||||
0.0, 3.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HotkeysDumper,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HotkeysDumper,
|
||||
&m_HotkeysDumper, m_HotkeysDumper ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::DrawBoundingBoxes,
|
||||
&m_DrawBoundingBoxes, m_DrawBoundingBoxes ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowPcbnewExportNetlist,
|
||||
&m_ShowPcbnewExportNetlist,
|
||||
m_ShowPcbnewExportNetlist ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelFileCache,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Skip3DModelFileCache,
|
||||
&m_Skip3DModelFileCache, m_Skip3DModelFileCache ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelMemoryCache,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Skip3DModelMemoryCache,
|
||||
&m_Skip3DModelMemoryCache,
|
||||
m_Skip3DModelMemoryCache ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HideVersionFromTitle,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::HideVersionFromTitle,
|
||||
&m_HideVersionFromTitle, m_HideVersionFromTitle ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRepairSchematic,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowRepairSchematic,
|
||||
&m_ShowRepairSchematic, m_ShowRepairSchematic ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowEventCounters,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ShowEventCounters,
|
||||
&m_ShowEventCounters, m_ShowEventCounters ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowManualCanvasScale,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::AllowManualCanvasScale,
|
||||
&m_AllowManualCanvasScale,
|
||||
m_AllowManualCanvasScale ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::V3DRT_BevelHeight_um,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::V3DRT_BevelHeight_um,
|
||||
&m_3DRT_BevelHeight_um, m_3DRT_BevelHeight_um,
|
||||
0, std::numeric_limits<int>::max(),
|
||||
AC_GROUPS::V3D_RayTracing ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::V3DRT_BevelExtentFactor,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::V3DRT_BevelExtentFactor,
|
||||
&m_3DRT_BevelExtentFactor,
|
||||
m_3DRT_BevelExtentFactor, 0.0, 100.0,
|
||||
AC_GROUPS::V3D_RayTracing ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Use3DConnexionDriver,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::Use3DConnexionDriver,
|
||||
&m_Use3DConnexionDriver, m_Use3DConnexionDriver ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::IncrementalConnectivity,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::IncrementalConnectivity,
|
||||
&m_IncrementalConnectivity,
|
||||
m_IncrementalConnectivity ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::DisambiguationTime,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::DisambiguationTime,
|
||||
&m_DisambiguationMenuDelay,
|
||||
m_DisambiguationMenuDelay,
|
||||
50, 10000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnablePcbDesignBlocks, &m_EnablePcbDesignBlocks,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnablePcbDesignBlocks, &m_EnablePcbDesignBlocks,
|
||||
m_EnablePcbDesignBlocks ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableGenerators,
|
||||
&m_EnableGenerators, m_EnableGenerators ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableAPILogging,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableAPILogging,
|
||||
&m_EnableAPILogging, m_EnableAPILogging ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibWithText,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableLibWithText,
|
||||
&m_EnableLibWithText, m_EnableLibWithText ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibDir,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableLibDir,
|
||||
&m_EnableLibDir, m_EnableLibDir ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::PcbSelectionVisibilityRatio,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::PcbSelectionVisibilityRatio,
|
||||
&m_PcbSelectionVisibilityRatio,
|
||||
m_PcbSelectionVisibilityRatio, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::FontErrorSize,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::FontErrorSize,
|
||||
&m_FontErrorSize,
|
||||
m_FontErrorSize, 0.01, 100 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::OcePluginLinearDeflection,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::OcePluginLinearDeflection,
|
||||
&m_OcePluginLinearDeflection,
|
||||
m_OcePluginLinearDeflection, 0.01, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::OcePluginAngularDeflection,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::OcePluginAngularDeflection,
|
||||
&m_OcePluginAngularDeflection,
|
||||
m_OcePluginAngularDeflection, 0.01, 360.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateSimplificationLevel,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::TriangulateSimplificationLevel,
|
||||
&m_TriangulateSimplificationLevel,
|
||||
m_TriangulateSimplificationLevel, 5, 1000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateMinimumArea,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::TriangulateMinimumArea,
|
||||
&m_TriangulateMinimumArea,
|
||||
m_TriangulateMinimumArea, 25, 100000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableCacheFriendlyFracture,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableCacheFriendlyFracture,
|
||||
&m_EnableCacheFriendlyFracture,
|
||||
m_EnableCacheFriendlyFracture ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaxFileSystemWatchers,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaxFileSystemWatchers,
|
||||
&m_MaxFilesystemWatchers, m_MaxFilesystemWatchers,
|
||||
0, 2147483647 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MinorSchematicGraphSize,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MinorSchematicGraphSize,
|
||||
&m_MinorSchematicGraphSize,
|
||||
m_MinorSchematicGraphSize,
|
||||
0, 2147483647 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ResolveTextRecursionDepth,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ResolveTextRecursionDepth,
|
||||
&m_ResolveTextRecursionDepth,
|
||||
m_ResolveTextRecursionDepth, 0, 10 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableExtensionSnaps,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableExtensionSnaps,
|
||||
&m_EnableExtensionSnaps,
|
||||
m_EnableExtensionSnaps ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ExtensionSnapTimeoutMs,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ExtensionSnapTimeoutMs,
|
||||
&m_ExtensionSnapTimeoutMs,
|
||||
m_ExtensionSnapTimeoutMs, 0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ExtensionSnapActivateOnHover,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ExtensionSnapActivateOnHover,
|
||||
&m_ExtensionSnapActivateOnHover,
|
||||
m_ExtensionSnapActivateOnHover ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableSnapAnchorsDebug,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::EnableSnapAnchorsDebug,
|
||||
&m_EnableSnapAnchorsDebug,
|
||||
m_EnableSnapAnchorsDebug ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinParallelAngle,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::SnapHysteresis,
|
||||
&m_SnapHysteresis, m_SnapHysteresis,
|
||||
0, 100 ) );
|
||||
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::MinParallelAngle,
|
||||
&m_MinParallelAngle, m_MinParallelAngle,
|
||||
0.0, 45.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::HoleWallPaintingMultiplier,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_DOUBLE>( true, AC_KEYS::HoleWallPaintingMultiplier,
|
||||
&m_HoleWallPaintingMultiplier,
|
||||
m_HoleWallPaintingMultiplier,
|
||||
0.1, 100.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MsgPanelShowUuids,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MsgPanelShowUuids,
|
||||
&m_MsgPanelShowUuids,
|
||||
m_MsgPanelShowUuids ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaximumThreads,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaximumThreads,
|
||||
&m_MaximumThreads, m_MaximumThreads,
|
||||
0, 500 ) );
|
||||
|
||||
configParams.push_back(
|
||||
new PARAM_CFG_INT( true, AC_KEYS::NetInspectorBulkUpdateOptimisationThreshold,
|
||||
m_entries.push_back(
|
||||
std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::NetInspectorBulkUpdateOptimisationThreshold,
|
||||
&m_NetInspectorBulkUpdateOptimisationThreshold,
|
||||
m_NetInspectorBulkUpdateOptimisationThreshold, 0, 1000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::ExcludeFromSimulationLineWidth,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ExcludeFromSimulationLineWidth,
|
||||
&m_ExcludeFromSimulationLineWidth,
|
||||
m_ExcludeFromSimulationLineWidth, 1, 100 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::GitIconRefreshInterval,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::GitIconRefreshInterval,
|
||||
&m_GitIconRefreshInterval,
|
||||
m_GitIconRefreshInterval, 0, 100000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ConfigurableToolbars,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ConfigurableToolbars,
|
||||
&m_ConfigurableToolbars,
|
||||
m_ConfigurableToolbars ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaxPastedTextLength,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::MaxPastedTextLength,
|
||||
&m_MaxPastedTextLength,
|
||||
m_MaxPastedTextLength, 0, 100000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::PNSProcessClusterTimeout,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::PNSProcessClusterTimeout,
|
||||
&m_PNSProcessClusterTimeout, 100, 10, 10000 ) );
|
||||
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_BOOL>( true, AC_KEYS::ImportSkipComponentBodies,
|
||||
&m_ImportSkipComponentBodies,
|
||||
m_ImportSkipComponentBodies ) );
|
||||
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_INT>( true, AC_KEYS::ScreenDPI,
|
||||
&m_ScreenDPI, m_ScreenDPI,
|
||||
50, 500 ) );
|
||||
|
||||
// Special case for trace mask setting...we just grab them and set them immediately
|
||||
// Because we even use wxLogTrace inside of advanced config
|
||||
wxString traceMasks;
|
||||
configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks,
|
||||
m_entries.push_back( std::make_unique<PARAM_CFG_WXSTRING>( true, AC_KEYS::TraceMasks, &m_traceMasks,
|
||||
wxS( "" ) ) );
|
||||
|
||||
// Load the config from file
|
||||
wxConfigLoadSetups( &aCfg, configParams );
|
||||
wxConfigLoadSetups( &aCfg, m_entries );
|
||||
|
||||
// Now actually set the trace masks
|
||||
wxStringTokenizer traceMaskTokenizer( traceMasks, wxS( "," ) );
|
||||
wxStringTokenizer traceMaskTokenizer( m_traceMasks, wxS( "," ) );
|
||||
|
||||
while( traceMaskTokenizer.HasMoreTokens() )
|
||||
{
|
||||
@ -626,13 +664,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
wxLog::AddTraceMask( mask );
|
||||
}
|
||||
|
||||
dumpCfg( configParams );
|
||||
|
||||
for( PARAM_CFG* param : configParams )
|
||||
delete param;
|
||||
dumpCfg( m_entries );
|
||||
|
||||
wxLogTrace( kicadTraceCoroutineStack, wxT( "Using coroutine stack size %d" ),
|
||||
m_CoroutineStackSize );
|
||||
}
|
||||
|
||||
|
||||
|
@ -178,7 +178,7 @@ HANDLER_RESULT<types::Box2> API_HANDLER_COMMON::handleGetTextExtents(
|
||||
|
||||
types::Box2 response;
|
||||
|
||||
BOX2I bbox = text.GetTextBox();
|
||||
BOX2I bbox = text.GetTextBox( nullptr );
|
||||
EDA_ANGLE angle = text.GetTextAngle();
|
||||
|
||||
if( !angle.IsZero() )
|
||||
|
@ -397,6 +397,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_24.png" ), 24, wxT( "light" ) );
|
||||
@ -448,6 +449,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_24.png" ), 24, wxT( "light" ) );
|
||||
@ -570,6 +573,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_24.png" ), 24, wxT( "light" ) );
|
||||
@ -833,6 +837,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@ -884,6 +889,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@ -1006,6 +1013,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@ -1269,6 +1277,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_16.png" ), 16, wxT( "light" ) );
|
||||
@ -1320,6 +1329,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_16.png" ), 16, wxT( "light" ) );
|
||||
@ -1442,6 +1453,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_16.png" ), 16, wxT( "light" ) );
|
||||
@ -1705,6 +1717,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@ -1756,6 +1769,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@ -1878,6 +1893,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@ -2141,6 +2157,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_32.png" ), 32, wxT( "light" ) );
|
||||
@ -2192,6 +2209,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_32.png" ), 32, wxT( "light" ) );
|
||||
@ -2314,6 +2333,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_32.png" ), 32, wxT( "light" ) );
|
||||
@ -2577,6 +2597,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@ -2628,6 +2649,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@ -2750,6 +2773,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@ -3013,6 +3037,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_48.png" ), 48, wxT( "light" ) );
|
||||
@ -3064,6 +3089,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_48.png" ), 48, wxT( "light" ) );
|
||||
@ -3186,6 +3213,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_48.png" ), 48, wxT( "light" ) );
|
||||
@ -3449,6 +3477,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@ -3500,6 +3529,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@ -3622,6 +3653,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@ -3885,6 +3917,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_64.png" ), 64, wxT( "light" ) );
|
||||
@ -3936,6 +3969,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_64.png" ), 64, wxT( "light" ) );
|
||||
@ -4058,6 +4093,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_64.png" ), 64, wxT( "light" ) );
|
||||
@ -4321,6 +4357,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::add_line].emplace_back( BITMAPS::add_line, wxT( "add_line_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_orthogonal_dimension].emplace_back( BITMAPS::add_orthogonal_dimension, wxT( "add_orthogonal_dimension_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_pcb_target].emplace_back( BITMAPS::add_pcb_target, wxT( "add_pcb_target_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_point].emplace_back( BITMAPS::add_point, wxT( "add_point_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_power].emplace_back( BITMAPS::add_power, wxT( "add_power_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_radial_dimension].emplace_back( BITMAPS::add_radial_dimension, wxT( "add_radial_dimension_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::add_rectangle].emplace_back( BITMAPS::add_rectangle, wxT( "add_rectangle_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@ -4372,6 +4409,8 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@ -4494,6 +4533,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::jobset].emplace_back( BITMAPS::jobset, wxT( "jobset_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::jobset_open].emplace_back( BITMAPS::jobset_open, wxT( "jobset_open_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::language].emplace_back( BITMAPS::language, wxT( "language_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::lasso].emplace_back( BITMAPS::lasso, wxT( "lasso_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::layers_manager].emplace_back( BITMAPS::layers_manager, wxT( "layers_manager_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::leave_sheet].emplace_back( BITMAPS::leave_sheet, wxT( "leave_sheet_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::left].emplace_back( BITMAPS::left, wxT( "left_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
|
@ -207,18 +207,15 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
|
||||
|
||||
void BITMAP_STORE::ThemeChanged()
|
||||
{
|
||||
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
|
||||
wxString oldTheme = m_theme;
|
||||
|
||||
if( settings )
|
||||
if( COMMON_SETTINGS* settings = Pgm().GetCommonSettings() )
|
||||
{
|
||||
switch( settings->m_Appearance.icon_theme )
|
||||
{
|
||||
case ICON_THEME::LIGHT: m_theme = wxT( "light" ); break;
|
||||
case ICON_THEME::DARK: m_theme = wxT( "dark" ); break;
|
||||
case ICON_THEME::AUTO:
|
||||
m_theme = KIPLATFORM::UI::IsDarkTheme() ? wxT( "dark" ) : wxT( "light" );
|
||||
break;
|
||||
case ICON_THEME::AUTO: m_theme = KIPLATFORM::UI::IsDarkTheme() ? wxT( "dark" ) : wxT( "light" ); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -317,6 +317,13 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
aMsg << indent4 << "KICAD_IPC_API=" << OFF;
|
||||
#endif
|
||||
|
||||
aMsg << indent4 << "KICAD_USE_PCH=";
|
||||
#ifdef KICAD_USE_PCH
|
||||
aMsg << ON;
|
||||
#else
|
||||
aMsg << OFF;
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
aMsg << indent4 << "KICAD_STDLIB_DEBUG=";
|
||||
#ifdef KICAD_STDLIB_DEBUG
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "clipboard.h"
|
||||
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/dataobj.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/string.h>
|
||||
@ -90,10 +91,10 @@ std::unique_ptr<wxImage> GetImageFromClipboard()
|
||||
{
|
||||
if( wxTheClipboard->IsSupported( wxDF_BITMAP ) )
|
||||
{
|
||||
wxImageDataObject data;
|
||||
wxBitmapDataObject data;
|
||||
if( wxTheClipboard->GetData( data ) )
|
||||
{
|
||||
image = std::make_unique<wxImage>( data.GetImage() );
|
||||
image = std::make_unique<wxImage>( data.GetBitmap().ConvertToImage() );
|
||||
}
|
||||
}
|
||||
else if( wxTheClipboard->IsSupported( wxDF_FILENAME ) )
|
||||
|
@ -38,52 +38,66 @@ COMMIT::COMMIT()
|
||||
|
||||
COMMIT::~COMMIT()
|
||||
{
|
||||
for( COMMIT_LINE& ent : m_changes )
|
||||
for( COMMIT_LINE& ent : m_entries )
|
||||
delete ent.m_copy;
|
||||
}
|
||||
|
||||
|
||||
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen,
|
||||
RECURSE_MODE aRecurse )
|
||||
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen, RECURSE_MODE aRecurse )
|
||||
{
|
||||
int flags = aChangeType & CHT_FLAGS;
|
||||
int changeType = aChangeType & CHT_TYPE;
|
||||
EDA_ITEM* undoItem = undoLevelItem( aItem );
|
||||
|
||||
if( undoItem != aItem )
|
||||
changeType = CHT_MODIFY;
|
||||
|
||||
// CHT_MODIFY and CHT_DONE are not compatible
|
||||
wxASSERT( ( aChangeType & ( CHT_MODIFY | CHT_DONE ) ) != ( CHT_MODIFY | CHT_DONE ) );
|
||||
if( changeType == CHT_MODIFY )
|
||||
wxASSERT( ( flags & CHT_DONE ) == 0 );
|
||||
|
||||
int flag = aChangeType & CHT_FLAGS;
|
||||
|
||||
switch( aChangeType & CHT_TYPE )
|
||||
switch( changeType )
|
||||
{
|
||||
case CHT_ADD:
|
||||
makeEntry( aItem, CHT_ADD | flag, nullptr, aScreen );
|
||||
if( m_addedItems.find( { aItem, aScreen } ) != m_addedItems.end() )
|
||||
break;
|
||||
|
||||
makeEntry( aItem, CHT_ADD | flags, nullptr, aScreen );
|
||||
break;
|
||||
|
||||
case CHT_REMOVE:
|
||||
if( m_deletedItems.insert( aItem ).second )
|
||||
{
|
||||
makeEntry( aItem, CHT_REMOVE | flag, makeImage( aItem ), aScreen );
|
||||
if( m_deletedItems.find( { aItem, aScreen } ) != m_deletedItems.end() )
|
||||
break;
|
||||
|
||||
makeEntry( aItem, CHT_REMOVE | flags, makeImage( aItem ), aScreen );
|
||||
|
||||
if( EDA_GROUP* parentGroup = aItem->GetParentGroup() )
|
||||
{
|
||||
if( parentGroup->AsEdaItem()->GetFlags() & STRUCT_DELETED )
|
||||
Modify( parentGroup->AsEdaItem(), aScreen, RECURSE_MODE::NO_RECURSE );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CHT_MODIFY:
|
||||
if( EDA_ITEM* parent = parentObject( aItem ) )
|
||||
createModified( parent, makeImage( parent ), flag, aScreen );
|
||||
if( m_addedItems.find( { aItem, aScreen } ) != m_addedItems.end() )
|
||||
break;
|
||||
|
||||
if( m_changedItems.find( { undoItem, aScreen } ) != m_changedItems.end() )
|
||||
break;
|
||||
|
||||
makeEntry( undoItem, CHT_MODIFY | flags, makeImage( undoItem ), aScreen );
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL;
|
||||
UNIMPLEMENTED_FOR( undoItem->GetClass() );
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
COMMIT& COMMIT::Stage( std::vector<EDA_ITEM*> &container, CHANGE_TYPE aChangeType,
|
||||
BASE_SCREEN *aScreen )
|
||||
COMMIT& COMMIT::Stage( std::vector<EDA_ITEM*> &container, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen )
|
||||
{
|
||||
for( EDA_ITEM* item : container )
|
||||
Stage( item, aChangeType, aScreen);
|
||||
@ -119,31 +133,45 @@ COMMIT& COMMIT::Stage( const PICKED_ITEMS_LIST &aItems, UNDO_REDO aModFlag, BASE
|
||||
}
|
||||
|
||||
|
||||
int COMMIT::GetStatus( EDA_ITEM* aItem, BASE_SCREEN *aScreen )
|
||||
void COMMIT::Unstage( EDA_ITEM* aItem, BASE_SCREEN* aScreen )
|
||||
{
|
||||
COMMIT_LINE* entry = findEntry( parentObject( aItem ), aScreen );
|
||||
std::erase_if( m_entries,
|
||||
[&]( COMMIT_LINE& line )
|
||||
{
|
||||
if( line.m_item == aItem && line.m_screen == aScreen )
|
||||
{
|
||||
// Only new items which have never been committed can be unstaged
|
||||
wxASSERT( line.m_item->IsNew() );
|
||||
|
||||
return entry ? entry->m_type : 0;
|
||||
delete line.m_item;
|
||||
delete line.m_copy;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
COMMIT& COMMIT::createModified( EDA_ITEM* aItem, EDA_ITEM* aCopy, int aExtraFlags,
|
||||
BASE_SCREEN* aScreen )
|
||||
COMMIT& COMMIT::Modified( EDA_ITEM* aItem, EDA_ITEM* aCopy, BASE_SCREEN *aScreen )
|
||||
{
|
||||
EDA_ITEM* parent = parentObject( aItem );
|
||||
|
||||
if( m_changedItems.find( parent ) != m_changedItems.end() )
|
||||
{
|
||||
delete aCopy;
|
||||
return *this; // item has been already modified once
|
||||
}
|
||||
|
||||
makeEntry( parent, CHT_MODIFY | aExtraFlags, aCopy, aScreen );
|
||||
if( undoLevelItem( aItem ) != aItem )
|
||||
wxFAIL_MSG( "We've no way to get a copy of the undo level item at this point" );
|
||||
else
|
||||
makeEntry( aItem, CHT_MODIFY, aCopy, aScreen );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
int COMMIT::GetStatus( EDA_ITEM* aItem, BASE_SCREEN *aScreen )
|
||||
{
|
||||
COMMIT_LINE* entry = findEntry( undoLevelItem( aItem ), aScreen );
|
||||
|
||||
return entry ? entry->m_type : 0;
|
||||
}
|
||||
|
||||
|
||||
void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BASE_SCREEN *aScreen )
|
||||
{
|
||||
COMMIT_LINE ent;
|
||||
@ -156,17 +184,24 @@ void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BAS
|
||||
// N.B. Do not throw an assertion for multiple changed items. An item can be changed
|
||||
// multiple times in a single commit such as when importing graphics and grouping them.
|
||||
|
||||
m_changedItems.insert( aItem );
|
||||
m_changes.push_back( ent );
|
||||
switch( aType & CHT_TYPE )
|
||||
{
|
||||
case CHT_ADD: m_addedItems.insert( { aItem, aScreen } ); break;
|
||||
case CHT_REMOVE: m_deletedItems.insert( { aItem, aScreen } ); break;
|
||||
case CHT_MODIFY: m_changedItems.insert( { aItem, aScreen } ); break;
|
||||
default: wxFAIL; break;
|
||||
}
|
||||
|
||||
m_entries.push_back( ent );
|
||||
}
|
||||
|
||||
|
||||
COMMIT::COMMIT_LINE* COMMIT::findEntry( EDA_ITEM* aItem, BASE_SCREEN *aScreen )
|
||||
{
|
||||
for( COMMIT_LINE& change : m_changes )
|
||||
for( COMMIT_LINE& entry : m_entries )
|
||||
{
|
||||
if( change.m_item == aItem && change.m_screen == aScreen )
|
||||
return &change;
|
||||
if( entry.m_item == aItem && entry.m_screen == aScreen )
|
||||
return &entry;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@ -180,7 +215,7 @@ CHANGE_TYPE COMMIT::convert( UNDO_REDO aType ) const
|
||||
case UNDO_REDO::NEWITEM: return CHT_ADD;
|
||||
case UNDO_REDO::DELETED: return CHT_REMOVE;
|
||||
case UNDO_REDO::CHANGED: return CHT_MODIFY;
|
||||
default: wxASSERT( false ); return CHT_MODIFY;
|
||||
default: wxFAIL; return CHT_MODIFY;
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,7 +227,7 @@ UNDO_REDO COMMIT::convert( CHANGE_TYPE aType ) const
|
||||
case CHT_ADD: return UNDO_REDO::NEWITEM;
|
||||
case CHT_REMOVE: return UNDO_REDO::DELETED;
|
||||
case CHT_MODIFY: return UNDO_REDO::CHANGED;
|
||||
default: wxASSERT( false ); return UNDO_REDO::CHANGED;
|
||||
default: wxFAIL; return UNDO_REDO::CHANGED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,12 +30,12 @@
|
||||
#include <wx/config.h> // for wxConfigBase
|
||||
#include <wx/debug.h> // for wxASSERT
|
||||
|
||||
void wxConfigLoadParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList,
|
||||
void wxConfigLoadParams( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList,
|
||||
const wxString& aGroup )
|
||||
{
|
||||
wxASSERT( aCfg );
|
||||
|
||||
for( PARAM_CFG* param : aList )
|
||||
for( const auto& param : aList )
|
||||
{
|
||||
if( !!param->m_Group )
|
||||
aCfg->SetPath( param->m_Group );
|
||||
@ -50,11 +50,11 @@ void wxConfigLoadParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aLis
|
||||
}
|
||||
|
||||
|
||||
void wxConfigLoadSetups( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList )
|
||||
void wxConfigLoadSetups( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList )
|
||||
{
|
||||
wxASSERT( aCfg );
|
||||
|
||||
for( PARAM_CFG* param : aList )
|
||||
for( const auto& param : aList )
|
||||
{
|
||||
if( !param->m_Setup )
|
||||
continue;
|
||||
@ -64,12 +64,12 @@ void wxConfigLoadSetups( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aLis
|
||||
}
|
||||
|
||||
|
||||
void wxConfigSaveParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList,
|
||||
void wxConfigSaveParams( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList,
|
||||
const wxString& aGroup )
|
||||
{
|
||||
wxASSERT( aCfg );
|
||||
|
||||
for( PARAM_CFG* param : aList )
|
||||
for( const auto& param : aList )
|
||||
{
|
||||
if( !!param->m_Group )
|
||||
aCfg->SetPath( param->m_Group );
|
||||
@ -92,11 +92,11 @@ void wxConfigSaveParams( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aLis
|
||||
}
|
||||
|
||||
|
||||
void wxConfigSaveSetups( wxConfigBase* aCfg, const std::vector<PARAM_CFG*>& aList )
|
||||
void wxConfigSaveSetups( wxConfigBase* aCfg, const std::vector<std::unique_ptr<PARAM_CFG>>& aList )
|
||||
{
|
||||
wxASSERT( aCfg );
|
||||
|
||||
for( PARAM_CFG* param : aList )
|
||||
for( const auto& param : aList )
|
||||
{
|
||||
if( !param->m_Setup )
|
||||
continue;
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <core/kicad_algo.h>
|
||||
#include <json_common.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include <database/database_lib_settings.h>
|
||||
#include <settings/parameters.h>
|
||||
@ -91,7 +92,7 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
|
||||
|
||||
// Sanitize library display names; currently only `/` is removed because we
|
||||
// use it as a separator and allow it in symbol names.
|
||||
alg::delete_matching( table.name, '/' );
|
||||
std::erase( table.name, '/' );
|
||||
|
||||
if( entry.contains( "properties" ) && entry["properties"].is_object() )
|
||||
{
|
||||
|
@ -48,12 +48,8 @@ public:
|
||||
const wxString& GetBoardFile() const { return m_boardFile; }
|
||||
void SetBoardFile( const wxString& aFile ) { m_boardFile = aFile; }
|
||||
|
||||
void SetFields( nlohmann::ordered_map<wxString, wxString>& aFields )
|
||||
{
|
||||
m_fields = std::move( aFields );
|
||||
}
|
||||
|
||||
const nlohmann::ordered_map<wxString, wxString>& GetFields() const { return m_fields; }
|
||||
nlohmann::ordered_map<wxString, wxString>& GetFields() { return m_fields; }
|
||||
|
||||
DESIGN_BLOCK() = default;
|
||||
|
||||
|
@ -190,7 +190,7 @@ void DESIGN_BLOCK_LIST_IMPL::loadDesignBlocks()
|
||||
};
|
||||
|
||||
for( size_t ii = 0; ii < num_elements; ++ii )
|
||||
returns[ii] = tp.submit( db_thread );
|
||||
returns[ii] = tp.submit_task( db_thread );
|
||||
|
||||
for( const std::future<size_t>& ret : returns )
|
||||
{
|
||||
|
@ -325,8 +325,6 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
|
||||
if( dbMetadata.contains( "keywords" ) )
|
||||
newDB->SetKeywords( dbMetadata["keywords"] );
|
||||
|
||||
nlohmann::ordered_map<wxString, wxString> fields;
|
||||
|
||||
// Read the "fields" object from the JSON
|
||||
if( dbMetadata.contains( "fields" ) )
|
||||
{
|
||||
@ -335,10 +333,8 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
|
||||
wxString name = wxString::FromUTF8( item.key() );
|
||||
wxString value = wxString::FromUTF8( item.value().get<std::string>() );
|
||||
|
||||
fields[name] = value;
|
||||
newDB->GetFields()[name] = value;
|
||||
}
|
||||
|
||||
newDB->SetFields( fields );
|
||||
}
|
||||
}
|
||||
catch( ... )
|
||||
|
@ -79,7 +79,7 @@ void DESIGN_BLOCK_TREE_MODEL_ADAPTER::AddLibraries( EDA_BASE_FRAME* aParent )
|
||||
DoAddLibrary( libName, library->GetDescr(), getDesignBlocks( aParent, libName ), pinned, true );
|
||||
}
|
||||
|
||||
m_tree.AssignIntrinsicRanks();
|
||||
m_tree.AssignIntrinsicRanks( m_shownColumns );
|
||||
}
|
||||
|
||||
|
||||
|
@ -449,7 +449,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
ADD_DEV( wxT( "Martin McNamara" ), CONTRIB_DEV );
|
||||
ADD_DEV( wxT( "Cameron McQuinn" ), CONTRIB_DEV );
|
||||
ADD_DEV( wxT( "Ievgenii Meshcheriakov" ), CONTRIB_DEV );
|
||||
ADD_DEV( wxT( "Mojca Miklavec" ), CONTRIB_DEV );
|
||||
ADD_DEV( wxT( "Mojca Miklavec Groenhuis" ), CONTRIB_DEV );
|
||||
ADD_DEV( wxT( "Ashley Mills" ), CONTRIB_DEV );
|
||||
ADD_DEV( wxT( "Christoph Moench-Tegeder" ), CONTRIB_DEV );
|
||||
ADD_DEV( wxT( "Peter Montgomery" ), CONTRIB_DEV );
|
||||
@ -873,7 +873,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
ADD_LIBRARIAN( wxT( "Uli Köhler" ) );
|
||||
ADD_LIBRARIAN( wxT( "Graham Keeth" ) );
|
||||
ADD_LIBRARIAN( wxT( "Andrew Lutsenko" ) );
|
||||
ADD_LIBRARIAN( wxT( "Mojca Miklavec" ) );
|
||||
ADD_LIBRARIAN( wxT( "Mojca Miklavec Groenhuis" ) );
|
||||
ADD_LIBRARIAN( wxT( "Jorge Neiva" ) );
|
||||
ADD_LIBRARIAN( wxT( "Carlos Nieves Ónega" ) );
|
||||
ADD_LIBRARIAN( wxT( "Lynn Ochs" ) );
|
||||
|
@ -22,6 +22,9 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <build_version.h>
|
||||
#include <eda_base_frame.h>
|
||||
@ -108,8 +111,20 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
|
||||
m_titleName = aParent->GetAboutTitle();
|
||||
m_untranslatedTitleName = aParent->GetUntranslatedAboutTitle();
|
||||
m_staticTextAppTitle->SetLabel( m_titleName );
|
||||
|
||||
// On windows, display the number of GDI objects in use. Can be useful when some GDI objects
|
||||
// are not displayed because the max count of GDI objects (usually 10000) is reached
|
||||
// So displaying this number can help to diagnose strange display issues
|
||||
wxString extraInfo;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
uint32_t gdi_count = GetGuiResources( GetCurrentProcess(), GR_GDIOBJECTS );
|
||||
extraInfo.Printf( _( "GDI objects in use %u" ), gdi_count );
|
||||
extraInfo.Prepend( wxT( "\n" ) );
|
||||
#endif
|
||||
|
||||
m_staticTextBuildVersion->SetLabel( wxS( "Version: " ) + m_info.GetBuildVersion() );
|
||||
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() );
|
||||
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() + extraInfo );
|
||||
|
||||
SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
|
||||
createNotebooks();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,22 +21,148 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <dialogs/dialog_assign_netclass.h>
|
||||
#include "dialogs/dialog_assign_netclass.h"
|
||||
|
||||
#include <wx/regex.h>
|
||||
|
||||
#include <widgets/wx_html_report_box.h>
|
||||
#include <project.h>
|
||||
#include <project/project_file.h>
|
||||
#include <project/net_settings.h>
|
||||
#include <eda_base_frame.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
|
||||
DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS( EDA_BASE_FRAME* aParent, const wxString aNetName,
|
||||
wxString UpgradeGlobStarToRegex( const wxString& aPattern )
|
||||
{
|
||||
// Match a '*' that is NOT preceded by '.'
|
||||
// (needs lookbehind, so no std::regex)
|
||||
static const wxRegEx globStarPattern( wxT( R"((?<!\.)\*)" ) );
|
||||
|
||||
wxString result = aPattern;
|
||||
globStarPattern.ReplaceAll( &result, ".*" );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static wxString GetStringCommonPrefix( const wxArrayString& aSet )
|
||||
{
|
||||
if( aSet.empty() )
|
||||
return wxEmptyString;
|
||||
|
||||
wxString commonPrefix = *aSet.begin();
|
||||
|
||||
for( const wxString& str : aSet )
|
||||
{
|
||||
const size_t minLength = std::min( commonPrefix.size(), str.size() );
|
||||
size_t matchUntil = 0;
|
||||
while( matchUntil < minLength && commonPrefix[matchUntil] == str[matchUntil] )
|
||||
{
|
||||
++matchUntil;
|
||||
}
|
||||
|
||||
commonPrefix = commonPrefix.substr( 0, matchUntil );
|
||||
|
||||
// If the common prefix is empty, we can stop early
|
||||
// as there is no common prefix.
|
||||
if( commonPrefix.empty() )
|
||||
break;
|
||||
}
|
||||
|
||||
return commonPrefix;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Propose a netclass pattern for a set of net names.
|
||||
*
|
||||
* This is a bit of a fudge, as there is no true answer for a perfect pattern.
|
||||
* (e.g. if you have A0 and A1, is the answer A*, A[0-9], A[0|1] or A0|A1, or
|
||||
* something else?)
|
||||
*
|
||||
* Also if you select A0, A1 and there is an A2 in the schematics,
|
||||
* is the answer to include A2 or exclude it? E.g. A*, A0|A1 are not the same.
|
||||
*
|
||||
* For now, we just glue the net names together with a pipe, handle the most basic
|
||||
* case of a single prefix if we can. No attempt is made to see if a star is
|
||||
* safe (i.e. the options given are all the options there are).
|
||||
*/
|
||||
static wxString GetNetclassPatternForSet( const std::set<wxString>& aNetNames )
|
||||
{
|
||||
if( aNetNames.empty() )
|
||||
return wxEmptyString;
|
||||
|
||||
if( aNetNames.size() == 1 )
|
||||
{
|
||||
return *aNetNames.begin();
|
||||
}
|
||||
|
||||
wxArrayString netNames;
|
||||
for( const wxString& netName : aNetNames )
|
||||
{
|
||||
// If the net name contains a '*' (e..g it was a bus prefix),
|
||||
// we CAN use it in a pipe-separated regex pattern, but it has to be
|
||||
// upgraded from a glob star to a regex star.
|
||||
netNames.Add( UpgradeGlobStarToRegex( netName ) );
|
||||
}
|
||||
|
||||
// Sort the net names to have a consistent order.
|
||||
StrNumSort( netNames, CASE_SENSITIVITY::INSENSITIVE );
|
||||
|
||||
// Get the common prefix of all net names.
|
||||
const wxString commonPrefix = GetStringCommonPrefix( netNames );
|
||||
|
||||
if( !commonPrefix.IsEmpty() && commonPrefix != wxT( "/" ) )
|
||||
{
|
||||
// If the common prefix is not empty, we can use it to simplify the pattern.
|
||||
// This only works for one prefix, but with tries or similar, we can find
|
||||
// multiple prefixes if that's something we want to do.
|
||||
|
||||
wxArrayString netTails;
|
||||
|
||||
for( const wxString& netName : netNames )
|
||||
{
|
||||
// Add the tail of the net name after the common prefix.
|
||||
netTails.Add( netName.Mid( commonPrefix.size() ) );
|
||||
}
|
||||
|
||||
return commonPrefix + + wxT("(") + wxJoin( netTails, wxT( '|' ) ) + wxT(")");
|
||||
}
|
||||
|
||||
// No better ideas, just a straight pipe-separated list of net names.
|
||||
return wxJoin( netNames, wxT( '|' ) );
|
||||
}
|
||||
|
||||
|
||||
DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS( EDA_BASE_FRAME* aParent,
|
||||
const std::set<wxString>& aNetNames,
|
||||
const std::set<wxString> aCandidateNetNames,
|
||||
const std::function<void( const std::vector<wxString>& )>& aPreviewer ) :
|
||||
DIALOG_ASSIGN_NETCLASS_BASE( aParent ),
|
||||
m_frame( aParent ),
|
||||
m_selectedNetNames( aNetNames ),
|
||||
m_netCandidates( aCandidateNetNames ),
|
||||
m_previewer( aPreviewer )
|
||||
{
|
||||
m_matchingNets->SetFont( KIUI::GetInfoFont( this ) );
|
||||
m_info->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
||||
|
||||
// @translate the string below.
|
||||
if( aParent->GetFrameType() == FRAME_PCB_EDITOR )
|
||||
m_info->SetLabel( wxT( "Note: complete netclass assignments can be edited in Board "
|
||||
"Setup > Project." ) );
|
||||
|
||||
SetupStandardButtons();
|
||||
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_ASSIGN_NETCLASS::TransferDataToWindow()
|
||||
{
|
||||
if( !wxWindow::TransferDataToWindow() )
|
||||
return false;
|
||||
|
||||
std::shared_ptr<NET_SETTINGS>& netSettings = m_frame->Prj().GetProjectFile().m_NetSettings;
|
||||
|
||||
m_netclassCtrl->Append( NETCLASS::Default );
|
||||
@ -49,18 +175,10 @@ DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS( EDA_BASE_FRAME* aParent, const w
|
||||
else
|
||||
m_netclassCtrl->SetSelection( 0 ); // Default netclass
|
||||
|
||||
m_patternCtrl->SetValue( aNetName );
|
||||
m_matchingNets->SetFont( KIUI::GetInfoFont( this ) );
|
||||
m_info->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
||||
const wxString initialNetclassPattern = GetNetclassPatternForSet( m_selectedNetNames );
|
||||
m_patternCtrl->SetValue( initialNetclassPattern );
|
||||
|
||||
// @translate the string below.
|
||||
if( aParent->GetFrameType() == FRAME_PCB_EDITOR )
|
||||
m_info->SetLabel( wxT( "Note: complete netclass assignments can be edited in Board "
|
||||
"Setup > Project." ) );
|
||||
|
||||
SetupStandardButtons();
|
||||
|
||||
finishDialogSettings();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -110,5 +228,3 @@ void DIALOG_ASSIGN_NETCLASS::onPatternText( wxCommandEvent& aEvent )
|
||||
m_lastPattern = pattern;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -1,41 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="16" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration">; </property>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="cpp_class_decoration">; </property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_assign_netclass_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">DIALOG_ASSIGN_NETCLASS_BASE</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
@ -56,33 +59,33 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bMainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bUpperSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -95,6 +98,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -131,19 +135,19 @@
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<object class="wxTextCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -156,6 +160,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -166,7 +171,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">240,-1</property>
|
||||
@ -196,19 +201,19 @@
|
||||
<event name="OnText">onPatternText</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">30</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -221,6 +226,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -257,19 +263,19 @@
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxComboBox" expanded="1">
|
||||
<object class="wxComboBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -283,6 +289,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -324,28 +331,28 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bLowerSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">2</property>
|
||||
<object class="wxHtmlWindow" expanded="1">
|
||||
<object class="wxHtmlWindow" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -358,6 +365,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -391,19 +399,19 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -416,6 +424,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -454,11 +463,11 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="0">
|
||||
<object class="wxStdDialogButtonSizer" expanded="false">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">1</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -28,7 +28,6 @@ class WX_HTML_REPORT_BOX;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_ASSIGN_NETCLASS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -252,6 +252,9 @@ void DIALOG_CONFIGURE_PATHS::OnGridCellChanging( wxGridEvent& event )
|
||||
int col = event.GetCol();
|
||||
wxString text = event.GetString();
|
||||
|
||||
text.Trim( true ).Trim( false ); // Trim from both sides
|
||||
grid->SetCellValue( row, col, text ); // Update the grid with trimmed value
|
||||
|
||||
if( text.IsEmpty() )
|
||||
{
|
||||
if( grid == m_EnvVars )
|
||||
@ -316,38 +319,32 @@ void DIALOG_CONFIGURE_PATHS::OnGridCellChanging( wxGridEvent& event )
|
||||
|
||||
void DIALOG_CONFIGURE_PATHS::OnAddEnvVar( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_EnvVars->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
m_EnvVars->OnAddRow(
|
||||
[&]() -> std::pair<int, int>
|
||||
{
|
||||
AppendEnvVar( wxEmptyString, wxEmptyString, false );
|
||||
|
||||
m_EnvVars->MakeCellVisible( m_EnvVars->GetNumberRows() - 1, TV_NAME_COL );
|
||||
m_EnvVars->SetGridCursor( m_EnvVars->GetNumberRows() - 1, TV_NAME_COL );
|
||||
|
||||
m_EnvVars->EnableCellEditControl( true );
|
||||
m_EnvVars->ShowCellEditControl();
|
||||
return { m_EnvVars->GetNumberRows() - 1, TV_NAME_COL };
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_CONFIGURE_PATHS::OnRemoveEnvVar( wxCommandEvent& event )
|
||||
{
|
||||
int curRow = m_EnvVars->GetGridCursorRow();
|
||||
|
||||
if( curRow < 0 || m_EnvVars->GetNumberRows() <= curRow )
|
||||
m_EnvVars->OnDeleteRows(
|
||||
[&]( int row )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if( ENV_VAR::IsEnvVarImmutable( m_EnvVars->GetCellValue( curRow, TV_NAME_COL ) ) )
|
||||
if( ENV_VAR::IsEnvVarImmutable( m_EnvVars->GetCellValue( row, TV_NAME_COL ) ) )
|
||||
{
|
||||
wxBell();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_EnvVars->CommitPendingChanges( true /* silent mode; we don't care if it's valid */ );
|
||||
m_EnvVars->DeleteRows( curRow, 1 );
|
||||
|
||||
m_EnvVars->MakeCellVisible( std::max( 0, curRow-1 ), m_EnvVars->GetGridCursorCol() );
|
||||
m_EnvVars->SetGridCursor( std::max( 0, curRow-1 ), m_EnvVars->GetGridCursorCol() );
|
||||
return true;
|
||||
},
|
||||
[&]( int row )
|
||||
{
|
||||
m_EnvVars->DeleteRows( row, 1 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
@ -116,11 +116,10 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromWindow()
|
||||
|
||||
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnAddField( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_fieldsGrid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
m_fieldsGrid->OnAddRow(
|
||||
[&]() -> std::pair<int, int>
|
||||
{
|
||||
int row = m_fieldsGrid->GetNumberRows();
|
||||
|
||||
m_fieldsGrid->AppendRows( 1 );
|
||||
|
||||
m_fieldsGrid->SetCellValue( row, 0, _( "Untitled Field" ) );
|
||||
@ -130,81 +129,38 @@ void DIALOG_DESIGN_BLOCK_PROPERTIES::OnAddField( wxCommandEvent& event )
|
||||
m_fieldsGrid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
|
||||
m_fieldsGrid->SetCellAlignment( row, 1, wxALIGN_LEFT, wxALIGN_CENTRE );
|
||||
|
||||
// wx documentation is wrong, SetGridCursor does not make visible.
|
||||
m_fieldsGrid->MakeCellVisible( row, 0 );
|
||||
m_fieldsGrid->SetGridCursor( row, 0 );
|
||||
return { row, 0 };
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnDeleteField( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_fieldsGrid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
wxArrayInt selectedRows = m_fieldsGrid->GetSelectedRows();
|
||||
|
||||
if( selectedRows.empty() && m_fieldsGrid->GetGridCursorRow() >= 0 )
|
||||
selectedRows.push_back( m_fieldsGrid->GetGridCursorRow() );
|
||||
|
||||
if( selectedRows.empty() )
|
||||
return;
|
||||
|
||||
// Reverse sort so deleting a row doesn't change the indexes of the other rows.
|
||||
selectedRows.Sort( []( int* first, int* second ) { return *second - *first; } );
|
||||
|
||||
for( int row : selectedRows )
|
||||
m_fieldsGrid->OnDeleteRows(
|
||||
[&]( int row )
|
||||
{
|
||||
m_fieldsGrid->DeleteRows( row );
|
||||
|
||||
m_fieldsGrid->MakeCellVisible( std::max( 0, row - 1 ), m_fieldsGrid->GetGridCursorCol() );
|
||||
m_fieldsGrid->SetGridCursor( std::max( 0, row - 1 ), m_fieldsGrid->GetGridCursorCol() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnMoveFieldUp( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_fieldsGrid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
int row = m_fieldsGrid->GetGridCursorRow();
|
||||
|
||||
if( m_fieldsGrid->GetNumberRows() < 2 || row == 0 )
|
||||
return;
|
||||
|
||||
// Swap the grid at row with the grid at row - 1
|
||||
wxString temp0 = m_fieldsGrid->GetCellValue( row, 0 );
|
||||
m_fieldsGrid->SetCellValue( row, 0, m_fieldsGrid->GetCellValue( row - 1, 0 ) );
|
||||
m_fieldsGrid->SetCellValue( row - 1, 0, temp0 );
|
||||
|
||||
wxString temp1 = m_fieldsGrid->GetCellValue( row, 1 );
|
||||
m_fieldsGrid->SetCellValue( row, 1, m_fieldsGrid->GetCellValue( row - 1, 1 ) );
|
||||
m_fieldsGrid->SetCellValue( row - 1, 1, temp1 );
|
||||
|
||||
m_fieldsGrid->SetGridCursor( row - 1, 0 );
|
||||
m_fieldsGrid->OnMoveRowUp(
|
||||
[&]( int row )
|
||||
{
|
||||
m_fieldsGrid->SwapRows( row, row - 1 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DESIGN_BLOCK_PROPERTIES::OnMoveFieldDown( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_fieldsGrid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
int row = m_fieldsGrid->GetGridCursorRow();
|
||||
|
||||
if( m_fieldsGrid->GetNumberRows() < 2 || row == ( (int) m_fieldsGrid->GetNumberRows() - 1 ) )
|
||||
return;
|
||||
|
||||
// Swap the grid at row with the grid at row + 1
|
||||
wxString temp0 = m_fieldsGrid->GetCellValue( row, 0 );
|
||||
m_fieldsGrid->SetCellValue( row, 0, m_fieldsGrid->GetCellValue( row + 1, 0 ) );
|
||||
m_fieldsGrid->SetCellValue( row + 1, 0, temp0 );
|
||||
|
||||
wxString temp1 = m_fieldsGrid->GetCellValue( row, 1 );
|
||||
m_fieldsGrid->SetCellValue( row, 1, m_fieldsGrid->GetCellValue( row + 1, 1 ) );
|
||||
m_fieldsGrid->SetCellValue( row + 1, 1, temp1 );
|
||||
|
||||
m_fieldsGrid->SetGridCursor( row + 1, 0 );
|
||||
m_fieldsGrid->OnMoveRowUp(
|
||||
[&]( int row )
|
||||
{
|
||||
m_fieldsGrid->SwapRows( row, row + 1 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@ -238,7 +194,7 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromGrid()
|
||||
if( !m_fieldsGrid->CommitPendingChanges() )
|
||||
return false;
|
||||
|
||||
nlohmann::ordered_map<wxString, wxString> newFields;
|
||||
m_designBlock->GetFields().clear();
|
||||
|
||||
for( int row = 0; row < m_fieldsGrid->GetNumberRows(); row++ )
|
||||
{
|
||||
@ -246,17 +202,15 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromGrid()
|
||||
fieldName.Replace( wxT( "\n" ), wxT( "" ), true ); // strip all newlines
|
||||
fieldName.Replace( wxT( " " ), wxT( " " ), true ); // double space to single
|
||||
|
||||
if( newFields.count( fieldName ) )
|
||||
if( m_designBlock->GetFields().count( fieldName ) )
|
||||
{
|
||||
wxMessageBox( _( "Duplicate fields are not allowed." ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
newFields[fieldName] = m_fieldsGrid->GetCellValue( row, 1 );
|
||||
m_designBlock->GetFields()[fieldName] = m_fieldsGrid->GetCellValue( row, 1 );
|
||||
}
|
||||
|
||||
m_designBlock->SetFields( newFields );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
|
||||
#include <dialogs/dialog_embed_files.h>
|
||||
|
||||
|
||||
DIALOG_EMBED_FILES::DIALOG_EMBED_FILES( wxWindow* aParent, const wxString& aTitle ) :
|
||||
DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
|
||||
m_contentPanel( nullptr )
|
||||
{
|
||||
// Construction delayed until after panel is installed
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EMBED_FILES::InstallPanel( wxPanel* aPanel )
|
||||
{
|
||||
m_contentPanel = aPanel;
|
||||
|
||||
// Now perform the body of the constructor
|
||||
auto mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
SetSizer( mainSizer );
|
||||
|
||||
mainSizer->Add( m_contentPanel, 1, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 5 );
|
||||
m_contentPanel->SetMinSize( FromDIP( wxSize( 1000, 600 ) ) );
|
||||
|
||||
auto sdbSizer = new wxStdDialogButtonSizer();
|
||||
auto sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
sdbSizer->AddButton( sdbSizerOK );
|
||||
auto sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
sdbSizer->AddButton( sdbSizerCancel );
|
||||
sdbSizer->Realize();
|
||||
|
||||
mainSizer->Add( sdbSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
SetupStandardButtons();
|
||||
|
||||
finishDialogSettings();
|
||||
|
||||
// On some windows manager (Unity, XFCE), this dialog is not always raised, depending
|
||||
// on how the dialog is run.
|
||||
Raise();
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_EMBED_FILES::TransferDataToWindow()
|
||||
{
|
||||
return m_contentPanel->TransferDataToWindow();
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_EMBED_FILES::TransferDataFromWindow()
|
||||
{
|
||||
/**
|
||||
* N.B. *do not* call wxDialog::TransferDataFromWindow() in the dialog code.
|
||||
*/
|
||||
return m_contentPanel->TransferDataFromWindow();
|
||||
}
|
||||
|
171
common/dialogs/dialog_generate_database_connection.cpp
Normal file
171
common/dialogs/dialog_generate_database_connection.cpp
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 KiCad Developers
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <dialogs/dialog_generate_database_connection.h>
|
||||
|
||||
#include <wx/choice.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/msgdlg.h>
|
||||
|
||||
#include <database/database_connection.h>
|
||||
#include <vector>
|
||||
|
||||
DIALOG_GENERATE_DATABASE_CONNECTION::DIALOG_GENERATE_DATABASE_CONNECTION( wxWindow* aParent ) :
|
||||
DIALOG_SHIM( aParent, wxID_ANY, _( "Generate Database Connection" ), wxDefaultPosition,
|
||||
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
|
||||
{
|
||||
wxBoxSizer* topSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_dsnChoice = new wxChoice( this, wxID_ANY );
|
||||
std::vector<std::string> dsns;
|
||||
DATABASE_CONNECTION::ListDataSources( dsns );
|
||||
|
||||
for( const std::string& d : dsns )
|
||||
m_dsnChoice->Append( d );
|
||||
|
||||
m_dsnChoice->Append( _( "Custom" ) );
|
||||
|
||||
topSizer->Add( new wxStaticText( this, wxID_ANY, _( "Data Source Name" ) ), 0, wxALL, 5 );
|
||||
topSizer->Add( m_dsnChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
||||
|
||||
wxFlexGridSizer* grid = new wxFlexGridSizer( 2, 2, 5, 5 );
|
||||
grid->AddGrowableCol( 1, 1 );
|
||||
|
||||
grid->Add( new wxStaticText( this, wxID_ANY, _( "Username" ) ), 0, wxALIGN_CENTER_VERTICAL );
|
||||
m_userCtrl = new wxTextCtrl( this, wxID_ANY );
|
||||
grid->Add( m_userCtrl, 1, wxEXPAND );
|
||||
|
||||
grid->Add( new wxStaticText( this, wxID_ANY, _( "Password" ) ), 0, wxALIGN_CENTER_VERTICAL );
|
||||
m_passCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PASSWORD );
|
||||
grid->Add( m_passCtrl, 1, wxEXPAND );
|
||||
|
||||
grid->Add( new wxStaticText( this, wxID_ANY, _( "Timeout" ) ), 0, wxALIGN_CENTER_VERTICAL );
|
||||
m_timeoutCtrl = new wxSpinCtrl( this, wxID_ANY );
|
||||
m_timeoutCtrl->SetRange( 0, 999 );
|
||||
m_timeoutCtrl->SetValue( DATABASE_CONNECTION::DEFAULT_TIMEOUT );
|
||||
grid->Add( m_timeoutCtrl, 0, wxEXPAND );
|
||||
|
||||
grid->Add( new wxStaticText( this, wxID_ANY, _( "Connection String" ) ), 0,
|
||||
wxALIGN_CENTER_VERTICAL );
|
||||
m_connStrCtrl = new wxTextCtrl( this, wxID_ANY );
|
||||
grid->Add( m_connStrCtrl, 1, wxEXPAND );
|
||||
|
||||
topSizer->Add( grid, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
||||
|
||||
m_testButton = new wxButton( this, wxID_ANY, _( "Test Connection" ) );
|
||||
topSizer->Add( m_testButton, 0, wxLEFT | wxBOTTOM, 5 );
|
||||
|
||||
topSizer->Add( new wxStaticText( this, wxID_ANY, _( "Tables" ) ), 0, wxLEFT | wxRIGHT, 5 );
|
||||
m_tableChoice = new wxChoice( this, wxID_ANY );
|
||||
m_tableChoice->Enable( false );
|
||||
topSizer->Add( m_tableChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
||||
|
||||
SetSizerAndFit( topSizer );
|
||||
|
||||
m_dsnChoice->Bind( wxEVT_CHOICE, &DIALOG_GENERATE_DATABASE_CONNECTION::OnDSNChanged, this );
|
||||
m_testButton->Bind( wxEVT_BUTTON, &DIALOG_GENERATE_DATABASE_CONNECTION::OnTest, this );
|
||||
|
||||
UpdateControls();
|
||||
SetupStandardButtons();
|
||||
}
|
||||
|
||||
DATABASE_SOURCE DIALOG_GENERATE_DATABASE_CONNECTION::GetSource() const
|
||||
{
|
||||
DATABASE_SOURCE src;
|
||||
src.type = DATABASE_SOURCE_TYPE::ODBC;
|
||||
|
||||
int sel = m_dsnChoice->GetSelection();
|
||||
if( sel != wxNOT_FOUND && sel < (int) m_dsnChoice->GetCount() - 1 )
|
||||
{
|
||||
src.dsn = m_dsnChoice->GetString( sel ).ToStdString();
|
||||
src.username = m_userCtrl->GetValue().ToStdString();
|
||||
src.password = m_passCtrl->GetValue().ToStdString();
|
||||
src.timeout = m_timeoutCtrl->GetValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
src.connection_string = m_connStrCtrl->GetValue().ToStdString();
|
||||
src.timeout = DATABASE_CONNECTION::DEFAULT_TIMEOUT;
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
void DIALOG_GENERATE_DATABASE_CONNECTION::OnDSNChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
void DIALOG_GENERATE_DATABASE_CONNECTION::UpdateControls()
|
||||
{
|
||||
bool custom = m_dsnChoice->GetSelection() == (int) m_dsnChoice->GetCount() - 1;
|
||||
|
||||
m_userCtrl->Enable( !custom );
|
||||
m_passCtrl->Enable( !custom );
|
||||
m_timeoutCtrl->Enable( !custom );
|
||||
m_connStrCtrl->Enable( custom );
|
||||
}
|
||||
|
||||
void DIALOG_GENERATE_DATABASE_CONNECTION::OnTest( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_tableChoice->Clear();
|
||||
|
||||
std::unique_ptr<DATABASE_CONNECTION> conn;
|
||||
|
||||
if( m_dsnChoice->GetSelection() != (int) m_dsnChoice->GetCount() - 1 )
|
||||
{
|
||||
wxString dsn = m_dsnChoice->GetStringSelection();
|
||||
wxString user = m_userCtrl->GetValue();
|
||||
wxString pass = m_passCtrl->GetValue();
|
||||
int timeout = m_timeoutCtrl->GetValue();
|
||||
|
||||
conn = std::make_unique<DATABASE_CONNECTION>( dsn.ToStdString(), user.ToStdString(), pass.ToStdString(),
|
||||
timeout, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
conn = std::make_unique<DATABASE_CONNECTION>( m_connStrCtrl->GetValue().ToStdString(),
|
||||
DATABASE_CONNECTION::DEFAULT_TIMEOUT, false );
|
||||
}
|
||||
|
||||
if( !conn->Connect() )
|
||||
{
|
||||
wxMessageBox( _( "Unable to connect to database" ), _( "Database Error" ), wxOK | wxICON_ERROR,
|
||||
this );
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<std::string> tables;
|
||||
|
||||
if( conn->GetTables( tables ) )
|
||||
{
|
||||
for( const std::string& t : tables )
|
||||
m_tableChoice->Append( t );
|
||||
|
||||
if( !tables.empty() )
|
||||
m_tableChoice->SetSelection( 0 );
|
||||
|
||||
m_tableChoice->Enable( true );
|
||||
}
|
||||
}
|
@ -42,6 +42,9 @@ DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS( wxWindow* aParent, wxWindow* aEventS
|
||||
m_gridSizeX( aProvider, aEventSource, m_staticTextX, m_textX, m_staticTextXUnits, true ),
|
||||
m_gridSizeY( aProvider, aEventSource, m_staticTextY, m_textY, m_staticTextYUnits, true )
|
||||
{
|
||||
// Properties dialogs don't really want state-saving/restoring
|
||||
OptOut( this );
|
||||
|
||||
SetupStandardButtons();
|
||||
SetInitialFocus( m_textName );
|
||||
|
||||
@ -83,8 +86,7 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow()
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !m_checkLinked->IsChecked()
|
||||
&& !m_gridSizeY.Validate( 0.001, 1000.0, EDA_UNITS::MM ) )
|
||||
if( !m_checkLinked->IsChecked() && !m_gridSizeY.Validate( 0.001, 1000.0, EDA_UNITS::MM ) )
|
||||
{
|
||||
wxMessageBox( _( "Grid size Y out of range." ), _( "Error" ), wxOK | wxICON_ERROR );
|
||||
return false;
|
||||
@ -94,10 +96,8 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow()
|
||||
|
||||
m_grid.name = m_textName->GetValue();
|
||||
// Grid X/Y are always stored in millimeters so we can compare them easily
|
||||
m_grid.x = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM,
|
||||
gridX );
|
||||
m_grid.y = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM,
|
||||
gridY );
|
||||
m_grid.x = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM, gridX );
|
||||
m_grid.y = EDA_UNIT_UTILS::UI::StringFromValue( m_unitsProvider->GetIuScale(), EDA_UNITS::MM, gridY );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES( EDA_DRAW_FRAME* aParent, EDA_G
|
||||
m_group( aGroup ),
|
||||
m_commit( aCommit )
|
||||
{
|
||||
// Properties dialogs don't really want state-saving/restoring
|
||||
OptOut( this );
|
||||
|
||||
m_bpAddMember->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
|
||||
m_bpRemoveMember->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
|
||||
|
||||
|
@ -101,8 +101,7 @@ std::vector<IMPORT_PROJECT_DESC> DIALOG_IMPORT_CHOOSE_PROJECT::GetProjects()
|
||||
|
||||
|
||||
std::vector<IMPORT_PROJECT_DESC>
|
||||
DIALOG_IMPORT_CHOOSE_PROJECT::RunModal( wxWindow* aParent,
|
||||
const std::vector<IMPORT_PROJECT_DESC>& aProjectDesc )
|
||||
DIALOG_IMPORT_CHOOSE_PROJECT::RunModal( wxWindow* aParent, const std::vector<IMPORT_PROJECT_DESC>& aProjectDesc )
|
||||
{
|
||||
DIALOG_IMPORT_CHOOSE_PROJECT dlg( aParent, aProjectDesc );
|
||||
|
||||
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <dialogs/dialog_locked_items_query.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
|
||||
DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent,
|
||||
std::size_t aLockedItemCount,
|
||||
PCBNEW_SETTINGS::LOCKING_OPTIONS& aLockingOptions ) :
|
||||
DIALOG_LOCKED_ITEMS_QUERY_BASE( aParent ),
|
||||
m_lockingOptions( aLockingOptions )
|
||||
{
|
||||
m_icon->SetBitmap( KiBitmapBundle( BITMAPS::locked ) );
|
||||
|
||||
m_messageLine1->SetLabel( wxString::Format( m_messageLine1->GetLabel(), aLockedItemCount ) );
|
||||
|
||||
SetupStandardButtons( { { wxID_OK, _( "Skip Locked Items" ) } } );
|
||||
m_sdbSizerOK->SetToolTip( _( "Remove locked items from the selection and only apply the "
|
||||
"operation to the unlocked items (if any)." ) );
|
||||
|
||||
m_doNotShowBtn->SetToolTip( _( "Do not show this dialog again until KiCad restarts. "
|
||||
"You can re-enable this dialog in Pcbnew preferences." ) );
|
||||
|
||||
SetInitialFocus( m_sdbSizerOK );
|
||||
|
||||
Layout();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LOCKED_ITEMS_QUERY::onOverrideLocks( wxCommandEvent& event )
|
||||
{
|
||||
// This will choose the correct way to end the dialog no matter how is was shown.
|
||||
EndDialog( wxID_APPLY );
|
||||
}
|
||||
|
||||
|
||||
int DIALOG_LOCKED_ITEMS_QUERY::ShowModal()
|
||||
{
|
||||
static int doNotShowValue = wxID_ANY;
|
||||
|
||||
if( doNotShowValue != wxID_ANY && m_lockingOptions.m_sessionSkipPrompts )
|
||||
return doNotShowValue;
|
||||
|
||||
int ret = DIALOG_SHIM::ShowModal();
|
||||
|
||||
// Has the user asked not to show the dialog again this session?
|
||||
if( m_doNotShowBtn->IsChecked() && ret != wxID_CANCEL )
|
||||
{
|
||||
doNotShowValue = ret;
|
||||
m_lockingOptions.m_sessionSkipPrompts = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_locked_items_query_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizer4;
|
||||
fgSizer4 = new wxFlexGridSizer( 0, 2, 10, 0 );
|
||||
fgSizer4->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_icon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer4->Add( m_icon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 10 );
|
||||
|
||||
wxBoxSizer* bSizer4;
|
||||
bSizer4 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_messageLine1 = new wxStaticText( this, wxID_ANY, _("The selection contains %zu locked items."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_messageLine1->Wrap( -1 );
|
||||
bSizer4->Add( m_messageLine1, 0, wxALL, 5 );
|
||||
|
||||
m_messageLine2 = new wxStaticText( this, wxID_ANY, _("These items will be skipped unless you override the locks."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_messageLine2->Wrap( -1 );
|
||||
bSizer4->Add( m_messageLine2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer4->Add( bSizer4, 1, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
|
||||
fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_doNotShowBtn = new wxCheckBox( this, wxID_ANY, _("Remember decision for this session."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_doNotShowBtn->SetToolTip( _("Remember the option selected for the remainder of this session.\nThis dialog will not be shown again until KiCad is restarted.") );
|
||||
|
||||
fgSizer4->Add( m_doNotShowBtn, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( fgSizer4, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
wxBoxSizer* bButtonSizer;
|
||||
bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_overrideBtn = new wxButton( this, wxID_ANY, _("Override Locks"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_overrideBtn->SetToolTip( _("Override locks and apply the operation on all the items selected.\nAny locked items will remain locked after the operation is complete.") );
|
||||
|
||||
bButtonSizer->Add( m_overrideBtn, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
bButtonSizer->Add( m_sdbSizer, 1, wxBOTTOM|wxTOP, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bButtonSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
bSizerMain->Fit( this );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) );
|
||||
m_overrideBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) );
|
||||
m_overrideBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this );
|
||||
|
||||
}
|
@ -1,462 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="file">dialog_locked_items_query_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">dialog_locked_items_query</property>
|
||||
<property name="path">.</property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_LOCKED_ITEMS_QUERY_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Locked Items</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="two_step_creation">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnInitDialog">OnInitDlg</event>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="true">
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols"></property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">fgSizer4</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">10</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticBitmap" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_icon</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer4</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">The selection contains %zu locked items.</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_messageLine1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">These items will be skipped unless you override the locks.</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_messageLine2</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Remember decision for this session.</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_doNotShowBtn</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Remember the option selected for the remainder of this session.
This dialog will not be shown again until KiCad is restarted.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bButtonSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Override Locks</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_overrideBtn</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Override locks and apply the operation on all the items selected.
Any locked items will remain locked after the operation is complete.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onOverrideLocks</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="true">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">1</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
<property name="Help">0</property>
|
||||
<property name="No">0</property>
|
||||
<property name="OK">1</property>
|
||||
<property name="Save">0</property>
|
||||
<property name="Yes">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
@ -27,7 +27,8 @@
|
||||
|
||||
|
||||
DIALOG_MIGRATE_SETTINGS::DIALOG_MIGRATE_SETTINGS( SETTINGS_MANAGER* aManager ) :
|
||||
DIALOG_MIGRATE_SETTINGS_BASE( nullptr ), m_manager( aManager )
|
||||
DIALOG_MIGRATE_SETTINGS_BASE( nullptr ),
|
||||
m_manager( aManager )
|
||||
{
|
||||
SetMinSize( FromDIP( GetMinSize() ) );
|
||||
m_standardButtonsCancel->SetLabel( _( "Quit KiCad" ) );
|
||||
@ -45,11 +46,6 @@ DIALOG_MIGRATE_SETTINGS::DIALOG_MIGRATE_SETTINGS( SETTINGS_MANAGER* aManager ) :
|
||||
}
|
||||
|
||||
|
||||
DIALOG_MIGRATE_SETTINGS::~DIALOG_MIGRATE_SETTINGS()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_MIGRATE_SETTINGS::TransferDataToWindow()
|
||||
{
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
@ -106,8 +102,6 @@ bool DIALOG_MIGRATE_SETTINGS::TransferDataFromWindow()
|
||||
m_manager->SetMigrationSource( wxEmptyString );
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -160,7 +154,7 @@ void DIALOG_MIGRATE_SETTINGS::OnDefaultSelected( wxCommandEvent& event )
|
||||
bool DIALOG_MIGRATE_SETTINGS::validatePath()
|
||||
{
|
||||
wxString path = m_cbPath->GetValue();
|
||||
bool valid = m_manager->IsSettingsPathValid( path );
|
||||
bool valid = SETTINGS_MANAGER::IsSettingsPathValid( path );
|
||||
|
||||
showPathError( !valid );
|
||||
m_standardButtons->GetAffirmativeButton()->Enable( valid && !path.IsEmpty() );
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <eda_draw_frame.h>
|
||||
#include <widgets/unit_binder.h>
|
||||
#include <core/type_helpers.h>
|
||||
|
||||
#include <string_utils.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/gbsizer.h>
|
||||
@ -35,7 +35,8 @@
|
||||
|
||||
WX_MULTI_ENTRY_DIALOG::WX_MULTI_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aCaption,
|
||||
std::vector<ENTRY> aEntries ) :
|
||||
DIALOG_SHIM( aParent, wxID_ANY, aCaption ), m_entries( std::move( aEntries ) )
|
||||
DIALOG_SHIM( aParent, wxID_ANY, aCaption ),
|
||||
m_entries( std::move( aEntries ) )
|
||||
{
|
||||
SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
@ -57,52 +58,41 @@ WX_MULTI_ENTRY_DIALOG::WX_MULTI_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxS
|
||||
[&]( const auto& aValue )
|
||||
{
|
||||
using EntryType = std::decay_t<decltype( aValue )>;
|
||||
|
||||
if constexpr( std::is_same_v<EntryType, UNIT_BOUND> )
|
||||
{
|
||||
// Label / Entry / Unit
|
||||
// and a binder
|
||||
wxStaticText* label =
|
||||
new wxStaticText( this, wxID_ANY, entry.m_label, wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
wxStaticText* label = new wxStaticText( this, wxID_ANY, entry.m_label );
|
||||
label->Wrap( -1 );
|
||||
bSizerContent->Add( label, wxGBPosition( gbRow, 0 ), wxGBSpan( 1, 1 ),
|
||||
wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxLEFT,
|
||||
5 );
|
||||
wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxLEFT, 5 );
|
||||
|
||||
wxTextCtrl* textCtrl =
|
||||
new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
wxTextCtrl* textCtrl = new wxTextCtrl( this, wxID_ANY );
|
||||
bSizerContent->Add( textCtrl, wxGBPosition( gbRow, 1 ), wxGBSpan( 1, 1 ),
|
||||
wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 5 );
|
||||
|
||||
wxStaticText* unit_label = new wxStaticText(
|
||||
this, wxID_ANY, _( "unit" ), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
unit_label->Wrap( -1 );
|
||||
bSizerContent->Add( unit_label, wxGBPosition( gbRow, 2 ), wxGBSpan( 1, 1 ),
|
||||
wxTOP | wxBOTTOM | wxRIGHT | wxALIGN_CENTER_VERTICAL,
|
||||
5 );
|
||||
wxStaticText* units = new wxStaticText( this, wxID_ANY, _( "unit" ) );
|
||||
units->Wrap( -1 );
|
||||
bSizerContent->Add( units, wxGBPosition( gbRow, 2 ), wxGBSpan( 1, 1 ),
|
||||
wxTOP | wxBOTTOM | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
if( !entry.m_tooltip.IsEmpty() )
|
||||
textCtrl->SetToolTip( entry.m_tooltip );
|
||||
|
||||
m_controls.push_back( textCtrl );
|
||||
m_unit_binders.push_back( std::make_unique<UNIT_BINDER>(
|
||||
aParent, label, textCtrl, unit_label ) );
|
||||
m_unit_binders.push_back( std::make_unique<UNIT_BINDER>( aParent, label, textCtrl, units ) );
|
||||
|
||||
m_unit_binders.back()->SetValue( aValue.m_default );
|
||||
}
|
||||
else if constexpr( std::is_same_v<EntryType, CHECKBOX> )
|
||||
{
|
||||
// Checkbox across all 3 cols
|
||||
wxCheckBox* checkBox =
|
||||
new wxCheckBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
wxCheckBox* checkBox = new wxCheckBox( this, wxID_ANY, entry.m_label );
|
||||
checkBox->SetValue( aValue.m_default );
|
||||
bSizerContent->Add( checkBox, wxGBPosition( gbRow, 0 ), wxGBSpan( 1, 3 ),
|
||||
wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||
|
||||
checkBox->SetLabel( entry.m_label );
|
||||
checkBox->SetValue( aValue.m_default );
|
||||
|
||||
if( !entry.m_tooltip.IsEmpty() )
|
||||
checkBox->SetToolTip( entry.m_tooltip );
|
||||
|
||||
@ -131,6 +121,10 @@ WX_MULTI_ENTRY_DIALOG::WX_MULTI_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxS
|
||||
|
||||
bSizerMain->Add( sdbSizer1, 0, wxALL | wxEXPAND, 5 );
|
||||
|
||||
// DIALOG_SHIM needs a title--specific hash_key so we don't save/restore state between
|
||||
// usage cases.
|
||||
m_hash_key = TO_UTF8( GetTitle() );
|
||||
|
||||
SetSizer( bSizerMain );
|
||||
SetupStandardButtons();
|
||||
Layout();
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <drawing_sheet/ds_painter.h>
|
||||
#include <string_utils.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <widgets/filedlg_open_embed_file.h>
|
||||
#include <widgets/filedlg_hook_embed_file.h>
|
||||
#include <wx/valgen.h>
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/filedlg.h>
|
||||
@ -78,9 +78,8 @@ static const wxString pageFmts[] =
|
||||
// to be recognized in code
|
||||
};
|
||||
|
||||
DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* aParent,
|
||||
EMBEDDED_FILES* aEmbeddedFiles, double aIuPerMils,
|
||||
const VECTOR2D& aMaxUserSizeMils ) :
|
||||
DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* aParent, EMBEDDED_FILES* aEmbeddedFiles,
|
||||
double aIuPerMils, const VECTOR2D& aMaxUserSizeMils ) :
|
||||
DIALOG_PAGES_SETTINGS_BASE( aParent ),
|
||||
m_parent( aParent ),
|
||||
m_screen( m_parent->GetScreen() ),
|
||||
@ -479,9 +478,7 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
|
||||
BASE_SCREEN::m_DrawingSheetFileName = fileName;
|
||||
|
||||
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName, &msg ) )
|
||||
{
|
||||
DisplayErrorMessage( this, wxString::Format( _( "Error loading drawing sheet '%s'." ), fullFileName ), msg );
|
||||
}
|
||||
|
||||
m_localPrjConfigChanged = true;
|
||||
|
||||
@ -506,36 +503,21 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
|
||||
else
|
||||
{
|
||||
// search for longest common string first, e.g. A4 before A
|
||||
if( paperType.Contains( PAGE_INFO::USLetter ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::USLetter );
|
||||
else if( paperType.Contains( PAGE_INFO::USLegal ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::USLegal );
|
||||
else if( paperType.Contains( PAGE_INFO::USLedger ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::USLedger );
|
||||
else if( paperType.Contains( PAGE_INFO::GERBER ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::GERBER );
|
||||
else if( paperType.Contains( PAGE_INFO::A5 ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::A5 );
|
||||
else if( paperType.Contains( PAGE_INFO::A4 ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::A4 );
|
||||
else if( paperType.Contains( PAGE_INFO::A3 ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::A3 );
|
||||
else if( paperType.Contains( PAGE_INFO::A2 ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::A2 );
|
||||
else if( paperType.Contains( PAGE_INFO::A1 ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::A1 );
|
||||
else if( paperType.Contains( PAGE_INFO::A0 ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::A0 );
|
||||
else if( paperType.Contains( PAGE_INFO::A ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::A );
|
||||
else if( paperType.Contains( PAGE_INFO::B ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::B );
|
||||
else if( paperType.Contains( PAGE_INFO::C ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::C );
|
||||
else if( paperType.Contains( PAGE_INFO::D ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::D );
|
||||
else if( paperType.Contains( PAGE_INFO::E ) )
|
||||
success = m_pageInfo.SetType( PAGE_INFO::E );
|
||||
if( paperType.Contains( PAGE_INFO::USLetter ) ) success = m_pageInfo.SetType( PAGE_INFO::USLetter );
|
||||
else if( paperType.Contains( PAGE_INFO::USLegal ) ) success = m_pageInfo.SetType( PAGE_INFO::USLegal );
|
||||
else if( paperType.Contains( PAGE_INFO::USLedger ) ) success = m_pageInfo.SetType( PAGE_INFO::USLedger );
|
||||
else if( paperType.Contains( PAGE_INFO::GERBER ) ) success = m_pageInfo.SetType( PAGE_INFO::GERBER );
|
||||
else if( paperType.Contains( PAGE_INFO::A5 ) ) success = m_pageInfo.SetType( PAGE_INFO::A5 );
|
||||
else if( paperType.Contains( PAGE_INFO::A4 ) ) success = m_pageInfo.SetType( PAGE_INFO::A4 );
|
||||
else if( paperType.Contains( PAGE_INFO::A3 ) ) success = m_pageInfo.SetType( PAGE_INFO::A3 );
|
||||
else if( paperType.Contains( PAGE_INFO::A2 ) ) success = m_pageInfo.SetType( PAGE_INFO::A2 );
|
||||
else if( paperType.Contains( PAGE_INFO::A1 ) ) success = m_pageInfo.SetType( PAGE_INFO::A1 );
|
||||
else if( paperType.Contains( PAGE_INFO::A0 ) ) success = m_pageInfo.SetType( PAGE_INFO::A0 );
|
||||
else if( paperType.Contains( PAGE_INFO::A ) ) success = m_pageInfo.SetType( PAGE_INFO::A );
|
||||
else if( paperType.Contains( PAGE_INFO::B ) ) success = m_pageInfo.SetType( PAGE_INFO::B );
|
||||
else if( paperType.Contains( PAGE_INFO::C ) ) success = m_pageInfo.SetType( PAGE_INFO::C );
|
||||
else if( paperType.Contains( PAGE_INFO::D ) ) success = m_pageInfo.SetType( PAGE_INFO::D );
|
||||
else if( paperType.Contains( PAGE_INFO::E ) ) success = m_pageInfo.SetType( PAGE_INFO::E );
|
||||
|
||||
if( success )
|
||||
{
|
||||
@ -799,9 +781,8 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
// Display a file picker dialog
|
||||
FILEDLG_OPEN_EMBED_FILE customize;
|
||||
wxFileDialog fileDialog( this, _( "Drawing Sheet File" ), path, name,
|
||||
FILEEXT::DrawingSheetFileWildcard(),
|
||||
FILEDLG_HOOK_EMBED_FILE customize;
|
||||
wxFileDialog fileDialog( this, _( "Drawing Sheet File" ), path, name, FILEEXT::DrawingSheetFileWildcard(),
|
||||
wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( m_embeddedFiles )
|
||||
|
@ -24,28 +24,21 @@
|
||||
#include <dialogs/dialog_paste_special.h>
|
||||
|
||||
|
||||
static PASTE_MODE g_paste_mode = PASTE_MODE::UNIQUE_ANNOTATIONS;
|
||||
|
||||
|
||||
DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent,
|
||||
PASTE_MODE* aMode,
|
||||
const wxString& aReplacement ) :
|
||||
DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent, PASTE_MODE* aMode, const wxString& aDefaultRef ) :
|
||||
DIALOG_PASTE_SPECIAL_BASE( aParent ),
|
||||
m_mode( aMode )
|
||||
{
|
||||
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::UNIQUE_ANNOTATIONS ),
|
||||
_( "Finds the next available reference designator for "
|
||||
"any designators that already exist in the design." ) );
|
||||
m_options->SetItemToolTip( static_cast<int>( PASTE_MODE::UNIQUE_ANNOTATIONS ),
|
||||
_( "Finds the next available reference designator for any designators that already "
|
||||
"exist in the design." ) );
|
||||
|
||||
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::KEEP_ANNOTATIONS ),
|
||||
m_options->SetItemToolTip( static_cast<int>( PASTE_MODE::KEEP_ANNOTATIONS ),
|
||||
wxT( "" ) ); // Self explanatory
|
||||
|
||||
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::REMOVE_ANNOTATIONS ),
|
||||
wxString::Format( _( "Replaces reference designators "
|
||||
"with '%s'." ),
|
||||
aReplacement ) );
|
||||
m_options->SetItemToolTip( static_cast<int>( PASTE_MODE::REMOVE_ANNOTATIONS ),
|
||||
wxString::Format( _( "Replaces reference designators with '%s'." ), aDefaultRef ) );
|
||||
|
||||
m_pasteOptions->SetFocus();
|
||||
m_options->SetFocus();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
@ -54,14 +47,26 @@ DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent,
|
||||
|
||||
bool DIALOG_PASTE_SPECIAL::TransferDataToWindow()
|
||||
{
|
||||
m_pasteOptions->SetSelection( static_cast<int>( g_paste_mode ) );
|
||||
switch( *m_mode )
|
||||
{
|
||||
case PASTE_MODE::UNIQUE_ANNOTATIONS: m_options->SetSelection( 0 ); break;
|
||||
case PASTE_MODE::KEEP_ANNOTATIONS: m_options->SetSelection( 1 ); break;
|
||||
case PASTE_MODE::REMOVE_ANNOTATIONS: m_options->SetSelection( 2 ); break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_PASTE_SPECIAL::TransferDataFromWindow()
|
||||
{
|
||||
g_paste_mode = *m_mode = static_cast<PASTE_MODE>( m_pasteOptions->GetSelection() );
|
||||
switch( m_options->GetSelection() )
|
||||
{
|
||||
case 0: *m_mode = PASTE_MODE::UNIQUE_ANNOTATIONS; break;
|
||||
case 1: *m_mode = PASTE_MODE::KEEP_ANNOTATIONS; break;
|
||||
case 2: *m_mode = PASTE_MODE::REMOVE_ANNOTATIONS; break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,11 @@ DIALOG_PASTE_SPECIAL_BASE::DIALOG_PASTE_SPECIAL_BASE( wxWindow* parent, wxWindow
|
||||
wxBoxSizer* optionsSizer;
|
||||
optionsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxString m_pasteOptionsChoices[] = { _("Assign unique reference designators to pasted symbols"), _("Keep existing reference designators, even if they are duplicated"), _("Clear reference designators on all pasted symbols") };
|
||||
int m_pasteOptionsNChoices = sizeof( m_pasteOptionsChoices ) / sizeof( wxString );
|
||||
m_pasteOptions = new wxRadioBox( this, wxID_ANY, _("Reference Designators"), wxDefaultPosition, wxDefaultSize, m_pasteOptionsNChoices, m_pasteOptionsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_pasteOptions->SetSelection( 1 );
|
||||
optionsSizer->Add( m_pasteOptions, 0, wxALL, 5 );
|
||||
wxString m_optionsChoices[] = { _("Assign unique reference designators to pasted symbols"), _("Keep existing reference designators, even if they are duplicated"), _("Clear reference designators on all pasted symbols") };
|
||||
int m_optionsNChoices = sizeof( m_optionsChoices ) / sizeof( wxString );
|
||||
m_options = new wxRadioBox( this, wxID_ANY, _("Reference Designators"), wxDefaultPosition, wxDefaultSize, m_optionsNChoices, m_optionsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_options->SetSelection( 1 );
|
||||
optionsSizer->Add( m_options, 0, wxALL, 5 );
|
||||
|
||||
m_clearNetsCB = new wxCheckBox( this, wxID_ANY, _("Clear net assignments"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_clearNetsCB->SetToolTip( _("Remove the net information from all connected items before pasting") );
|
||||
@ -50,12 +50,12 @@ DIALOG_PASTE_SPECIAL_BASE::DIALOG_PASTE_SPECIAL_BASE( wxWindow* parent, wxWindow
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_pasteOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
|
||||
m_options->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_PASTE_SPECIAL_BASE::~DIALOG_PASTE_SPECIAL_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_pasteOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
|
||||
m_options->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PASTE_SPECIAL_BASE::onRadioBoxEvent ), NULL, this );
|
||||
|
||||
}
|
||||
|
@ -116,7 +116,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_pasteOptions</property>
|
||||
<property name="name">m_options</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -32,7 +32,7 @@ class DIALOG_PASTE_SPECIAL_BASE : public DIALOG_SHIM
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxRadioBox* m_pasteOptions;
|
||||
wxRadioBox* m_options;
|
||||
wxCheckBox* m_clearNetsCB;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
|
@ -147,29 +147,20 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow()
|
||||
|
||||
int DIALOG_PLUGIN_OPTIONS::appendRow()
|
||||
{
|
||||
int row = m_grid->GetNumberRows();
|
||||
|
||||
m_grid->AppendRows( 1 );
|
||||
|
||||
// wx documentation is wrong, SetGridCursor does not make visible.
|
||||
m_grid->MakeCellVisible( row, 0 );
|
||||
m_grid->SetGridCursor( row, 0 );
|
||||
|
||||
return row;
|
||||
return m_grid->GetNumberRows() - 1;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLUGIN_OPTIONS::appendOption()
|
||||
int DIALOG_PLUGIN_OPTIONS::appendOption()
|
||||
{
|
||||
int selected_row = m_listbox->GetSelection();
|
||||
if( selected_row != wxNOT_FOUND )
|
||||
int row = m_listbox->GetSelection();
|
||||
|
||||
if( row != wxNOT_FOUND )
|
||||
{
|
||||
wxString option = m_listbox->GetString( selected_row );
|
||||
wxString option = m_listbox->GetString( row );
|
||||
|
||||
int row_count = m_grid->GetNumberRows();
|
||||
int row;
|
||||
|
||||
for( row=0; row<row_count; ++row )
|
||||
for( row = 0; row < m_grid->GetNumberRows(); ++row )
|
||||
{
|
||||
wxString col0 = m_grid->GetCellValue( row, 0 );
|
||||
|
||||
@ -177,12 +168,14 @@ void DIALOG_PLUGIN_OPTIONS::appendOption()
|
||||
break;
|
||||
}
|
||||
|
||||
if( row == row_count )
|
||||
if( row == m_grid->GetNumberRows() )
|
||||
row = appendRow();
|
||||
|
||||
m_grid->SetCellValue( row, 0, option );
|
||||
m_grid_widths_dirty = true;
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
@ -211,35 +204,32 @@ void DIALOG_PLUGIN_OPTIONS::onListBoxItemDoubleClicked( wxCommandEvent& event )
|
||||
|
||||
void DIALOG_PLUGIN_OPTIONS::onAppendOption( wxCommandEvent& )
|
||||
{
|
||||
if( !m_grid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
appendOption();
|
||||
m_grid->OnAddRow(
|
||||
[&]() -> std::pair<int, int>
|
||||
{
|
||||
return { appendOption(), -1 };
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLUGIN_OPTIONS::onAppendRow( wxCommandEvent& )
|
||||
{
|
||||
if( !m_grid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
appendRow();
|
||||
m_grid->OnAddRow(
|
||||
[&]() -> std::pair<int, int>
|
||||
{
|
||||
return { appendRow(), 0 };
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLUGIN_OPTIONS::onDeleteRow( wxCommandEvent& )
|
||||
{
|
||||
if( !m_grid->CommitPendingChanges() )
|
||||
return;
|
||||
|
||||
int curRow = m_grid->GetGridCursorRow();
|
||||
|
||||
m_grid->DeleteRows( curRow );
|
||||
m_grid->OnDeleteRows(
|
||||
[&]( int row )
|
||||
{
|
||||
m_grid->DeleteRows( row );
|
||||
m_grid_widths_dirty = true;
|
||||
|
||||
curRow = std::max( 0, curRow - 1 );
|
||||
m_grid->MakeCellVisible( curRow, m_grid->GetGridCursorCol() );
|
||||
m_grid->SetGridCursor( curRow, m_grid->GetGridCursorCol() );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,6 +33,8 @@
|
||||
static constexpr double MIN_SCALE = 0.01;
|
||||
static constexpr double MAX_SCALE = 100.0;
|
||||
|
||||
wxPrintData* DIALOG_PRINT_GENERIC::s_printData = nullptr;
|
||||
wxPageSetupDialogData* DIALOG_PRINT_GENERIC::s_pageSetupData = nullptr;
|
||||
|
||||
|
||||
/**
|
||||
@ -43,9 +45,8 @@ static constexpr double MAX_SCALE = 100.0;
|
||||
class KI_PREVIEW_FRAME : public wxPreviewFrame
|
||||
{
|
||||
public:
|
||||
KI_PREVIEW_FRAME( wxPrintPreview* aPreview, wxWindow* aParent,
|
||||
const wxString& aTitle, const wxPoint& aPos = wxDefaultPosition,
|
||||
const wxSize& aSize = wxDefaultSize ) :
|
||||
KI_PREVIEW_FRAME( wxPrintPreview* aPreview, wxWindow* aParent, const wxString& aTitle,
|
||||
const wxPoint& aPos = wxDefaultPosition, const wxSize& aSize = wxDefaultSize ) :
|
||||
wxPreviewFrame( aPreview, aParent, aTitle, aPos, aSize )
|
||||
{
|
||||
}
|
||||
@ -85,16 +86,10 @@ wxPoint KI_PREVIEW_FRAME::s_pos;
|
||||
wxSize KI_PREVIEW_FRAME::s_size;
|
||||
|
||||
|
||||
DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SETTINGS* aSettings )
|
||||
: DIALOG_PRINT_GENERIC_BASE( aParent ),
|
||||
m_config( nullptr ),
|
||||
DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SETTINGS* aSettings ) :
|
||||
DIALOG_PRINT_GENERIC_BASE( aParent ),
|
||||
m_settings( aSettings )
|
||||
{
|
||||
// Note: for the validator, min value is 0.0, to allow typing values like 0.5
|
||||
// that start by 0
|
||||
m_scaleValidator.SetRange( 0.0, MAX_SCALE );
|
||||
m_scaleCustomText->SetValidator( m_scaleValidator );
|
||||
|
||||
// Show m_panelPrinters only if there are printers to list:
|
||||
m_panelPrinters->Show( m_panelPrinters->AsPrintersAvailable() );
|
||||
|
||||
@ -114,22 +109,10 @@ DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SE
|
||||
}
|
||||
|
||||
|
||||
DIALOG_PRINT_GENERIC::~DIALOG_PRINT_GENERIC()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PRINT_GENERIC::ForcePrintBorder( bool aValue )
|
||||
{
|
||||
m_titleBlock->SetValue( aValue );
|
||||
m_titleBlock->Hide();
|
||||
|
||||
if( m_config )
|
||||
{
|
||||
m_settings->Load( m_config );
|
||||
m_settings->m_titleBlock = aValue;
|
||||
m_settings->Save( m_config );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -138,27 +121,27 @@ void DIALOG_PRINT_GENERIC::saveSettings()
|
||||
m_settings->m_scale = getScaleValue();
|
||||
m_settings->m_titleBlock = m_titleBlock->GetValue();
|
||||
m_settings->m_blackWhite = m_outputMode->GetSelection();
|
||||
|
||||
if( m_config )
|
||||
m_settings->Save( m_config );
|
||||
}
|
||||
|
||||
|
||||
double DIALOG_PRINT_GENERIC::getScaleValue()
|
||||
{
|
||||
if( m_scale1->GetValue() )
|
||||
{
|
||||
return 1.0;
|
||||
|
||||
if( m_scaleFit->GetValue() )
|
||||
}
|
||||
else if( m_scaleFit->GetValue() )
|
||||
{
|
||||
return 0.0;
|
||||
|
||||
if( m_scaleCustom->GetValue() )
|
||||
}
|
||||
else if( m_scaleCustom->GetValue() )
|
||||
{
|
||||
double scale = 1.0;;
|
||||
|
||||
if( !m_scaleCustomText->GetValue().ToDouble( &scale ) )
|
||||
{
|
||||
DisplayInfoMessage( nullptr, _( "Warning: scale is not a number." ) );
|
||||
DisplayInfoMessage( nullptr, _( "Warning: custom scale is not a number." ) );
|
||||
setScaleValue( 1.0 );
|
||||
scale = 1.0;
|
||||
}
|
||||
|
||||
@ -166,17 +149,15 @@ double DIALOG_PRINT_GENERIC::getScaleValue()
|
||||
{
|
||||
scale = MAX_SCALE;
|
||||
setScaleValue( scale );
|
||||
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: scale set to a very large "
|
||||
"value.\nIt will be clamped to %f." ),
|
||||
scale ) );
|
||||
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: custom scale is too large.\n"
|
||||
"It will be clamped to %f." ), scale ) );
|
||||
}
|
||||
else if( scale < MIN_SCALE )
|
||||
{
|
||||
scale = MIN_SCALE;
|
||||
setScaleValue( scale );
|
||||
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: scale set to a very small "
|
||||
"value.\nIt will be clamped to %f." ),
|
||||
scale ) );
|
||||
DisplayInfoMessage( nullptr, wxString::Format( _( "Warning: custom scale is too small.\n"
|
||||
"It will be clamped to %f." ), scale ) );
|
||||
}
|
||||
|
||||
return scale;
|
||||
@ -218,9 +199,6 @@ bool DIALOG_PRINT_GENERIC::TransferDataToWindow()
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
return false;
|
||||
|
||||
if( m_config )
|
||||
m_settings->Load( m_config );
|
||||
|
||||
setScaleValue( m_settings->m_scale );
|
||||
m_titleBlock->SetValue( m_settings->m_titleBlock );
|
||||
m_outputMode->SetSelection( m_settings->m_blackWhite ? 1 : 0 );
|
||||
@ -234,7 +212,7 @@ void DIALOG_PRINT_GENERIC::onPageSetup( wxCommandEvent& event )
|
||||
wxPageSetupDialog pageSetupDialog( this, s_pageSetupData );
|
||||
pageSetupDialog.ShowModal();
|
||||
|
||||
(*s_PrintData) = pageSetupDialog.GetPageSetupDialogData().GetPrintData();
|
||||
(*s_printData ) = pageSetupDialog.GetPageSetupDialogData().GetPrintData();
|
||||
(*s_pageSetupData) = pageSetupDialog.GetPageSetupDialogData();
|
||||
}
|
||||
|
||||
@ -255,12 +233,11 @@ void DIALOG_PRINT_GENERIC::onPrintPreview( wxCommandEvent& event )
|
||||
if( m_panelPrinters )
|
||||
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||
|
||||
s_PrintData->SetPrinterName( selectedPrinterName );
|
||||
s_printData->SetPrinterName( selectedPrinterName );
|
||||
|
||||
// Pass two printout objects: for preview, and possible printing.
|
||||
wxString title = _( "Print Preview" );
|
||||
wxPrintPreview* preview =
|
||||
new wxPrintPreview( createPrintout( title ), createPrintout( title ), s_PrintData );
|
||||
wxPrintPreview* preview = new wxPrintPreview( createPrintout( title ), createPrintout( title ), s_printData );
|
||||
|
||||
preview->SetZoom( 100 );
|
||||
|
||||
@ -313,9 +290,9 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
|
||||
if( m_panelPrinters )
|
||||
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||
|
||||
s_PrintData->SetPrinterName( selectedPrinterName );
|
||||
s_printData->SetPrinterName( selectedPrinterName );
|
||||
|
||||
wxPrintDialogData printDialogData( *s_PrintData );
|
||||
wxPrintDialogData printDialogData( *s_printData );
|
||||
printDialogData.SetMaxPage( m_settings->m_pageCount );
|
||||
|
||||
wxPrinter printer( &printDialogData );
|
||||
@ -331,7 +308,7 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
|
||||
}
|
||||
else
|
||||
{
|
||||
*s_PrintData = printer.GetPrintDialogData().GetPrintData();
|
||||
*s_printData = printer.GetPrintDialogData().GetPrintData();
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,38 +341,39 @@ void DIALOG_PRINT_GENERIC::onSetCustomScale( wxCommandEvent& event )
|
||||
|
||||
void DIALOG_PRINT_GENERIC::initPrintData()
|
||||
{
|
||||
if( !s_PrintData ) // First print
|
||||
if( !s_printData ) // First print
|
||||
{
|
||||
s_PrintData = new wxPrintData();
|
||||
s_printData = new wxPrintData();
|
||||
|
||||
if( !s_PrintData->Ok() )
|
||||
if( !s_printData->Ok() )
|
||||
DisplayError( this, _( "An error occurred initializing the printer information." ) );
|
||||
|
||||
s_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGH;
|
||||
s_printData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGH;
|
||||
}
|
||||
|
||||
if( !s_pageSetupData )
|
||||
{
|
||||
const PAGE_INFO& pageInfo = m_settings->m_pageInfo;
|
||||
|
||||
s_pageSetupData = new wxPageSetupDialogData( *s_PrintData );
|
||||
s_pageSetupData = new wxPageSetupDialogData( *s_printData );
|
||||
s_pageSetupData->SetPaperId( pageInfo.GetPaperId() );
|
||||
s_pageSetupData->GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
|
||||
|
||||
if( pageInfo.IsCustom() )
|
||||
{
|
||||
if( pageInfo.IsPortrait() )
|
||||
{
|
||||
s_pageSetupData->SetPaperSize( wxSize( EDA_UNIT_UTILS::Mils2mm( pageInfo.GetWidthMils() ),
|
||||
EDA_UNIT_UTILS::Mils2mm( pageInfo.GetHeightMils() ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
s_pageSetupData->SetPaperSize( wxSize( EDA_UNIT_UTILS::Mils2mm( pageInfo.GetHeightMils() ),
|
||||
EDA_UNIT_UTILS::Mils2mm( pageInfo.GetWidthMils() ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
*s_PrintData = s_pageSetupData->GetPrintData();
|
||||
*s_printData = s_pageSetupData->GetPrintData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxPrintData* DIALOG_PRINT_GENERIC::s_PrintData = nullptr;
|
||||
wxPageSetupDialogData* DIALOG_PRINT_GENERIC::s_pageSetupData = nullptr;
|
||||
|
@ -85,8 +85,6 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
|
||||
bSizerScaleCustom->Add( m_scaleCustom, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_scaleCustomText = new wxTextCtrl( bScaleSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_scaleCustomText->SetToolTip( _("Set X scale adjust for exact scale plotting") );
|
||||
|
||||
bSizerScaleCustom->Add( m_scaleCustomText, 1, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
|
||||
|
@ -674,7 +674,7 @@
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Set X scale adjust for exact scale plotting</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style"></property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
|
@ -81,6 +81,12 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
|
||||
bSizerBottom->Add( m_cbSchParity, 0, wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerBottom->Add( 0, 3, 0, wxEXPAND, 5 );
|
||||
|
||||
m_cbRefillZones = new wxCheckBox( this, wxID_ANY, _("Refill all zones before performing DRC"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerBottom->Add( m_cbRefillZones, 0, wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||
@ -95,7 +101,6 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
bSizerMain->Fit( this );
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_RC_JOB_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">443,239</property>
|
||||
<property name="size">443,255</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h; forward_declare</property>
|
||||
<property name="title"></property>
|
||||
@ -774,6 +774,81 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">3</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Refill all zones before performing DRC</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbRefillZones</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
|
@ -46,6 +46,7 @@ class KICOMMON_API DIALOG_RC_JOB_BASE : public DIALOG_SHIM
|
||||
wxCheckBox* m_cbHaltOutput;
|
||||
wxCheckBox* m_cbAllTrackViolations;
|
||||
wxCheckBox* m_cbSchParity;
|
||||
wxCheckBox* m_cbRefillZones;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
wxButton* m_sdbSizer1Cancel;
|
||||
@ -56,7 +57,7 @@ class KICOMMON_API DIALOG_RC_JOB_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 443,239 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 443,255 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
~DIALOG_RC_JOB_BASE();
|
||||
|
||||
|
@ -22,12 +22,11 @@
|
||||
*/
|
||||
|
||||
#include <dialogs/dialog_text_entry.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
|
||||
WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent,
|
||||
const wxString& aFieldLabel,
|
||||
const wxString& aCaption,
|
||||
const wxString& aDefaultValue,
|
||||
WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent, const wxString& aFieldLabel,
|
||||
const wxString& aCaption, const wxString& aDefaultValue,
|
||||
bool aExtraWidth ) :
|
||||
WX_TEXT_ENTRY_DIALOG_BASE( aParent, wxID_ANY, aCaption, wxDefaultPosition, wxDefaultSize )
|
||||
{
|
||||
@ -39,6 +38,10 @@ WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent,
|
||||
m_textCtrl->SetValue( aDefaultValue );
|
||||
m_textCtrl->SetMinSize( FromDIP( aExtraWidth ? wxSize( 700, -1 ) : wxSize( 300, -1 ) ) );
|
||||
|
||||
// DIALOG_SHIM needs a title- and label-specific hash_key so we don't save/restore state between
|
||||
// usage cases.
|
||||
m_hash_key = TO_UTF8( aCaption + aFieldLabel );
|
||||
|
||||
SetupStandardButtons();
|
||||
|
||||
SetInitialFocus( m_textCtrl );
|
||||
@ -48,34 +51,6 @@ WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent,
|
||||
}
|
||||
|
||||
|
||||
WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG( wxWindow* aParent, const wxString& aLabel,
|
||||
const wxString& aCaption,
|
||||
const wxString& aDefaultValue,
|
||||
const wxString& aChoiceCaption,
|
||||
const std::vector<wxString>& aChoices,
|
||||
int aDefaultChoice ) :
|
||||
WX_TEXT_ENTRY_DIALOG( aParent, aLabel, aCaption, aDefaultValue )
|
||||
{
|
||||
m_choiceLabel->SetLabel( aChoiceCaption );
|
||||
m_choiceLabel->Show( true );
|
||||
|
||||
for( const wxString& choice : aChoices )
|
||||
m_choice->Append( choice );
|
||||
|
||||
m_choice->SetSelection( aDefaultChoice );
|
||||
m_choice->Show( true );
|
||||
|
||||
this->Layout();
|
||||
m_mainSizer->Fit( this );
|
||||
}
|
||||
|
||||
|
||||
void WX_TEXT_ENTRY_DIALOG::SetTextValidator( wxTextValidatorStyle style )
|
||||
{
|
||||
SetTextValidator( wxTextValidator(style) );
|
||||
}
|
||||
|
||||
|
||||
void WX_TEXT_ENTRY_DIALOG::SetTextValidator( const wxTextValidator& validator )
|
||||
{
|
||||
m_textCtrl->SetValidator( validator );
|
||||
@ -88,8 +63,3 @@ wxString WX_TEXT_ENTRY_DIALOG::GetValue() const
|
||||
}
|
||||
|
||||
|
||||
int WX_TEXT_ENTRY_DIALOG::GetChoice() const
|
||||
{
|
||||
return m_choice->GetCurrentSelection();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -26,25 +26,6 @@ WX_TEXT_ENTRY_DIALOG_BASE::WX_TEXT_ENTRY_DIALOG_BASE( wxWindow* parent, wxWindow
|
||||
|
||||
m_ContentSizer->Add( m_textCtrl, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
wxBoxSizer* bSizer3;
|
||||
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_choiceLabel = new wxStaticText( this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_choiceLabel->Wrap( -1 );
|
||||
m_choiceLabel->Hide();
|
||||
|
||||
bSizer3->Add( m_choiceLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxArrayString m_choiceChoices;
|
||||
m_choice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceChoices, 0 );
|
||||
m_choice->SetSelection( 0 );
|
||||
m_choice->Hide();
|
||||
|
||||
bSizer3->Add( m_choice, 3, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
m_ContentSizer->Add( bSizer3, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( m_ContentSizer, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
@ -1,34 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="17"/>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_text_entry_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">dialog_text_entry_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
@ -80,10 +82,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -142,10 +144,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -169,7 +171,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">300,-1</property>
|
||||
@ -198,144 +200,6 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer3</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">1</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">MyLabel</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_choiceLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">3</property>
|
||||
<object class="wxChoice" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices"></property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">1</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_choice</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -18,14 +18,12 @@
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class WX_TEXT_ENTRY_DIALOG_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -37,8 +35,6 @@ class WX_TEXT_ENTRY_DIALOG_BASE : public DIALOG_SHIM
|
||||
wxBoxSizer* m_mainSizer;
|
||||
wxStaticText* m_label;
|
||||
wxTextCtrl* m_textCtrl;
|
||||
wxStaticText* m_choiceLabel;
|
||||
wxChoice* m_choice;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
wxButton* m_sdbSizer1Cancel;
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <dialogs/dialog_unit_entry.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
|
||||
WX_UNIT_ENTRY_DIALOG::WX_UNIT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aCaption,
|
||||
@ -34,6 +35,10 @@ WX_UNIT_ENTRY_DIALOG::WX_UNIT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxStr
|
||||
m_label->SetLabel( aLabel );
|
||||
m_unit_binder.SetValue( aDefaultValue );
|
||||
|
||||
// DIALOG_SHIM needs a title- and label-specific hash_key so we don't save/restore state between
|
||||
// usage cases.
|
||||
m_hash_key = TO_UTF8( aCaption + aLabel );
|
||||
|
||||
SetInitialFocus( m_textCtrl );
|
||||
SetupStandardButtons();
|
||||
|
||||
@ -66,6 +71,10 @@ WX_PT_ENTRY_DIALOG::WX_PT_ENTRY_DIALOG( EDA_DRAW_FRAME* aParent, const wxString&
|
||||
m_unit_binder_x.SetValue( aDefaultValue.x );
|
||||
m_unit_binder_y.SetValue( aDefaultValue.y );
|
||||
|
||||
// DIALOG_SHIM needs a title- and label-specific hash_key so we don't save/restore state between
|
||||
// usage cases.
|
||||
m_hash_key = TO_UTF8( aCaption + aLabelX + aLabelY );
|
||||
|
||||
SetInitialFocus( m_textCtrlX );
|
||||
SetupStandardButtons();
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <eda_draw_frame.h>
|
||||
#include <string_utils.h>
|
||||
#include <macros.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include "lib_tree_model_adapter.h"
|
||||
|
||||
// wxWidgets spends *far* too long calculating column widths (most of it, believe it or
|
||||
@ -78,6 +79,22 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( wxWindow* aParent, const wxString& aTitle, boo
|
||||
}
|
||||
|
||||
|
||||
void EDA_LIST_DIALOG::AddExtraCheckbox( const wxString& aLabel, bool* aValuePtr )
|
||||
{
|
||||
wxCHECK2_MSG( aValuePtr, return, wxT( "Null pointer for checkbox value." ) );
|
||||
|
||||
int flags = wxBOTTOM;
|
||||
|
||||
if( m_ExtrasSizer->GetItemCount() > 0 )
|
||||
flags |= wxTOP;
|
||||
|
||||
wxCheckBox* cb = new wxCheckBox( this, wxID_ANY, aLabel );
|
||||
cb->SetValue( *aValuePtr );
|
||||
m_ExtrasSizer->Add( cb, 0, flags, 5 );
|
||||
m_extraCheckboxMap[cb] = aValuePtr;
|
||||
}
|
||||
|
||||
|
||||
bool EDA_LIST_DIALOG::Show( bool show )
|
||||
{
|
||||
bool retVal = DIALOG_SHIM::Show( show );
|
||||
@ -209,6 +226,13 @@ wxString EDA_LIST_DIALOG::GetTextSelection( int aColumn )
|
||||
}
|
||||
|
||||
|
||||
void EDA_LIST_DIALOG::GetExtraCheckboxValues()
|
||||
{
|
||||
for( const auto& [checkbox, valuePtr] : m_extraCheckboxMap )
|
||||
*valuePtr = checkbox->GetValue();
|
||||
}
|
||||
|
||||
|
||||
void EDA_LIST_DIALOG::Append( const wxArrayString& itemList )
|
||||
{
|
||||
long itemIndex = m_listBox->InsertItem( m_listBox->GetItemCount(), itemList[0] );
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -31,6 +31,11 @@ EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, con
|
||||
m_filterBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bMargins->Add( m_filterBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_ExtrasSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
bMargins->Add( m_ExtrasSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bMargins, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
@ -1,41 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="16" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">eda_list_dialog_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">eda_list_dialog_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">decl_pure_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
@ -57,33 +60,33 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnSize">onSize</event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bMargins</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -96,6 +99,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -132,19 +136,19 @@
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
|
||||
<property name="proportion">3</property>
|
||||
<object class="wxListCtrl" expanded="1">
|
||||
<object class="wxListCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -157,6 +161,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -195,19 +200,19 @@
|
||||
<event name="OnListItemActivated">onListItemActivated</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<object class="wxTextCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -220,6 +225,7 @@
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
@ -230,7 +236,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
@ -260,22 +266,33 @@
|
||||
<event name="OnText">textChangeInFilterBox</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_ExtrasSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">public</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_ButtonsSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">public</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||
<object class="wxStdDialogButtonSizer" expanded="true">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">1</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -25,7 +25,6 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class EDA_LIST_DIALOG_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -48,6 +47,7 @@ class EDA_LIST_DIALOG_BASE : public DIALOG_SHIM
|
||||
|
||||
|
||||
public:
|
||||
wxBoxSizer* m_ExtrasSizer;
|
||||
wxBoxSizer* m_ButtonsSizer;
|
||||
|
||||
EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user