ADDED: New appearance control widget for PcbNew

Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
This commit is contained in:
Jon Evans 2020-07-11 13:42:00 -04:00
parent d7f26cfdf2
commit bd14f8a82a
59 changed files with 5799 additions and 399 deletions

View File

@ -100,6 +100,8 @@ set( BMAPS_SMALL
trash
tree_nosel
tree_sel
visibility
visibility_off
www
)

View File

@ -0,0 +1,31 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps_png/bitmaps_list.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0xb5, 0xfa, 0x37,
0xea, 0x00, 0x00, 0x00, 0xe5, 0x49, 0x44, 0x41, 0x54, 0x28, 0x15, 0x05, 0xc1, 0xb1, 0x2b, 0x84,
0x01, 0x00, 0x07, 0xd0, 0xf7, 0x5d, 0xb1, 0x89, 0x2c, 0x06, 0x92, 0x52, 0xea, 0x92, 0x8b, 0x44,
0x8e, 0xae, 0xce, 0x22, 0x3b, 0x83, 0xba, 0xe5, 0x16, 0xfb, 0x2d, 0x8c, 0x36, 0x7f, 0x87, 0xdd,
0x62, 0x30, 0x18, 0x24, 0xb1, 0xe8, 0x0c, 0x4e, 0x19, 0x2c, 0x26, 0x74, 0xc9, 0x6a, 0x40, 0x9d,
0xef, 0xe7, 0x3d, 0x00, 0x86, 0x14, 0xa8, 0xa9, 0x83, 0x61, 0x80, 0x0a, 0x80, 0x47, 0x55, 0x6c,
0xd9, 0xc5, 0x9c, 0x27, 0x80, 0x8a, 0xc2, 0x0a, 0xb8, 0xd7, 0x04, 0xb0, 0xa9, 0x0b, 0x56, 0x14,
0x85, 0x69, 0xf7, 0x5a, 0xae, 0x2c, 0x9a, 0x35, 0x61, 0x4a, 0xbc, 0xe9, 0x7b, 0xd3, 0xb3, 0xed,
0xc4, 0x32, 0x34, 0x9d, 0xda, 0xd2, 0x13, 0x51, 0x8a, 0x88, 0x3b, 0x0d, 0x67, 0x36, 0x00, 0x8e,
0x95, 0xe2, 0xd5, 0x8e, 0x11, 0xa3, 0x5a, 0x3e, 0xc4, 0x9f, 0x43, 0x80, 0x03, 0x11, 0xdf, 0xe6,
0xad, 0xbb, 0x74, 0x61, 0xc9, 0xaa, 0x81, 0x88, 0x7d, 0x98, 0xf1, 0x2b, 0xe2, 0x5a, 0xa1, 0x2f,
0xe2, 0x19, 0x0f, 0x22, 0xbe, 0x4c, 0x54, 0x44, 0x40, 0x21, 0x4a, 0x50, 0xa2, 0x00, 0x51, 0x42,
0x47, 0xc4, 0x8f, 0x05, 0xab, 0x2e, 0x9c, 0xab, 0xa9, 0x1b, 0x88, 0x68, 0x03, 0x1c, 0x29, 0xc5,
0xbb, 0x3d, 0x63, 0xc6, 0xb5, 0x7d, 0x8a, 0x81, 0x0e, 0x00, 0x6c, 0xea, 0x8a, 0x88, 0x88, 0xb8,
0xb1, 0x06, 0x14, 0x00, 0xa8, 0x6a, 0x98, 0x14, 0xaf, 0x6e, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x5e, 0x5d, 0x56, 0xf6, 0x32, 0x70,
0x52, 0x40, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE visibility_xpm[1] = {{ png, sizeof( png ), "visibility_xpm" }};
//EOF

View File

@ -0,0 +1,28 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps_png/bitmaps_list.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0xb5, 0xfa, 0x37,
0xea, 0x00, 0x00, 0x00, 0xb6, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0xa0, 0x27, 0x48,
0xd7, 0x4f, 0xcd, 0x4a, 0x6f, 0x4b, 0x6b, 0x4d, 0xcf, 0x48, 0xd7, 0xc2, 0x90, 0x4c, 0x73, 0x4b,
0x3b, 0x9f, 0xf6, 0x1f, 0x08, 0xff, 0x81, 0xc9, 0xff, 0xe9, 0xc7, 0x53, 0x6c, 0x91, 0xa5, 0x5b,
0xc1, 0x12, 0x8f, 0x52, 0x83, 0x93, 0x78, 0xd3, 0xf8, 0x53, 0xa3, 0xd3, 0x5e, 0x00, 0x79, 0x7f,
0xd3, 0xca, 0x60, 0xd2, 0xa5, 0x60, 0x5d, 0xdf, 0x53, 0xb5, 0x61, 0x1a, 0x32, 0xcc, 0xd2, 0xfe,
0x80, 0xc4, 0x52, 0x53, 0x81, 0x9c, 0x64, 0xf9, 0xb4, 0x1f, 0x60, 0x05, 0xfb, 0x80, 0x4a, 0x37,
0xa6, 0x9f, 0x01, 0xc2, 0x75, 0x40, 0xd6, 0x39, 0xb0, 0xd8, 0x97, 0x2c, 0x09, 0x84, 0x82, 0x03,
0x28, 0x0a, 0x20, 0x2e, 0xfa, 0x94, 0x28, 0x0a, 0xb2, 0xa2, 0x00, 0xcc, 0xf9, 0x91, 0xa6, 0x0b,
0xf7, 0x8f, 0x25, 0xd4, 0x8a, 0x04, 0xa8, 0x40, 0x6a, 0x1d, 0xd8, 0x91, 0x4f, 0x52, 0x23, 0x12,
0x04, 0x92, 0x85, 0x52, 0x13, 0xd2, 0x5e, 0x01, 0x79, 0x7f, 0xd2, 0x0a, 0x90, 0xfd, 0xe1, 0x98,
0x7a, 0x12, 0xe2, 0x41, 0x28, 0x3c, 0x98, 0x62, 0x81, 0x11, 0x16, 0x29, 0x9a, 0xe9, 0x69, 0xe9,
0x8d, 0x69, 0x0d, 0xa9, 0x49, 0xc9, 0x2a, 0x74, 0x8d, 0x21, 0x00, 0xfd, 0xf4, 0x70, 0x5c, 0x67,
0xba, 0xa2, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE visibility_off_xpm[1] = {{ png, sizeof( png ), "visibility_off_xpm" }};
//EOF

View File

@ -496,6 +496,8 @@ EXTERN_BITMAP( via_annulus_xpm )
EXTERN_BITMAP( via_diameter_xpm )
EXTERN_BITMAP( via_hole_diameter_xpm )
EXTERN_BITMAP( viewlibs_icon_xpm )
EXTERN_BITMAP( visibility_xpm )
EXTERN_BITMAP( visibility_off_xpm )
EXTERN_BITMAP( warning_xpm )
EXTERN_BITMAP( width_track_via_xpm )
EXTERN_BITMAP( width_track_xpm )

View File

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 24 24"
version="1.1"
id="svg3803"
sodipodi:docname="visibility.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
<metadata
id="metadata3809">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs3807" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1370"
id="namedview3805"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="45.254834"
inkscape:cx="-4.3168652"
inkscape:cy="15.336071"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg3803">
<sodipodi:guide
position="0,0"
orientation="0,24"
id="guide3862"
inkscape:locked="false" />
<sodipodi:guide
position="24,0"
orientation="-24,0"
id="guide3864"
inkscape:locked="false" />
<sodipodi:guide
position="24,24"
orientation="0,-24"
id="guide3866"
inkscape:locked="false" />
<sodipodi:guide
position="0,24"
orientation="24,0"
id="guide3868"
inkscape:locked="false" />
<sodipodi:guide
position="3.335608,16.474179"
orientation="0,1"
id="guide3872"
inkscape:locked="false" />
<sodipodi:guide
position="6.9364841,18.795302"
orientation="0,1"
id="guide3874"
inkscape:locked="false" />
<sodipodi:guide
position="1,12.010067"
orientation="1,0"
id="guide3876"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="22.959732,12.010067"
orientation="1,0"
id="guide3878"
inkscape:locked="false" />
<sodipodi:guide
position="11.321966,19.51172"
orientation="0,1"
id="guide3910"
inkscape:locked="false" />
<sodipodi:guide
position="12,14.295302"
orientation="1,0"
id="guide3915"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="8.3999893,19.167397"
orientation="1,0"
id="guide4765"
inkscape:locked="false" />
<sodipodi:guide
position="15.6,21.898213"
orientation="1,0"
id="guide4767"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="24,24"
orientation="1,0"
id="guide4784"
inkscape:locked="false" />
</sodipodi:namedview>
<path
d="M0 0h24v24H0z"
fill="none"
id="path3799" />
<path
d="m 11.959732,5.1644295 c -5.0000005,0 -9.2700005,2.8303087 -11.00000046,6.8255035 1.72999996,3.995195 5.99999996,6.825504 11.00000046,6.825504 5,0 9.27,-2.830309 11,-6.825504 -1.73,-3.9951948 -6,-6.8255035 -11,-6.8255035 z m 0,11.3758395 c -2.7600005,0 -5.0000005,-2.03855 -5.0000005,-4.550336 0,-2.5117854 2.24,-4.5503357 5.0000005,-4.5503357 2.76,0 5,2.0385503 5,4.5503357 0,2.511786 -2.24,4.550336 -5,4.550336 z m 0,-7.2805375 c -1.66,0 -3.0000005,1.2194895 -3.0000005,2.7302015 0,1.510712 1.3400005,2.730202 3.0000005,2.730202 1.66,0 3,-1.21949 3,-2.730202 0,-1.510712 -1.34,-2.7302015 -3,-2.7302015 z"
id="path3801"
inkscape:connector-curvature="0"
style="stroke-width:0.95397437" />
<rect
style="stroke-width:0.89999998;stroke-miterlimit:4;stroke-dasharray:none;paint-order:stroke fill markers"
id="rect4742"
width="1.5100671"
height="3.6040268"
x="-2.3988652"
y="4.2705975"
ry="0.0195265"
transform="rotate(-40.846397)" />
<rect
style="stroke-width:0.89999998;stroke-miterlimit:4;stroke-dasharray:none;paint-order:stroke fill markers"
id="rect4742-5"
width="1.5100671"
height="3.6040268"
x="5.4401145"
y="3.1494057"
ry="0.0195265"
transform="rotate(-14.26516)" />
<rect
style="stroke-width:0.89999998;stroke-miterlimit:4;stroke-dasharray:none;paint-order:stroke fill markers"
id="rect4742-6"
width="1.5100671"
height="3.6040268"
x="11.323424"
y="0.88057196"
ry="0.0195265"
transform="rotate(0.01862949)" />
<rect
style="stroke-width:0.89999998;stroke-miterlimit:4;stroke-dasharray:none;paint-order:stroke fill markers"
id="rect4742-5-2"
width="1.5100671"
height="3.6040268"
x="-17.841269"
y="-2.7698705"
ry="0.0195265"
transform="matrix(-0.96916574,-0.24640974,-0.24640974,0.96916574,0,0)" />
<rect
style="stroke-width:0.89999998;stroke-miterlimit:4;stroke-dasharray:none;paint-order:stroke fill markers"
id="rect4742-9"
width="1.5100671"
height="3.6040268"
x="-20.526423"
y="-11.402325"
ry="0.0195265"
transform="matrix(-0.75646568,-0.65403339,-0.65403339,0.75646568,0,0)" />
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 24 24"
version="1.1"
id="svg3803"
sodipodi:docname="visibility_off.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
<metadata
id="metadata3809">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs3807" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1370"
id="namedview3805"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="16"
inkscape:cx="-1.087079"
inkscape:cy="10.657984"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg3803">
<sodipodi:guide
position="0,0"
orientation="0,24"
id="guide3862"
inkscape:locked="false" />
<sodipodi:guide
position="24,0"
orientation="-24,0"
id="guide3864"
inkscape:locked="false" />
<sodipodi:guide
position="24,24"
orientation="0,-24"
id="guide3866"
inkscape:locked="false" />
<sodipodi:guide
position="0,24"
orientation="24,0"
id="guide3868"
inkscape:locked="false" />
<sodipodi:guide
position="3.335608,16.474179"
orientation="0,1"
id="guide3872"
inkscape:locked="false" />
<sodipodi:guide
position="6.9364841,18.795302"
orientation="0,1"
id="guide3874"
inkscape:locked="false" />
<sodipodi:guide
position="1,12.010067"
orientation="1,0"
id="guide3876"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="22.959732,12.010067"
orientation="1,0"
id="guide3878"
inkscape:locked="false" />
<sodipodi:guide
position="11.321966,19.51172"
orientation="0,1"
id="guide3910"
inkscape:locked="false" />
<sodipodi:guide
position="12,14.295302"
orientation="1,0"
id="guide3915"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="8.3999893,19.167397"
orientation="1,0"
id="guide4765"
inkscape:locked="false" />
<sodipodi:guide
position="15.6,21.898213"
orientation="1,0"
id="guide4767"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="24,24"
orientation="1,0"
id="guide4784"
inkscape:locked="false" />
<sodipodi:guide
position="0.95973154,12.010067"
orientation="0,1"
id="guide4834"
inkscape:locked="false" />
</sodipodi:namedview>
<path
d="M0 0h24v24H0z"
fill="none"
id="path3799" />
<path
d="m 11.959732,5.1644295 c -5.0000005,0 -9.2700005,2.8303087 -11.00000046,6.8255035 1.72999996,3.995195 5.99999996,6.825504 11.00000046,6.825504 5,0 9.27,-2.830309 11,-6.825504 -1.73,-3.9951948 -6,-6.8255035 -11,-6.8255035 z m 0,11.3758395 c -2.7600005,0 -5.0000005,-2.03855 -5.0000005,-4.550336 0,-2.5117854 2.24,-4.5503357 5.0000005,-4.5503357 2.76,0 5,2.0385503 5,4.5503357 0,2.511786 -2.24,4.550336 -5,4.550336 z"
id="path3801"
inkscape:connector-curvature="0"
style="fill:#666666;stroke-width:0.95397437"
sodipodi:nodetypes="scscssssss" />
<rect
style="fill:#666666;stroke-width:1.41000319;stroke-miterlimit:4;stroke-dasharray:none;paint-order:stroke fill markers"
id="rect4742-6"
width="2.3932726"
height="5.5814533"
x="10.76524"
y="-14.781991"
ry="0.030240133"
transform="matrix(-3.1770953e-4,0.99999995,-0.99999994,-3.3273889e-4,0,0)" />
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -198,6 +198,7 @@ set( COMMON_DLG_SRCS
set( COMMON_WIDGET_SRCS
widgets/app_progress_dialog.cpp
widgets/bitmap_toggle.cpp
widgets/button_row_panel.cpp
widgets/color_swatch.cpp
widgets/footprint_choice.cpp

View File

@ -651,6 +651,7 @@ LSET LSET::FrontAssembly()
F_SilkS,
F_Mask,
F_Fab,
F_CrtYd
};
static const LSET saved( front_assembly, arrayDim( front_assembly ) );
@ -664,6 +665,7 @@ LSET LSET::BackAssembly()
B_SilkS,
B_Mask,
B_Fab,
B_CrtYd
};
static const LSET saved( back_assembly, arrayDim( back_assembly ) );
@ -854,3 +856,68 @@ PCB_LAYER_ID ToLAYER_ID( int aLayer )
return PCB_LAYER_ID( aLayer );
}
GAL_SET::GAL_SET( const GAL_LAYER_ID* aArray, unsigned aCount ) : GAL_SET()
{
for( unsigned i = 0; i < aCount; ++i )
set( aArray[i] );
}
std::vector<GAL_LAYER_ID> GAL_SET::Seq() const
{
std::vector<GAL_LAYER_ID> ret;
for( size_t i = 0; i < size(); ++i )
{
if( test( i ) )
ret.push_back( static_cast<GAL_LAYER_ID>( i ) );
}
return ret;
}
GAL_SET GAL_SET::DefaultVisible()
{
static const GAL_LAYER_ID visible[] = {
LAYER_VIAS,
LAYER_VIA_MICROVIA,
LAYER_VIA_BBLIND,
LAYER_VIA_THROUGH,
LAYER_NON_PLATEDHOLES,
LAYER_MOD_TEXT_FR,
LAYER_MOD_TEXT_BK,
// LAYER_MOD_TEXT_INVISIBLE, // Invisible text hidden by default
LAYER_ANCHOR,
LAYER_PAD_FR,
LAYER_PAD_BK,
LAYER_RATSNEST,
LAYER_GRID,
LAYER_GRID_AXES,
LAYER_NO_CONNECTS,
LAYER_MOD_FR,
LAYER_MOD_BK,
LAYER_MOD_VALUES,
LAYER_MOD_REFERENCES,
LAYER_TRACKS,
LAYER_PADS_TH,
LAYER_PADS_PLATEDHOLES,
LAYER_VIAS_HOLES,
LAYER_DRC_ERROR,
LAYER_DRC_WARNING,
// LAYER_DRC_EXCLUSION, // DRC exclusions hidden by default
LAYER_WORKSHEET,
LAYER_GP_OVERLAY,
LAYER_SELECT_OVERLAY,
LAYER_PCB_BACKGROUND,
LAYER_CURSOR,
LAYER_AUX_ITEMS,
LAYER_DRAW_BITMAPS,
LAYER_PADS,
LAYER_ZONES,
};
static const GAL_SET saved( visible, arrayDim( visible ) );
return saved;
}

View File

@ -68,7 +68,7 @@ void WS_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings )
}
const COLOR4D& WS_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
COLOR4D WS_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
{
const EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );

View File

@ -43,9 +43,6 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( const wxString& aFilename ) :
},
LSET::AllLayersMask().FmtHex() ) );
static GAL_SET defaultVisible;
defaultVisible.set().reset( GAL_LAYER_INDEX( LAYER_MOD_TEXT_INVISIBLE ) );
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.visible_items",
[&]() -> nlohmann::json
{
@ -61,7 +58,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( const wxString& aFilename ) :
{
if( !aVal.is_array() || aVal.empty() )
{
m_VisibleItems = defaultVisible;
m_VisibleItems = GAL_SET::DefaultVisible();
return;
}
@ -149,7 +146,23 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( const wxString& aFilename ) :
&m_ContrastModeDisplay, HIGH_CONTRAST_MODE::NORMAL, HIGH_CONTRAST_MODE::NORMAL,
HIGH_CONTRAST_MODE::HIDDEN ) );
m_params.emplace_back( new PARAM<double>( "board.opacity.tracks", &m_TrackOpacity, 1.0 ) );
m_params.emplace_back( new PARAM<double>( "board.opacity.vias", &m_ViaOpacity, 1.0 ) );
m_params.emplace_back( new PARAM<double>( "board.opacity.pads", &m_PadOpacity, 1.0 ) );
m_params.emplace_back( new PARAM<double>( "board.opacity.zones", &m_ZoneOpacity, 1.0 ) );
m_params.emplace_back( new PARAM_LIST<wxString>( "board.hidden_nets", &m_HiddenNets, {} ) );
m_params.emplace_back( new PARAM_ENUM<NET_COLOR_MODE>( "board.net_color_mode",
&m_NetColorMode, NET_COLOR_MODE::RATSNEST, NET_COLOR_MODE::OFF,
NET_COLOR_MODE::ALL ) );
// TODO: move the rest of PCB_DISPLAY_OPTIONS that are project-specific in here
#if 0
m_params.emplace_back( new PARAM_ENUM<ZONE_DISPLAY_MODE>( "board.zone_display_mode",
&m_ZoneDisplayMode, ZONE_DISPLAY_MODE::SHOW_FILLED, ZONE_DISPLAY_MODE::SHOW_OUTLINED,
ZONE_DISPLAY_MODE::SHOW_FILLED ) );
#endif
}

View File

@ -142,7 +142,6 @@ COLOR_SETTINGS::COLOR_SETTINGS( wxString aFilename ) :
CLR( "board.ratsnest", LAYER_RATSNEST, COLOR4D( WHITE ) );
CLR( "board.select_overlay", LAYER_SELECT_OVERLAY, COLOR4D( DARKRED ) );
CLR( "board.through_via", LAYER_VIA_THROUGH, COLOR4D( LIGHTGRAY ) );
CLR( "board.via", LAYER_VIAS, COLOR4D( BLACK ) );
CLR( "board.via_blind_buried", LAYER_VIA_BBLIND, COLOR4D( BROWN ) );
CLR( "board.via_hole", LAYER_VIAS_HOLES, COLOR4D( WHITE ) );
CLR( "board.via_micro", LAYER_VIA_MICROVIA, COLOR4D( CYAN ) );

View File

@ -0,0 +1,72 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jon Evans <jon@craftyjon.com>
*
* 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 <widgets/bitmap_toggle.h>
wxDEFINE_EVENT( TOGGLE_CHANGED, wxCommandEvent );
BITMAP_TOGGLE::BITMAP_TOGGLE( wxWindow *aParent, wxWindowID aId, const wxBitmap& aCheckedBitmap,
const wxBitmap& aUncheckedBitmap, bool aChecked ) :
wxPanel( aParent, aId ),
m_checked( aChecked ),
m_unchecked_bitmap( aUncheckedBitmap ),
m_checked_bitmap( aCheckedBitmap )
{
wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL );
SetSizer( sizer );
const wxBitmap& bitmap = aChecked ? m_checked_bitmap : m_unchecked_bitmap;
m_bitmap = new wxStaticBitmap( this, aId, bitmap, wxDefaultPosition, bitmap.GetSize() );
sizer->Add( m_bitmap, 0, 0 );
m_bitmap->Bind( wxEVT_LEFT_UP,
[&]( wxMouseEvent& )
{
SetValue( !GetValue() );
wxCommandEvent event( TOGGLE_CHANGED );
event.SetInt( m_checked );
event.SetEventObject( this );
wxPostEvent( this, event );
} );
auto passOnEvent =
[&]( wxEvent& aEvent )
{
wxPostEvent( this, aEvent );
};
m_bitmap->Bind( wxEVT_RIGHT_DOWN, passOnEvent );
m_bitmap->Bind( wxEVT_RIGHT_UP, passOnEvent );
}
void BITMAP_TOGGLE::SetValue( bool aValue )
{
m_checked = aValue;
m_bitmap->SetBitmap( aValue ? m_checked_bitmap : m_unchecked_bitmap );
}

View File

@ -214,15 +214,17 @@ void COLOR_SWATCH::GetNewSwatchColor()
DIALOG_COLOR_PICKER dialog( ::wxGetTopLevelParent( this ), m_color, true, nullptr, m_default );
if( dialog.ShowModal() == wxID_OK )
{
newColor = dialog.GetColor();
if( newColor != COLOR4D::UNSPECIFIED || m_default == COLOR4D::UNSPECIFIED )
{
m_color = newColor;
if( newColor != COLOR4D::UNSPECIFIED || m_default == COLOR4D::UNSPECIFIED )
{
m_color = newColor;
wxBitmap bm = MakeBitmap( newColor, m_background, m_size );
m_swatch->SetBitmap( bm );
wxBitmap bm = MakeBitmap( newColor, m_background, m_size );
m_swatch->SetBitmap( bm );
sendSwatchChangeEvent( *this );
sendSwatchChangeEvent( *this );
}
}
}

View File

@ -102,7 +102,7 @@ void SCH_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings )
}
const COLOR4D& SCH_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
COLOR4D SCH_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
{
return m_layerColors[ aLayer ];
}

View File

@ -77,7 +77,7 @@ public:
void LoadColors( const COLOR_SETTINGS* aSettings ) override;
/// @copydoc RENDER_SETTINGS::GetColor()
virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
virtual COLOR4D GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
bool IsBackgroundDark() const override
{

View File

@ -102,7 +102,7 @@ void GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions( const GBR_DISPLAY_OPTIONS& aO
}
const COLOR4D& GERBVIEW_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
COLOR4D GERBVIEW_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
{
const EDA_ITEM* item = static_cast<const EDA_ITEM*>( aItem );
static const COLOR4D transparent = COLOR4D( 0, 0, 0, 0 );

View File

@ -61,7 +61,7 @@ public:
void LoadDisplayOptions( const GBR_DISPLAY_OPTIONS& aOptions );
/// @copydoc RENDER_SETTINGS::GetColor()
virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
virtual COLOR4D GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
/**
* Function GetLayerColor

View File

@ -170,7 +170,7 @@ enum GAL_LAYER_ID: int
{
GAL_LAYER_ID_START = NETNAMES_LAYER_ID_END,
LAYER_VIAS = GAL_LAYER_ID_START,
LAYER_VIAS = GAL_LAYER_ID_START, ///< Meta control for all vias opacity/visibility
LAYER_VIA_MICROVIA, ///< to draw micro vias
LAYER_VIA_BBLIND, ///< to draw blind/buried vias
LAYER_VIA_THROUGH, ///< to draw usual through hole vias
@ -211,6 +211,13 @@ enum GAL_LAYER_ID: int
LAYER_WORKSHEET_PAGE1, ///< for pageLayout editor previewing
LAYER_WORKSHEET_PAGEn, ///< for pageLayout editor previewing
LAYER_PADS, ///< Meta control for all pads opacity/visibility (color ignored)
LAYER_ZONES, ///< Control for copper zone opacity/visibility (color ignored)
/// Virtual layers for stacking zones and tracks on a given copper layer
LAYER_ZONE_START,
LAYER_ZONE_END = LAYER_ZONE_START + PCB_LAYER_ID_COUNT,
/// Add new GAL layers here
GAL_LAYER_ID_END
@ -219,6 +226,9 @@ enum GAL_LAYER_ID: int
/// Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS
#define GAL_LAYER_INDEX( x ) ( x - GAL_LAYER_ID_START )
/// Macro for getting the zone layer for a given copper layer
#define ZONE_LAYER_FOR( copperLayer ) ( LAYER_ZONE_START + copperLayer )
constexpr int GAL_LAYER_ID_COUNT = GAL_LAYER_ID_END - GAL_LAYER_ID_START;
inline GAL_LAYER_ID operator++( GAL_LAYER_ID& a )
@ -227,6 +237,12 @@ inline GAL_LAYER_ID operator++( GAL_LAYER_ID& a )
return a;
}
inline GAL_LAYER_ID ToGalLayer( int aInteger )
{
wxASSERT( aInteger >= GAL_LAYER_ID_START && aInteger <= GAL_LAYER_ID_END );
return static_cast<GAL_LAYER_ID>( aInteger );
}
/// Used for via types
inline GAL_LAYER_ID operator+( const GAL_LAYER_ID& a, int b )
{
@ -235,9 +251,14 @@ inline GAL_LAYER_ID operator+( const GAL_LAYER_ID& a, int b )
return t;
}
typedef std::bitset<GAL_LAYER_ID_COUNT> GAL_BASE_SET;
/// Helper for storing and iterating over GAL_LAYER_IDs
class GAL_SET : public std::bitset<GAL_LAYER_ID_COUNT>
class GAL_SET : public GAL_BASE_SET
{
private:
static constexpr int start = static_cast<int>( GAL_LAYER_ID_START );
public:
GAL_SET() : std::bitset<GAL_LAYER_ID_COUNT>()
{
@ -247,30 +268,34 @@ public:
{
}
GAL_SET( const GAL_LAYER_ID* aArray, unsigned aCount );
GAL_SET& set()
{
std::bitset<GAL_LAYER_ID_COUNT>::set();
GAL_BASE_SET::set();
return *this;
}
GAL_SET& set( size_t aPos, bool aVal = true )
GAL_SET& set( int aPos, bool aVal = true )
{
std::bitset<GAL_LAYER_ID_COUNT>::set( aPos, aVal );
GAL_BASE_SET::set( aPos, aVal );
return *this;
}
std::vector<GAL_LAYER_ID> Seq() const
GAL_SET& set( GAL_LAYER_ID aPos, bool aVal = true )
{
std::vector<GAL_LAYER_ID> ret;
for( size_t i = 0; i < size(); ++i )
{
if( test( i ) )
ret.push_back( static_cast<GAL_LAYER_ID>( i ) );
}
return ret;
GAL_BASE_SET::set( static_cast<int>( aPos ) - start, aVal );
return *this;
}
bool Contains( GAL_LAYER_ID aPos )
{
return test( static_cast<int>( aPos ) - start );
}
std::vector<GAL_LAYER_ID> Seq() const;
static GAL_SET DefaultVisible();
};
/// Eeschema drawing layers
@ -905,6 +930,12 @@ inline bool IsNetnameLayer( LAYER_NUM aLayer )
}
inline bool IsZoneLayer( LAYER_NUM aLayer )
{
return aLayer >= LAYER_ZONE_START && aLayer <= LAYER_ZONE_END;
}
inline bool IsDCodeLayer( int aLayer )
{
return aLayer >= (GERBVIEW_LAYER_ID_START + GERBER_DRAWLAYERS_COUNT) &&

View File

@ -74,22 +74,34 @@ public:
/// How trace clearances are displayed. @see TRACE_CLEARANCE_DISPLAY_MODE_T.
TRACE_CLEARANCE_DISPLAY_MODE_T m_ShowTrackClearanceMode;
int m_DisplayZonesMode;
/// @see ZONE_DISPLAY_MODE - stored in the project
ZONE_DISPLAY_MODE m_ZoneDisplayMode;
int m_DisplayNetNamesMode; /* 0 do not show netnames,
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads
*/
/// How inactive layers are displayed. @see HIGH_CONTRAST_MODE
/// How inactive layers are displayed. @see HIGH_CONTRAST_MODE - stored in the project
HIGH_CONTRAST_MODE m_ContrastModeDisplay;
/// How to use color overrides on specific nets and netclasses
NET_COLOR_MODE m_NetColorMode;
int m_MaxLinksShowed; // in track creation: number of hairwires shown
bool m_ShowModuleRatsnest; // When moving a footprint: allows displaying a ratsnest
bool m_ShowGlobalRatsnest; // If true, show all
bool m_DisplayRatsnestLinesCurved; // Airwires can be drawn as straight lines (false)
// or curved lines (true)
// These opacity overrides multiply with any opacity in the base layer color
double m_TrackOpacity; ///< Opacity override for all tracks
double m_ViaOpacity; ///< Opacity override for all types of via
double m_PadOpacity; ///< Opacity override for SMD pads and PTHs
double m_ZoneOpacity; ///< Opacity override for filled zone areas
public:
PCB_DISPLAY_OPTIONS();

View File

@ -76,8 +76,8 @@ struct SELECTION_FILTER_OPTIONS
};
/**
* Determines how inactive layers should be displayed
*/
* Determines how inactive layers should be displayed
*/
enum class HIGH_CONTRAST_MODE
{
NORMAL = 0, ///> Non-active layers are shown normally (no high-contrast mode)
@ -85,6 +85,22 @@ enum class HIGH_CONTRAST_MODE
HIDDEN ///> Non-active layers are hidden
};
///> Determines how zones should be displayed
enum class ZONE_DISPLAY_MODE
{
SHOW_FILLED, ///< Filled polygons are shown
HIDE_FILLED, ///< Only the zone outline is shown
SHOW_OUTLINED ///< Outlines of filled polygons are shown
};
///> Determines how net color overrides should be applied
enum class NET_COLOR_MODE
{
OFF, ///< Net (and netclass) colors are not shown
RATSNEST, ///< Net/netclass colors are shown on ratsnest lines only
ALL ///< Net/netclass colors are shown on all net copper
};
/**
* A saved set of layers that are visible
*/
@ -94,25 +110,34 @@ struct LAYER_PRESET
LSET layers; ///< Board layers that are visible
GAL_SET renderLayers; ///< Render layers (e.g. object types) that are visible
PCB_LAYER_ID activeLayer; ///< Optional layer to set active when this preset is loaded
bool readOnly; ///< True if this is a read-only (built-in) preset
LAYER_PRESET( const wxString& aName ) :
LAYER_PRESET( const wxString& aName = wxEmptyString ) :
name( aName ),
activeLayer( UNSELECTED_LAYER )
{
layers = LSET::AllLayersMask();
renderLayers = GAL_SET::DefaultVisible();
readOnly = false;
}
LAYER_PRESET( const wxString& aName, const LSET& aSet ) :
LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers ) :
name( aName ),
layers( aSet ),
layers( aVisibleLayers ),
activeLayer( UNSELECTED_LAYER )
{
renderLayers = GAL_SET::DefaultVisible();
readOnly = false;
}
LAYER_PRESET( const wxString& aName, const LSET& aSet, PCB_LAYER_ID aActive ) :
LAYER_PRESET( const wxString& aName, const LSET& aVisibleLayers, const GAL_SET& aVisibleObjects,
PCB_LAYER_ID aActiveLayer ) :
name( aName ),
layers( aSet ),
activeLayer( aActive )
layers( aVisibleLayers ),
renderLayers( aVisibleObjects ),
activeLayer( aActiveLayer )
{
readOnly = false;
}
bool LayersMatch( const LAYER_PRESET& aOther )

View File

@ -94,6 +94,17 @@ public:
/// The current contrast mode
HIGH_CONTRAST_MODE m_ContrastModeDisplay;
/// The current net color mode
NET_COLOR_MODE m_NetColorMode;
/// How zones are drawn (TODO: not yet used)
ZONE_DISPLAY_MODE m_ZoneDisplayMode;
double m_TrackOpacity; ///< Opacity override for all tracks
double m_ViaOpacity; ///< Opacity override for all types of via
double m_PadOpacity; ///< Opacity override for SMD pads and PTH
double m_ZoneOpacity; ///< Opacity override for filled zones
/**
* A list of netnames that have been manually hidden in the board editor.
* Currently, hiding nets means hiding the ratsnest for those nets.

View File

@ -151,14 +151,13 @@ public:
bool GetHighContrast() const { return m_hiContrastEnabled; }
/**
* Function GetColor
* Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer
* using currently used render settings.
* @param aItem is the VIEW_ITEM.
* @param aLayer is the layer.
* @return The color.
*/
virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) const = 0;
virtual COLOR4D GetColor( const VIEW_ITEM* aItem, int aLayer ) const = 0;
float GetWorksheetLineWidth() const { return m_worksheetLineWidth; }

View File

@ -0,0 +1,69 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jon Evans <jon@craftyjon.com>
*
* 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
*/
#ifndef _BITMAP_TOGGLE_H
#define _BITMAP_TOGGLE_H
#include <wx/wx.h>
//#include <common.h>
#include <gal/color4d.h>
wxDECLARE_EVENT( TOGGLE_CHANGED, wxCommandEvent );
/**
* A checkbox control except with custom bitmaps for the checked and unchecked states
*
* This is useful in space-constrained situations where native toggle button controls are too big
*/
class BITMAP_TOGGLE : public wxPanel
{
public:
BITMAP_TOGGLE() {}
BITMAP_TOGGLE( wxWindow *aParent, wxWindowID aId, const wxBitmap& aCheckedBitmap,
const wxBitmap& aUncheckedBitmap, bool aChecked = false );
///> Set the checkbox state
void SetValue( bool aValue );
///> Read the checkbox state
bool GetValue() { return m_checked; }
private:
bool m_checked;
wxStaticBitmap* m_bitmap;
///> Bitmap to display in unchecked state
wxBitmap m_unchecked_bitmap;
///> Bitmap to display in checked state
wxBitmap m_checked_bitmap;
};
#endif

View File

@ -54,7 +54,7 @@ public:
void LoadColors( const COLOR_SETTINGS* aSettings ) override;
/// @copydoc RENDER_SETTINGS::GetColor()
virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
virtual COLOR4D GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
inline bool IsBackgroundDark() const override
{

View File

@ -339,8 +339,11 @@ set( PCBNEW_CLASS_SRCS
footprint_preview_panel.cpp
footprint_tree_pane.cpp
widgets/appearance_controls.cpp
widgets/appearance_controls_base.cpp
widgets/panel_selection_filter.cpp
widgets/panel_selection_filter_base.cpp
)
set( PCBNEW_SRCS

View File

@ -1164,6 +1164,10 @@ unsigned int D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
const int HIDE = std::numeric_limits<unsigned int>::max();
BOARD* board = GetBoard();
// Meta control for hiding all pads
if( !aView->IsLayerVisible( LAYER_PADS ) )
return HIDE;
// Handle Render tab switches
if( ( GetAttribute() == PAD_ATTRIB_STANDARD || GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
&& !aView->IsLayerVisible( LAYER_PADS_TH ) )

View File

@ -622,9 +622,13 @@ unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
}
}
// Only draw the via if at least one of the layers it crosses is being displayed
if( onVisibleLayer && aView->IsLayerVisible( LAYER_VIAS ) )
// Draw through vias unconditionally if the vias control is turned on.
// Draw blind/buried/microvias only if at least one of the layers crossed is enabeld.
if( aView->IsLayerVisible( LAYER_VIAS ) )
{
if( !onVisibleLayer && m_ViaType != VIATYPE::THROUGH )
return HIDE;
switch( m_ViaType )
{
case VIATYPE::THROUGH: return aView->IsLayerVisible( LAYER_VIA_THROUGH ) ? 0 : HIDE;

View File

@ -296,12 +296,20 @@ void ZONE_CONTAINER::ViewGetLayers( int aLayers[], int& aCount ) const
LSEQ layers = m_layerSet.Seq();
for( unsigned int idx = 0; idx < layers.size(); idx++ )
aLayers[idx] = layers[idx];
aLayers[idx] = LAYER_ZONE_START + layers[idx];
aCount = layers.size();
}
unsigned int ZONE_CONTAINER::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{
constexpr unsigned int HIDE = std::numeric_limits<unsigned int>::max();
return aView->IsLayerVisible( LAYER_ZONES ) ? 0 : HIDE;
}
bool ZONE_CONTAINER::IsOnLayer( PCB_LAYER_ID aLayer ) const
{
return m_layerSet.test( aLayer );

View File

@ -148,6 +148,8 @@ public:
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
void SetFillMode( ZONE_FILL_MODE aFillMode ) { m_FillMode = aFillMode; }
ZONE_FILL_MODE GetFillMode() const { return m_FillMode; }

View File

@ -82,6 +82,13 @@ void CONNECTIVITY_DATA::Build( BOARD* aBoard )
{
m_connAlgo.reset( new CN_CONNECTIVITY_ALGO );
m_connAlgo->Build( aBoard );
m_netclassMap.clear();
for( NETINFO_ITEM* net : aBoard->GetNetInfo() )
if( net->GetNetClass()->GetName() != NETCLASS::Default )
m_netclassMap[net->GetNet()] = net->GetNetClass()->GetName();
RecalculateRatsnest();
}

View File

@ -258,6 +258,11 @@ public:
void MarkItemNetAsDirty( BOARD_ITEM* aItem );
void SetProgressReporter( PROGRESS_REPORTER* aReporter );
const std::map<int, wxString>& GetNetclassMap() const
{
return m_netclassMap;
}
#ifndef SWIG
const std::vector<CN_EDGE> GetRatsnestForItems( const std::vector<BOARD_ITEM*> aItems );
@ -286,6 +291,9 @@ private:
bool m_skipRatsnest = false;
std::mutex m_lock;
/// Map of netcode -> netclass the net is a member of; used for ratsnest painting
std::map<int, wxString> m_netclassMap;
};
#endif

View File

@ -38,8 +38,8 @@
#include <wildcards_and_files_ext.h>
#include <class_marker_pcb.h>
#include <wx/wupdlock.h>
#include <widgets/appearance_controls.h>
#include <widgets/ui_common.h>
#include <pcb_layer_widget.h>
DIALOG_DRC::DIALOG_DRC( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ) :
@ -273,7 +273,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
if( ( violationLayers & board->GetVisibleLayers() ) == 0 )
{
m_brdEditor->GetLayerManager()->SetLayerVisible( item->GetLayer(), true );
m_brdEditor->GetAppearancePanel()->SetLayerVisible( item->GetLayer(), true );
m_brdEditor->GetCanvas()->Refresh();
}

View File

@ -26,10 +26,10 @@
#include <panel_pcbnew_color_settings.h>
#include <pcbnew_settings.h>
#include <pcb_edit_frame.h>
#include <pcb_layer_widget.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>
#include <footprint_preview_panel.h>
#include <widgets/appearance_controls.h>
#include <ws_proxy_view_item.h>
#include <pcb_painter.h>
#include <class_track.h>
@ -439,7 +439,7 @@ bool PANEL_PCBNEW_COLOR_SETTINGS::TransferDataFromWindow()
PCBNEW_SETTINGS* app_settings = settingsMgr.GetAppSettings<PCBNEW_SETTINGS>();
app_settings->m_ColorTheme = m_currentSettings->GetFilename();
m_frame->GetLayerManager()->SyncLayerColors();
m_frame->GetAppearancePanel()->OnColorThemeChanged();
return true;
}

View File

@ -506,8 +506,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
return false;
}
wxWindowUpdateLocker no_update( m_Layers ); // Avoid flicker when rebuilding m_Layers
// Unlink the old project if needed
GetBoard()->ClearProject();

View File

@ -37,6 +37,7 @@
#include <pcbnew.h>
#include <footprint_edit_frame.h>
#include <widgets/appearance_controls.h>
bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery, bool aFinal )
@ -81,7 +82,7 @@ bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery, bool aFinal )
GetBoard()->SetVisibleLayers( LSET().set() );
ReCreateLayerBox();
ReCreateAuxiliaryToolbar();
ReFillLayerWidget();
m_appearancePanel->OnBoardChanged();
UpdateTitle();
Zoom_Automatique( false );

View File

@ -294,15 +294,15 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
};
auto zonesFilledCondition = [ &disp_opt ]( const SELECTION &aSel )
{
return disp_opt.m_DisplayZonesMode == 0;
return disp_opt.m_ZoneDisplayMode == ZONE_DISPLAY_MODE::SHOW_FILLED;
};
auto zonesWireframedCondition = [ &disp_opt ]( const SELECTION &aSel )
{
return disp_opt.m_DisplayZonesMode == 1;
return disp_opt.m_ZoneDisplayMode == ZONE_DISPLAY_MODE::HIDE_FILLED;
};
auto zonesOutlinedCondition = [ &disp_opt ]( const SELECTION &aSel )
{
return disp_opt.m_DisplayZonesMode == 2;
return disp_opt.m_ZoneDisplayMode == ZONE_DISPLAY_MODE::SHOW_OUTLINED;
};
auto sketchTracksCondition = [ &disp_opt ]( const SELECTION &aSel )
{

View File

@ -25,7 +25,6 @@
#include <kiface_i.h>
#include <pcb_base_edit_frame.h>
#include <tool/tool_manager.h>
#include <pcb_layer_widget.h>
#include <pcbnew_settings.h>
#include <pgm_base.h>
#include <class_board.h>
@ -35,6 +34,7 @@
#include <settings/settings_manager.h>
#include <tools/pcb_actions.h>
#include <dialogs/dialog_grid_settings.h>
#include <widgets/appearance_controls.h>
PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
FRAME_T aFrameType, const wxString& aTitle,
@ -136,8 +136,8 @@ void PCB_BASE_EDIT_FRAME::SetGridVisibility( bool aVisible )
PCB_BASE_FRAME::SetGridVisibility( aVisible );
// Update the grid checkbox in the layer widget
if( m_Layers )
m_Layers->SetRenderState( LAYER_GRID, aVisible );
if( m_appearancePanel )
m_appearancePanel->SetObjectVisible( LAYER_GRID, aVisible );
// TODO (ISM): Remove this by changing toolbars to use the EVT_UPDATE_UI to get the state
SyncToolbars();

View File

@ -27,6 +27,7 @@
#include <pcb_base_frame.h>
class APPEARANCE_CONTROLS;
class BOARD_ITEM_CONTAINER;
class PCB_LAYER_WIDGET;
class PANEL_SELECTION_FILTER;
@ -222,6 +223,9 @@ protected:
/// AUI panel for changing the selection tool filter controls
PANEL_SELECTION_FILTER* m_selectionFilterPanel;
/// AUI panel for controlling layer and object visibility and appearance
APPEARANCE_CONTROLS* m_appearancePanel;
};
#endif

View File

@ -43,16 +43,20 @@ PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS()
m_DisplayPcbTrackFill = FILLED; // false = sketch , true = filled
m_ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
m_DisplayZonesMode = 0; /* 0 = Show filled areas outlines in zones,
* 1 = do not show filled areas outlines
* 2 = show outlines of filled areas */
m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
m_DisplayNetNamesMode = 3; /* 0 do not show netnames,
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads */
m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
m_NetColorMode = NET_COLOR_MODE::RATSNEST;
m_MaxLinksShowed = 3; // in track creation: number of hairwires shown
m_ShowModuleRatsnest = true; // When moving a footprint: allows displaying a ratsnest
m_DisplayRatsnestLinesCurved = false;
m_ShowGlobalRatsnest = true;
m_TrackOpacity = 1.0;
m_ViaOpacity = 1.0;
m_PadOpacity = 1.0;
m_ZoneOpacity = 1.0;
}

View File

@ -66,41 +66,43 @@ const LAYER_NUM GAL_LAYER_ORDER[] =
LAYER_VIA_MICROVIA, LAYER_PADS_TH,
LAYER_PAD_FR_NETNAMES, LAYER_PAD_FR,
NETNAMES_LAYER_INDEX( F_Cu ), F_Cu, F_Mask, F_SilkS, F_Paste, F_Adhes, F_CrtYd, F_Fab,
NETNAMES_LAYER_INDEX( F_Cu ), F_Cu, ZONE_LAYER_FOR( F_Cu ),
F_Mask, F_SilkS, F_Paste, F_Adhes, F_CrtYd, F_Fab,
NETNAMES_LAYER_INDEX( In1_Cu ), In1_Cu,
NETNAMES_LAYER_INDEX( In2_Cu ), In2_Cu,
NETNAMES_LAYER_INDEX( In3_Cu ), In3_Cu,
NETNAMES_LAYER_INDEX( In4_Cu ), In4_Cu,
NETNAMES_LAYER_INDEX( In5_Cu ), In5_Cu,
NETNAMES_LAYER_INDEX( In6_Cu ), In6_Cu,
NETNAMES_LAYER_INDEX( In7_Cu ), In7_Cu,
NETNAMES_LAYER_INDEX( In8_Cu ), In8_Cu,
NETNAMES_LAYER_INDEX( In9_Cu ), In9_Cu,
NETNAMES_LAYER_INDEX( In10_Cu ), In10_Cu,
NETNAMES_LAYER_INDEX( In11_Cu ), In11_Cu,
NETNAMES_LAYER_INDEX( In12_Cu ), In12_Cu,
NETNAMES_LAYER_INDEX( In13_Cu ), In13_Cu,
NETNAMES_LAYER_INDEX( In14_Cu ), In14_Cu,
NETNAMES_LAYER_INDEX( In15_Cu ), In15_Cu,
NETNAMES_LAYER_INDEX( In16_Cu ), In16_Cu,
NETNAMES_LAYER_INDEX( In17_Cu ), In17_Cu,
NETNAMES_LAYER_INDEX( In18_Cu ), In18_Cu,
NETNAMES_LAYER_INDEX( In19_Cu ), In19_Cu,
NETNAMES_LAYER_INDEX( In20_Cu ), In20_Cu,
NETNAMES_LAYER_INDEX( In21_Cu ), In21_Cu,
NETNAMES_LAYER_INDEX( In22_Cu ), In22_Cu,
NETNAMES_LAYER_INDEX( In23_Cu ), In23_Cu,
NETNAMES_LAYER_INDEX( In24_Cu ), In24_Cu,
NETNAMES_LAYER_INDEX( In25_Cu ), In25_Cu,
NETNAMES_LAYER_INDEX( In26_Cu ), In26_Cu,
NETNAMES_LAYER_INDEX( In27_Cu ), In27_Cu,
NETNAMES_LAYER_INDEX( In28_Cu ), In28_Cu,
NETNAMES_LAYER_INDEX( In29_Cu ), In29_Cu,
NETNAMES_LAYER_INDEX( In30_Cu ), In30_Cu,
NETNAMES_LAYER_INDEX( In1_Cu ), In1_Cu, ZONE_LAYER_FOR( In1_Cu ),
NETNAMES_LAYER_INDEX( In2_Cu ), In2_Cu, ZONE_LAYER_FOR( In2_Cu ),
NETNAMES_LAYER_INDEX( In3_Cu ), In3_Cu, ZONE_LAYER_FOR( In3_Cu ),
NETNAMES_LAYER_INDEX( In4_Cu ), In4_Cu, ZONE_LAYER_FOR( In4_Cu ),
NETNAMES_LAYER_INDEX( In5_Cu ), In5_Cu, ZONE_LAYER_FOR( In5_Cu ),
NETNAMES_LAYER_INDEX( In6_Cu ), In6_Cu, ZONE_LAYER_FOR( In6_Cu ),
NETNAMES_LAYER_INDEX( In7_Cu ), In7_Cu, ZONE_LAYER_FOR( In7_Cu ),
NETNAMES_LAYER_INDEX( In8_Cu ), In8_Cu, ZONE_LAYER_FOR( In8_Cu ),
NETNAMES_LAYER_INDEX( In9_Cu ), In9_Cu, ZONE_LAYER_FOR( In9_Cu ),
NETNAMES_LAYER_INDEX( In10_Cu ), In10_Cu, ZONE_LAYER_FOR( In10_Cu ),
NETNAMES_LAYER_INDEX( In11_Cu ), In11_Cu, ZONE_LAYER_FOR( In11_Cu ),
NETNAMES_LAYER_INDEX( In12_Cu ), In12_Cu, ZONE_LAYER_FOR( In12_Cu ),
NETNAMES_LAYER_INDEX( In13_Cu ), In13_Cu, ZONE_LAYER_FOR( In13_Cu ),
NETNAMES_LAYER_INDEX( In14_Cu ), In14_Cu, ZONE_LAYER_FOR( In14_Cu ),
NETNAMES_LAYER_INDEX( In15_Cu ), In15_Cu, ZONE_LAYER_FOR( In15_Cu ),
NETNAMES_LAYER_INDEX( In16_Cu ), In16_Cu, ZONE_LAYER_FOR( In16_Cu ),
NETNAMES_LAYER_INDEX( In17_Cu ), In17_Cu, ZONE_LAYER_FOR( In17_Cu ),
NETNAMES_LAYER_INDEX( In18_Cu ), In18_Cu, ZONE_LAYER_FOR( In18_Cu ),
NETNAMES_LAYER_INDEX( In19_Cu ), In19_Cu, ZONE_LAYER_FOR( In19_Cu ),
NETNAMES_LAYER_INDEX( In20_Cu ), In20_Cu, ZONE_LAYER_FOR( In20_Cu ),
NETNAMES_LAYER_INDEX( In21_Cu ), In21_Cu, ZONE_LAYER_FOR( In21_Cu ),
NETNAMES_LAYER_INDEX( In22_Cu ), In22_Cu, ZONE_LAYER_FOR( In22_Cu ),
NETNAMES_LAYER_INDEX( In23_Cu ), In23_Cu, ZONE_LAYER_FOR( In23_Cu ),
NETNAMES_LAYER_INDEX( In24_Cu ), In24_Cu, ZONE_LAYER_FOR( In24_Cu ),
NETNAMES_LAYER_INDEX( In25_Cu ), In25_Cu, ZONE_LAYER_FOR( In25_Cu ),
NETNAMES_LAYER_INDEX( In26_Cu ), In26_Cu, ZONE_LAYER_FOR( In26_Cu ),
NETNAMES_LAYER_INDEX( In27_Cu ), In27_Cu, ZONE_LAYER_FOR( In27_Cu ),
NETNAMES_LAYER_INDEX( In28_Cu ), In28_Cu, ZONE_LAYER_FOR( In28_Cu ),
NETNAMES_LAYER_INDEX( In29_Cu ), In29_Cu, ZONE_LAYER_FOR( In29_Cu ),
NETNAMES_LAYER_INDEX( In30_Cu ), In30_Cu, ZONE_LAYER_FOR( In30_Cu ),
LAYER_PAD_BK_NETNAMES, LAYER_PAD_BK,
NETNAMES_LAYER_INDEX( B_Cu ), B_Cu, B_Mask, B_Adhes, B_Paste, B_SilkS, B_CrtYd, B_Fab,
NETNAMES_LAYER_INDEX( B_Cu ), B_Cu, ZONE_LAYER_FOR( B_Cu ),
B_Mask, B_Adhes, B_Paste, B_SilkS, B_CrtYd, B_Fab,
LAYER_MOD_TEXT_BK,
LAYER_WORKSHEET
@ -253,6 +255,7 @@ void PCB_DRAW_PANEL_GAL::SetHighContrastLayer( PCB_LAYER_ID aLayer )
// should be done in some other way I guess..
LAYER_NUM layers[] = {
GetNetnameLayer( aLayer ),
ZONE_LAYER_FOR( aLayer ),
LAYER_VIA_THROUGH, LAYER_VIAS_HOLES, LAYER_VIAS_NETNAMES,
LAYER_PADS_TH, LAYER_PADS_PLATEDHOLES, LAYER_PADS_NETNAMES,
LAYER_NON_PLATEDHOLES, LAYER_SELECT_OVERLAY, LAYER_GP_OVERLAY,
@ -301,12 +304,12 @@ void PCB_DRAW_PANEL_GAL::SetTopLayer( PCB_LAYER_ID aLayer )
// Extra layers that are brought to the top if a F.* or B.* is selected
const std::vector<LAYER_NUM> frontLayers = {
F_Cu, F_Adhes, F_Paste, F_SilkS, F_Mask, F_Fab, F_CrtYd, LAYER_PAD_FR,
LAYER_PAD_FR_NETNAMES, NETNAMES_LAYER_INDEX( F_Cu )
LAYER_PAD_FR_NETNAMES, NETNAMES_LAYER_INDEX( F_Cu ), ZONE_LAYER_FOR( F_Cu )
};
const std::vector<LAYER_NUM> backLayers = {
B_Cu, B_Adhes, B_Paste, B_SilkS, B_Mask, B_Fab, B_CrtYd, LAYER_PAD_BK,
LAYER_PAD_BK_NETNAMES, NETNAMES_LAYER_INDEX( B_Cu )
LAYER_PAD_BK_NETNAMES, NETNAMES_LAYER_INDEX( B_Cu ), ZONE_LAYER_FOR( B_Cu )
};
const std::vector<LAYER_NUM>* extraLayers = NULL;
@ -330,6 +333,7 @@ void PCB_DRAW_PANEL_GAL::SetTopLayer( PCB_LAYER_ID aLayer )
{
// Display labels for copper layers on the top
m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
}
m_view->EnableTopLayer( true );
@ -346,10 +350,23 @@ void PCB_DRAW_PANEL_GAL::SyncLayersVisibility( const BOARD* aBoard )
for( GAL_LAYER_ID i = GAL_LAYER_ID_START; i < GAL_LAYER_ID_END; ++i )
m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
// Via layers controlled by dependencies
m_view->SetLayerVisible( LAYER_VIA_MICROVIA, true );
m_view->SetLayerVisible( LAYER_VIA_BBLIND, true );
m_view->SetLayerVisible( LAYER_VIA_THROUGH, true );
// Pad layers controlled by dependencies
m_view->SetLayerVisible( LAYER_PADS_TH, true );
m_view->SetLayerVisible( LAYER_PAD_FR, true );
m_view->SetLayerVisible( LAYER_PAD_BK, true );
// Always enable netname layers, as their visibility is controlled by layer dependencies
for( LAYER_NUM i = NETNAMES_LAYER_ID_START; i < NETNAMES_LAYER_ID_END; ++i )
m_view->SetLayerVisible( i, true );
for( LAYER_NUM i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
m_view->SetLayerVisible( i, true );
// Enable some layers that are GAL specific
m_view->SetLayerVisible( LAYER_PADS_PLATEDHOLES, true );
m_view->SetLayerVisible( LAYER_VIAS_HOLES, true );
@ -476,7 +493,10 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps()
// Set layer display dependencies & targets
if( IsCopperLayer( layer ) )
{
m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
m_view->SetRequired( GetNetnameLayer( layer ), layer );
}
else if( IsNetnameLayer( layer ) )
m_view->SetLayerDisplayOnly( layer );
}
@ -491,6 +511,16 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps()
m_view->SetRequired( LAYER_NON_PLATEDHOLES, LAYER_PADS_TH );
m_view->SetRequired( LAYER_PADS_NETNAMES, LAYER_PADS_TH );
// Via visibility
m_view->SetRequired( LAYER_VIA_MICROVIA, LAYER_VIAS );
m_view->SetRequired( LAYER_VIA_BBLIND, LAYER_VIAS );
m_view->SetRequired( LAYER_VIA_THROUGH, LAYER_VIAS );
// Pad visibility
m_view->SetRequired( LAYER_PADS_TH, LAYER_PADS );
m_view->SetRequired( LAYER_PAD_FR, LAYER_PADS );
m_view->SetRequired( LAYER_PAD_BK, LAYER_PADS );
// Front modules
m_view->SetRequired( LAYER_PAD_FR, F_Cu );
m_view->SetRequired( LAYER_MOD_TEXT_FR, LAYER_MOD_FR );

View File

@ -86,8 +86,10 @@
#include <wx/wupdlock.h>
#include <dialog_drc.h> // for DIALOG_DRC_WINDOW_NAME definition
#include <ratsnest/ratsnest_viewitem.h>
#include <widgets/appearance_controls.h>
#include <widgets/panel_selection_filter.h>
#include <widgets/infobar.h>
#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
@ -196,9 +198,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
SetBoard( new BOARD() );
// Create the PCB_LAYER_WIDGET *after* SetBoard():
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas() );
wxIcon icon;
icon.CopyFromBitmap( KiBitmap( icon_pcbnew_xpm ) );
SetIcon( icon );
@ -225,8 +224,10 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Create the infobar
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas() );
m_auimgr.SetManagedWindow( this );
m_auimgr.SetFlags( wxAUI_MGR_LIVE_RESIZE );
m_auimgr.SetFlags( wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE );
// Horizontal items; layers 4 - 6
m_auimgr.AddPane( m_mainToolBar,
@ -246,10 +247,12 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
EDA_PANE().VToolbar().Name( "MicrowaveToolbar" ).Right().Layer(2) );
m_auimgr.AddPane( m_drawToolBar,
EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(3) );
m_auimgr.AddPane( m_Layers,
EDA_PANE().Palette().Name( "LayersManager" ).Right().Layer(4)
.Caption( _( "Layers Manager" ) ).PaneBorder( false )
.MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ).Maximize() );
m_auimgr.AddPane( m_appearancePanel,
EDA_PANE().Name( "LayersManager" ).Right().Layer( 4 )
.Caption( _( "Appearance" ) ).MinSize( 150, -1 )
.BestSize( m_appearancePanel->GetBestSize() ) );
m_auimgr.AddPane( m_selectionFilterPanel,
EDA_PANE().Palette().Name( "SelectionFilter" ).Right().Layer( 4 )
.Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 )
@ -261,11 +264,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools );
m_Layers->ReFillRender(); // Update colors in Render after the config is read
ReFillLayerWidget(); // this is near end and after ReFillRender()
// because contents establish size
syncLayerWidgetLayer();
// The selection filter doesn't need to grow in the vertical direction when docked
m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0;
@ -365,8 +363,11 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
if( m_toolManager )
m_toolManager->ShutdownAllTools();
if( GetBoard() )
GetBoard()->RemoveListener( m_appearancePanel );
delete m_selectionFilterPanel;
delete m_Layers;
delete m_appearancePanel;
}
@ -472,34 +473,6 @@ void PCB_EDIT_FRAME::setupTools()
}
void PCB_EDIT_FRAME::ReFillLayerWidget()
{
ENUM_MAP<PCB_LAYER_ID>& layerEnum = ENUM_MAP<PCB_LAYER_ID>::Instance();
layerEnum.Choices().Clear();
layerEnum.Undefined( UNDEFINED_LAYER );
for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
layerEnum.Map( *seq, GetBoard()->GetLayerName( *seq ) );
wxWindowUpdateLocker no_update( m_Layers );
m_Layers->ReFill();
wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );
wxSize bestz = m_Layers->GetBestSize();
lyrs.MinSize( bestz );
lyrs.BestSize( bestz );
lyrs.FloatingSize( bestz );
if( lyrs.IsDocked() )
m_auimgr.Update();
else
m_Layers->SetSize( bestz );
}
void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event )
{
if( event.GetId() == wxID_EXIT )
@ -748,7 +721,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
{
PCB_BASE_FRAME::SetActiveLayer( aLayer );
syncLayerWidgetLayer();
m_appearancePanel->OnLayerChanged();
m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
GetCanvas()->SetFocus(); // allow capture of hotkeys
@ -772,14 +745,11 @@ void PCB_EDIT_FRAME::onBoardLoaded()
m_infoBar->ShowMessage( "Board file is read only.", wxICON_WARNING );
}
// Re-create layers manager based on layer info in board
ReFillLayerWidget();
ReCreateLayerBox();
m_appearancePanel->OnBoardChanged();
// Sync layer and item visibility
syncLayerVisibilities();
syncLayerWidgetLayer();
SyncRenderStates();
GetCanvas()->SyncLayersVisibility( m_Pcb );
SetElementVisibility( LAYER_RATSNEST, GetDisplayOptions().m_ShowGlobalRatsnest );
@ -800,29 +770,15 @@ void PCB_EDIT_FRAME::onBoardLoaded()
}
void PCB_EDIT_FRAME::syncLayerWidgetLayer()
void PCB_EDIT_FRAME::OnDisplayOptionsChanged()
{
m_Layers->SelectLayer( GetActiveLayer() );
m_Layers->OnLayerSelected();
}
void PCB_EDIT_FRAME::SyncRenderStates()
{
m_Layers->ReFillRender();
}
void PCB_EDIT_FRAME::syncLayerVisibilities()
{
m_Layers->SyncLayerVisibilities();
GetCanvas()->SyncLayersVisibility( m_Pcb );
m_appearancePanel->UpdateDisplayOptions();
}
void PCB_EDIT_FRAME::OnUpdateLayerAlpha( wxUpdateUIEvent & )
{
m_Layers->SyncLayerAlphaIndicators();
m_appearancePanel->OnLayerAlphaChanged();
}
@ -841,16 +797,6 @@ void PCB_EDIT_FRAME::SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState
GetCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
GetBoard()->SetElementVisibility( aElement, aNewState );
m_Layers->SetRenderState( aElement, aNewState );
}
void PCB_EDIT_FRAME::SetVisibleAlls()
{
GetBoard()->SetVisibleAlls();
for( GAL_LAYER_ID ii = GAL_LAYER_ID_START; ii < GAL_LAYER_ID_BITMASK_END; ++ii )
m_Layers->SetRenderState( ii, true );
}
@ -859,23 +805,12 @@ void PCB_EDIT_FRAME::ShowChangedLanguage()
// call my base class
PCB_BASE_EDIT_FRAME::ShowChangedLanguage();
// update the layer manager
m_Layers->Freeze();
wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_Layers );
pane_info.Caption( _( "Visibles" ) );
// TODO(JE) APPEARANCE
wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_appearancePanel );
pane_info.Caption( _( "Appearance" ) );
m_auimgr.Update();
m_Layers->SetLayersManagerTabsText();
ReFillLayerWidget();
// m_Layers->ReFillRender(); // SyncRenderStates() does this
// upate the layer widget to match board visibility states, both layers and render columns.
syncLayerVisibilities();
syncLayerWidgetLayer();
SyncRenderStates();
m_Layers->Thaw();
m_appearancePanel->OnBoardChanged();
// pcbnew-specific toolbars
ReCreateMicrowaveVToolbar();
@ -965,17 +900,16 @@ void PCB_EDIT_FRAME::UpdateUserInterface()
m_SelLayerBox->SetLayerSelection( GetActiveLayer() );
// Update the layer manager
m_Layers->Freeze();
ReFillLayerWidget();
// m_Layers->ReFillRender(); // SyncRenderStates() does this
ENUM_MAP<PCB_LAYER_ID>& layerEnum = ENUM_MAP<PCB_LAYER_ID>::Instance();
// upate the layer widget to match board visibility states, both layers and render columns.
syncLayerVisibilities();
syncLayerWidgetLayer();
SyncRenderStates();
layerEnum.Choices().Clear();
layerEnum.Undefined( UNDEFINED_LAYER );
m_Layers->Thaw();
for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
layerEnum.Map( *seq, GetBoard()->GetLayerName( *seq ) );
// Stackup and/or color theme may have changed
m_appearancePanel->OnBoardChanged();
}
@ -1009,12 +943,6 @@ void PCB_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
{
// switches currently used canvas (Cairo / OpenGL).
PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
// The base class method *does not* reinitialize the layers manager. We must upate the
// layer widget to match board visibility states, both layers and render columns.
syncLayerVisibilities();
syncLayerWidgetLayer();
SyncRenderStates();
}

View File

@ -88,6 +88,7 @@ class PCB_EDIT_FRAME : public PCB_BASE_EDIT_FRAME
{
friend struct PCB::IFACE;
friend class PCB_LAYER_WIDGET;
friend class APPEARANCE_CONTROLS;
/// The auxiliary right vertical tool bar used to access the microwave tools.
ACTION_TOOLBAR* m_microWaveToolBar;
@ -205,25 +206,6 @@ protected:
*/
void onBoardLoaded();
/**
* Function syncLayerWidgetLayer
* updates the currently layer "selection" within the PCB_LAYER_WIDGET.
* The currently selected layer is defined by the return value of GetActiveLayer().
* <p>
* This function cannot be inline without including layer_widget.h in
* here and we do not want to do that.
* </p>
*/
void syncLayerWidgetLayer();
/**
* Function syncLayerVisibilities
* updates each "Layer" checkbox in the layer widget according
* to each layer's current visibility determined by IsLayerVisible(), and is
* helpful immediately after loading a BOARD which may have state information in it.
*/
void syncLayerVisibilities();
/**
* Function doAutoSave
* performs auto save when the board has been modified and not saved within the
@ -486,13 +468,15 @@ public:
*/
void SetActiveLayer( PCB_LAYER_ID aLayer ) override;
PCB_LAYER_WIDGET* GetLayerManager() { return m_Layers; }
APPEARANCE_CONTROLS* GetAppearancePanel() { return m_appearancePanel; }
/**
* Update the UI to reflect changes to the current layer's transparency.
*/
void OnUpdateLayerAlpha( wxUpdateUIEvent& aEvent ) override;
void OnDisplayOptionsChanged() override;
/**
* Function IsElementVisible
* tests whether a given element category is visible. Keep this as an
@ -512,26 +496,6 @@ public:
*/
void SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState );
/**
* Function SetVisibleAlls
* Set the status of all visible element categories and layers to VISIBLE
*/
void SetVisibleAlls();
/**
* Function ReFillLayerWidget
* changes out all the layers in m_Layers and may be called upon
* loading a new BOARD.
*/
void ReFillLayerWidget();
/**
* Updates the "Render" colors and checkboxes in the layer widget according
* to current toggle values determined by IsElementVisible(), and is helpful
* immediately after loading a BOARD which may have state information in it.
*/
void SyncRenderStates();
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas()
void ActivateGalCanvas() override;

View File

@ -58,7 +58,7 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
m_netNamesOnTracks = true;
m_netNamesOnVias = true;
m_zoneOutlines = true;
m_displayZone = DZ_SHOW_FILLED;
m_zoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
m_clearance = CL_NONE;
m_sketchGraphics = false;
m_sketchText = false;
@ -66,6 +66,11 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
m_netColorMode = NET_COLOR_MODE::RATSNEST;
m_contrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
m_trackOpacity = 1.0;
m_viaOpacity = 1.0;
m_padOpacity = 1.0;
m_zoneOpacity = 1.0;
// By default everything should be displayed as filled
for( unsigned int i = 0; i < arrayDim( m_sketchMode ); ++i )
{
@ -175,20 +180,7 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOption
}
// Zone display settings
switch( aOptions.m_DisplayZonesMode )
{
case 0:
m_displayZone = DZ_SHOW_FILLED;
break;
case 1:
m_displayZone = DZ_HIDE_FILLED;
break;
case 2:
m_displayZone = DZ_SHOW_OUTLINED;
break;
}
m_zoneDisplayMode = aOptions.m_ZoneDisplayMode;
// Clearance settings
switch( aOptions.m_ShowTrackClearanceMode )
@ -219,39 +211,27 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOption
m_contrastModeDisplay = aOptions.m_ContrastModeDisplay;
m_netColorMode = aOptions.m_NetColorMode;
m_trackOpacity = aOptions.m_TrackOpacity;
m_viaOpacity = aOptions.m_ViaOpacity;
m_padOpacity = aOptions.m_PadOpacity;
m_zoneOpacity = aOptions.m_ZoneOpacity;
m_showPageLimits = aShowPageLimits;
}
void PCB_RENDER_SETTINGS::LoadNetSettings( const NET_SETTINGS& aSettings, const NETINFO_LIST& aList,
const std::set<int>& aHiddenNets )
{
m_netColors.clear();
for( const auto& pair : aSettings.m_PcbNetColors )
{
if( NETINFO_ITEM* net = aList.GetNetItem( pair.first ) )
m_netColors[net->GetNet()] = pair.second;
}
m_netclassColors.clear();
for( const auto& pair : aSettings.m_NetClasses )
{
if( pair.second->GetPcbColor() != COLOR4D::UNSPECIFIED )
m_netclassColors[pair.first] = pair.second->GetPcbColor();
}
m_hiddenNets = aHiddenNets;
}
const COLOR4D& PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
{
int netCode = -1;
const EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );
const BOARD_CONNECTED_ITEM* conItem = dynamic_cast<const BOARD_CONNECTED_ITEM*> ( aItem );
// Zones should pull from the copper layer
if( item && item->Type() == PCB_ZONE_AREA_T && IsZoneLayer( aLayer ) )
aLayer = aLayer - LAYER_ZONE_START;
// Make items invisible in "other layers hidden" contrast mode
if( m_contrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN && m_activeLayers.count( aLayer ) == 0 )
return COLOR4D::CLEAR;
@ -261,76 +241,84 @@ const COLOR4D& PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer
&& m_activeLayers.count( aLayer ) == 0 )
return COLOR4D::CLEAR;
// Normal path: get the layer base color
COLOR4D color = m_layerColors[aLayer];
if( item )
{
// Selection disambiguation
if( item->IsBrightened() )
{
return m_selectionCandidateColor;
}
// Don't let pads that *should* be NPTHs get lost
if( item->Type() == PCB_PAD_T && dyn_cast<const D_PAD*>( item )->PadShouldBeNPTH() )
aLayer = LAYER_MOD_TEXT_INVISIBLE;
if( item->IsSelected() )
return m_layerColorsSel[aLayer];
if( item->Type() == PCB_MARKER_T )
return m_layerColors[aLayer];
// For vias, some layers depend on other layers in high contrast mode
if( m_hiContrastEnabled && item->Type() == PCB_VIA_T &&
( aLayer == LAYER_VIAS_HOLES ||
aLayer == LAYER_VIA_THROUGH ||
aLayer == LAYER_VIA_MICROVIA ||
aLayer == LAYER_VIA_BBLIND ) )
{
const VIA* via = static_cast<const VIA*>( item );
const BOARD* pcb = static_cast<const BOARD*>( item->GetParent() );
bool viaActiveLayer = false;
for( auto activeLayer : m_activeLayers )
{
auto lay_id = static_cast<PCB_LAYER_ID>( activeLayer );
viaActiveLayer |= via->IsOnLayer( lay_id ) && pcb->IsLayerVisible( lay_id );
}
if( viaActiveLayer )
return m_layerColors[aLayer];
else
return m_hiContrastColor[aLayer];
}
color = m_layerColorsSel[aLayer];
}
else
{
return m_layerColors[aLayer];
}
// Try to obtain the netcode for the item
if( conItem )
netCode = conItem->GetNetCode();
// Single net highlight mode
if( m_highlightEnabled && m_highlightNetcodes.count( netCode ) )
return m_layerColorsHi[aLayer];
// Return grayish color for non-highlighted layers in the dimmed high contrast mode
if( m_contrastModeDisplay == HIGH_CONTRAST_MODE::DIMMED && m_activeLayers.count( aLayer ) == 0 )
return m_hiContrastColor[aLayer];
// Catch the case when highlight and high-contraste modes are enabled
// and we are drawing a not highlighted track
if( m_highlightEnabled )
return m_layerColorsDark[aLayer];
// Apply net color overrides
if( conItem && m_netColorMode == NET_COLOR_MODE::ALL )
{
if( m_netColors.count( conItem->GetNetCode() ) )
return m_netColors.at( conItem->GetNetCode() );
color = m_netColors.at( conItem->GetNetCode() );
else if( m_netclassColors.count( conItem->GetNetClassName() ) )
return m_netclassColors.at( conItem->GetNetClassName() );
color = m_netclassColors.at( conItem->GetNetClassName() );
}
// Single net highlight mode
if( m_highlightEnabled )
color = m_highlightNetcodes.count( netCode ) ? m_layerColorsHi[aLayer]
: m_layerColorsDark[aLayer];
// Return grayish color for non-highlighted layers in the dimmed high contrast mode
if( m_contrastModeDisplay == HIGH_CONTRAST_MODE::DIMMED && m_activeLayers.count( aLayer ) == 0 )
color = m_hiContrastColor[aLayer];
// For vias, some layers depend on other layers in high contrast mode
if( m_hiContrastEnabled && item->Type() == PCB_VIA_T &&
( aLayer == LAYER_VIAS_HOLES ||
aLayer == LAYER_VIA_THROUGH ||
aLayer == LAYER_VIA_MICROVIA ||
aLayer == LAYER_VIA_BBLIND ) )
{
const VIA* via = static_cast<const VIA*>( item );
const BOARD* pcb = static_cast<const BOARD*>( item->GetParent() );
bool viaActiveLayer = false;
for( auto activeLayer : m_activeLayers )
{
auto lay_id = static_cast<PCB_LAYER_ID>( activeLayer );
viaActiveLayer |= via->IsOnLayer( lay_id ) && pcb->IsLayerVisible( lay_id );
}
if( viaActiveLayer )
color = m_layerColors[aLayer];
else
color = m_hiContrastColor[aLayer];
}
// Apply per-type opacity overrides
if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T )
color.a *= m_trackOpacity;
else if( item->Type() == PCB_VIA_T )
color.a *= m_viaOpacity;
else if( item->Type() == PCB_PAD_T )
color.a *= m_padOpacity;
else if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
color.a *= m_zoneOpacity;
// No special modificators enabled
return m_layerColors[aLayer];
return color;
}
@ -494,7 +482,7 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
else if( IsCopperLayer( aLayer ) )
{
// Draw a regular track
const COLOR4D& color = m_pcbSettings.GetColor( aTrack, aLayer );
COLOR4D color = m_pcbSettings.GetColor( aTrack, aLayer );
bool outline_mode = m_pcbSettings.m_sketchMode[LAYER_TRACKS];
m_gal->SetStrokeColor( color );
m_gal->SetFillColor( color );
@ -528,7 +516,7 @@ void PCB_PAINTER::draw( const ARC* aArc, int aLayer )
if( IsCopperLayer( aLayer ) )
{
// Draw a regular track
const COLOR4D& color = m_pcbSettings.GetColor( aArc, aLayer );
COLOR4D color = m_pcbSettings.GetColor( aArc, aLayer );
bool outline_mode = m_pcbSettings.m_sketchMode[LAYER_TRACKS];
m_gal->SetStrokeColor( color );
m_gal->SetFillColor( color );
@ -623,7 +611,7 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer )
radius = getDrillSize(aVia) / 2.0 ;
bool sketchMode = false;
const COLOR4D& color = m_pcbSettings.GetColor( aVia, aLayer );
COLOR4D color = m_pcbSettings.GetColor( aVia, aLayer );
switch( aVia->GetViaType() )
{
@ -1179,14 +1167,21 @@ void PCB_PAINTER::draw( const PCB_GROUP* aGroup, int aLayer )
void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer )
{
PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( aLayer );
/**
* aLayer will be the virtual zone layer (LAYER_ZONE_START, ... in GAL_LAYER_ID)
* This is used for draw ordering in the GAL.
* The color for the zone comes from the associated copper layer ( aLayer - LAYER_ZONE_START )
* and the visibility comes from the combination of that copper layer and LAYER_ZONES
*/
wxASSERT( IsZoneLayer( aLayer ) );
PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( aLayer - LAYER_ZONE_START );
if( !aZone->IsOnLayer( layer ) )
return;
const COLOR4D& color = m_pcbSettings.GetColor( aZone, aLayer );
COLOR4D color = m_pcbSettings.GetColor( aZone, layer );
std::deque<VECTOR2D> corners;
PCB_RENDER_SETTINGS::DISPLAY_ZONE_MODE displayMode = m_pcbSettings.m_displayZone;
ZONE_DISPLAY_MODE displayMode = m_pcbSettings.m_zoneDisplayMode;
// Draw the outline
const SHAPE_POLY_SET* outline = aZone->Outline();
@ -1221,7 +1216,7 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer )
}
// Draw the filling
if( displayMode != PCB_RENDER_SETTINGS::DZ_HIDE_FILLED )
if( displayMode != ZONE_DISPLAY_MODE::HIDE_FILLED )
{
const SHAPE_POLY_SET& polySet = aZone->GetFilledPolysList( layer );
@ -1234,12 +1229,12 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer )
m_gal->SetFillColor( color );
m_gal->SetLineWidth( outline_thickness );
if( displayMode == PCB_RENDER_SETTINGS::DZ_SHOW_FILLED )
if( displayMode == ZONE_DISPLAY_MODE::SHOW_FILLED )
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( outline_thickness > 0 );
}
else if( displayMode == PCB_RENDER_SETTINGS::DZ_SHOW_OUTLINED )
else if( displayMode == ZONE_DISPLAY_MODE::SHOW_OUTLINED )
{
m_gal->SetIsFill( false );
m_gal->SetIsStroke( true );

View File

@ -82,22 +82,6 @@ public:
CL_EXISTING = 0x20
};
///> Determines how zones should be displayed
enum DISPLAY_ZONE_MODE
{
DZ_HIDE_FILLED = 0,
DZ_SHOW_FILLED,
DZ_SHOW_OUTLINED
};
///> Determines how net color overrides should be applied
enum class NET_COLOR_MODE
{
OFF, ///< Net (and netclass) colors are not shown
RATSNEST, ///< Net/netclass colors are shown on ratsnest lines only
ALL ///< Net/netclass colors are shown on all net copper
};
PCB_RENDER_SETTINGS();
/**
@ -108,19 +92,10 @@ public:
*/
void LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions, bool aShowPageLimits );
/**
* Loads net-specific render settings
* @param aSettings is the NET_SETTINGS for the current proejct
* @param aList is the list of nets on the board
* @param aHiddenNets is a list of nets to hide from the ratsnest
*/
void LoadNetSettings( const NET_SETTINGS& aSettings, const NETINFO_LIST& aList,
const std::set<int>& aHiddenNets );
virtual void LoadColors( const COLOR_SETTINGS* aSettings ) override;
/// @copydoc RENDER_SETTINGS::GetColor()
virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
virtual COLOR4D GetColor( const VIEW_ITEM* aItem, int aLayer ) const override;
/**
* Function SetSketchMode
@ -243,7 +218,7 @@ protected:
static const double MAX_FONT_SIZE;
///> Option for different display modes for zones
DISPLAY_ZONE_MODE m_displayZone;
ZONE_DISPLAY_MODE m_zoneDisplayMode;
///> Clearance visibility settings
int m_clearance;
@ -265,6 +240,12 @@ protected:
///> How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
HIGH_CONTRAST_MODE m_contrastModeDisplay;
// These opacity overrides multiply with any opacity in the base layer color
double m_trackOpacity; ///< Opacity override for all tracks
double m_viaOpacity; ///< Opacity override for all types of via
double m_padOpacity; ///< Opacity override for SMD pads and PTHs
double m_zoneOpacity; ///< Opacity override for filled zones
};

View File

@ -48,6 +48,7 @@
#include <footprint_viewer_frame.h>
#include <invoke_pcb_dialog.h>
#include <wildcards_and_files_ext.h>
#include <widgets/appearance_controls.h>
#include <widgets/paged_dialog.h>
#include <widgets/panel_selection_filter.h>
#include <project/net_settings.h>
@ -98,11 +99,16 @@ bool PCB_EDIT_FRAME::LoadProjectSettings()
pglayout.SetPageLayout( filename );
// Load render settings that aren't stored in PCB_DISPLAY_OPTIONS
NET_SETTINGS& netSettings = project.NetSettings();
NETINFO_LIST& nets = GetBoard()->GetNetInfo();
KIGFX::PCB_RENDER_SETTINGS* rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>(
GetCanvas()->GetView()->GetPainter()->GetSettings() );
NETINFO_LIST& nets = GetBoard()->GetNetInfo();
std::set<int> hiddenNets;
std::set<int>& hiddenNets = rs->GetHiddenNets();
hiddenNets.clear();
for( const wxString& hidden : localSettings.m_HiddenNets )
{
@ -110,7 +116,26 @@ bool PCB_EDIT_FRAME::LoadProjectSettings()
hiddenNets.insert( net->GetNet() );
}
rs->LoadNetSettings( project.NetSettings(), nets, hiddenNets );
std::map<int, KIGFX::COLOR4D>& netColors = rs->GetNetColorMap();
netColors.clear();
for( const auto& pair : netSettings.m_PcbNetColors )
{
if( NETINFO_ITEM* net = nets.GetNetItem( pair.first ) )
netColors[net->GetNet()] = pair.second;
}
std::map<wxString, KIGFX::COLOR4D>& netclassColors = rs->GetNetclassColorMap();
netclassColors.clear();
for( const auto& pair : netSettings.m_NetClasses )
{
if( pair.second->GetPcbColor() != COLOR4D::UNSPECIFIED )
netclassColors[pair.first] = pair.second->GetPcbColor();
}
m_appearancePanel->SetUserLayerPresets( project.m_LayerPresets );
m_appearancePanel->ApplyLayerPreset( localSettings.m_ActiveLayerPreset );
SELECTION_FILTER_OPTIONS& filterOpts = GetToolManager()->GetTool<SELECTION_TOOL>()->GetFilter();
@ -119,6 +144,11 @@ bool PCB_EDIT_FRAME::LoadProjectSettings()
PCB_DISPLAY_OPTIONS opts = GetDisplayOptions();
opts.m_ContrastModeDisplay = localSettings.m_ContrastModeDisplay;
opts.m_NetColorMode = localSettings.m_NetColorMode;
opts.m_TrackOpacity = localSettings.m_TrackOpacity;
opts.m_ViaOpacity = localSettings.m_ViaOpacity;
opts.m_PadOpacity = localSettings.m_PadOpacity;
opts.m_ZoneOpacity = localSettings.m_ZoneOpacity;
SetDisplayOptions( opts );
SetActiveLayer( localSettings.m_ActiveLayer );
@ -146,11 +176,26 @@ void PCB_EDIT_FRAME::SaveProjectSettings()
// TODO: Can this be pulled out of BASE_SCREEN?
project.m_BoardPageLayoutDescrFile = BASE_SCREEN::m_PageLayoutDescrFileName;
project.m_LayerPresets = m_appearancePanel->GetUserLayerPresets();
RecordDRCExclusions();
localSettings.m_ActiveLayer = GetActiveLayer();
// Save appearance control settings
localSettings.m_ContrastModeDisplay = GetDisplayOptions().m_ContrastModeDisplay;
localSettings.m_ActiveLayer = GetActiveLayer();
localSettings.m_ActiveLayerPreset = m_appearancePanel->GetActiveLayerPreset();
const PCB_DISPLAY_OPTIONS& displayOpts = GetDisplayOptions();
localSettings.m_ContrastModeDisplay = displayOpts.m_ContrastModeDisplay;
localSettings.m_NetColorMode = displayOpts.m_NetColorMode;
localSettings.m_TrackOpacity = displayOpts.m_TrackOpacity;
localSettings.m_ViaOpacity = displayOpts.m_ViaOpacity;
localSettings.m_PadOpacity = displayOpts.m_PadOpacity;
localSettings.m_ZoneOpacity = displayOpts.m_ZoneOpacity;
localSettings.m_ZoneDisplayMode = displayOpts.m_ZoneDisplayMode;
// Save render settings that aren't stored in PCB_DISPLAY_OPTIONS
KIGFX::PCB_RENDER_SETTINGS* rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>(
GetCanvas()->GetView()->GetPainter()->GetSettings() );
@ -165,6 +210,25 @@ void PCB_EDIT_FRAME::SaveProjectSettings()
localSettings.m_HiddenNets.emplace_back( net->GetNetname() );
}
NET_SETTINGS& netSettings = project.NetSettings();
netSettings.m_PcbNetColors.clear();
for( const auto& pair : rs->GetNetColorMap() )
{
if( NETINFO_ITEM* net = nets.GetNetItem( pair.first ) )
netSettings.m_PcbNetColors[net->GetNetname()] = pair.second;
}
std::map<wxString, KIGFX::COLOR4D>& netclassColors = rs->GetNetclassColorMap();
// NOTE: this assumes netclasses will have already been updated, which I think is the case
for( const auto& pair : netSettings.m_NetClasses )
{
if( netclassColors.count( pair.first ) )
pair.second->SetPcbColor( netclassColors.at( pair.first ) );
}
SELECTION_FILTER_OPTIONS& filterOpts = GetToolManager()->GetTool<SELECTION_TOOL>()->GetFilter();
localSettings.m_SelectionFilter = filterOpts;

View File

@ -165,8 +165,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
m_params.emplace_back(
new PARAM<bool>( "pcb_display.via_fill", &m_Display.m_DisplayViaFill, true ) );
m_params.emplace_back(
new PARAM<int>( "pcb_display.zone_mode", &m_Display.m_DisplayZonesMode, 0, 0, 2 ) );
m_params.emplace_back( new PARAM_ENUM<ZONE_DISPLAY_MODE>( "pcb_display.zone_mode",
&m_Display.m_ZoneDisplayMode, ZONE_DISPLAY_MODE::SHOW_FILLED,
ZONE_DISPLAY_MODE::SHOW_OUTLINED, ZONE_DISPLAY_MODE::SHOW_FILLED ) );
m_params.emplace_back(
new PARAM<double>( "plot.line_width", &m_PlotLineWidth, 0.1, 0.01, 5.0 ) );

View File

@ -76,15 +76,16 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
gal->SetLineWidth( 1.0 );
auto rs = static_cast<PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
COLOR4D defaultColor = rs->GetColor( nullptr, LAYER_RATSNEST );
COLOR4D color = defaultColor;
bool colorByNet = rs->GetNetColorMode() != PCB_RENDER_SETTINGS::NET_COLOR_MODE::OFF;
COLOR4D defaultColor = rs->GetColor( nullptr, LAYER_RATSNEST );
COLOR4D color = defaultColor;
const bool colorByNet = rs->GetNetColorMode() != NET_COLOR_MODE::OFF;
std::set<int> highlightedNets = rs->GetHighlightNetCodes();
const std::set<int>& hiddenNets = rs->GetHiddenNets();
std::map<int, KIGFX::COLOR4D>& netColors = rs->GetNetColorMap();
std::map<int, KIGFX::COLOR4D>& netColors = rs->GetNetColorMap();
std::map<wxString, KIGFX::COLOR4D>& netclassColors = rs->GetNetclassColorMap();
const std::map<int, wxString>& netclassMap = m_data->GetNetclassMap();
const bool curved_ratsnest = rs->GetCurvedRatsnestLinesEnabled();
@ -96,9 +97,15 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
if( colorByNet && netColors.count( l.netCode ) )
color = netColors.at( l.netCode );
else if( colorByNet && netclassMap.count( l.netCode )
&& netclassColors.count( netclassMap.at( l.netCode ) ) )
color = netclassColors.at( netclassMap.at( l.netCode ) );
else
color = defaultColor;
if( color == COLOR4D::UNSPECIFIED )
color = defaultColor;
gal->SetStrokeColor( color.Brightened( 0.5 ) );
if ( l.a == l.b )
@ -137,9 +144,15 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
if( colorByNet && netColors.count( i ) )
color = netColors.at( i );
else if( colorByNet && netclassMap.count( i )
&& netclassColors.count( netclassMap.at( i ) ) )
color = netclassColors.at( netclassMap.at( i ) );
else
color = defaultColor;
if( color == COLOR4D::UNSPECIFIED )
color = defaultColor;
// Draw the "static" ratsnest
if( highlightedNets.count( i ) )
gal->SetStrokeColor( color.Brightened(0.8) );

View File

@ -868,9 +868,6 @@ bool ROUTER_TOOL::prepareInteractive()
editFrame->SetActiveLayer( ToLAYER_ID( routingLayer ) );
// Force layer visible
editFrame->GetLayerManager()->SetLayerVisible( routingLayer, true );
// for some reason I don't understand, GetNetclass() may return null sometimes...
if( m_startItem && m_startItem->Net() >= 0 &&
m_startItem->Parent() && m_startItem->Parent()->GetNetClass() )

View File

@ -33,6 +33,10 @@
*/
%ignore operator+(const GAL_LAYER_ID&, int);
// Force the GAL_LAYER_ID version to be exposed
%ignore GAL_SET::set(int, bool);
%ignore GAL_SET::set(int);
%include layers_id_colors_and_visibility.h
// Extend LSET by 2 methods to add or remove layers from the layer list

View File

@ -704,7 +704,7 @@ void PCB_EDIT_FRAME::SyncToolbars()
auto& opts = GetDisplayOptions();
KIGFX::GAL_DISPLAY_OPTIONS& galOpts = GetGalDisplayOptions();
int zoneMode = opts.m_DisplayZonesMode;
ZONE_DISPLAY_MODE zoneMode = opts.m_ZoneDisplayMode;
m_mainToolBar->Toggle( ACTIONS::save, IsContentModified() );
m_mainToolBar->Toggle( ACTIONS::undo, GetUndoCommandCount() > 0 );
@ -731,15 +731,18 @@ void PCB_EDIT_FRAME::SyncToolbars()
m_optionsToolBar->Toggle( PCB_ACTIONS::showLayersManager, LayerManagerShown() );
m_optionsToolBar->Toggle( PCB_ACTIONS::showMicrowaveToolbar, MicrowaveToolbarShown() );
bool hcm = opts.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL;
m_optionsToolBar->Toggle( PCB_ACTIONS::zoneDisplayEnable,
zoneMode == ZONE_DISPLAY_MODE::SHOW_FILLED );
m_optionsToolBar->Toggle( PCB_ACTIONS::zoneDisplayDisable,
zoneMode == ZONE_DISPLAY_MODE::HIDE_FILLED );
m_optionsToolBar->Toggle( PCB_ACTIONS::zoneDisplayOutlines,
zoneMode == ZONE_DISPLAY_MODE::SHOW_OUTLINED );
m_optionsToolBar->Toggle( PCB_ACTIONS::zoneDisplayEnable, zoneMode == 0 );
m_optionsToolBar->Toggle( PCB_ACTIONS::zoneDisplayDisable, zoneMode == 1 );
m_optionsToolBar->Toggle( PCB_ACTIONS::zoneDisplayOutlines, zoneMode == 2 );
m_optionsToolBar->Toggle( PCB_ACTIONS::trackDisplayMode, !opts.m_DisplayPcbTrackFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::viaDisplayMode, !opts.m_DisplayViaFill );
m_optionsToolBar->Toggle( PCB_ACTIONS::padDisplayMode, !opts.m_DisplayPadFill );
m_optionsToolBar->Toggle( ACTIONS::highContrastMode, hcm );
m_optionsToolBar->Toggle( ACTIONS::highContrastMode,
opts.m_ContrastModeDisplay != HIGH_CONTRAST_MODE::NORMAL );
m_optionsToolBar->Refresh();
TOGGLE_TOOL( m_drawToolBar, ACTIONS::selectionTool );

View File

@ -272,18 +272,19 @@ int PCB_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent )
int PCB_INSPECTION_TOOL::HighlightNet( const TOOL_EVENT& aEvent )
{
int netcode = aEvent.Parameter<intptr_t>();
KIGFX::RENDER_SETTINGS* settings = m_toolMgr->GetView()->GetPainter()->GetSettings();
int netcode = aEvent.Parameter<intptr_t>();
KIGFX::RENDER_SETTINGS* settings = m_toolMgr->GetView()->GetPainter()->GetSettings();
const std::set<int>& highlighted = settings->GetHighlightNetCodes();
if( netcode > 0 )
{
m_lastNetcode = *settings->GetHighlightNetCodes().begin();
m_lastNetcode = highlighted.empty() ? -1 : *highlighted.begin();
settings->SetHighlight( true, netcode );
m_toolMgr->GetView()->UpdateAllLayersColor();
}
else if( aEvent.IsAction( &PCB_ACTIONS::toggleLastNetHighlight ) )
{
int temp = *settings->GetHighlightNetCodes().begin();
int temp = highlighted.empty() ? -1 : *highlighted.begin();
settings->SetHighlight( true, m_lastNetcode );
m_toolMgr->GetView()->UpdateAllLayersColor();
m_lastNetcode = temp;

View File

@ -184,13 +184,16 @@ int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
// Apply new display options to the GAL canvas
if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayEnable ) )
opts.m_DisplayZonesMode = 0;
opts.m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayDisable ) )
opts.m_DisplayZonesMode = 1;
opts.m_ZoneDisplayMode = ZONE_DISPLAY_MODE::HIDE_FILLED;
else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayOutlines ) )
opts.m_DisplayZonesMode = 2;
opts.m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_OUTLINED;
else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayToggle ) )
opts.m_DisplayZonesMode = ( opts.m_DisplayZonesMode + 1 ) % 3;
{
int nextMode = ( static_cast<int>( opts.m_ZoneDisplayMode ) + 1 ) % 3;
opts.m_ZoneDisplayMode = static_cast<ZONE_DISPLAY_MODE>( nextMode );
}
else
wxFAIL;

View File

@ -66,9 +66,6 @@ public:
// Rotate through the available high-contrast modes
int HighContrastModeCycle( const TOOL_EVENT& aEvent );
// Layer view presets
int ApplyLayerPreset( const TOOL_EVENT& aEvent );
// Layer control
int LayerSwitch( const TOOL_EVENT& aEvent );
int LayerNext( const TOOL_EVENT& aEvent );

View File

@ -460,15 +460,17 @@ const GENERAL_COLLECTORS_GUIDE SELECTION_TOOL::getCollectorsGuide() const
GENERAL_COLLECTORS_GUIDE guide( board()->GetVisibleLayers(),
(PCB_LAYER_ID) view()->GetTopLayer(), view() );
bool padsDisabled = !board()->IsElementVisible( LAYER_PADS );
// account for the globals
guide.SetIgnoreMTextsMarkedNoShow( ! board()->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) );
guide.SetIgnoreMTextsOnBack( ! board()->IsElementVisible( LAYER_MOD_TEXT_BK ) );
guide.SetIgnoreMTextsOnFront( ! board()->IsElementVisible( LAYER_MOD_TEXT_FR ) );
guide.SetIgnoreModulesOnBack( ! board()->IsElementVisible( LAYER_MOD_BK ) );
guide.SetIgnoreModulesOnFront( ! board()->IsElementVisible( LAYER_MOD_FR ) );
guide.SetIgnorePadsOnBack( ! board()->IsElementVisible( LAYER_PAD_BK ) );
guide.SetIgnorePadsOnFront( ! board()->IsElementVisible( LAYER_PAD_FR ) );
guide.SetIgnoreThroughHolePads( ! board()->IsElementVisible( LAYER_PADS_TH ) );
guide.SetIgnorePadsOnBack( padsDisabled || ! board()->IsElementVisible( LAYER_PAD_BK ) );
guide.SetIgnorePadsOnFront( padsDisabled || ! board()->IsElementVisible( LAYER_PAD_FR ) );
guide.SetIgnoreThroughHolePads( padsDisabled || ! board()->IsElementVisible( LAYER_PADS_TH ) );
guide.SetIgnoreModulesVals( ! board()->IsElementVisible( LAYER_MOD_VALUES ) );
guide.SetIgnoreModulesRefs( ! board()->IsElementVisible( LAYER_MOD_REFERENCES ) );
guide.SetIgnoreThroughVias( ! board()->IsElementVisible( LAYER_VIA_THROUGH ) );
@ -488,7 +490,7 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag,
GENERAL_COLLECTOR collector;
auto& displayOpts = m_frame->GetDisplayOptions();
guide.SetIgnoreZoneFills( displayOpts.m_DisplayZonesMode != 0 );
guide.SetIgnoreZoneFills( displayOpts.m_ZoneDisplayMode != ZONE_DISPLAY_MODE::SHOW_FILLED );
if( m_enteredGroup &&
!m_enteredGroup->GetBoundingBox().Contains( wxPoint( aWhere.x, aWhere.y ) ) )
@ -1045,12 +1047,22 @@ void SELECTION_TOOL::selectAllItemsOnNet( int aNetCode )
auto connectivity = board()->GetConnectivity();
for( BOARD_CONNECTED_ITEM* item : connectivity->GetNetItems( aNetCode, types ) )
select( item );
if( itemPassesFilter( item ) )
select( item );
}
int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent )
{
// If we've been passed an argument, just select that netcode
int netcode = aEvent.Parameter<intptr_t>();
if( netcode > 0 )
{
selectAllItemsOnNet( netcode );
return 0;
}
if( !selectCursor() )
return 0;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,286 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020 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/>.
*/
#ifndef _APPEARANCE_CONTROLS_H
#define _APPEARANCE_CONTROLS_H
#include <vector>
#include <class_board.h>
#include <gal/color4d.h>
#include <layers_id_colors_and_visibility.h>
#include <project/board_project_settings.h>
#include <widgets/appearance_controls_base.h>
class BITMAP_TOGGLE;
class COLOR_SWATCH;
class INDICATOR_ICON;
class PCB_BASE_FRAME;
class ROW_ICON_PROVIDER;
using KIGFX::COLOR4D;
class APPEARANCE_CONTROLS : public APPEARANCE_CONTROLS_BASE, public BOARD_LISTENER
{
public:
/**
* Container for an appearance setting (can control a single board layer, or GAL layer, etc)
*/
struct APPEARANCE_SETTING
{
int id;
wxString label;
wxString tooltip;
bool visible;
bool can_control_opacity;
bool spacer;
wxPanel* ctl_panel;
INDICATOR_ICON* ctl_indicator;
BITMAP_TOGGLE* ctl_visibility;
COLOR_SWATCH* ctl_color;
wxStaticText* ctl_text;
wxSlider* ctl_opacity;
APPEARANCE_SETTING( const wxString& aLabel, int aId,
const wxString& aTooltip = wxEmptyString,
bool aCanControlOpacity = false )
{
label = aLabel;
id = aId;
tooltip = aTooltip;
spacer = false;
visible = true;
can_control_opacity = aCanControlOpacity;
ctl_panel = nullptr;
ctl_indicator = nullptr;
ctl_visibility = nullptr;
ctl_color = nullptr;
ctl_text = nullptr;
ctl_opacity = nullptr;
}
APPEARANCE_SETTING() :
id( -1 ), label( "" ), tooltip( "" ), visible( false ),
can_control_opacity( false ), spacer( true )
{
}
};
APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner, bool aFpEditor = false );
wxSize GetBestSize() const;
///> Updates the panel contents from the application and board models
void OnBoardChanged();
void OnBoardNetSettingsChanged( BOARD& aBoard ) override;
void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
///> Updates the colors on all the widgets from the new chosen color theme
void OnColorThemeChanged();
///> Updates the widget when the active board layer is changed
void OnLayerChanged();
///> Manually update visibility for a given layer
void SetLayerVisible( LAYER_NUM aLayer, bool isVisible );
void SetObjectVisible( GAL_LAYER_ID aLayer, bool isVisible = true );
///> Updates the manual layer alpha overrides
void OnLayerAlphaChanged();
void UpdateDisplayOptions();
///> Returns a list of the layer presets created by the user
std::vector<LAYER_PRESET> GetUserLayerPresets() const;
///> Updates the current layer presets from those saved in the project file
void SetUserLayerPresets( std::vector<LAYER_PRESET>& aPresetList );
void ApplyLayerPreset( const wxString& aPresetName );
void ApplyLayerPreset( const LAYER_PRESET& aPreset );
wxString GetActiveLayerPreset() const
{
if( m_currentPreset )
return m_currentPreset->name;
else
return wxEmptyString;
}
void OnColorSwatchChanged( wxCommandEvent& aEvent );
void OnLayerContextMenu( wxCommandEvent& aEvent );
protected:
void OnLayerDisplayPaneChanged( wxCollapsiblePaneEvent& event ) override;
void OnNetDisplayPaneChanged( wxCollapsiblePaneEvent& event ) override;
void OnBtnDeleteLayerPreset( wxCommandEvent& event ) override;
void OnNotebookPageChanged( wxNotebookEvent& event ) override;
private:
PCB_BASE_FRAME* m_frame;
static const APPEARANCE_SETTING s_objectSettings[];
ROW_ICON_PROVIDER* m_iconProvider;
BOARD* m_board;
std::vector<std::unique_ptr<APPEARANCE_SETTING>> m_layerSettings;
std::map<PCB_LAYER_ID, APPEARANCE_SETTING*> m_layerSettingsMap;
std::vector<std::unique_ptr<APPEARANCE_SETTING>> m_objectSettings;
std::map<GAL_LAYER_ID, APPEARANCE_SETTING*> m_objectSettingsMap;
std::vector<std::unique_ptr<APPEARANCE_SETTING>> m_netSettings;
std::map<int, APPEARANCE_SETTING*> m_netSettingsMap;
std::vector<std::unique_ptr<APPEARANCE_SETTING>> m_netclassSettings;
std::map<wxString, APPEARANCE_SETTING*> m_netclassSettingsMap;
// TODO(JE) Move preset storage to the PCBNEW_CONTROL tool
// Storage for all layer presets
std::map<wxString, LAYER_PRESET> m_layerPresets;
LAYER_PRESET* m_currentPreset;
wxMenu* m_layerContextMenu;
/// Stores wxIDs for each netclass for control event mapping
std::map<int, wxString> m_netclassIdMap;
/// The net code of the net that was right-clicked
int m_contextMenuNetCode;
/// The name of the netclass that was right-clicked
wxString m_contextMenuNetclass;
// The built-in layer presets
static LAYER_PRESET presetNoLayers;
static LAYER_PRESET presetAllLayers;
static LAYER_PRESET presetAllCopper;
static LAYER_PRESET presetInnerCopper;
static LAYER_PRESET presetFront;
static LAYER_PRESET presetFrontAssembly;
static LAYER_PRESET presetBack;
static LAYER_PRESET presetBackAssembly;
int m_pointSize;
enum POPUP_ID
{
ID_CHANGE_COLOR = wxID_HIGHEST,
ID_SET_NET_COLOR,
ID_CLEAR_NET_COLOR,
ID_SHOW_ALL_NETS,
ID_HIDE_OTHER_NETS,
ID_HIGHLIGHT_NET,
ID_SELECT_NET,
ID_SHOW_ALL_COPPER_LAYERS,
ID_HIDE_ALL_COPPER_LAYERS,
ID_HIDE_ALL_BUT_ACTIVE,
ID_PRESET_NO_LAYERS,
ID_PRESET_ALL_LAYERS,
ID_PRESET_FRONT,
ID_PRESET_FRONT_ASSEMBLY,
ID_PRESET_INNER_COPPER,
ID_PRESET_BACK,
ID_PRESET_BACK_ASSEMBLY,
ID_HIDE_ALL_NON_COPPER,
ID_SHOW_ALL_NON_COPPER,
ID_LAST_VALUE
};
void rebuildLayers();
void rebuildLayerContextMenu();
void syncColorsAndVisibility();
void rebuildObjects();
void syncObjectSettings();
void rebuildNets();
void loadDefaultLayerPresets();
void rebuildLayerPresetsWidget();
void syncLayerPresetSelection();
void updateDeleteLayerPresetButton();
void onLayerClick( wxMouseEvent& aEvent );
void onLayerVisibilityChanged( PCB_LAYER_ID aLayer, bool isVisible, bool isFinal );
void onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool isVisible, bool isFinal );
void onObjectOpacitySlider( int aLayer, float aOpacity );
void updateLayerPresetSelection( const wxString& aName );
void onLayerPresetChanged( wxCommandEvent& aEvent );
void doApplyLayerPreset( const LAYER_PRESET& aPreset );
void onNetclassVisibilityChanged( wxCommandEvent& aEvent );
void showNetclass( const wxString& aClassName, bool aShow = true );
void onNetContextMenu( wxCommandEvent& aEvent );
void onNetclassColorChanged( wxCommandEvent& aEvent );
wxString netclassNameFromEvent( wxEvent& aEvent );
void onNetColorModeChanged( wxCommandEvent& aEvent );
void onNetclassContextMenu( wxCommandEvent& aEvent );
void handleBoardItemsChanged();
};
#endif

View File

@ -0,0 +1,283 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "appearance_controls_base.h"
///////////////////////////////////////////////////////////////////////////
APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
this->SetFont( wxFont( 9, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
m_sizerOuter = new wxBoxSizer( wxVERTICAL );
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panelLayers = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelLayersSizer = new wxBoxSizer( wxVERTICAL );
m_windowLayers = new wxScrolledWindow( m_panelLayers, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_windowLayers->SetScrollRate( 0, 5 );
m_windowLayers->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
m_layers_outer_sizer = new wxBoxSizer( wxVERTICAL );
m_windowLayers->SetSizer( m_layers_outer_sizer );
m_windowLayers->Layout();
m_layers_outer_sizer->Fit( m_windowLayers );
m_panelLayersSizer->Add( m_windowLayers, 1, wxEXPAND | wxALL, 5 );
m_paneLayerDisplay = new wxCollapsiblePane( m_panelLayers, wxID_ANY, wxT("Layer Display Options"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE|wxBORDER_NONE|wxCLIP_CHILDREN|wxFULL_REPAINT_ON_RESIZE );
m_paneLayerDisplay->Collapse( true );
wxBoxSizer* bSizer121;
bSizer121 = new wxBoxSizer( wxVERTICAL );
m_staticText13 = new wxStaticText( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Show non-active layers as:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText13->Wrap( -1 );
bSizer121->Add( m_staticText13, 0, wxALL, 5 );
wxBoxSizer* bSizer19;
bSizer19 = new wxBoxSizer( wxHORIZONTAL );
m_rbHighContrastNormal = new wxRadioButton( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Normal"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_rbHighContrastNormal->SetValue( true );
m_rbHighContrastNormal->SetToolTip( wxT("Non-active layers will be shown in full color") );
bSizer19->Add( m_rbHighContrastNormal, 0, wxALL, 5 );
m_rbHighContrastDim = new wxRadioButton( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Dimmed"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbHighContrastDim->SetToolTip( wxT("Non-active layers will be dimmed") );
bSizer19->Add( m_rbHighContrastDim, 0, wxALL, 5 );
m_rbHighContrastOff = new wxRadioButton( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Off"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbHighContrastOff->SetToolTip( wxT("Non-active layers will be hidden") );
bSizer19->Add( m_rbHighContrastOff, 0, wxALL, 5 );
bSizer121->Add( bSizer19, 0, wxEXPAND, 5 );
m_staticline5 = new wxStaticLine( m_paneLayerDisplay->GetPane(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer121->Add( m_staticline5, 0, wxEXPAND | wxALL, 5 );
m_cbFlipBoard = new wxCheckBox( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Flip board view"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer121->Add( m_cbFlipBoard, 0, wxALL, 5 );
m_paneLayerDisplay->GetPane()->SetSizer( bSizer121 );
m_paneLayerDisplay->GetPane()->Layout();
bSizer121->Fit( m_paneLayerDisplay->GetPane() );
m_panelLayersSizer->Add( m_paneLayerDisplay, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
m_panelLayers->SetSizer( m_panelLayersSizer );
m_panelLayers->Layout();
m_panelLayersSizer->Fit( m_panelLayers );
m_notebook->AddPage( m_panelLayers, wxT("Layers"), true );
m_panelObjects = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelObjects->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
m_objectsPanelSizer = new wxBoxSizer( wxVERTICAL );
m_windowObjects = new wxScrolledWindow( m_panelObjects, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_windowObjects->SetScrollRate( 0, 5 );
m_windowObjects->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
m_objectsSizer = new wxGridBagSizer( 0, 0 );
m_objectsSizer->SetFlexibleDirection( wxBOTH );
m_objectsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_windowObjects->SetSizer( m_objectsSizer );
m_windowObjects->Layout();
m_objectsSizer->Fit( m_windowObjects );
m_objectsPanelSizer->Add( m_windowObjects, 1, wxEXPAND | wxALL, 5 );
m_panelObjects->SetSizer( m_objectsPanelSizer );
m_panelObjects->Layout();
m_objectsPanelSizer->Fit( m_panelObjects );
m_notebook->AddPage( m_panelObjects, wxT("Objects"), false );
m_panelNetsAndClasses = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer16;
bSizer16 = new wxBoxSizer( wxVERTICAL );
m_netsTabSplitter = new wxSplitterWindow( m_panelNetsAndClasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
m_netsTabSplitter->SetSashGravity( 0.8 );
m_netsTabSplitter->Connect( wxEVT_IDLE, wxIdleEventHandler( APPEARANCE_CONTROLS_BASE::m_netsTabSplitterOnIdle ), NULL, this );
m_netsTabSplitter->SetMinimumPaneSize( 80 );
m_panelNets = new wxPanel( m_netsTabSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer192;
bSizer192 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer17;
bSizer17 = new wxBoxSizer( wxHORIZONTAL );
m_staticText141 = new wxStaticText( m_panelNets, wxID_ANY, wxT("Nets"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText141->Wrap( -1 );
m_staticText141->SetFont( wxFont( 9, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizer17->Add( m_staticText141, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
m_txtNetFilter = new wxTextCtrl( m_panelNets, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_txtNetFilter->Hide();
bSizer17->Add( m_txtNetFilter, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxTOP, 5 );
m_btnNetInspector = new wxBitmapButton( m_panelNets, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
m_btnNetInspector->SetToolTip( wxT("Show the Net Inspector") );
bSizer17->Add( m_btnNetInspector, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
bSizer192->Add( bSizer17, 0, wxEXPAND, 5 );
m_netsScrolledWindow = new wxScrolledWindow( m_panelNets, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_netsScrolledWindow->SetScrollRate( 5, 5 );
m_netsOuterSizer = new wxBoxSizer( wxVERTICAL );
m_netsScrolledWindow->SetSizer( m_netsOuterSizer );
m_netsScrolledWindow->Layout();
m_netsOuterSizer->Fit( m_netsScrolledWindow );
bSizer192->Add( m_netsScrolledWindow, 1, wxEXPAND | wxALL, 5 );
m_panelNets->SetSizer( bSizer192 );
m_panelNets->Layout();
bSizer192->Fit( m_panelNets );
m_panelNetclasses = new wxPanel( m_netsTabSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer21;
bSizer21 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer20;
bSizer20 = new wxBoxSizer( wxHORIZONTAL );
m_staticText14 = new wxStaticText( m_panelNetclasses, wxID_ANY, wxT("Net Classes"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
m_staticText14->SetFont( wxFont( 9, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizer20->Add( m_staticText14, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
m_btnConfigureNetClasses = new wxBitmapButton( m_panelNetclasses, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
m_btnConfigureNetClasses->SetToolTip( wxT("Configure net classes") );
bSizer20->Add( m_btnConfigureNetClasses, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
bSizer21->Add( bSizer20, 0, wxEXPAND, 5 );
m_netclassScrolledWindow = new wxScrolledWindow( m_panelNetclasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_netclassScrolledWindow->SetScrollRate( 5, 5 );
m_netclassOuterSizer = new wxBoxSizer( wxVERTICAL );
m_netclassScrolledWindow->SetSizer( m_netclassOuterSizer );
m_netclassScrolledWindow->Layout();
m_netclassOuterSizer->Fit( m_netclassScrolledWindow );
bSizer21->Add( m_netclassScrolledWindow, 1, wxEXPAND | wxALL, 5 );
m_panelNetclasses->SetSizer( bSizer21 );
m_panelNetclasses->Layout();
bSizer21->Fit( m_panelNetclasses );
m_netsTabSplitter->SplitHorizontally( m_panelNets, m_panelNetclasses, 300 );
bSizer16->Add( m_netsTabSplitter, 1, wxEXPAND, 5 );
m_paneNetDisplay = new wxCollapsiblePane( m_panelNetsAndClasses, wxID_ANY, wxT("Net Display Options"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE );
m_paneNetDisplay->Collapse( true );
wxBoxSizer* bSizer1211;
bSizer1211 = new wxBoxSizer( wxVERTICAL );
m_staticText131 = new wxStaticText( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("Show net colors on:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText131->Wrap( -1 );
m_staticText131->SetToolTip( wxT("Choose when to show net and netclass colors") );
bSizer1211->Add( m_staticText131, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer191;
bSizer191 = new wxBoxSizer( wxHORIZONTAL );
m_rbNetColorOff = new wxRadioButton( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("Off"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_rbNetColorOff->SetToolTip( wxT("Net and netclass colors are not shown") );
bSizer191->Add( m_rbNetColorOff, 0, wxLEFT|wxTOP, 5 );
m_rbNetColorRatsnest = new wxRadioButton( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("Ratsnest"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbNetColorRatsnest->SetValue( true );
m_rbNetColorRatsnest->SetToolTip( wxT("Net and netclass colors are shown on the ratsnest only") );
bSizer191->Add( m_rbNetColorRatsnest, 0, wxLEFT|wxTOP, 5 );
m_rbNetColorAll = new wxRadioButton( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("All Items"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbNetColorAll->SetToolTip( wxT("Net and netclass colors are shown on all copper items") );
bSizer191->Add( m_rbNetColorAll, 0, wxALL, 5 );
bSizer1211->Add( bSizer191, 0, wxEXPAND, 5 );
m_paneNetDisplay->GetPane()->SetSizer( bSizer1211 );
m_paneNetDisplay->GetPane()->Layout();
bSizer1211->Fit( m_paneNetDisplay->GetPane() );
bSizer16->Add( m_paneNetDisplay, 0, wxEXPAND | wxALL, 5 );
m_panelNetsAndClasses->SetSizer( bSizer16 );
m_panelNetsAndClasses->Layout();
bSizer16->Fit( m_panelNetsAndClasses );
m_notebook->AddPage( m_panelNetsAndClasses, wxT("Nets"), false );
m_sizerOuter->Add( m_notebook, 1, wxEXPAND | wxALL, 5 );
wxStaticBoxSizer* presetsSizer;
presetsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Layer Presets") ), wxHORIZONTAL );
wxString m_cbLayerPresetsChoices[] = { wxT("All Layers"), wxT("(unsaved)") };
int m_cbLayerPresetsNChoices = sizeof( m_cbLayerPresetsChoices ) / sizeof( wxString );
m_cbLayerPresets = new wxChoice( presetsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbLayerPresetsNChoices, m_cbLayerPresetsChoices, 0 );
m_cbLayerPresets->SetSelection( 1 );
presetsSizer->Add( m_cbLayerPresets, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_btnDeletePreset = new wxBitmapButton( presetsSizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_btnDeletePreset->Enable( false );
m_btnDeletePreset->SetToolTip( wxT("Delete this layer preset") );
presetsSizer->Add( m_btnDeletePreset, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
m_sizerOuter->Add( presetsSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
this->SetSizer( m_sizerOuter );
this->Layout();
// Connect Events
m_notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( APPEARANCE_CONTROLS_BASE::OnNotebookPageChanged ), NULL, this );
m_paneLayerDisplay->Connect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnLayerDisplayPaneChanged ), NULL, this );
m_cbFlipBoard->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnFlipBoardChecked ), NULL, this );
m_paneNetDisplay->Connect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnNetDisplayPaneChanged ), NULL, this );
m_cbLayerPresets->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnLayerPresetChanged ), NULL, this );
m_btnDeletePreset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnBtnDeleteLayerPreset ), NULL, this );
}
APPEARANCE_CONTROLS_BASE::~APPEARANCE_CONTROLS_BASE()
{
// Disconnect Events
m_notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( APPEARANCE_CONTROLS_BASE::OnNotebookPageChanged ), NULL, this );
m_paneLayerDisplay->Disconnect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnLayerDisplayPaneChanged ), NULL, this );
m_cbFlipBoard->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnFlipBoardChecked ), NULL, this );
m_paneNetDisplay->Disconnect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnNetDisplayPaneChanged ), NULL, this );
m_cbLayerPresets->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnLayerPresetChanged ), NULL, this );
m_btnDeletePreset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnBtnDeleteLayerPreset ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,107 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/sizer.h>
#include <wx/gdicmn.h>
#include <wx/scrolwin.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/radiobut.h>
#include <wx/statline.h>
#include <wx/checkbox.h>
#include <wx/collpane.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/gbsizer.h>
#include <wx/textctrl.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/splitter.h>
#include <wx/notebook.h>
#include <wx/choice.h>
#include <wx/statbox.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class APPEARANCE_CONTROLS_BASE
///////////////////////////////////////////////////////////////////////////////
class APPEARANCE_CONTROLS_BASE : public wxPanel
{
private:
protected:
wxBoxSizer* m_sizerOuter;
wxNotebook* m_notebook;
wxPanel* m_panelLayers;
wxBoxSizer* m_panelLayersSizer;
wxScrolledWindow* m_windowLayers;
wxBoxSizer* m_layers_outer_sizer;
wxCollapsiblePane* m_paneLayerDisplay;
wxStaticText* m_staticText13;
wxRadioButton* m_rbHighContrastNormal;
wxRadioButton* m_rbHighContrastDim;
wxRadioButton* m_rbHighContrastOff;
wxStaticLine* m_staticline5;
wxCheckBox* m_cbFlipBoard;
wxPanel* m_panelObjects;
wxBoxSizer* m_objectsPanelSizer;
wxScrolledWindow* m_windowObjects;
wxGridBagSizer* m_objectsSizer;
wxPanel* m_panelNetsAndClasses;
wxSplitterWindow* m_netsTabSplitter;
wxPanel* m_panelNets;
wxStaticText* m_staticText141;
wxTextCtrl* m_txtNetFilter;
wxBitmapButton* m_btnNetInspector;
wxScrolledWindow* m_netsScrolledWindow;
wxBoxSizer* m_netsOuterSizer;
wxPanel* m_panelNetclasses;
wxStaticText* m_staticText14;
wxBitmapButton* m_btnConfigureNetClasses;
wxScrolledWindow* m_netclassScrolledWindow;
wxBoxSizer* m_netclassOuterSizer;
wxCollapsiblePane* m_paneNetDisplay;
wxStaticText* m_staticText131;
wxRadioButton* m_rbNetColorOff;
wxRadioButton* m_rbNetColorRatsnest;
wxRadioButton* m_rbNetColorAll;
wxChoice* m_cbLayerPresets;
wxBitmapButton* m_btnDeletePreset;
// Virtual event handlers, overide them in your derived class
virtual void OnNotebookPageChanged( wxNotebookEvent& event ) { event.Skip(); }
virtual void OnLayerDisplayPaneChanged( wxCollapsiblePaneEvent& event ) { event.Skip(); }
virtual void OnFlipBoardChecked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnNetDisplayPaneChanged( wxCollapsiblePaneEvent& event ) { event.Skip(); }
virtual void OnLayerPresetChanged( wxCommandEvent& event ) { event.Skip(); }
virtual void OnBtnDeleteLayerPreset( wxCommandEvent& event ) { event.Skip(); }
public:
APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 275,762 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~APPEARANCE_CONTROLS_BASE();
void m_netsTabSplitterOnIdle( wxIdleEvent& )
{
m_netsTabSplitter->SetSashPosition( 300 );
m_netsTabSplitter->Disconnect( wxEVT_IDLE, wxIdleEventHandler( APPEARANCE_CONTROLS_BASE::m_netsTabSplitterOnIdle ), NULL, this );
}
};