SCH_NETCLASS_FLAGs and SCH_FIELDs for labels.

ADDED: a new label type for netclass flags.
ADDED: the ability to define fields on labels.
This commit is contained in:
Jeff Young 2021-10-12 21:05:37 +01:00
parent b7e196b710
commit 889970a449
121 changed files with 10811 additions and 3981 deletions

View File

@ -77,6 +77,10 @@ set( BMAPS_SMALL
icon_pagelayout_editor_16
icon_pcbcalculator_16
icon_pcbnew_16
label_align_left
label_align_right
label_align_top
label_align_bottom
list_nets_16
options_generic_16
pinorient_right
@ -113,6 +117,18 @@ set( BMAPS_SMALL
small_trash
small_up
small_warning
text_horizontal
text_vertical
text_align_left
text_align_center
text_align_right
text_align_bottom
text_align_top
text_valign_top
text_valign_center
text_valign_bottom
text_bold
text_italic
tree_nosel
tree_sel
visibility
@ -130,6 +146,7 @@ set( BMAPS_MID
add_bus2bus
add_bus
add_center_dimension
add_class_flag
add_circle
add_component
add_corner

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

View File

@ -0,0 +1,108 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="add_class_flag.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="26.841039"
inkscape:cx="13.076515"
inkscape:cy="15.990298"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>label</dc:title>
</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="defs157961">
<style
id="style157959">.cls-1{fill:#545454;}.cls-2{fill:#1a81c4;}</style>
</defs>
<title
id="title157963">label</title>
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:1.25;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans, Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;letter-spacing:0px;word-spacing:0px;fill:#ded3dd;fill-opacity:1;stroke:#ded3dd;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="12.126078"
y="15.398792"
id="text15403"
transform="scale(0.98961654,1.0104924)"><tspan
sodipodi:role="line"
id="tspan15401"
x="12.126078"
y="15.398792"
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans, Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#ded3dd;fill-opacity:1;stroke:#ded3dd;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">A</tspan></text>
<ellipse
style="fill:none;stroke:#ded3dd;stroke-width:2.00692913;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path843"
cx="6.8751192"
cy="9.1359987"
rx="3.6851397"
ry="3.6851389" />
<rect
style="fill:none;stroke:#ded3dd;stroke-width:1.6063;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect845"
width="0.54948211"
height="3.6666667"
x="6.5501499"
y="14.00015" />
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,108 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="add_class_flag.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="26.841039"
inkscape:cx="3.6879065"
inkscape:cy="11.85484"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>label</dc:title>
</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="defs157961">
<style
id="style157959">.cls-1{fill:#545454;}.cls-2{fill:#1a81c4;}</style>
</defs>
<title
id="title157963">label</title>
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:1.25;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans, Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;letter-spacing:0px;word-spacing:0px;stroke-width:0.999997"
x="12.126078"
y="15.398792"
id="text15403"
transform="scale(0.98961654,1.0104924)"><tspan
sodipodi:role="line"
id="tspan15401"
x="12.126078"
y="15.398792"
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans, Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#545454;fill-opacity:1;stroke-width:0.999997">A</tspan></text>
<ellipse
style="fill:none;stroke:#545454;stroke-width:2.00692913;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path843"
cx="6.8751192"
cy="9.1359987"
rx="3.6851397"
ry="3.6851389" />
<rect
style="fill:none;stroke:#545454;stroke-width:1.6063;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect845"
width="0.54948211"
height="3.6666667"
x="6.6500001"
y="14.00015" />
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,94 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="label_align_bottom.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1429"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.468206"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 12.5,16 v 7.5"
id="path1475" />
<rect
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4419"
width="15"
height="9"
x="1"
y="-17"
transform="rotate(90)" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,93 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="label_align_left.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1429"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.043461"
inkscape:cy="12.32908"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 0.5,11.5 h 7"
id="path1475" />
<rect
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4419-4"
width="15"
height="9"
x="7.8000002"
y="7" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,93 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="label_align_right.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1429"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="2.3451142"
inkscape:cy="8.5535679"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.5,11.5 h 7"
id="path1475" />
<rect
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4419-4"
width="15"
height="9"
x="1.3"
y="7" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,94 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="label_align_top.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1426"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.468206"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 12.5,0.5 V 8"
id="path1475" />
<rect
style="fill:none;stroke:#333333;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4419"
width="15"
height="9"
x="8"
y="-17"
transform="rotate(90)" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,106 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_align_bottom.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1432"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.468206"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<g
id="g4376"
transform="rotate(-90,11.5,11.5)">
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,5.5 H 20"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 3,8.5 H 15"
id="path1473" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,11.5 H 20"
id="path1475" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,17.5 H 20"
id="path1477" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 3,14.5 H 15"
id="path1479" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,102 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_align_center.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1432"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.468206"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,5.5 H 20"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:0.912871;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 6.6666667,8.5 H 16.666667"
id="path1473" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,11.5 H 20"
id="path1475" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,17.5 H 20"
id="path1477" />
<path
style="fill:none;stroke:#333333;stroke-width:0.912871;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 6.6666667,14.5 H 16.666667"
id="path1479" />
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,102 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_align_left.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1432"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.468206"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,5.5 H 20"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="M 3,8.5 H 15"
id="path1473" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,11.5 H 20"
id="path1475" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,17.5 H 20"
id="path1477" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 3,14.5 H 15"
id="path1479" />
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,102 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_align_right.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.468206"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 4,5.5 H 21"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 9,8.5 H 21"
id="path1473" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 4,11.5 H 21"
id="path1475" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 4,17.5 H 21"
id="path1477" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 9,14.5 H 21"
id="path1479" />
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,102 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_align_top.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1432"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.468206"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5.5,20 V 3"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 8.5,15 V 3"
id="path1473" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 11.5,20 V 3"
id="path1475" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 17.5,20 V 3"
id="path1477" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 14.5,15 V 3"
id="path1479" />
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,93 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_bold.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.751369"
inkscape:cy="9.8749969"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:24px;line-height:1.25;font-family:sans-serif;fill:#333333;fill-opacity:1;stroke:none;"
x="2.8384311"
y="20.913694"
id="text863"><tspan
sodipodi:role="line"
id="tspan861"
x="2.8384311"
y="20.913694"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:24px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#333333;">B</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,93 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_horizontal.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1429"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.751369"
inkscape:cy="11.375567"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:24px;line-height:1.25;font-family:sans-serif;fill:#333333;fill-opacity:1;stroke:none"
x="4.7733812"
y="19.922623"
id="text863"><tspan
sodipodi:role="line"
id="tspan861"
x="4.7733812"
y="19.922623"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24px;font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman, ';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#333333">T</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,93 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_italic.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="3.6665432"
inkscape:cy="9.8749969"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#333333;fill-opacity:1;stroke:none;"
x="6.6611366"
y="20.488951"
id="text863"><tspan
sodipodi:role="line"
id="tspan861"
x="6.6611366"
y="20.488951"
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#333333;">I</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,94 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_valign_bottom.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1432"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="3.3833802"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,20.5 H 20"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,14.5 H 20"
id="path1475" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,17.5 H 20"
id="path1477" />
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,94 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_valign_center.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1432"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="3.3833802"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,8.5 H 20"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,11.5 H 20"
id="path1475" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,14.5 H 20"
id="path1477" />
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,94 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_valign_top.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1404"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="3.3833802"
inkscape:cy="13.225764"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<path
style="fill:#333333;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,2.5 H 20"
id="path1471" />
<path
style="fill:none;stroke:#333333;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 3,8.5 H 20"
id="path1473" />
<path
style="fill:none;stroke:#333333;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3,5.5 H 20"
id="path1475" />
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,94 @@
<?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"
id="Слой_1"
data-name="Слой 1"
viewBox="0 0 24 24"
version="1.1"
sodipodi:docname="text_vertical.svg"
inkscape:version="1.0.2 (e86c8708, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1429"
inkscape:window-height="800"
id="namedview30"
showgrid="true"
inkscape:zoom="21.189179"
inkscape:cx="12.751369"
inkscape:cy="11.375567"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:document-rotation="0"
inkscape:current-layer="Слой_1">
<inkscape:grid
type="xygrid"
id="grid_kicad"
spacingx="0.5"
spacingy="0.5"
color="#9999ff"
opacity="0.13"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata43">
<rdf:RDF>
<cc:Work
rdf:about="">
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>add_glabel</dc:title>
</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="defs174">
<style
id="style172">.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}.cls-1{stroke:#1a81c4;}.cls-2{stroke:#545454;}.cls-3{fill:#545454;}</style>
</defs>
<title
id="title176">add_glabel</title>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:24px;line-height:1.25;font-family:sans-serif;fill:#333333;fill-opacity:1;stroke:none"
x="-19.371841"
y="19.913626"
id="text863"
transform="rotate(-90)"><tspan
sodipodi:role="line"
id="tspan861"
x="-19.371841"
y="19.913626"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24px;font-family:'Times New Roman';-inkscape-font-specification:'Times New Roman, ';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#333333">T</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -342,6 +342,7 @@ static struct EDA_ITEM_DESC
.Map( SCH_BITMAP_T, _HKI( "Bitmap" ) )
.Map( SCH_TEXT_T, _HKI( "Text" ) )
.Map( SCH_LABEL_T, _HKI( "Net Label" ) )
.Map( SCH_NETCLASS_FLAG_T, _HKI( "Net Class Flag" ) )
.Map( SCH_GLOBAL_LABEL_T, _HKI( "Global Label" ) )
.Map( SCH_HIER_LABEL_T, _HKI( "Hierarchical Label" ) )
.Map( SCH_FIELD_T, _HKI( "Field" ) )

View File

@ -114,6 +114,8 @@ wxString LayerName( int aLayer )
case LAYER_REFERENCEPART: return _( "Symbol references" );
case LAYER_VALUEPART: return _( "Symbol values" );
case LAYER_FIELDS: return _( "Symbol fields" );
case LAYER_INTERSHEET_REFS: return _( "Sheet references" );
case LAYER_NETCLASS_REFS: return _( "Net class references" );
case LAYER_DEVICE: return _( "Symbol body outlines" );
case LAYER_DEVICE_BACKGROUND: return _( "Symbol body fills" );
case LAYER_NOTES: return _( "Schematic text && graphics" );

View File

@ -46,6 +46,7 @@ static const std::map<int, COLOR4D> s_defaultTheme =
{ LAYER_GLOBLABEL, CSS_COLOR( 132, 0, 0, 1 ) },
{ LAYER_HIERLABEL, CSS_COLOR( 114, 86, 0, 1 ) },
{ LAYER_LOCLABEL, CSS_COLOR( 15, 15, 15, 1 ) },
{ LAYER_NETCLASS_REFS, CSS_COLOR( 72, 72, 72, 1 ) },
{ LAYER_NOCONNECT, CSS_COLOR( 0, 0, 132, 1 ) },
{ LAYER_NOTES, CSS_COLOR( 0, 0, 194, 1 ) },
{ LAYER_NOTES_BACKGROUND, CSS_COLOR( 0, 0, 0, 0 ) },
@ -192,6 +193,7 @@ static const std::map<int, COLOR4D> s_classicTheme =
{ LAYER_GLOBLABEL, COLOR4D( RED ) },
{ LAYER_HIERLABEL, COLOR4D( BROWN ) },
{ LAYER_LOCLABEL, COLOR4D( BLACK ) },
{ LAYER_NETCLASS_REFS, COLOR4D( BLACK ) },
{ LAYER_NOCONNECT, COLOR4D( BLUE ) },
{ LAYER_NOTES, COLOR4D( LIGHTBLUE ) },
{ LAYER_NOTES_BACKGROUND, COLOR4D( UNSPECIFIED_COLOR ) },

View File

@ -92,6 +92,7 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
CLR( "schematic.label_global", LAYER_GLOBLABEL );
CLR( "schematic.label_hier", LAYER_HIERLABEL );
CLR( "schematic.label_local", LAYER_LOCLABEL );
CLR( "schematic.netclass_flag", LAYER_NETCLASS_REFS );
CLR( "schematic.no_connect", LAYER_NOCONNECT );
CLR( "schematic.note", LAYER_NOTES );
CLR( "schematic.note_background", LAYER_NOTES_BACKGROUND );

View File

@ -70,7 +70,7 @@ bool SELECTION::Contains( EDA_ITEM* aItem ) const
/// Returns the center point of the selection area bounding box.
VECTOR2I SELECTION::GetCenter() const
{
KICAD_T textTypes[] = { SCH_TEXT_T, SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EOT };
KICAD_T textTypes[] = { SCH_TEXT_T, SCH_LABEL_LOCATE_ANY_T, EOT };
bool hasOnlyText = true;
// If the selection contains only texts calculate the center as the mean of all positions

View File

@ -29,6 +29,8 @@
#include <wx/renderer.h>
#include <wx/settings.h>
#define wxCONTROL_SEPARATOR wxCONTROL_SPECIAL
BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxPoint& aPos,
const wxSize& aSize, int aStyles ) :
@ -38,8 +40,28 @@ BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxPoint&
m_acceptDraggedInClicks( false )
{
if( aSize == wxDefaultSize )
SetMinSize( wxButton::GetDefaultSize() );
SetMinSize( wxButton::GetDefaultSize() + wxSize( m_padding * 2, m_padding * 2) );
setupEvents();
}
BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxBitmap& aDummyBitmap,
const wxPoint& aPos, const wxSize& aSize, int aStyles ) :
wxPanel( aParent, aId, aPos, aSize, aStyles ),
m_buttonState( 0 ),
m_padding( 5 ),
m_acceptDraggedInClicks( false )
{
if( aSize == wxDefaultSize )
SetMinSize( wxButton::GetDefaultSize() + wxSize( m_padding * 2, m_padding * 2) );
setupEvents();
}
void BITMAP_BUTTON::setupEvents()
{
Bind( wxEVT_PAINT, &BITMAP_BUTTON::OnPaint, this );
Bind( wxEVT_LEFT_UP, &BITMAP_BUTTON::OnLeftButtonUp, this );
Bind( wxEVT_LEFT_DOWN, &BITMAP_BUTTON::OnLeftButtonDown, this );
@ -58,7 +80,7 @@ BITMAP_BUTTON::~BITMAP_BUTTON()
void BITMAP_BUTTON::SetPadding( int aPadding )
{
m_padding = aPadding;
SetMinSize( m_unadjustedMinSize + wxSize( aPadding * 2, aPadding * 2) );
SetMinSize( m_unadjustedMinSize + wxSize( aPadding * 2, aPadding * 2 ) );
}
@ -109,7 +131,9 @@ void BITMAP_BUTTON::OnKillFocus( wxEvent& aEvent )
void BITMAP_BUTTON::OnSetFocus( wxEvent& aEvent )
{
if( !hasFlag( wxCONTROL_CHECKABLE ) )
setFlag( wxCONTROL_FOCUSED );
Refresh();
aEvent.Skip();
}
@ -119,14 +143,10 @@ void BITMAP_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent )
{
// Only create a button event when the control is enabled
// and only accept clicks that came without prior mouse-down if configured
if( !hasFlag( wxCONTROL_DISABLED ) &&
( m_acceptDraggedInClicks || hasFlag( wxCONTROL_PRESSED | wxCONTROL_FOCUSED ) ) )
if( !hasFlag( wxCONTROL_DISABLED )
&& ( m_acceptDraggedInClicks || hasFlag( wxCONTROL_PRESSED | wxCONTROL_FOCUSED ) ) )
{
wxEvtHandler* pEventHandler = GetEventHandler();
wxASSERT( pEventHandler );
pEventHandler->CallAfter(
[=]()
GetEventHandler()->CallAfter( [=]()
{
wxCommandEvent evt( wxEVT_BUTTON, GetId() );
evt.SetEventObject( this );
@ -143,7 +163,29 @@ void BITMAP_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent )
void BITMAP_BUTTON::OnLeftButtonDown( wxMouseEvent& aEvent )
{
if( hasFlag( wxCONTROL_CHECKABLE ) )
{
if( hasFlag( wxCONTROL_CHECKED ) )
{
clearFlag( wxCONTROL_CHECKED );
}
else
{
setFlag( wxCONTROL_CHECKED );
GetEventHandler()->CallAfter( [=]()
{
wxCommandEvent evt( wxEVT_BUTTON, GetId() );
evt.SetEventObject( this );
GetEventHandler()->ProcessEvent( evt );
} );
}
}
else
{
setFlag( wxCONTROL_PRESSED );
}
Refresh();
aEvent.Skip();
@ -159,6 +201,13 @@ void BITMAP_BUTTON::OnPaint( wxPaintEvent& aEvent )
wxRect rect( wxPoint( 0, 0 ), GetSize() );
wxPaintDC dc( this );
if( hasFlag( wxCONTROL_SEPARATOR ) )
{
dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ) );
dc.DrawLine( wxPoint( GetSize().x / 2, 0 ), wxPoint( GetSize().x / 2, GetSize().y ) );
return;
}
// This drawing is done so the button looks the same as an AUI toolbar button
if( !hasFlag( wxCONTROL_DISABLED ) )
{
@ -214,8 +263,23 @@ bool BITMAP_BUTTON::Enable( bool aEnable )
}
void BITMAP_BUTTON::SetIsCheckButton()
{
setFlag( wxCONTROL_CHECKABLE );
}
void BITMAP_BUTTON::SetIsSeparator()
{
setFlag( wxCONTROL_SEPARATOR | wxCONTROL_DISABLED );
SetMinSize( wxSize( m_padding * 2, wxButton::GetDefaultSize().y ) );
}
void BITMAP_BUTTON::Check( bool aCheck )
{
wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." );
if( aCheck )
setFlag( wxCONTROL_CHECKED );
else
@ -223,3 +287,11 @@ void BITMAP_BUTTON::Check( bool aCheck )
Refresh();
}
bool BITMAP_BUTTON::IsChecked() const
{
wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." );
return hasFlag( wxCONTROL_CHECKED );
}

View File

@ -90,6 +90,9 @@ void GRID_CELL_COMBOBOX::BeginEdit( int aRow, int aCol, wxGrid* aGrid )
// Work around a wxWidgets bug where the drop-down is the wrong width on the first drop.
Combo()->Set( Combo()->GetStrings() );
Combo()->ChangeValue( m_value );
Combo()->SelectAll();
#ifdef __WXOSX_COCOA__
// This is a work around for the combobox being simply dismissed when a
// choice is made in it under OS X. The bug is almost certainly due to a

View File

@ -67,6 +67,8 @@ set( EESCHEMA_DLGS
dialogs/dialog_global_edit_text_and_graphics_base.cpp
dialogs/dialog_junction_props.cpp
dialogs/dialog_junction_props_base.cpp
dialogs/dialog_label_properties.cpp
dialogs/dialog_label_properties_base.cpp
dialogs/dialog_lib_edit_pin_table.cpp
dialogs/dialog_lib_edit_pin_table_base.cpp
dialogs/dialog_lib_text_properties.cpp
@ -106,8 +108,8 @@ set( EESCHEMA_DLGS
dialogs/dialog_symbol_properties_base.cpp
dialogs/dialog_symbol_remap.cpp
dialogs/dialog_symbol_remap_base.cpp
dialogs/dialog_text_and_label_properties.cpp
dialogs/dialog_text_and_label_properties_base.cpp
dialogs/dialog_text_properties.cpp
dialogs/dialog_text_properties_base.cpp
dialogs/dialog_update_from_pcb.cpp
dialogs/dialog_update_from_pcb_base.cpp
dialogs/dialog_update_symbol_fields.cpp

View File

@ -119,7 +119,7 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCheckMultipleDrivers )
{
SCH_SHEET_PIN* p = static_cast<SCH_SHEET_PIN*>( c );
if( p->GetShape() == PINSHEETLABEL_SHAPE::PS_OUTPUT )
if( p->GetShape() == LABEL_FLAG_SHAPE::L_OUTPUT )
{
m_driver = c;
break;
@ -258,7 +258,8 @@ std::vector<SCH_ITEM*> CONNECTION_SUBGRAPH::GetBusLabels() const
break;
}
default: break;
default:
break;
}
}

View File

@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <widgets/bitmap_button.h>
#include <bitmaps.h>
#include <kiway.h>
#include <confirm.h>
@ -69,6 +70,51 @@ DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const
} );
m_StyledTextCtrl->SetEOLMode( wxSTC_EOL_LF ); // Normalize EOL across platforms
m_separator1->SetIsSeparator();
m_horizontal->SetIsCheckButton();
m_horizontal->SetBitmap( KiBitmap( BITMAPS::text_horizontal ) );
m_vertical->SetIsCheckButton();
m_vertical->SetBitmap( KiBitmap( BITMAPS::text_vertical ) );
m_separator2->SetIsSeparator();
m_bold->SetIsCheckButton();
m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
m_italic->SetIsCheckButton();
m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
m_separator3->SetIsSeparator();
m_hAlignLeft->SetIsCheckButton();
m_hAlignLeft->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
m_hAlignCenter->SetIsCheckButton();
m_hAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_align_center ) );
m_hAlignRight->SetIsCheckButton();
m_hAlignRight->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
m_separator4->SetIsSeparator();
m_vAlignTop->SetIsCheckButton();
m_vAlignTop->SetBitmap( KiBitmap( BITMAPS::text_valign_top ) );
m_vAlignCenter->SetIsCheckButton();
m_vAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_valign_center ) );
m_vAlignBottom->SetIsCheckButton();
m_vAlignBottom->SetBitmap( KiBitmap( BITMAPS::text_valign_bottom ) );
m_separator5->SetIsSeparator();
m_horizontal->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onOrientButton, this );
m_vertical->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onOrientButton, this );
m_hAlignLeft->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onHAlignButton, this );
m_hAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onHAlignButton, this );
m_hAlignRight->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onHAlignButton, this );
m_vAlignTop->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onVAlignButton, this );
m_vAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onVAlignButton, this );
m_vAlignBottom->Bind( wxEVT_BUTTON, &DIALOG_FIELD_PROPERTIES::onVAlignButton, this );
m_text = aTextItem->GetText();
m_isItalic = aTextItem->IsItalic();
m_isBold = aTextItem->IsBold();
@ -210,6 +256,36 @@ void DIALOG_FIELD_PROPERTIES::OnSetFocusText( wxFocusEvent& event )
}
void DIALOG_FIELD_PROPERTIES::onOrientButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_horizontal, m_vertical } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
void DIALOG_FIELD_PROPERTIES::onHAlignButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_hAlignLeft, m_hAlignCenter, m_hAlignRight } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
void DIALOG_FIELD_PROPERTIES::onVAlignButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_vAlignTop, m_vAlignTop, m_vAlignBottom } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
bool DIALOG_FIELD_PROPERTIES::TransferDataToWindow()
{
if( m_TextCtrl->IsShown() )
@ -220,12 +296,28 @@ bool DIALOG_FIELD_PROPERTIES::TransferDataToWindow()
m_posX.SetValue( m_position.x );
m_posY.SetValue( m_position.y );
m_textSize.SetValue( m_size );
m_orientChoice->SetSelection( m_isVertical ? 1 : 0 );
m_hAlignChoice->SetSelection( m_horizontalJustification );
m_vAlignChoice->SetSelection( m_verticalJustification );
m_horizontal->Check( !m_isVertical );
m_vertical->Check( m_isVertical );
m_italic->Check( m_isItalic );
m_bold->Check( m_isBold );
switch ( m_horizontalJustification )
{
case GR_TEXT_HJUSTIFY_LEFT: m_hAlignLeft->Check( true ); break;
case GR_TEXT_HJUSTIFY_CENTER: m_hAlignCenter->Check( true ); break;
case GR_TEXT_HJUSTIFY_RIGHT: m_hAlignRight->Check( true ); break;
}
switch ( m_verticalJustification )
{
case GR_TEXT_VJUSTIFY_TOP: m_vAlignTop->Check( true ); break;
case GR_TEXT_VJUSTIFY_CENTER: m_vAlignCenter->Check( true ); break;
case GR_TEXT_VJUSTIFY_BOTTOM: m_vAlignBottom->Check( true ); break;
}
m_visible->SetValue( m_isVisible );
m_italic->SetValue( m_isItalic );
m_bold->SetValue( m_isBold );
return true;
}
@ -268,14 +360,29 @@ bool DIALOG_FIELD_PROPERTIES::TransferDataFromWindow()
}
}
m_isVertical = m_orientChoice->GetSelection() == 1;
m_position = wxPoint( m_posX.GetValue(), m_posY.GetValue() );
m_size = m_textSize.GetValue();
m_horizontalJustification = m_hAlignChoice->GetSelection();
m_verticalJustification = m_vAlignChoice->GetSelection();
m_isVertical = m_vertical->IsChecked();
m_isBold = m_bold->IsChecked();
m_isItalic = m_italic->IsChecked();
if( m_hAlignLeft->IsChecked() )
m_horizontalJustification = GR_TEXT_HJUSTIFY_LEFT;
else if( m_hAlignCenter->IsChecked() )
m_horizontalJustification = GR_TEXT_HJUSTIFY_CENTER;
else
m_horizontalJustification = GR_TEXT_HJUSTIFY_RIGHT;
if( m_vAlignTop->IsChecked() )
m_verticalJustification = GR_TEXT_VJUSTIFY_TOP;
else if( m_vAlignCenter->IsChecked() )
m_verticalJustification = GR_TEXT_VJUSTIFY_CENTER;
else
m_verticalJustification = GR_TEXT_VJUSTIFY_BOTTOM;
m_isVisible = m_visible->GetValue();
m_isItalic = m_italic->GetValue();
m_isBold = m_bold->GetValue();
return true;
}

View File

@ -80,6 +80,11 @@ protected:
*/
virtual void OnSetFocusText( wxFocusEvent& event ) override;
void onOrientButton( wxCommandEvent &aEvent );
void onHAlignButton( wxCommandEvent &aEvent );
void onVAlignButton( wxCommandEvent &aEvent );
protected:
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
UNIT_BINDER m_textSize;

View File

@ -0,0 +1,696 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <widgets/bitmap_button.h>
#include <sch_edit_frame.h>
#include <base_units.h>
#include <sch_validators.h>
#include <tool/tool_manager.h>
#include <general.h>
#include <gr_text.h>
#include <confirm.h>
#include <sch_reference_list.h>
#include <schematic.h>
#include <dialogs/html_message_box.h>
#include <dialog_label_properties.h>
#include <string_utils.h>
#include <project/net_settings.h>
#include <project/project_file.h>
#include <kiface_base.h>
class SCH_EDIT_FRAME;
class SCH_TEXT;
DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_LABEL_BASE* aLabel ) :
DIALOG_LABEL_PROPERTIES_BASE( aParent ),
m_activeTextEntry( nullptr ),
m_netNameValidator( true ),
m_fields( nullptr ),
m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, false ),
m_helpWindow( nullptr )
{
m_Parent = aParent;
m_currentLabel = aLabel;
m_fields = new FIELDS_GRID_TABLE<SCH_FIELD>( this, aParent, m_grid, m_currentLabel );
m_width = 100; // Will be later set to a better value
m_delayedFocusRow = -1;
m_delayedFocusColumn = FDC_VALUE;
if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T || m_currentLabel->Type() == SCH_LABEL_T )
{
m_activeTextEntry = m_valueCombo;
SetInitialFocus( m_valueCombo );
m_labelSingleLine->Show( false );
m_valueSingleLine->Show( false );
m_valueCombo->SetValidator( m_netNameValidator );
}
else if( m_currentLabel->Type() == SCH_HIER_LABEL_T )
{
m_activeTextEntry = m_valueSingleLine;
SetInitialFocus( m_valueSingleLine );
m_labelCombo->Show( false );
m_valueCombo->Show( false );
m_valueSingleLine->SetValidator( m_netNameValidator );
}
else if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
{
SetInitialFocus( m_grid );
m_delayedFocusRow = 0;
m_labelSingleLine->Show( false );
m_valueSingleLine->Show( false );
m_labelCombo->Show( false );
m_valueCombo->Show( false );
m_syntaxHelp->Show( false );
m_textSizeLabel->SetLabel( _( "Pin length:" ) );
}
switch( m_currentLabel->Type() )
{
case SCH_GLOBAL_LABEL_T: SetTitle( _( "Global Label Properties" ) ); break;
case SCH_HIER_LABEL_T: SetTitle( _( "Hierarchical Label Properties" ) ); break;
case SCH_LABEL_T: SetTitle( _( "Label Properties" ) ); break;
case SCH_NETCLASS_FLAG_T: SetTitle( _( "Net Class Flag Properties" ) ); break;
case SCH_SHEET_PIN_T: SetTitle( _( "Hierarchical Sheet Pin Properties" ) ); break;
default: UNIMPLEMENTED_FOR( m_currentLabel->GetClass() ); break;
}
// Give a bit more room for combobox editors
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
m_grid->SetTable( m_fields );
m_grid->PushEventHandler( new FIELDS_GRID_TRICKS( m_grid, this ) );
m_grid->SetSelectionMode( wxGrid::wxGridSelectRows );
// Show/hide columns according to user's preference
auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
wxASSERT( cfg );
if( cfg )
{
m_shownColumns = cfg->m_Appearance.edit_label_visible_columns;
m_grid->ShowHideColumns( m_shownColumns );
}
// Configure button logos
m_bpAdd->SetBitmap( KiBitmap( BITMAPS::small_plus ) );
m_bpDelete->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
m_bpMoveUp->SetBitmap( KiBitmap( BITMAPS::small_up ) );
m_bpMoveDown->SetBitmap( KiBitmap( BITMAPS::small_down ) );
m_separator1->SetIsSeparator();
m_bold->SetIsCheckButton();
m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
m_italic->SetIsCheckButton();
m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
m_separator2->SetIsSeparator();
m_spin0->SetIsCheckButton();
m_spin1->SetIsCheckButton();
m_spin2->SetIsCheckButton();
m_spin3->SetIsCheckButton();
m_separator3->SetIsSeparator();
// Show/hide relevant controls
if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T || m_currentLabel->Type() == SCH_HIER_LABEL_T )
{
m_dot->Hide();
m_circle->Hide();
m_diamond->Hide();
m_rectangle->Hide();
m_spin0->SetBitmap( KiBitmap( BITMAPS::label_align_left ) );
m_spin1->SetBitmap( KiBitmap( BITMAPS::label_align_right ) );
m_spin2->SetBitmap( KiBitmap( BITMAPS::label_align_bottom ) );
m_spin3->SetBitmap( KiBitmap( BITMAPS::label_align_top ) );
}
else if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
{
m_input->Hide();
m_output->Hide();
m_bidirectional->Hide();
m_triState->Hide();
m_passive->Hide();
m_spin0->SetBitmap( KiBitmap( BITMAPS::pinorient_down ) );
m_spin1->SetBitmap( KiBitmap( BITMAPS::pinorient_up ) );
m_spin2->SetBitmap( KiBitmap( BITMAPS::pinorient_right ) );
m_spin3->SetBitmap( KiBitmap( BITMAPS::pinorient_left ) );
}
else
{
m_shapeSizer->Show( false );
m_spin0->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
m_spin1->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
m_spin2->SetBitmap( KiBitmap( BITMAPS::text_align_bottom ) );
m_spin3->SetBitmap( KiBitmap( BITMAPS::text_align_top ) );
}
m_sdbSizer1OK->SetDefault();
// DIALOG_SHIM needs a unique hash_key because classname is not sufficient because the
// various versions have different controls so we want to store sizes for each version.
m_hash_key = TO_UTF8( GetTitle() );
m_spin0->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
m_spin1->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
m_spin2->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
m_spin3->Bind( wxEVT_BUTTON, &DIALOG_LABEL_PROPERTIES::onSpinButton, this );
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
DIALOG_LABEL_PROPERTIES::~DIALOG_LABEL_PROPERTIES()
{
auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
wxASSERT( cfg );
if( cfg )
cfg->m_Appearance.edit_sheet_visible_columns = m_grid->GetShownColumns();
// Prevents crash bug in wxGrid's d'tor
m_grid->DestroyTable( m_fields );
// Delete the GRID_TRICKS.
m_grid->PopEventHandler( true );
if( m_helpWindow )
m_helpWindow->Destroy();
}
bool DIALOG_LABEL_PROPERTIES::TransferDataToWindow()
{
if( !wxDialog::TransferDataToWindow() )
return false;
if( m_activeTextEntry )
{
// show control characters in a human-readable format
m_activeTextEntry->SetValue( UnescapeString( m_currentLabel->GetText() ) );
}
if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T || m_currentLabel->Type() == SCH_LABEL_T )
{
// Load the combobox with the existing labels of the same type
std::set<wxString> existingLabels;
SCH_SCREENS allScreens( m_Parent->Schematic().Root() );
for( SCH_SCREEN* screen = allScreens.GetFirst(); screen; screen = allScreens.GetNext() )
{
for( SCH_ITEM* item : screen->Items().OfType( m_currentLabel->Type() ) )
{
const SCH_TEXT* textItem = static_cast<const SCH_TEXT*>( item );
existingLabels.insert( UnescapeString( textItem->GetText() ) );
}
}
wxArrayString existingLabelArray;
for( const wxString& label : existingLabels )
existingLabelArray.push_back( label );
m_valueCombo->Append( existingLabelArray );
}
else if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
{
// Load the combobox with existing existingNetclassNames
NET_SETTINGS& netSettings = m_Parent->Schematic().Prj().GetProjectFile().NetSettings();
wxArrayString existingNetclassNames;
existingNetclassNames.push_back( netSettings.m_NetClasses.GetDefault()->GetName() );
for( const std::pair<const wxString, NETCLASSPTR>& pair : netSettings.m_NetClasses )
existingNetclassNames.push_back( pair.second->GetName() );
m_valueCombo->Append( existingNetclassNames );
}
// Push a copy of each field into m_updateFields
for( SCH_FIELD& field : m_currentLabel->GetFields() )
{
SCH_FIELD field_copy( field );
// change offset to be symbol-relative
field_copy.Offset( -m_currentLabel->GetPosition() );
m_fields->push_back( field_copy );
}
// notify the grid
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_fields->size() );
m_grid->ProcessTableMessage( msg );
AdjustGridColumns( m_grid->GetRect().GetWidth() );
if( m_shapeSizer->AreAnyItemsShown() )
{
switch( m_currentLabel->GetShape() )
{
case LABEL_FLAG_SHAPE::L_INPUT: m_input->SetValue( true ); break;
case LABEL_FLAG_SHAPE::L_OUTPUT: m_output->SetValue( true ); break;
case LABEL_FLAG_SHAPE::L_BIDI: m_bidirectional->SetValue( true ); break;
case LABEL_FLAG_SHAPE::L_TRISTATE: m_triState->SetValue( true ); break;
case LABEL_FLAG_SHAPE::L_UNSPECIFIED: m_passive->SetValue( true ); break;
case LABEL_FLAG_SHAPE::F_DOT: m_dot->SetValue( true ); break;
case LABEL_FLAG_SHAPE::F_ROUND: m_circle->SetValue( true ); break;
case LABEL_FLAG_SHAPE::F_DIAMOND: m_diamond->SetValue( true ); break;
case LABEL_FLAG_SHAPE::F_RECTANGLE: m_rectangle->SetValue( true ); break;
}
}
if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
m_textSize.SetValue( static_cast<SCH_NETCLASS_FLAG*>( m_currentLabel )->GetPinLength() );
else
m_textSize.SetValue( m_currentLabel->GetTextWidth() );
m_bold->Check( m_currentLabel->IsBold() );
m_italic->Check( m_currentLabel->IsItalic() );
switch( m_currentLabel->GetLabelSpinStyle() )
{
case LABEL_SPIN_STYLE::RIGHT: m_spin0->Check( true ); break;
case LABEL_SPIN_STYLE::LEFT: m_spin1->Check( true ); break;
case LABEL_SPIN_STYLE::UP: m_spin2->Check( true ); break;
case LABEL_SPIN_STYLE::BOTTOM: m_spin3->Check( true ); break;
}
return true;
}
/*!
* wxEVT_COMMAND_ENTER event handler for single-line control
*/
void DIALOG_LABEL_PROPERTIES::OnEnterKey( wxCommandEvent& aEvent )
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
}
static bool positioningChanged( const SCH_FIELD& a, const SCH_FIELD& b )
{
if( a.GetPosition() != b.GetPosition() )
return true;
if( a.GetHorizJustify() != b.GetHorizJustify() )
return true;
if( a.GetVertJustify() != b.GetVertJustify() )
return true;
if( a.GetTextAngle() != b.GetTextAngle() )
return true;
return false;
}
static bool positioningChanged( FIELDS_GRID_TABLE<SCH_FIELD>* a, std::vector<SCH_FIELD>& b )
{
for( size_t i = 0; i < a->size() && i < b.size(); ++i )
{
if( positioningChanged( a->at( i ), b.at( i ) ) )
return true;
}
return false;
}
bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
{
if( !m_grid->CommitPendingChanges() )
return false;
if( !wxDialog::TransferDataFromWindow() )
return false;
// Don't allow text to disappear; it can be difficult to correct if you can't select it
if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
return false;
wxString text;
/* save old text in undo list if not already in edit */
if( m_currentLabel->GetEditFlags() == 0 )
{
m_Parent->SaveCopyInUndoList( m_Parent->GetScreen(), m_currentLabel, UNDO_REDO::CHANGED,
false );
}
m_Parent->GetCanvas()->Refresh();
if( m_activeTextEntry )
{
// labels need escaping
text = EscapeString( m_activeTextEntry->GetValue(), CTX_NETNAME );
#ifdef __WXMAC__
// On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
text.Replace( "\r", "\n" );
#endif
if( text.IsEmpty() && !m_currentLabel->IsNew() )
{
DisplayError( this, _( "Label can not be empty." ) );
return false;
}
m_currentLabel->SetText( text );
}
bool doAutoplace = false;
// change all field positions from relative to absolute
for( SCH_FIELD& field : *m_fields )
{
field.Offset( m_currentLabel->GetPosition() );
if( field.GetCanonicalName() == wxT( "Netclass" ) )
field.SetLayer( LAYER_NETCLASS_REFS );
else if( field.GetCanonicalName() == wxT( "Intersheetrefs" ) )
field.SetLayer( LAYER_INTERSHEET_REFS );
else
field.SetLayer( LAYER_FIELDS );
}
if( positioningChanged( m_fields, m_currentLabel->GetFields() ) )
m_currentLabel->ClearFieldsAutoplaced();
else
doAutoplace = true;
m_currentLabel->SetFields( *m_fields );
if( m_shapeSizer->AreAnyItemsShown() )
{
if( m_input->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
else if( m_output->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT );
else if( m_bidirectional->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_BIDI );
else if( m_triState->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_TRISTATE );
else if( m_passive->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED );
else if( m_dot->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_DOT );
else if( m_circle->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_ROUND );
else if( m_diamond->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_DIAMOND );
else if( m_rectangle->GetValue() )
m_currentLabel->SetShape( LABEL_FLAG_SHAPE::F_RECTANGLE );
}
if( m_currentLabel->Type() == SCH_NETCLASS_FLAG_T )
static_cast<SCH_NETCLASS_FLAG*>( m_currentLabel )->SetPinLength( m_textSize.GetValue() );
else if( m_currentLabel->GetTextWidth() != m_textSize.GetValue() )
m_currentLabel->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
if( m_bold->IsChecked() != m_currentLabel->IsBold() )
{
if( m_bold->IsChecked() )
{
m_currentLabel->SetBold( true );
m_currentLabel->SetTextThickness( GetPenSizeForBold( m_currentLabel->GetTextWidth() ) );
}
else
{
m_currentLabel->SetBold( false );
m_currentLabel->SetTextThickness( 0 ); // Use default pen width
}
}
m_currentLabel->SetItalic( m_italic->IsChecked() );
LABEL_SPIN_STYLE selectedSpinStyle= LABEL_SPIN_STYLE::LEFT;
if( m_spin0->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::RIGHT;
else if( m_spin1->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::LEFT;
else if( m_spin2->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::UP;
else if( m_spin3->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::BOTTOM;
if( m_currentLabel->GetLabelSpinStyle() != selectedSpinStyle )
m_currentLabel->SetLabelSpinStyle( selectedSpinStyle );
if( doAutoplace )
m_currentLabel->AutoAutoplaceFields( m_Parent->GetScreen() );
m_Parent->UpdateItem( m_currentLabel );
m_Parent->GetCanvas()->Refresh();
m_Parent->OnModify();
return true;
}
void DIALOG_LABEL_PROPERTIES::onSpinButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_spin0, m_spin1, m_spin2, m_spin3 } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
void DIALOG_LABEL_PROPERTIES::OnFormattingHelp( wxHyperlinkEvent& aEvent )
{
m_helpWindow = SCH_TEXT::ShowSyntaxHelp( this );
}
void DIALOG_LABEL_PROPERTIES::OnAddField( wxCommandEvent& event )
{
if( !m_grid->CommitPendingChanges() )
return;
int fieldID = m_fields->size();
wxString fieldName;
if( (int) fieldID == m_currentLabel->GetMandatoryFieldCount()
|| m_fields->at( m_fields->size()-1 ).GetCanonicalName() == wxT( "Netclass" ) )
{
fieldName = wxT( "Netclass" );
}
else
{
fieldName = SCH_LABEL_BASE::GetDefaultFieldName( fieldName, true );
}
SCH_FIELD newField( wxPoint( 0, 0 ), fieldID, m_currentLabel, fieldName );
if( m_fields->size() > 0 )
{
newField.SetVisible( m_fields->at( m_fields->size() - 1 ).IsVisible() );
newField.SetTextAngle( m_fields->at( m_fields->size() - 1 ).GetTextAngle() );
newField.SetItalic( m_fields->at( m_fields->size() - 1 ).IsItalic() );
newField.SetBold( m_fields->at( m_fields->size() - 1 ).IsBold() );
}
else
{
newField.SetVisible( true );
newField.SetItalic( true );
}
m_fields->push_back( newField );
// notify the grid
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
m_grid->ProcessTableMessage( msg );
m_grid->MakeCellVisible( m_fields->size() - 1, 0 );
m_grid->SetGridCursor( m_fields->size() - 1, fieldName == wxT( "Netclass" ) ? 1 : 0 );
m_grid->EnableCellEditControl();
m_grid->ShowCellEditControl();
}
void DIALOG_LABEL_PROPERTIES::OnDeleteField( wxCommandEvent& event )
{
wxArrayInt selectedRows = m_grid->GetSelectedRows();
if( selectedRows.empty() && m_grid->GetGridCursorRow() >= 0 )
selectedRows.push_back( m_grid->GetGridCursorRow() );
if( selectedRows.empty() )
return;
for( int row : selectedRows )
{
if( row < m_currentLabel->GetMandatoryFieldCount() )
{
DisplayError( this, _( "The first field is mandatory." ) );
return;
}
}
m_grid->CommitPendingChanges( true /* quiet mode */ );
// Reverse sort so deleting a row doesn't change the indexes of the other rows.
selectedRows.Sort( []( int* first, int* second ) { return *second - *first; } );
for( int row : selectedRows )
{
m_fields->erase( m_fields->begin() + row );
// notify the grid
wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
m_grid->ProcessTableMessage( msg );
if( m_grid->GetNumberRows() > 0 )
{
m_grid->MakeCellVisible( std::max( 0, row-1 ), m_grid->GetGridCursorCol() );
m_grid->SetGridCursor( std::max( 0, row-1 ), m_grid->GetGridCursorCol() );
}
}
}
void DIALOG_LABEL_PROPERTIES::OnMoveUp( wxCommandEvent& event )
{
if( !m_grid->CommitPendingChanges() )
return;
int i = m_grid->GetGridCursorRow();
if( i > m_currentLabel->GetMandatoryFieldCount() )
{
SCH_FIELD tmp = m_fields->at( (unsigned) i );
m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );
m_fields->insert( m_fields->begin() + i - 1, tmp );
m_grid->ForceRefresh();
m_grid->SetGridCursor( i - 1, m_grid->GetGridCursorCol() );
m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
}
else
{
wxBell();
}
}
void DIALOG_LABEL_PROPERTIES::OnMoveDown( wxCommandEvent& event )
{
if( !m_grid->CommitPendingChanges() )
return;
int i = m_grid->GetGridCursorRow();
if( i >= m_currentLabel->GetMandatoryFieldCount() && i < m_grid->GetNumberRows() - 1 )
{
SCH_FIELD tmp = m_fields->at( (unsigned) i );
m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );
m_fields->insert( m_fields->begin() + i + 1, tmp );
m_grid->ForceRefresh();
m_grid->SetGridCursor( i + 1, m_grid->GetGridCursorCol() );
m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
}
else
{
wxBell();
}
}
void DIALOG_LABEL_PROPERTIES::AdjustGridColumns( int aWidth )
{
m_width = aWidth;
// Account for scroll bars
aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x );
m_grid->AutoSizeColumn( 0 );
m_grid->SetColSize( 0, std::max( m_grid->GetColSize( 0 ), 72 ) );
int fixedColsWidth = m_grid->GetColSize( 0 );
for( int i = 2; i < m_grid->GetNumberCols(); i++ )
fixedColsWidth += m_grid->GetColSize( i );
m_grid->SetColSize( 1, std::max( aWidth - fixedColsWidth, 120 ) );
}
void DIALOG_LABEL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
{
wxString shownColumns = m_grid->GetShownColumns();
if( shownColumns != m_shownColumns )
{
m_shownColumns = shownColumns;
if( !m_grid->IsCellEditControlShown() )
AdjustGridColumns( m_grid->GetRect().GetWidth() );
}
// Handle a delayed focus
if( m_delayedFocusRow >= 0 && m_delayedFocusRow < m_grid->GetNumberRows() )
{
m_grid->SetFocus();
m_grid->MakeCellVisible( m_delayedFocusRow, m_delayedFocusColumn );
m_grid->SetGridCursor( m_delayedFocusRow, m_delayedFocusColumn );
m_grid->EnableCellEditControl( true );
m_grid->ShowCellEditControl();
}
m_delayedFocusRow = -1;
m_delayedFocusColumn = -1;
}
void DIALOG_LABEL_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
{
int new_size = event.GetSize().GetX();
if( m_width != new_size )
AdjustGridColumns( new_size );
// Always propagate for a grid repaint (needed if the height changes, as well as width)
event.Skip();
}

View File

@ -0,0 +1,84 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DIALOG_LABEL_PROPERTIES_H
#define DIALOG_LABEL_PROPERTIES_H
#include <fields_grid_table.h>
#include <widgets/unit_binder.h>
#include <sch_text.h>
#include <sch_validators.h>
#include <dialog_label_properties_base.h>
class SCH_EDIT_FRAME;
class SCH_TEXT;
class HTML_MESSAGE_BOX;
class DIALOG_LABEL_PROPERTIES : public DIALOG_LABEL_PROPERTIES_BASE
{
public:
DIALOG_LABEL_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_LABEL_BASE* aLabel );
~DIALOG_LABEL_PROPERTIES();
private:
void OnEnterKey( wxCommandEvent& aEvent ) override;
void OnFormattingHelp( wxHyperlinkEvent& aEvent ) override;
void onSpinButton( wxCommandEvent &aEvent );
// event handlers
void OnAddField( wxCommandEvent& event ) override;
void OnDeleteField( wxCommandEvent& event ) override;
void OnMoveUp( wxCommandEvent& event ) override;
void OnMoveDown( wxCommandEvent& event ) override;
void OnSizeGrid( wxSizeEvent& event ) override;
void OnUpdateUI( wxUpdateUIEvent& event ) override;
void AdjustGridColumns( int aWidth );
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
private:
SCH_EDIT_FRAME* m_Parent;
int m_width;
int m_delayedFocusRow;
int m_delayedFocusColumn;
SCH_LABEL_BASE* m_currentLabel;
wxTextEntry* m_activeTextEntry;
SCH_NETNAME_VALIDATOR m_netNameValidator;
FIELDS_GRID_TABLE<SCH_FIELD>* m_fields;
wxString m_shownColumns;
UNIT_BINDER m_textSize;
HTML_MESSAGE_BOX* m_helpWindow;
};
#endif // DIALOG_LABEL_PROPERTIES_H

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 "widgets/bitmap_button.h"
#include "widgets/wx_grid.h"
#include "dialog_label_properties_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_textEntrySizer = new wxFlexGridSizer( 5, 2, 1, 3 );
m_textEntrySizer->AddGrowableCol( 1 );
m_textEntrySizer->AddGrowableRow( 1 );
m_textEntrySizer->SetFlexibleDirection( wxBOTH );
m_textEntrySizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_labelSingleLine = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelSingleLine->Wrap( -1 );
m_labelSingleLine->SetToolTip( _("Enter the text to be used within the schematic") );
m_textEntrySizer->Add( m_labelSingleLine, 0, wxALIGN_CENTER_VERTICAL, 2 );
m_valueSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH );
m_textEntrySizer->Add( m_valueSingleLine, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 2 );
m_labelCombo = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelCombo->Wrap( -1 );
m_textEntrySizer->Add( m_labelCombo, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_valueCombo = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
m_textEntrySizer->Add( m_valueCombo, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_textEntrySizer->Add( 0, 0, 1, wxEXPAND, 5 );
m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_syntaxHelp->SetToolTip( _("Show syntax help window") );
m_textEntrySizer->Add( m_syntaxHelp, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( m_textEntrySizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
wxStaticBoxSizer* sbFields;
sbFields = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxVERTICAL );
m_grid = new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_grid->CreateGrid( 4, 11 );
m_grid->EnableEditing( true );
m_grid->EnableGridLines( true );
m_grid->EnableDragGridSize( false );
m_grid->SetMargins( 0, 0 );
// Columns
m_grid->SetColSize( 0, 72 );
m_grid->SetColSize( 1, 84 );
m_grid->SetColSize( 2, 48 );
m_grid->SetColSize( 3, 72 );
m_grid->SetColSize( 4, 72 );
m_grid->SetColSize( 5, 48 );
m_grid->SetColSize( 6, 48 );
m_grid->SetColSize( 7, 84 );
m_grid->SetColSize( 8, 48 );
m_grid->SetColSize( 9, 84 );
m_grid->SetColSize( 10, 84 );
m_grid->EnableDragColMove( false );
m_grid->EnableDragColSize( true );
m_grid->SetColLabelSize( 22 );
m_grid->SetColLabelValue( 0, _("Name") );
m_grid->SetColLabelValue( 1, _("Value") );
m_grid->SetColLabelValue( 2, _("Show") );
m_grid->SetColLabelValue( 3, _("H Align") );
m_grid->SetColLabelValue( 4, _("V Align") );
m_grid->SetColLabelValue( 5, _("Italic") );
m_grid->SetColLabelValue( 6, _("Bold") );
m_grid->SetColLabelValue( 7, _("Text Size") );
m_grid->SetColLabelValue( 8, _("Orientation") );
m_grid->SetColLabelValue( 9, _("X Position") );
m_grid->SetColLabelValue( 10, _("Y Position") );
m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
m_grid->EnableDragRowSize( true );
m_grid->SetRowLabelSize( 0 );
m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Label Appearance
// Cell Defaults
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_grid->SetMinSize( wxSize( -1,100 ) );
sbFields->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bButtonSize;
bButtonSize = new wxBoxSizer( wxHORIZONTAL );
m_bpAdd = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_bpAdd->SetToolTip( _("Add field") );
bButtonSize->Add( m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_bpMoveUp->SetToolTip( _("Move up") );
bButtonSize->Add( m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_bpMoveDown->SetToolTip( _("Move down") );
bButtonSize->Add( m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
bButtonSize->Add( 20, 0, 0, wxEXPAND, 10 );
m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_bpDelete->SetToolTip( _("Delete field") );
bButtonSize->Add( m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
sbFields->Add( bButtonSize, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbFields, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* optionsSizer;
optionsSizer = new wxBoxSizer( wxHORIZONTAL );
m_shapeSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Shape") ), wxVERTICAL );
m_input = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Input"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_input, 0, wxBOTTOM|wxRIGHT, 2 );
m_output = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Output"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_output, 0, wxBOTTOM|wxRIGHT, 3 );
m_bidirectional = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Bidirectional"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_bidirectional, 0, wxBOTTOM|wxRIGHT, 3 );
m_triState = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Tri-state"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_triState, 0, wxBOTTOM|wxRIGHT, 3 );
m_passive = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Passive"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_passive, 0, wxBOTTOM|wxRIGHT, 3 );
m_dot = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Dot"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_dot, 0, wxBOTTOM|wxRIGHT, 3 );
m_circle = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Circle"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_circle, 0, wxBOTTOM|wxRIGHT, 3 );
m_diamond = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Diamond"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_diamond, 0, wxBOTTOM|wxRIGHT, 3 );
m_rectangle = new wxRadioButton( m_shapeSizer->GetStaticBox(), wxID_ANY, _("Rectangle"), wxDefaultPosition, wxDefaultSize, 0 );
m_shapeSizer->Add( m_rectangle, 0, wxBOTTOM|wxRIGHT, 3 );
optionsSizer->Add( m_shapeSizer, 0, wxEXPAND|wxTOP|wxRIGHT, 5 );
wxStaticBoxSizer* formatting;
formatting = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Formatting") ), wxVERTICAL );
wxBoxSizer* formattingSizer;
formattingSizer = new wxBoxSizer( wxHORIZONTAL );
m_textSizeLabel = new wxStaticText( formatting->GetStaticBox(), wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeLabel->Wrap( -1 );
formattingSizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_textSizeCtrl = new wxTextCtrl( formatting->GetStaticBox(), wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
formattingSizer->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_textSizeUnits = new wxStaticText( formatting->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeUnits->Wrap( -1 );
formattingSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 2 );
m_separator1 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator1->Enable( false );
formattingSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_bold = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_bold->SetToolTip( _("Bold") );
formattingSizer->Add( m_bold, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_italic = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_italic->SetToolTip( _("Italic") );
formattingSizer->Add( m_italic, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_separator2 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator2->Enable( false );
formattingSizer->Add( m_separator2, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_spin0 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
formattingSizer->Add( m_spin0, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_spin1 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
formattingSizer->Add( m_spin1, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_spin2 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
formattingSizer->Add( m_spin2, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_spin3 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
formattingSizer->Add( m_spin3, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_separator3 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator3->Enable( false );
formattingSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL, 5 );
formatting->Add( formattingSizer, 0, wxEXPAND|wxBOTTOM, 5 );
optionsSizer->Add( formatting, 1, wxEXPAND|wxTOP, 5 );
bMainSizer->Add( optionsSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizer4->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bSizer4, 0, wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
// Connect Events
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnUpdateUI ) );
m_valueSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_valueCombo->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_syntaxHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnAddField ), NULL, this );
m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveUp ), NULL, this );
m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveDown ), NULL, this );
m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnDeleteField ), NULL, this );
}
DIALOG_LABEL_PROPERTIES_BASE::~DIALOG_LABEL_PROPERTIES_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnUpdateUI ) );
m_valueSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_valueCombo->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_syntaxHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnAddField ), NULL, this );
m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveUp ), NULL, this );
m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnMoveDown ), NULL, this );
m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LABEL_PROPERTIES_BASE::OnDeleteField ), 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/intl.h>
class BITMAP_BUTTON;
class WX_GRID;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/combobox.h>
#include <wx/hyperlink.h>
#include <wx/sizer.h>
#include <wx/grid.h>
#include <wx/bmpbuttn.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/radiobut.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_LABEL_PROPERTIES_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM
{
private:
protected:
enum
{
wxID_VALUESINGLE = 1000,
wxID_SIZE
};
wxFlexGridSizer* m_textEntrySizer;
wxStaticText* m_labelSingleLine;
wxTextCtrl* m_valueSingleLine;
wxStaticText* m_labelCombo;
wxComboBox* m_valueCombo;
wxHyperlinkCtrl* m_syntaxHelp;
WX_GRID* m_grid;
wxBitmapButton* m_bpAdd;
wxBitmapButton* m_bpMoveUp;
wxBitmapButton* m_bpMoveDown;
wxBitmapButton* m_bpDelete;
wxStaticBoxSizer* m_shapeSizer;
wxRadioButton* m_input;
wxRadioButton* m_output;
wxRadioButton* m_bidirectional;
wxRadioButton* m_triState;
wxRadioButton* m_passive;
wxRadioButton* m_dot;
wxRadioButton* m_circle;
wxRadioButton* m_diamond;
wxRadioButton* m_rectangle;
wxStaticText* m_textSizeLabel;
wxTextCtrl* m_textSizeCtrl;
wxStaticText* m_textSizeUnits;
BITMAP_BUTTON* m_separator1;
BITMAP_BUTTON* m_bold;
BITMAP_BUTTON* m_italic;
BITMAP_BUTTON* m_separator2;
BITMAP_BUTTON* m_spin0;
BITMAP_BUTTON* m_spin1;
BITMAP_BUTTON* m_spin2;
BITMAP_BUTTON* m_spin3;
BITMAP_BUTTON* m_separator3;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnEnterKey( wxCommandEvent& event ) { event.Skip(); }
virtual void OnFormattingHelp( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnSizeGrid( wxSizeEvent& event ) { event.Skip(); }
virtual void OnAddField( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMoveUp( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMoveDown( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDeleteField( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Label Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_LABEL_PROPERTIES_BASE();
};

View File

@ -22,12 +22,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <widgets/bitmap_button.h>
#include <symbol_edit_frame.h>
#include <lib_text.h>
#include <settings/settings_manager.h>
#include <dialog_lib_text_properties.h>
#include <symbol_editor/symbol_editor_settings.h>
#include <tools/symbol_editor_drawing_tools.h>
#include <scintilla_tricks.h>
DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent,
@ -40,6 +42,12 @@ DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aPare
m_parent = aParent;
m_graphicText = aText;
m_scintillaTricks = new SCINTILLA_TRICKS( m_StyledTextCtrl, wxT( "{}" ), false,
[this]()
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
} );
// Disable options for fieldedit, not existing in graphic text
m_visible->Show( false );
m_TextValueSelectButton->Hide();
@ -61,11 +69,62 @@ DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aPare
m_sdbSizerButtonsOK->SetDefault();
}
m_separator1->SetIsSeparator();
m_horizontal->SetIsCheckButton();
m_horizontal->SetBitmap( KiBitmap( BITMAPS::text_horizontal ) );
m_vertical->SetIsCheckButton();
m_vertical->SetBitmap( KiBitmap( BITMAPS::text_vertical ) );
m_separator2->SetIsSeparator();
m_bold->SetIsCheckButton();
m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
m_italic->SetIsCheckButton();
m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
m_separator3->SetIsSeparator();
m_hAlignLeft->SetIsCheckButton();
m_hAlignLeft->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
m_hAlignCenter->SetIsCheckButton();
m_hAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_align_center ) );
m_hAlignRight->SetIsCheckButton();
m_hAlignRight->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
m_separator4->SetIsSeparator();
m_vAlignTop->SetIsCheckButton();
m_vAlignTop->SetBitmap( KiBitmap( BITMAPS::text_valign_top ) );
m_vAlignCenter->SetIsCheckButton();
m_vAlignCenter->SetBitmap( KiBitmap( BITMAPS::text_valign_center ) );
m_vAlignBottom->SetIsCheckButton();
m_vAlignBottom->SetBitmap( KiBitmap( BITMAPS::text_valign_bottom ) );
m_separator5->SetIsSeparator();
m_horizontal->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onOrientButton, this );
m_vertical->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onOrientButton, this );
m_hAlignLeft->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton, this );
m_hAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton, this );
m_hAlignRight->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton, this );
m_vAlignTop->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton, this );
m_vAlignCenter->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton, this );
m_vAlignBottom->Bind( wxEVT_BUTTON, &DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton, this );
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
DIALOG_LIB_TEXT_PROPERTIES::~DIALOG_LIB_TEXT_PROPERTIES()
{
delete m_scintillaTricks;
};
bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow()
{
if( m_graphicText )
@ -75,24 +134,28 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow()
m_textSize.SetValue( m_graphicText->GetTextWidth() );
m_TextCtrl->SetValue( m_graphicText->GetText() );
m_italic->SetValue( m_graphicText->IsItalic() );
m_bold->SetValue( m_graphicText->IsBold() );
m_italic->Check( m_graphicText->IsItalic() );
m_bold->Check( m_graphicText->IsBold() );
m_CommonUnit->SetValue( m_graphicText->GetUnit() == 0 );
m_CommonConvert->SetValue( m_graphicText->GetConvert() == 0 );
m_orientChoice->SetSelection( m_graphicText->GetTextAngle() == TEXT_ANGLE_HORIZ ? 0 : 1 );
if( m_graphicText->GetTextAngle() == TEXT_ANGLE_HORIZ )
m_horizontal->Check();
else
m_vertical->Check();
switch ( m_graphicText->GetHorizJustify() )
{
case GR_TEXT_HJUSTIFY_LEFT: m_hAlignChoice->SetSelection( 0 ); break;
case GR_TEXT_HJUSTIFY_CENTER: m_hAlignChoice->SetSelection( 1 ); break;
case GR_TEXT_HJUSTIFY_RIGHT: m_hAlignChoice->SetSelection( 2 ); break;
case GR_TEXT_HJUSTIFY_LEFT: m_hAlignLeft->Check( true ); break;
case GR_TEXT_HJUSTIFY_CENTER: m_hAlignCenter->Check( true ); break;
case GR_TEXT_HJUSTIFY_RIGHT: m_hAlignRight->Check( true ); break;
}
switch ( m_graphicText->GetVertJustify() )
{
case GR_TEXT_VJUSTIFY_TOP: m_vAlignChoice->SetSelection( 0 ); break;
case GR_TEXT_VJUSTIFY_CENTER: m_vAlignChoice->SetSelection( 1 ); break;
case GR_TEXT_VJUSTIFY_BOTTOM: m_vAlignChoice->SetSelection( 2 ); break;
case GR_TEXT_VJUSTIFY_TOP: m_vAlignTop->Check( true ); break;
case GR_TEXT_VJUSTIFY_CENTER: m_vAlignCenter->Check( true ); break;
case GR_TEXT_VJUSTIFY_BOTTOM: m_vAlignBottom->Check( true ); break;
}
}
else
@ -104,13 +167,47 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow()
m_CommonUnit->SetValue( !tools->GetDrawSpecificUnit() );
m_CommonConvert->SetValue( !tools->GetDrawSpecificConvert() );
m_orientChoice->SetSelection( tools->GetLastTextAngle() == TEXT_ANGLE_HORIZ ? 0 : 1 );
if( tools->GetLastTextAngle() == TEXT_ANGLE_HORIZ )
m_horizontal->Check();
else
m_vertical->Check();
}
return true;
}
void DIALOG_LIB_TEXT_PROPERTIES::onOrientButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_horizontal, m_vertical } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
void DIALOG_LIB_TEXT_PROPERTIES::onHAlignButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_hAlignLeft, m_hAlignCenter, m_hAlignRight } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
void DIALOG_LIB_TEXT_PROPERTIES::onVAlignButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_vAlignTop, m_vAlignTop, m_vAlignBottom } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
{
if( m_graphicText )
@ -125,8 +222,10 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
if( m_textSize.GetValue() != m_graphicText->GetTextWidth() )
m_graphicText->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
m_graphicText->SetTextAngle( m_orientChoice->GetSelection() ? TEXT_ANGLE_VERT
: TEXT_ANGLE_HORIZ );
if( m_horizontal->IsChecked() )
m_graphicText->SetTextAngle( TEXT_ANGLE_HORIZ );
else
m_graphicText->SetTextAngle( TEXT_ANGLE_VERT );
if( !m_CommonUnit->GetValue() )
m_graphicText->SetUnit( m_parent->GetUnit() );
@ -138,22 +237,22 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
else
m_graphicText->SetConvert( 0 );
m_graphicText->SetItalic( m_italic->GetValue() );
m_graphicText->SetBold( m_bold->GetValue() );
m_graphicText->SetItalic( m_italic->IsChecked() );
m_graphicText->SetBold( m_bold->IsChecked() );
switch( m_hAlignChoice->GetSelection() )
{
case 0: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT ); break;
case 1: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER ); break;
case 2: m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); break;
}
if( m_hAlignLeft->IsChecked() )
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
else if( m_hAlignCenter->IsChecked() )
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER );
else
m_graphicText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
switch( m_vAlignChoice->GetSelection() )
{
case 0: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP ); break;
case 1: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER ); break;
case 2: m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); break;
}
if( m_vAlignTop->IsChecked() )
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
else if( m_vAlignCenter->IsChecked() )
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
else
m_graphicText->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
// Record settings used for next time:
auto* tools = m_parent->GetToolManager()->GetTool<SYMBOL_EDITOR_DRAWING_TOOLS>();
@ -166,3 +265,12 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
return true;
}
void DIALOG_LIB_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
{
if( m_scintillaTricks )
m_scintillaTricks->CancelAutocomplete();
event.Skip();
}

View File

@ -30,6 +30,7 @@
#include <widgets/unit_binder.h>
class SYMBOL_EDIT_FRAME;
class SCINTILLA_TRICKS;
class LIB_TEXT;
@ -37,9 +38,14 @@ class DIALOG_LIB_TEXT_PROPERTIES : public DIALOG_LIB_TEXT_PROPERTIES_BASE
{
public:
DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent, LIB_TEXT* aText );
~DIALOG_LIB_TEXT_PROPERTIES() override {};
~DIALOG_LIB_TEXT_PROPERTIES() override;
private:
void onOrientButton( wxCommandEvent &aEvent );
void onHAlignButton( wxCommandEvent &aEvent );
void onVAlignButton( wxCommandEvent &aEvent );
void onMultiLineTCLostFocus( wxFocusEvent& event ) override;
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
@ -49,6 +55,7 @@ private:
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
UNIT_BINDER m_textSize;
SCINTILLA_TRICKS* m_scintillaTricks;
};

View File

@ -5,6 +5,8 @@
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/bitmap_button.h"
#include "dialog_lib_text_properties_base.h"
///////////////////////////////////////////////////////////////////////////
@ -86,99 +88,141 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare
bPropertiesSizer->Add( bSizer9, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 0, 8, 3, 3 );
fgSizer3 = new wxFlexGridSizer( 0, 4, 3, 3 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_xPosLabel = new wxStaticText( this, wxID_ANY, _("Position X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_xPosLabel->Wrap( -1 );
fgSizer3->Add( m_xPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_xPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_xPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND, 5 );
m_xPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_xPosUnits->Wrap( -1 );
fgSizer3->Add( m_xPosUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_italic = new wxCheckBox( this, wxID_ANY, _("Italic"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_italic, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_orientLabel = new wxStaticText( this, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_orientLabel->Wrap( -1 );
fgSizer3->Add( m_orientLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
wxString m_orientChoiceChoices[] = { _("Horizontal"), _("Vertical") };
int m_orientChoiceNChoices = sizeof( m_orientChoiceChoices ) / sizeof( wxString );
m_orientChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_orientChoiceNChoices, m_orientChoiceChoices, 0 );
m_orientChoice->SetSelection( 0 );
fgSizer3->Add( m_orientChoice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_yPosLabel = new wxStaticText( this, wxID_ANY, _("Position Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_yPosLabel->Wrap( -1 );
fgSizer3->Add( m_yPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_yPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_yPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND, 5 );
m_yPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_yPosUnits->Wrap( -1 );
fgSizer3->Add( m_yPosUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_bold = new wxCheckBox( this, wxID_ANY, _("Bold"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_bold, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_hAlignLabel = new wxStaticText( this, wxID_ANY, _("H Align:"), wxDefaultPosition, wxDefaultSize, 0 );
m_hAlignLabel->Wrap( -1 );
fgSizer3->Add( m_hAlignLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
wxString m_hAlignChoiceChoices[] = { _("Left"), _("Center"), _("Right") };
int m_hAlignChoiceNChoices = sizeof( m_hAlignChoiceChoices ) / sizeof( wxString );
m_hAlignChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_hAlignChoiceNChoices, m_hAlignChoiceChoices, 0 );
m_hAlignChoice->SetSelection( 0 );
fgSizer3->Add( m_hAlignChoice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeLabel->Wrap( -1 );
fgSizer3->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_textSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_textSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
fgSizer3->Add( m_textSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeUnits->Wrap( -1 );
fgSizer3->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizer3->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* formattingSizer;
formattingSizer = new wxBoxSizer( wxHORIZONTAL );
m_separator1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator1->Enable( false );
formattingSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_horizontal = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_horizontal->SetToolTip( _("Horizontal text") );
formattingSizer->Add( m_horizontal, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_vertical = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_vertical->SetToolTip( _("Vertical text") );
formattingSizer->Add( m_vertical, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_separator2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator2->Enable( false );
formattingSizer->Add( m_separator2, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_bold = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_bold->SetToolTip( _("Bold") );
formattingSizer->Add( m_bold, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_italic = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_italic->SetToolTip( _("Italic") );
formattingSizer->Add( m_italic, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_separator3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator3->Enable( false );
formattingSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_hAlignLeft = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_hAlignLeft->SetToolTip( _("Align left") );
formattingSizer->Add( m_hAlignLeft, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_hAlignCenter = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_hAlignCenter->SetToolTip( _("Align horizontal center") );
formattingSizer->Add( m_hAlignCenter, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_hAlignRight = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_hAlignRight->SetToolTip( _("Align right") );
formattingSizer->Add( m_hAlignRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_separator4 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator4->Enable( false );
formattingSizer->Add( m_separator4, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_vAlignTop = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_vAlignTop->SetToolTip( _("Align top") );
formattingSizer->Add( m_vAlignTop, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_vAlignCenter = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_vAlignCenter->SetToolTip( _("Align vertical center") );
formattingSizer->Add( m_vAlignCenter, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_vAlignBottom = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_vAlignBottom->SetToolTip( _("Align bottom") );
formattingSizer->Add( m_vAlignBottom, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_separator5 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator5->Enable( false );
formattingSizer->Add( m_separator5, 0, wxALIGN_CENTER_VERTICAL, 5 );
fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
fgSizer3->Add( formattingSizer, 1, wxEXPAND|wxRIGHT, 5 );
fgSizer3->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
fgSizer3->Add( 0, 10, 1, wxEXPAND, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
m_vAlignLabel = new wxStaticText( this, wxID_ANY, _("V Align:"), wxDefaultPosition, wxDefaultSize, 0 );
m_vAlignLabel->Wrap( -1 );
fgSizer3->Add( m_vAlignLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
wxString m_vAlignChoiceChoices[] = { _("Top"), _("Center"), _("Bottom") };
int m_vAlignChoiceNChoices = sizeof( m_vAlignChoiceChoices ) / sizeof( wxString );
m_vAlignChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_vAlignChoiceNChoices, m_vAlignChoiceChoices, 0 );
m_vAlignChoice->SetSelection( 0 );
fgSizer3->Add( m_vAlignChoice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
m_xPosLabel = new wxStaticText( this, wxID_ANY, _("Position X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_xPosLabel->Wrap( -1 );
fgSizer3->Add( m_xPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_xPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_xPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_xPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_xPosUnits->Wrap( -1 );
fgSizer3->Add( m_xPosUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to all units"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_CommonUnit, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 80 );
m_yPosLabel = new wxStaticText( this, wxID_ANY, _("Position Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_yPosLabel->Wrap( -1 );
fgSizer3->Add( m_yPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_yPosCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_yPosCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_yPosUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_yPosUnits->Wrap( -1 );
fgSizer3->Add( m_yPosUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_CommonConvert, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 80 );
bPropertiesSizer->Add( fgSizer3, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@ -186,12 +230,6 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare
wxBoxSizer* bBottomtBoxSizer;
bBottomtBoxSizer = new wxBoxSizer( wxVERTICAL );
m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to all units"), wxDefaultPosition, wxDefaultSize, 0 );
bBottomtBoxSizer->Add( m_CommonUnit, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
bBottomtBoxSizer->Add( m_CommonConvert, 0, wxLEFT|wxRIGHT, 5 );
bPropertiesSizer->Add( bBottomtBoxSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
@ -218,6 +256,7 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnCloseDialog ) );
m_TextCtrl->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
m_StyledTextCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_StyledTextCtrl->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
m_TextValueSelectButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnTextValueSelectButtonClick ), NULL, this );
}
@ -227,6 +266,7 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::~DIALOG_LIB_TEXT_PROPERTIES_BASE()
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnCloseDialog ) );
m_TextCtrl->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
m_StyledTextCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_StyledTextCtrl->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnSetFocusText ), NULL, this );
m_TextValueSelectButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_TEXT_PROPERTIES_BASE::OnTextValueSelectButtonClick ), NULL, this );

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,8 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class BITMAP_BUTTON;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
@ -26,7 +28,6 @@
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/choice.h>
#include <wx/statline.h>
#include <wx/dialog.h>
@ -46,24 +47,31 @@ class DIALOG_LIB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
wxBitmapButton* m_TextValueSelectButton;
wxStaticText* m_note;
wxCheckBox* m_visible;
wxStaticText* m_xPosLabel;
wxTextCtrl* m_xPosCtrl;
wxStaticText* m_xPosUnits;
wxCheckBox* m_italic;
wxStaticText* m_orientLabel;
wxChoice* m_orientChoice;
wxStaticText* m_yPosLabel;
wxTextCtrl* m_yPosCtrl;
wxStaticText* m_yPosUnits;
wxCheckBox* m_bold;
wxStaticText* m_hAlignLabel;
wxChoice* m_hAlignChoice;
wxStaticText* m_textSizeLabel;
wxTextCtrl* m_textSizeCtrl;
wxStaticText* m_textSizeUnits;
wxStaticText* m_vAlignLabel;
wxChoice* m_vAlignChoice;
BITMAP_BUTTON* m_separator1;
BITMAP_BUTTON* m_horizontal;
BITMAP_BUTTON* m_vertical;
BITMAP_BUTTON* m_separator2;
BITMAP_BUTTON* m_bold;
BITMAP_BUTTON* m_italic;
BITMAP_BUTTON* m_separator3;
BITMAP_BUTTON* m_hAlignLeft;
BITMAP_BUTTON* m_hAlignCenter;
BITMAP_BUTTON* m_hAlignRight;
BITMAP_BUTTON* m_separator4;
BITMAP_BUTTON* m_vAlignTop;
BITMAP_BUTTON* m_vAlignCenter;
BITMAP_BUTTON* m_vAlignBottom;
BITMAP_BUTTON* m_separator5;
wxStaticText* m_xPosLabel;
wxTextCtrl* m_xPosCtrl;
wxStaticText* m_xPosUnits;
wxCheckBox* m_CommonUnit;
wxStaticText* m_yPosLabel;
wxTextCtrl* m_yPosCtrl;
wxStaticText* m_yPosUnits;
wxCheckBox* m_CommonConvert;
wxStaticLine* m_staticline2;
wxStdDialogButtonSizer* m_sdbSizerButtons;
@ -73,6 +81,7 @@ class DIALOG_LIB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
// Virtual event handlers, overide them in your derived class
virtual void OnCloseDialog( wxCloseEvent& event ) { event.Skip(); }
virtual void OnSetFocusText( wxFocusEvent& event ) { event.Skip(); }
virtual void onMultiLineTCLostFocus( wxFocusEvent& event ) { event.Skip(); }
virtual void OnTextValueSelectButtonClick( wxCommandEvent& event ) { event.Skip(); }

View File

@ -122,7 +122,7 @@ bool DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow()
// and expects text width = text height
m_sheetPin->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
auto shape = static_cast<PINSHEETLABEL_SHAPE>( m_choiceConnectionType->GetCurrentSelection() );
auto shape = static_cast<LABEL_FLAG_SHAPE>( m_choiceConnectionType->GetCurrentSelection() );
m_sheetPin->SetShape( shape );
m_frame->UpdateItem( m_sheetPin, false, true );

View File

@ -774,7 +774,9 @@ void DIALOG_SHEET_PROPERTIES::OnMoveUp( wxCommandEvent& event )
m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
}
else
{
wxBell();
}
}
@ -796,7 +798,9 @@ void DIALOG_SHEET_PROPERTIES::OnMoveDown( wxCommandEvent& event )
m_grid->MakeCellVisible( m_grid->GetGridCursorRow(), m_grid->GetGridCursorCol() );
}
else
{
wxBell();
}
}
@ -866,7 +870,6 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
m_grid->MakeCellVisible( m_delayedFocusRow, m_delayedFocusColumn );
m_grid->SetGridCursor( m_delayedFocusRow, m_delayedFocusColumn );
m_grid->EnableCellEditControl( true );
m_grid->ShowCellEditControl();
@ -878,12 +881,10 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
void DIALOG_SHEET_PROPERTIES::OnSizeGrid( wxSizeEvent& event )
{
auto new_size = event.GetSize().GetX();
int new_size = event.GetSize().GetX();
if( m_width != new_size )
{
AdjustGridColumns( new_size );
}
// Always propagate for a grid repaint (needed if the height changes, as well as width)
event.Skip();

View File

@ -43,21 +43,6 @@ public:
~DIALOG_SHEET_PROPERTIES() override;
private:
SCH_EDIT_FRAME* m_frame;
SCH_SHEET* m_sheet;
bool* m_clearAnnotationNewItems;
int m_width;
int m_delayedFocusRow;
int m_delayedFocusColumn;
wxString m_shownColumns;
FIELDS_GRID_TABLE<SCH_FIELD>* m_fields;
UNIT_BINDER m_borderWidth;
SCH_SHEET m_dummySheet;
SCH_FIELD m_dummySheetNameField;
bool onSheetFilenameChanged( const wxString& aNewFilename );
bool TransferDataToWindow() override;
@ -76,6 +61,22 @@ private:
void OnInitDlg( wxInitDialogEvent& event ) override;
void AdjustGridColumns( int aWidth );
private:
SCH_EDIT_FRAME* m_frame;
SCH_SHEET* m_sheet;
bool* m_clearAnnotationNewItems;
int m_width;
int m_delayedFocusRow;
int m_delayedFocusColumn;
wxString m_shownColumns;
FIELDS_GRID_TABLE<SCH_FIELD>* m_fields;
UNIT_BINDER m_borderWidth;
SCH_SHEET m_dummySheet;
SCH_FIELD m_dummySheetNameField;
};
#endif // DIALOG_SHEET_PROPERTIES_H

View File

@ -69,7 +69,7 @@ DIALOG_SHEET_PROPERTIES_BASE::DIALOG_SHEET_PROPERTIES_BASE( wxWindow* parent, wx
// Cell Defaults
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_grid->SetMinSize( wxSize( -1,180 ) );
m_grid->SetMinSize( wxSize( -1,120 ) );
sbFields->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
@ -173,7 +173,7 @@ DIALOG_SHEET_PROPERTIES_BASE::DIALOG_SHEET_PROPERTIES_BASE( wxWindow* parent, wx
bSizer6->Add( 0, 0, 3, wxEXPAND, 5 );
mainSizer->Add( bSizer6, 0, wxALL|wxEXPAND, 5 );
mainSizer->Add( bSizer6, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
mainSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );

View File

@ -143,7 +143,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,180</property>
<property name="minimum_size">-1,120</property>
<property name="moveable">1</property>
<property name="name">m_grid</property>
<property name="pane_border">1</property>
@ -975,8 +975,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="border">10</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>

View File

@ -322,7 +322,7 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
if( cfg )
{
m_shownColumns = cfg->m_Appearance.edit_component_visible_columns;
m_shownColumns = cfg->m_Appearance.edit_symbol_visible_columns;
m_fieldsGrid->ShowHideColumns( m_shownColumns );
}
@ -379,7 +379,7 @@ DIALOG_SYMBOL_PROPERTIES::~DIALOG_SYMBOL_PROPERTIES()
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
if( cfg )
cfg->m_Appearance.edit_component_visible_columns = m_fieldsGrid->GetShownColumns();
cfg->m_Appearance.edit_symbol_visible_columns = m_fieldsGrid->GetShownColumns();
// Prevents crash bug in wxGrid's d'tor
m_fieldsGrid->DestroyTable( m_fields );

View File

@ -1,409 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sch_edit_frame.h>
#include <base_units.h>
#include <sch_validators.h>
#include <tool/tool_manager.h>
#include <general.h>
#include <gr_text.h>
#include <confirm.h>
#include <sch_symbol.h>
#include <sch_reference_list.h>
#include <schematic.h>
#include <dialogs/html_message_box.h>
#include <dialog_text_and_label_properties.h>
#include <string_utils.h>
#include <tool/actions.h>
#include <scintilla_tricks.h>
class SCH_EDIT_FRAME;
class SCH_TEXT;
DIALOG_TEXT_AND_LABEL_PROPERTIES::DIALOG_TEXT_AND_LABEL_PROPERTIES( SCH_EDIT_FRAME* aParent,
SCH_TEXT* aTextItem ) :
DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE( aParent ),
m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, false ),
m_netNameValidator( true ),
m_scintillaTricks( nullptr ),
m_helpWindow( nullptr )
{
m_Parent = aParent;
m_CurrentText = aTextItem;
m_valueMultiLine->SetEOLMode( wxSTC_EOL_LF );
m_scintillaTricks = new SCINTILLA_TRICKS( m_valueMultiLine, wxT( "{}" ), false,
[this]()
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
} );
if( m_CurrentText->IsMultilineAllowed() )
{
m_activeTextCtrl = m_valueMultiLine;
m_activeTextEntry = nullptr;
m_labelSingleLine->Show( false );
m_valueSingleLine->Show( false );
m_labelCombo->Show( false );
m_valueCombo->Show( false );
m_textEntrySizer->AddGrowableRow( 0 );
}
else if( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T || m_CurrentText->Type() == SCH_LABEL_T )
{
m_activeTextCtrl = m_valueCombo;
m_activeTextEntry = m_valueCombo;
m_labelSingleLine->Show( false ); m_valueSingleLine->Show( false );
m_labelMultiLine->Show( false ); m_valueMultiLine->Show( false );
m_valueCombo->SetValidator( m_netNameValidator );
}
else
{
m_activeTextCtrl = m_valueSingleLine;
m_activeTextEntry = m_valueSingleLine;
m_labelCombo->Show( false );
m_valueCombo->Show( false );
m_labelMultiLine->Show( false );
m_valueMultiLine->Show( false );
if( m_CurrentText->Type() != SCH_TEXT_T )
m_valueSingleLine->SetValidator( m_netNameValidator );
m_valueCombo->SetValidator( m_netNameValidator );
}
switch( m_CurrentText->Type() )
{
case SCH_GLOBAL_LABEL_T: SetTitle( _( "Global Label Properties" ) ); break;
case SCH_HIER_LABEL_T: SetTitle( _( "Hierarchical Label Properties" ) ); break;
case SCH_LABEL_T: SetTitle( _( "Label Properties" ) ); break;
case SCH_SHEET_PIN_T: SetTitle( _( "Hierarchical Sheet Pin Properties" ) ); break;
default: SetTitle( _( "Text Properties" ) ); break;
}
SetInitialFocus( m_activeTextCtrl );
m_TextShape->Show( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T ||
m_CurrentText->Type() == SCH_HIER_LABEL_T );
if( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T )
{
m_note1->SetFont( KIUI::GetInfoFont( this ).Italic() );
m_note2->SetFont( KIUI::GetInfoFont( this ).Italic() );
}
else
{
m_note1->Show( false );
m_note2->Show( false );
}
m_sdbSizer1OK->SetDefault();
Layout();
m_valueMultiLine->Bind( wxEVT_STC_CHARADDED, &DIALOG_TEXT_AND_LABEL_PROPERTIES::onScintillaCharAdded, this );
// DIALOG_SHIM needs a unique hash_key because classname is not sufficient because the
// various versions have different controls so we want to store sizes for each version.
m_hash_key = TO_UTF8( GetTitle() );
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
DIALOG_TEXT_AND_LABEL_PROPERTIES::~DIALOG_TEXT_AND_LABEL_PROPERTIES()
{
delete m_scintillaTricks;
if( m_helpWindow )
m_helpWindow->Destroy();
}
void DIALOG_TEXT_AND_LABEL_PROPERTIES::SetTitle( const wxString& aTitle )
{
// This class is shared for numerous tasks: a couple of single line labels and
// multi-line text fields. Since the desired size of the multi-line text field editor
// is often larger, we retain separate sizes based on the dialog titles.
switch( m_CurrentText->Type() )
{
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
case SCH_LABEL_T:
// labels can share retained settings probably.
break;
default:
m_hash_key = TO_UTF8( aTitle );
m_hash_key += typeid(*this).name();
}
DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::SetTitle( aTitle );
}
bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataToWindow()
{
if( !wxDialog::TransferDataToWindow() )
return false;
if( m_CurrentText->Type() == SCH_TEXT_T )
{
SCHEMATIC& schematic = m_Parent->Schematic();
// show text variable cross-references in a human-readable format
m_valueMultiLine->SetValue( schematic.ConvertKIIDsToRefs( m_CurrentText->GetText() ) );
}
else
{
// show control characters in a human-readable format
m_activeTextEntry->SetValue( UnescapeString( m_CurrentText->GetText() ) );
}
if( m_valueCombo->IsShown() )
{
// Load the combobox with the existing labels of the same type
std::set<wxString> existingLabels;
SCH_SCREENS allScreens( m_Parent->Schematic().Root() );
for( SCH_SCREEN* screen = allScreens.GetFirst(); screen; screen = allScreens.GetNext() )
{
for( SCH_ITEM* item : screen->Items().OfType( m_CurrentText->Type() ) )
{
auto textItem = static_cast<const SCH_TEXT*>( item );
existingLabels.insert( UnescapeString( textItem->GetText() ) );
}
}
wxArrayString existingLabelArray;
for( const wxString& label : existingLabels )
existingLabelArray.push_back( label );
// existingLabelArray.Sort();
m_valueCombo->Append( existingLabelArray );
}
// Set text options:
m_TextOrient->SetSelection( static_cast<int>( m_CurrentText->GetLabelSpinStyle() ) );
m_TextShape->SetSelection( static_cast<int>( m_CurrentText->GetShape() ) );
int style = 0;
if( m_CurrentText->IsItalic() )
style = 1;
if( m_CurrentText->IsBold() )
style += 2;
m_TextStyle->SetSelection( style );
m_textSize.SetValue( m_CurrentText->GetTextWidth() );
return true;
}
/*!
* wxEVT_COMMAND_ENTER event handler for single-line control
*/
void DIALOG_TEXT_AND_LABEL_PROPERTIES::OnEnterKey( wxCommandEvent& aEvent )
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
}
void DIALOG_TEXT_AND_LABEL_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
{
wxStyledTextCtrl* te = m_valueMultiLine;
wxArrayString autocompleteTokens;
int text_pos = te->GetCurrentPos();
int start = te->WordStartPosition( text_pos, true );
wxString partial;
auto textVarRef =
[&]( int pos )
{
return pos >= 2 && te->GetCharAt( pos-2 ) == '$' && te->GetCharAt( pos-1 ) == '{';
};
// Check for cross-reference
if( start > 1 && te->GetCharAt( start-1 ) == ':' )
{
int refStart = te->WordStartPosition( start-1, true );
if( textVarRef( refStart ) )
{
partial = te->GetRange( start+1, text_pos );
wxString ref = te->GetRange( refStart, start-1 );
SCH_SHEET_LIST sheets = m_Parent->Schematic().GetSheets();
SCH_REFERENCE_LIST refs;
SCH_SYMBOL* refSymbol = nullptr;
sheets.GetSymbols( refs );
for( size_t jj = 0; jj < refs.GetCount(); jj++ )
{
if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(), true ) == ref )
{
refSymbol = refs[ jj ].GetSymbol();
break;
}
}
if( refSymbol )
refSymbol->GetContextualTextVars( &autocompleteTokens );
}
}
else if( textVarRef( start ) )
{
partial = te->GetTextRange( start, text_pos );
m_CurrentText->GetContextualTextVars( &autocompleteTokens );
SCHEMATIC* schematic = m_CurrentText->Schematic();
if( schematic && schematic->CurrentSheet().Last() )
schematic->CurrentSheet().Last()->GetContextualTextVars( &autocompleteTokens );
for( std::pair<wxString, wxString> entry : Prj().GetTextVars() )
autocompleteTokens.push_back( entry.first );
}
m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
m_valueMultiLine->SetFocus();
}
bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
{
if( !wxDialog::TransferDataFromWindow() )
return false;
// Don't allow text to disappear; it can be difficult to correct if you can't select it
if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
return false;
wxString text;
/* save old text in undo list if not already in edit */
if( m_CurrentText->GetEditFlags() == 0 )
m_Parent->SaveCopyInUndoList( m_Parent->GetScreen(), m_CurrentText, UNDO_REDO::CHANGED, false );
m_Parent->GetCanvas()->Refresh();
if( m_CurrentText->Type() == SCH_TEXT_T )
{
// convert any text variable cross-references to their UUIDs
text = m_Parent->Schematic().ConvertRefsToKIIDs( m_valueMultiLine->GetValue() );
}
else
{
// labels need escaping
text = EscapeString( m_activeTextEntry->GetValue(), CTX_NETNAME );
}
if( !text.IsEmpty() )
{
#ifdef __WXMAC__
// On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
text.Replace( "\r", "\n" );
#endif
m_CurrentText->SetText( text );
}
else if( !m_CurrentText->IsNew() )
{
DisplayError( this, _( "Label requires non-empty text." ) );
return false;
}
LABEL_SPIN_STYLE selectedSpinStyle(
static_cast<LABEL_SPIN_STYLE::SPIN>( m_TextOrient->GetSelection() ) );
if( m_CurrentText->GetLabelSpinStyle() != selectedSpinStyle )
m_CurrentText->SetLabelSpinStyle( selectedSpinStyle );
if( m_CurrentText->GetTextWidth() != m_textSize.GetValue() )
m_CurrentText->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
if( m_TextShape )
m_CurrentText->SetShape( (PINSHEETLABEL_SHAPE) m_TextShape->GetSelection() );
int style = m_TextStyle->GetSelection();
bool wantItalic = ( style & 1 ) > 0;
bool wantBold = (style & 2 ) > 0;
m_CurrentText->SetItalic( wantItalic );
if( wantBold != m_CurrentText->IsBold() )
{
if( wantBold )
{
m_CurrentText->SetBold( true );
m_CurrentText->SetTextThickness( GetPenSizeForBold( m_CurrentText->GetTextWidth() ) );
}
else
{
m_CurrentText->SetBold( false );
m_CurrentText->SetTextThickness( 0 ); // Use default pen width
}
}
m_Parent->UpdateItem( m_CurrentText, false, true );
m_Parent->GetCanvas()->Refresh();
m_Parent->OnModify();
if( m_CurrentText->Type() == SCH_GLOBAL_LABEL_T )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( m_CurrentText );
label->UpdateIntersheetRefProps();
}
return true;
}
void DIALOG_TEXT_AND_LABEL_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
{
if( m_scintillaTricks )
m_scintillaTricks->CancelAutocomplete();
event.Skip();
}
void DIALOG_TEXT_AND_LABEL_PROPERTIES::OnFormattingHelp( wxHyperlinkEvent& aEvent )
{
m_helpWindow = SCH_TEXT::ShowSyntaxHelp( this );
}

View File

@ -1,177 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_text_and_label_properties_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_textEntrySizer = new wxFlexGridSizer( 5, 2, 1, 3 );
m_textEntrySizer->AddGrowableCol( 1 );
m_textEntrySizer->AddGrowableRow( 1 );
m_textEntrySizer->SetFlexibleDirection( wxBOTH );
m_textEntrySizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_textEntrySizer->SetMinSize( wxSize( 500,-1 ) );
m_labelSingleLine = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelSingleLine->Wrap( -1 );
m_labelSingleLine->SetToolTip( _("Enter the text to be used within the schematic") );
m_textEntrySizer->Add( m_labelSingleLine, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 );
m_valueSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH );
m_valueSingleLine->SetMinSize( wxSize( 360,-1 ) );
m_textEntrySizer->Add( m_valueSingleLine, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 );
m_labelMultiLine = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelMultiLine->Wrap( -1 );
m_textEntrySizer->Add( m_labelMultiLine, 0, wxTOP|wxRIGHT, 2 );
m_valueMultiLine = new wxStyledTextCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN, wxEmptyString );
m_valueMultiLine->SetUseTabs( true );
m_valueMultiLine->SetTabWidth( 4 );
m_valueMultiLine->SetIndent( 4 );
m_valueMultiLine->SetTabIndents( false );
m_valueMultiLine->SetBackSpaceUnIndents( false );
m_valueMultiLine->SetViewEOL( false );
m_valueMultiLine->SetViewWhiteSpace( false );
m_valueMultiLine->SetMarginWidth( 2, 0 );
m_valueMultiLine->SetIndentationGuides( false );
m_valueMultiLine->SetReadOnly( false );
m_valueMultiLine->SetMarginWidth( 1, 0 );
m_valueMultiLine->SetMarginWidth( 0, 0 );
m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS );
m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) );
m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) );
m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS );
m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) );
m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) );
m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY );
m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUS );
m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) );
m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) );
m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUS );
m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) );
m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) );
m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY );
m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
m_valueMultiLine->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
m_valueMultiLine->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
m_textEntrySizer->Add( m_valueMultiLine, 1, wxEXPAND|wxBOTTOM, 2 );
m_labelCombo = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelCombo->Wrap( -1 );
m_textEntrySizer->Add( m_labelCombo, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_valueCombo = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
m_valueCombo->SetMinSize( wxSize( 360,-1 ) );
m_textEntrySizer->Add( m_valueCombo, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text Size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeLabel->Wrap( -1 );
m_textEntrySizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 6 );
wxBoxSizer* bSizeCtrlSizer;
bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
m_textSizeCtrl = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizeCtrlSizer->Add( m_textSizeCtrl, 0, wxBOTTOM|wxRIGHT|wxTOP, 6 );
m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeUnits->Wrap( -1 );
bSizeCtrlSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 6 );
bSizeCtrlSizer->Add( 0, 0, 1, wxEXPAND, 15 );
m_formattingHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_formattingHelp->SetToolTip( _("Show syntax help window") );
bSizeCtrlSizer->Add( m_formattingHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_textEntrySizer->Add( bSizeCtrlSizer, 1, wxEXPAND, 6 );
m_note1 = new wxStaticText( this, wxID_ANY, _("Note:"), wxDefaultPosition, wxDefaultSize, 0 );
m_note1->Wrap( -1 );
m_textEntrySizer->Add( m_note1, 0, wxTOP|wxRIGHT, 2 );
m_note2 = new wxStaticText( this, wxID_ANY, _("The margins around the text are controlled by the text offset ratio\nin Schematic Setup > General > Formatting."), wxDefaultPosition, wxDefaultSize, 0 );
m_note2->Wrap( -1 );
m_textEntrySizer->Add( m_note2, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 2 );
bMainSizer->Add( m_textEntrySizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
wxBoxSizer* m_OptionsSizer;
m_OptionsSizer = new wxBoxSizer( wxHORIZONTAL );
wxString m_TextOrientChoices[] = { _("Align right"), _("Align bottom"), _("Align left"), _("Align top") };
int m_TextOrientNChoices = sizeof( m_TextOrientChoices ) / sizeof( wxString );
m_TextOrient = new wxRadioBox( this, wxID_ANY, _("Justification"), wxDefaultPosition, wxDefaultSize, m_TextOrientNChoices, m_TextOrientChoices, 1, wxRA_SPECIFY_COLS );
m_TextOrient->SetSelection( 2 );
m_OptionsSizer->Add( m_TextOrient, 1, wxRIGHT|wxTOP|wxEXPAND, 3 );
wxString m_TextStyleChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold and italic") };
int m_TextStyleNChoices = sizeof( m_TextStyleChoices ) / sizeof( wxString );
m_TextStyle = new wxRadioBox( this, wxID_ANY, _("Style"), wxDefaultPosition, wxDefaultSize, m_TextStyleNChoices, m_TextStyleChoices, 1, wxRA_SPECIFY_COLS );
m_TextStyle->SetSelection( 0 );
m_OptionsSizer->Add( m_TextStyle, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 3 );
wxString m_TextShapeChoices[] = { _("Input"), _("Output"), _("Bidirectional"), _("Tri-state"), _("Passive") };
int m_TextShapeNChoices = sizeof( m_TextShapeChoices ) / sizeof( wxString );
m_TextShape = new wxRadioBox( this, wxID_ANY, _("Shape"), wxDefaultPosition, wxDefaultSize, m_TextShapeNChoices, m_TextShapeChoices, 1, wxRA_SPECIFY_COLS );
m_TextShape->SetSelection( 0 );
m_OptionsSizer->Add( m_TextShape, 1, wxEXPAND|wxTOP|wxLEFT, 3 );
bMainSizer->Add( m_OptionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizer4->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bSizer4, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
// Connect Events
m_valueSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_valueMultiLine->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_valueCombo->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_formattingHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
}
DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::~DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE()
{
// Disconnect Events
m_valueSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_valueMultiLine->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_valueCombo->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
m_formattingHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,296 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sch_edit_frame.h>
#include <widgets/bitmap_button.h>
#include <base_units.h>
#include <tool/tool_manager.h>
#include <general.h>
#include <gr_text.h>
#include <confirm.h>
#include <schematic.h>
#include <dialogs/html_message_box.h>
#include <string_utils.h>
#include <scintilla_tricks.h>
#include <dialog_text_properties.h>
class SCH_EDIT_FRAME;
class SCH_TEXT;
DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTextItem ) :
DIALOG_TEXT_PROPERTIES_BASE( aParent ),
m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, false ),
m_scintillaTricks( nullptr ),
m_helpWindow( nullptr )
{
m_Parent = aParent;
m_currentText = aTextItem;
m_textCtrl->SetEOLMode( wxSTC_EOL_LF );
m_scintillaTricks = new SCINTILLA_TRICKS( m_textCtrl, wxT( "{}" ), false,
[this]()
{
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
} );
m_textEntrySizer->AddGrowableRow( 0 );
SetInitialFocus( m_textCtrl );
m_separator1->SetIsSeparator();
m_bold->SetIsCheckButton();
m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
m_italic->SetIsCheckButton();
m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
m_separator2->SetIsSeparator();
m_spin0->SetIsCheckButton();
m_spin0->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
m_spin1->SetIsCheckButton();
m_spin1->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
m_spin2->SetIsCheckButton();
m_spin2->SetBitmap( KiBitmap( BITMAPS::text_align_bottom ) );
m_spin3->SetIsCheckButton();
m_spin3->SetBitmap( KiBitmap( BITMAPS::text_align_top ) );
m_separator3->SetIsSeparator();
m_sdbSizer1OK->SetDefault();
Layout();
m_textCtrl->Bind( wxEVT_STC_CHARADDED, &DIALOG_TEXT_PROPERTIES::onScintillaCharAdded, this );
m_spin0->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
m_spin1->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
m_spin2->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
m_spin3->Bind( wxEVT_BUTTON, &DIALOG_TEXT_PROPERTIES::onSpinButton, this );
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
DIALOG_TEXT_PROPERTIES::~DIALOG_TEXT_PROPERTIES()
{
delete m_scintillaTricks;
if( m_helpWindow )
m_helpWindow->Destroy();
}
bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
{
if( !wxDialog::TransferDataToWindow() )
return false;
SCHEMATIC& schematic = m_Parent->Schematic();
// show text variable cross-references in a human-readable format
m_textCtrl->SetValue( schematic.ConvertKIIDsToRefs( m_currentText->GetText() ) );
m_textSize.SetValue( m_currentText->GetTextWidth() );
m_bold->Check( m_currentText->IsBold() );
m_italic->Check( m_currentText->IsItalic() );
switch( m_currentText->GetLabelSpinStyle() )
{
case LABEL_SPIN_STYLE::RIGHT: m_spin0->Check( true ); break;
case LABEL_SPIN_STYLE::LEFT: m_spin1->Check( true ); break;
case LABEL_SPIN_STYLE::UP: m_spin2->Check( true ); break;
case LABEL_SPIN_STYLE::BOTTOM: m_spin3->Check( true ); break;
}
return true;
}
void DIALOG_TEXT_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
{
wxStyledTextCtrl* te = m_textCtrl;
wxArrayString autocompleteTokens;
int text_pos = te->GetCurrentPos();
int start = te->WordStartPosition( text_pos, true );
wxString partial;
auto textVarRef =
[&]( int pos )
{
return pos >= 2 && te->GetCharAt( pos-2 ) == '$' && te->GetCharAt( pos-1 ) == '{';
};
// Check for cross-reference
if( start > 1 && te->GetCharAt( start-1 ) == ':' )
{
int refStart = te->WordStartPosition( start-1, true );
if( textVarRef( refStart ) )
{
partial = te->GetRange( start+1, text_pos );
wxString ref = te->GetRange( refStart, start-1 );
SCH_SHEET_LIST sheets = m_Parent->Schematic().GetSheets();
SCH_REFERENCE_LIST refs;
SCH_SYMBOL* refSymbol = nullptr;
sheets.GetSymbols( refs );
for( size_t jj = 0; jj < refs.GetCount(); jj++ )
{
if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(), true ) == ref )
{
refSymbol = refs[ jj ].GetSymbol();
break;
}
}
if( refSymbol )
refSymbol->GetContextualTextVars( &autocompleteTokens );
}
}
else if( textVarRef( start ) )
{
partial = te->GetTextRange( start, text_pos );
SCHEMATIC* schematic = m_currentText->Schematic();
if( schematic && schematic->CurrentSheet().Last() )
schematic->CurrentSheet().Last()->GetContextualTextVars( &autocompleteTokens );
for( std::pair<wxString, wxString> entry : Prj().GetTextVars() )
autocompleteTokens.push_back( entry.first );
}
m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
m_textCtrl->SetFocus();
}
void DIALOG_TEXT_PROPERTIES::onSpinButton( wxCommandEvent& aEvent )
{
for( BITMAP_BUTTON* btn : { m_spin0, m_spin1, m_spin2, m_spin3 } )
{
if( btn->IsChecked() && btn != aEvent.GetEventObject() )
btn->Check( false );
}
}
bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
{
if( !wxDialog::TransferDataFromWindow() )
return false;
// Don't allow text to disappear; it can be difficult to correct if you can't select it
if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
return false;
wxString text;
/* save old text in undo list if not already in edit */
if( m_currentText->GetEditFlags() == 0 )
{
m_Parent->SaveCopyInUndoList( m_Parent->GetScreen(), m_currentText, UNDO_REDO::CHANGED,
false );
}
m_Parent->GetCanvas()->Refresh();
// convert any text variable cross-references to their UUIDs
text = m_Parent->Schematic().ConvertRefsToKIIDs( m_textCtrl->GetValue() );
if( !text.IsEmpty() )
{
#ifdef __WXMAC__
// On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
text.Replace( "\r", "\n" );
#endif
m_currentText->SetText( text );
}
else if( !m_currentText->IsNew() )
{
DisplayError( this, _( "Text can not be empty." ) );
return false;
}
if( m_currentText->GetTextWidth() != m_textSize.GetValue() )
m_currentText->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
if( m_bold->IsChecked() != m_currentText->IsBold() )
{
if( m_bold->IsChecked() )
{
m_currentText->SetBold( true );
m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
}
else
{
m_currentText->SetBold( false );
m_currentText->SetTextThickness( 0 ); // Use default pen width
}
}
m_currentText->SetItalic( m_italic->IsChecked() );
LABEL_SPIN_STYLE selectedSpinStyle= LABEL_SPIN_STYLE::LEFT;
if( m_spin0->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::RIGHT;
else if( m_spin1->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::LEFT;
else if( m_spin2->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::UP;
else if( m_spin3->IsChecked() )
selectedSpinStyle = LABEL_SPIN_STYLE::BOTTOM;
if( m_currentText->GetLabelSpinStyle() != selectedSpinStyle )
m_currentText->SetLabelSpinStyle( selectedSpinStyle );
m_Parent->UpdateItem( m_currentText, false, true );
m_Parent->GetCanvas()->Refresh();
m_Parent->OnModify();
return true;
}
void DIALOG_TEXT_PROPERTIES::OnFormattingHelp( wxHyperlinkEvent& aEvent )
{
m_helpWindow = SCH_TEXT::ShowSyntaxHelp( this );
}
void DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
{
if( m_scintillaTricks )
m_scintillaTricks->CancelAutocomplete();
event.Skip();
}

View File

@ -21,13 +21,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DIALOG_TEXT_AND_LABEL_PROPERTIES_H
#define DIALOG_TEXT_AND_LABEL_PROPERTIES_H
#ifndef DIALOG_TEXT_PROPERTIES_H
#define DIALOG_TEXT_PROPERTIES_H
#include <widgets/unit_binder.h>
#include <sch_text.h>
#include <sch_validators.h>
#include <dialog_text_and_label_properties_base.h>
#include <dialog_text_properties_base.h>
class SCH_EDIT_FRAME;
@ -36,21 +35,16 @@ class SCINTILLA_TRICKS;
class HTML_MESSAGE_BOX;
class DIALOG_TEXT_AND_LABEL_PROPERTIES : public DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE
class DIALOG_TEXT_PROPERTIES : public DIALOG_TEXT_PROPERTIES_BASE
{
public:
DIALOG_TEXT_AND_LABEL_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_TEXT* aTextItem );
~DIALOG_TEXT_AND_LABEL_PROPERTIES();
// This class is shared for numerous tasks: a couple of single line labels and
// multi-line text fields. Since the desired size of the multi-line text field editor
// is often larger, we retain separate sizes based on the dialog titles.
void SetTitle( const wxString& aTitle ) override;
DIALOG_TEXT_PROPERTIES( SCH_EDIT_FRAME* parent, SCH_TEXT* aTextItem );
~DIALOG_TEXT_PROPERTIES();
private:
void onScintillaCharAdded( wxStyledTextEvent &aEvent );
void onSpinButton( wxCommandEvent &aEvent );
void OnEnterKey( wxCommandEvent& aEvent ) override;
void OnFormattingHelp( wxHyperlinkEvent& aEvent ) override;
void onMultiLineTCLostFocus( wxFocusEvent& event ) override;
@ -58,11 +52,8 @@ private:
bool TransferDataFromWindow() override;
SCH_EDIT_FRAME* m_Parent;
SCH_TEXT* m_CurrentText;
wxWindow* m_activeTextCtrl;
wxTextEntry* m_activeTextEntry;
SCH_TEXT* m_currentText;
UNIT_BINDER m_textSize;
SCH_NETNAME_VALIDATOR m_netNameValidator;
SCINTILLA_TRICKS* m_scintillaTricks;
HTML_MESSAGE_BOX* m_helpWindow;
@ -70,4 +61,4 @@ private:
#endif // DIALOG_TEXT_AND_LABEL_PROPERTIES_H
#endif // DIALOG_TEXT_PROPERTIES_H

View File

@ -0,0 +1,171 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/bitmap_button.h"
#include "dialog_text_properties_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_TEXT_PROPERTIES_BASE::DIALOG_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_textEntrySizer = new wxFlexGridSizer( 5, 2, 1, 5 );
m_textEntrySizer->AddGrowableCol( 1 );
m_textEntrySizer->AddGrowableRow( 1 );
m_textEntrySizer->SetFlexibleDirection( wxBOTH );
m_textEntrySizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_textLabel = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textLabel->Wrap( -1 );
m_textEntrySizer->Add( m_textLabel, 0, wxTOP|wxRIGHT, 2 );
m_textCtrl = new wxStyledTextCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN, wxEmptyString );
m_textCtrl->SetUseTabs( true );
m_textCtrl->SetTabWidth( 4 );
m_textCtrl->SetIndent( 4 );
m_textCtrl->SetTabIndents( false );
m_textCtrl->SetBackSpaceUnIndents( false );
m_textCtrl->SetViewEOL( false );
m_textCtrl->SetViewWhiteSpace( false );
m_textCtrl->SetMarginWidth( 2, 0 );
m_textCtrl->SetIndentationGuides( false );
m_textCtrl->SetMarginWidth( 1, 0 );
m_textCtrl->SetMarginWidth( 0, 0 );
m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS );
m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) );
m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) );
m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS );
m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) );
m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) );
m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY );
m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUS );
m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) );
m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) );
m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUS );
m_textCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) );
m_textCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) );
m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY );
m_textCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
m_textCtrl->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
m_textCtrl->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
m_textCtrl->SetMinSize( wxSize( 500,140 ) );
m_textEntrySizer->Add( m_textCtrl, 1, wxEXPAND|wxBOTTOM, 2 );
m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeLabel->Wrap( -1 );
m_textEntrySizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 6 );
wxBoxSizer* bSizeCtrlSizer;
bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
m_textSizeCtrl = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizeCtrlSizer->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeUnits->Wrap( -1 );
bSizeCtrlSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 );
m_separator1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator1->Enable( false );
bSizeCtrlSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_bold = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_bold->SetToolTip( _("Bold") );
bSizeCtrlSizer->Add( m_bold, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
m_italic = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_italic->SetToolTip( _("Italic") );
bSizeCtrlSizer->Add( m_italic, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
m_separator2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator2->Enable( false );
bSizeCtrlSizer->Add( m_separator2, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
m_spin0 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_spin0->SetToolTip( _("Align right") );
bSizeCtrlSizer->Add( m_spin0, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
m_spin1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_spin1->SetToolTip( _("Align bottom") );
bSizeCtrlSizer->Add( m_spin1, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
m_spin2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_spin2->SetToolTip( _("Align left") );
bSizeCtrlSizer->Add( m_spin2, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
m_spin3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_spin3->SetToolTip( _("Align top") );
bSizeCtrlSizer->Add( m_spin3, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
m_separator3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
m_separator3->Enable( false );
bSizeCtrlSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
bSizeCtrlSizer->Add( 0, 0, 1, wxEXPAND, 15 );
m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_syntaxHelp->SetToolTip( _("Show syntax help window") );
bSizeCtrlSizer->Add( m_syntaxHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_textEntrySizer->Add( bSizeCtrlSizer, 1, wxEXPAND, 6 );
bMainSizer->Add( m_textEntrySizer, 1, wxEXPAND|wxALL, 12 );
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizer4->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bSizer4, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
// Connect Events
m_textCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_syntaxHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
}
DIALOG_TEXT_PROPERTIES_BASE::~DIALOG_TEXT_PROPERTIES_BASE()
{
// Disconnect Events
m_textCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
m_syntaxHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -10,6 +10,8 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class BITMAP_BUTTON;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
@ -17,62 +19,63 @@
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/stc/stc.h>
#include <wx/combobox.h>
#include <wx/textctrl.h>
#include <wx/bmpbuttn.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/hyperlink.h>
#include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/statline.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE
/// Class DIALOG_TEXT_PROPERTIES_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE : public DIALOG_SHIM
class DIALOG_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
{
private:
protected:
enum
{
wxID_VALUESINGLE = 1000,
wxID_SIZE
wxID_SIZE = 1000
};
wxFlexGridSizer* m_textEntrySizer;
wxStaticText* m_labelSingleLine;
wxTextCtrl* m_valueSingleLine;
wxStaticText* m_labelMultiLine;
wxStyledTextCtrl* m_valueMultiLine;
wxStaticText* m_labelCombo;
wxComboBox* m_valueCombo;
wxStaticText* m_textLabel;
wxStyledTextCtrl* m_textCtrl;
wxStaticText* m_textSizeLabel;
wxTextCtrl* m_textSizeCtrl;
wxStaticText* m_textSizeUnits;
wxHyperlinkCtrl* m_formattingHelp;
wxStaticText* m_note1;
wxStaticText* m_note2;
wxRadioBox* m_TextOrient;
wxRadioBox* m_TextStyle;
wxRadioBox* m_TextShape;
BITMAP_BUTTON* m_separator1;
BITMAP_BUTTON* m_bold;
BITMAP_BUTTON* m_italic;
BITMAP_BUTTON* m_separator2;
BITMAP_BUTTON* m_spin0;
BITMAP_BUTTON* m_spin1;
BITMAP_BUTTON* m_spin2;
BITMAP_BUTTON* m_spin3;
BITMAP_BUTTON* m_separator3;
wxHyperlinkCtrl* m_syntaxHelp;
wxStaticLine* m_staticline;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, override them in your derived class
virtual void OnEnterKey( wxCommandEvent& event ) { event.Skip(); }
// Virtual event handlers, overide them in your derived class
virtual void onMultiLineTCLostFocus( wxFocusEvent& event ) { event.Skip(); }
virtual void OnFormattingHelp( wxHyperlinkEvent& event ) { event.Skip(); }
public:
DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE();
DIALOG_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_TEXT_PROPERTIES_BASE();
};

View File

@ -48,6 +48,7 @@ const KICAD_T EE_COLLECTOR::EditableItems[] = {
SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
SCH_HIER_LABEL_T,
SCH_NETCLASS_FLAG_T,
SCH_FIELD_T,
SCH_SYMBOL_T,
SCH_SHEET_PIN_T,
@ -86,6 +87,7 @@ const KICAD_T EE_COLLECTOR::MovableItems[] =
SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
SCH_HIER_LABEL_T,
SCH_NETCLASS_FLAG_T,
SCH_FIELD_T,
SCH_SYMBOL_T,
SCH_SHEET_PIN_T,
@ -103,7 +105,10 @@ const KICAD_T EE_COLLECTOR::WiresOnly[] = {
const KICAD_T EE_COLLECTOR::FieldOwners[] = {
SCH_SYMBOL_T,
SCH_SHEET_T,
SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
SCH_HIER_LABEL_T,
SCH_NETCLASS_FLAG_T,
EOT
};
@ -148,49 +153,9 @@ void EE_COLLECTOR::Collect( SCH_SCREEN* aScreen, const KICAD_T aFilterList[], co
if( aScreen )
{
// Symbols and sheets own their own children so have to be visited even if
// they're not in the filter list
bool symbolsVisited = false;
bool sheetsVisited = false;
bool globalLabelsVisited = false;
EE_RTREE& items = aScreen->Items();
for( const KICAD_T *filter = aFilterList; *filter != EOT; ++filter )
{
for( SCH_ITEM *item : items.Overlapping( *filter, aPos, m_Threshold ) )
{
if( *filter == SCH_SYMBOL_T || *filter == SCH_LOCATE_ANY_T )
symbolsVisited = true;
if( *filter == SCH_SHEET_T || *filter == SCH_LOCATE_ANY_T )
sheetsVisited = true;
if( *filter == SCH_GLOBAL_LABEL_T || *filter == SCH_LOCATE_ANY_T )
globalLabelsVisited = true;
for( SCH_ITEM *item : aScreen->Items().Overlapping( SCH_LOCATE_ANY_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
}
if( !symbolsVisited )
{
for( SCH_ITEM *item : items.Overlapping( SCH_SYMBOL_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
if( !sheetsVisited )
{
for( SCH_ITEM *item : items.Overlapping( SCH_SHEET_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
if( !globalLabelsVisited )
{
for( SCH_ITEM *item : items.Overlapping( SCH_GLOBAL_LABEL_T, aPos, m_Threshold ) )
item->Visit( m_inspector, nullptr, m_scanTypes );
}
}
}
@ -245,10 +210,13 @@ void CollectOtherUnits( const wxString& aRef, int aUnit, const LIB_ID& aLibId,
{
SCH_REFERENCE symbol = symbols[i];
if( symbol.GetRef() == aRef && symbol.GetSymbol()->GetLibId() == aLibId
if( symbol.GetRef() == aRef
&& symbol.GetSymbol()->GetLibId() == aLibId
&& symbol.GetUnit() != aUnit )
{
otherUnits->push_back( symbol.GetSymbol() );
}
}
}

View File

@ -73,12 +73,15 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
m_Simulator(),
m_RescueNeverShow( false )
{
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_component_visible_columns",
&m_Appearance.edit_component_visible_columns, "0 1 2 3 4 5 6 7" ) );
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_symbol_visible_columns",
&m_Appearance.edit_symbol_visible_columns, "0 1 2 3 4 5 6 7" ) );
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_sheet_visible_columns",
&m_Appearance.edit_sheet_visible_columns, "0 1 2 3 4 5 6 7" ) );
m_params.emplace_back( new PARAM<wxString>( "appearance.edit_label_visible_columns",
&m_Appearance.edit_label_visible_columns, "0 1 2 3 4 5 6 7" ) );
m_params.emplace_back( new PARAM<int>( "appearance.erc_severities",
&m_Appearance.erc_severities, RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) );

View File

@ -35,8 +35,9 @@ class EESCHEMA_SETTINGS : public APP_SETTINGS_BASE
public:
struct APPEARANCE
{
wxString edit_component_visible_columns;
wxString edit_symbol_visible_columns;
wxString edit_sheet_visible_columns;
wxString edit_label_visible_columns;
int erc_severities;
bool footprint_preview;
bool navigator_stays_open;

View File

@ -27,17 +27,22 @@
#include <fields_grid_table.h>
#include <sch_base_frame.h>
#include <sch_field.h>
#include <sch_text.h>
#include <sch_validators.h>
#include <validators.h>
#include <sch_edit_frame.h>
#include <netclass.h>
#include <symbol_library.h>
#include <schematic.h>
#include <template_fieldnames.h>
#include <widgets/grid_text_button_helpers.h>
#include <wildcards_and_files_ext.h>
#include <project/project_file.h>
#include <project/net_settings.h>
#include "eda_doc.h"
#include <wx/settings.h>
#include <string_utils.h>
#include <widgets/grid_combobox.h>
enum
{
@ -88,6 +93,28 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
}
template <class T>
FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame,
WX_GRID* aGrid, SCH_LABEL_BASE* aLabel ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_userUnits( aDialog->GetUserUnits() ),
m_grid( aGrid ),
m_parentType( SCH_LABEL_LOCATE_ANY_T ),
m_mandatoryFieldCount( aLabel->GetMandatoryFieldCount() ),
m_part( nullptr ),
m_fieldNameValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), FIELD_NAME ),
m_referenceValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), 0 ),
m_valueValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), 0 ),
m_libIdValidator(),
m_urlValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), FIELD_VALUE ),
m_nonUrlValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), FIELD_VALUE ),
m_filepathValidator( aFrame->IsType( FRAME_SCH_SYMBOL_EDITOR ), 0 )
{
initGrid( aGrid );
}
template <class T>
void FIELDS_GRID_TABLE<T>::initGrid( WX_GRID* aGrid )
{
@ -169,6 +196,23 @@ void FIELDS_GRID_TABLE<T>::initGrid( WX_GRID* aGrid )
m_orientationAttr->SetEditor( new wxGridCellChoiceEditor( orientationNames ) );
m_orientationAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
wxArrayString existingNetclasses;
if( editFrame )
{
// Load the combobox with existing existingNetclassNames
NET_SETTINGS& netSettings = editFrame->Schematic().Prj().GetProjectFile().NetSettings();
existingNetclasses.push_back( netSettings.m_NetClasses.GetDefault()->GetName() );
for( const std::pair<const wxString, NETCLASSPTR>& pair : netSettings.m_NetClasses )
existingNetclasses.push_back( pair.second->GetName() );
}
m_netclassAttr = new wxGridCellAttr;
m_netclassAttr->SetEditor( new GRID_CELL_COMBOBOX( existingNetclasses ) );
m_frame->Bind( UNITS_CHANGED, &FIELDS_GRID_TABLE<T>::onUnitsChanged, this );
}
@ -188,6 +232,7 @@ FIELDS_GRID_TABLE<T>::~FIELDS_GRID_TABLE()
m_vAlignAttr->DecRef();
m_hAlignAttr->DecRef();
m_orientationAttr->DecRef();
m_netclassAttr->DecRef();
m_frame->Unbind( UNITS_CHANGED, &FIELDS_GRID_TABLE<T>::onUnitsChanged, this );
}
@ -321,6 +366,12 @@ wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAtt
m_filepathAttr->IncRef();
return m_filepathAttr;
}
else if( ( m_parentType == SCH_LABEL_LOCATE_ANY_T )
&& this->at( (size_t) aRow ).GetCanonicalName() == wxT( "Netclass" ) )
{
m_netclassAttr->IncRef();
return m_netclassAttr;
}
else
{
wxString fn = GetValue( aRow, FDC_NAME );
@ -342,8 +393,6 @@ wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAtt
}
}
return nullptr;
case FDC_TEXT_SIZE:
case FDC_POSX:
case FDC_POSY:
@ -383,17 +432,31 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
switch( aCol )
{
case FDC_NAME:
// Use default field name for mandatory fields, because they are translated
// Use default field names for mandatory and system fields because they are translated
// according to the current locale
if( aRow < m_mandatoryFieldCount )
{
if( m_parentType == SCH_SYMBOL_T )
{
if( aRow < m_mandatoryFieldCount )
return TEMPLATE_FIELDNAME::GetDefaultFieldName( aRow );
else if( m_parentType == SCH_SHEET_T )
return SCH_SHEET::GetDefaultFieldName( aRow );
}
else
return field.GetName( false );
}
else if( m_parentType == SCH_SHEET_T )
{
if( aRow < m_mandatoryFieldCount )
return SCH_SHEET::GetDefaultFieldName( aRow );
else
return field.GetName( false );
}
else if( m_parentType == SCH_LABEL_LOCATE_ANY_T )
{
return SCH_LABEL_BASE::GetDefaultFieldName( field.GetCanonicalName(), false );
}
else
{
wxFAIL_MSG( "Unhandled field owner type." );
return field.GetName( false );
}
case FDC_VALUE:
return UnescapeString( field.GetText() );
@ -679,8 +742,8 @@ bool FIELDS_GRID_TABLE<T>::BoolFromString( wxString aValue ) const
}
else
{
wxFAIL_MSG( wxString::Format( "string '%s' can't be converted to boolean "
"correctly, it will have been perceived as FALSE", aValue ) );
wxFAIL_MSG( wxString::Format( "string '%s' can't be converted to boolean correctly and "
"will be perceived as FALSE", aValue ) );
return false;
}
}

View File

@ -33,6 +33,7 @@
class SCH_BASE_FRAME;
class DIALOG_SHIM;
class SCH_LABEL_BASE;
class FIELDS_GRID_TRICKS : public GRID_TRICKS
@ -76,6 +77,8 @@ public:
LIB_SYMBOL* aSymbol );
FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame, WX_GRID* aGrid,
SCH_SHEET* aSheet );
FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* aFrame, WX_GRID* aGrid,
SCH_LABEL_BASE* aLabel );
~FIELDS_GRID_TABLE();
int GetNumberRows() override { return (int) this->size(); }
@ -135,6 +138,7 @@ private:
wxGridCellAttr* m_vAlignAttr;
wxGridCellAttr* m_hAlignAttr;
wxGridCellAttr* m_orientationAttr;
wxGridCellAttr* m_netclassAttr;
};

View File

@ -207,6 +207,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
placeMenu->Add( EE_ACTIONS::placeNoConnect );
placeMenu->Add( EE_ACTIONS::placeJunction );
placeMenu->Add( EE_ACTIONS::placeLabel );
placeMenu->Add( EE_ACTIONS::placeClassLabel );
placeMenu->Add( EE_ACTIONS::placeGlobalLabel );
placeMenu->AppendSeparator();

View File

@ -316,7 +316,13 @@ void SCH_BASE_FRAME::UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete, bool aUpda
GetCanvas()->GetView()->Update( aItem );
// Some children are drawn from their parents. Mark them for re-paint.
static KICAD_T parentTypes[] = { SCH_SYMBOL_T, SCH_SHEET_T, SCH_GLOBAL_LABEL_T, EOT };
static KICAD_T parentTypes[] = { SCH_SYMBOL_T,
SCH_SHEET_T,
SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
SCH_HIER_LABEL_T,
SCH_NETCLASS_FLAG_T,
EOT };
if( parent && parent->IsType( parentTypes ) )
GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT );

View File

@ -479,6 +479,7 @@ void SCH_EDIT_FRAME::setupUIConditions()
CURRENT_TOOL( EE_ACTIONS::placeNoConnect );
CURRENT_TOOL( EE_ACTIONS::placeJunction );
CURRENT_TOOL( EE_ACTIONS::placeLabel );
CURRENT_TOOL( EE_ACTIONS::placeClassLabel );
CURRENT_TOOL( EE_ACTIONS::placeGlobalLabel );
CURRENT_TOOL( EE_ACTIONS::placeHierLabel );
CURRENT_TOOL( EE_ACTIONS::drawSheet );
@ -1135,6 +1136,9 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
static void inheritNetclass( const SCH_SHEET_PATH& aSheetPath, SCH_TEXT* aItem )
{
if( CONNECTION_SUBGRAPH::GetDriverPriority( aItem ) == CONNECTION_SUBGRAPH::PRIORITY::NONE )
return;
// Netclasses are assigned to subgraphs by association with their netname. However, when
// a new label is attached to an existing subgraph (with an existing netclass association),
// the association will be lost as the label will drive its name on to the graph.
@ -1434,7 +1438,7 @@ void SCH_EDIT_FRAME::RecomputeIntersheetRefs()
for( SCH_GLOBALLABEL* globalLabel : globalLabels )
{
globalLabel->GetIntersheetRefs()->SetVisible( show );
globalLabel->GetFields()[0].SetVisible( show );
if( show )
{
@ -1450,19 +1454,7 @@ void SCH_EDIT_FRAME::ShowAllIntersheetRefs( bool aShow )
if( aShow )
RecomputeIntersheetRefs();
SCH_SCREENS screens( Schematic().Root() );
for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
{
for( SCH_ITEM* item : screen->Items().OfType( SCH_GLOBAL_LABEL_T ) )
{
SCH_GLOBALLABEL* gLabel = (SCH_GLOBALLABEL*)( item );
SCH_FIELD* intersheetRef = gLabel->GetIntersheetRefs();
intersheetRef->SetVisible( aShow );
UpdateItem( intersheetRef, true );
}
}
GetCanvas()->GetView()->SetLayerVisible( LAYER_INTERSHEET_REFS, aShow );
}

View File

@ -40,7 +40,6 @@
#include <eeschema_settings.h>
#include <math/box2.h>
#include <sch_base_frame.h>
#include <sch_text.h> // enum PINSHEETLABEL_SHAPE
#include <template_fieldnames.h>
class STATUS_TEXT_POPUP;

View File

@ -90,7 +90,7 @@ void SCH_FIELD::SetId( int aId )
default: SetLayer( LAYER_SHEETFIELDS ); break;
}
}
else
else if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
{
switch( m_id )
{
@ -99,11 +99,25 @@ void SCH_FIELD::SetId( int aId )
default: SetLayer( LAYER_FIELDS ); break;
}
}
else
{
// We can't use defined IDs for labels because there can be multiple net class
// assignments.
if( GetCanonicalName() == wxT( "Netclass" ) )
SetLayer( LAYER_NETCLASS_REFS );
else if( GetCanonicalName() == wxT( "Intersheetrefs" ) )
SetLayer( LAYER_INTERSHEET_REFS );
else
SetLayer( LAYER_FIELDS );
}
}
wxString SCH_FIELD::GetShownText( int aDepth ) const
{
KICAD_T labelTypes[] = { SCH_LABEL_LOCATE_ANY_T, EOT };
std::function<bool( wxString* )> symbolResolver =
[&]( wxString* token ) -> bool
{
@ -136,11 +150,11 @@ wxString SCH_FIELD::GetShownText( int aDepth ) const
return sheet->ResolveTextVar( token, aDepth + 1 );
};
std::function<bool( wxString* )> globalLabelResolver =
std::function<bool( wxString* )> labelResolver =
[&]( wxString* token ) -> bool
{
SCH_GLOBALLABEL* globalLabel = static_cast<SCH_GLOBALLABEL*>( m_parent );
return globalLabel->ResolveTextVar( token, aDepth + 1 );
SCH_LABEL_BASE* label = static_cast<SCH_LABEL_BASE*>( m_parent );
return label->ResolveTextVar( token, aDepth + 1 );
};
PROJECT* project = nullptr;
@ -161,8 +175,8 @@ wxString SCH_FIELD::GetShownText( int aDepth ) const
text = ExpandTextVars( text, &symbolResolver, nullptr, project );
else if( m_parent && m_parent->Type() == SCH_SHEET_T )
text = ExpandTextVars( text, &sheetResolver, nullptr, project );
else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T )
text = ExpandTextVars( text, &globalLabelResolver, nullptr, project );
else if( m_parent && m_parent->IsType( labelTypes ) )
text = ExpandTextVars( text, &labelResolver, nullptr, project );
else
text = ExpandTextVars( text, project );
}
@ -484,6 +498,7 @@ bool SCH_FIELD::IsReplaceable() const
}
else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T )
{
if( m_id == 0 /* IntersheetRefs */ )
return false;
}
@ -554,6 +569,10 @@ bool SCH_FIELD::Replace( const wxFindReplaceData& aSearchData, void* aAuxData )
// sheets, etc. See DIALOG_SHEET_PROPERTIES::TransferDataFromWindow().
}
}
else
{
isReplaced = EDA_TEXT::Replace( aSearchData );
}
return isReplaced;
}
@ -677,24 +696,42 @@ void SCH_FIELD::DoHypertextMenu( EDA_DRAW_FRAME* aFrame )
wxString SCH_FIELD::GetName( bool aUseDefaultName ) const
{
if( !m_name.IsEmpty() )
return m_name;
else if( aUseDefaultName )
{
if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
return TEMPLATE_FIELDNAME::GetDefaultFieldName( m_id );
else if( m_parent && m_parent->Type() == SCH_SHEET_T )
return SCH_SHEET::GetDefaultFieldName( m_id );
else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T )
return _( "Intersheet References" );
}
KICAD_T labelTypes[] = { SCH_LABEL_LOCATE_ANY_T, EOT };
return wxEmptyString;
if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
{
if( m_id < MANDATORY_FIELDS )
return TEMPLATE_FIELDNAME::GetDefaultFieldName( m_id );
else if( m_name.IsEmpty() && aUseDefaultName )
return TEMPLATE_FIELDNAME::GetDefaultFieldName( m_id );
else
return m_name;
}
else if( m_parent && m_parent->Type() == SCH_SHEET_T )
{
if( m_id < SHEET_MANDATORY_FIELDS )
return SCH_SHEET::GetDefaultFieldName( m_id );
else if( m_name.IsEmpty() && aUseDefaultName )
return SCH_SHEET::GetDefaultFieldName( m_id );
else
return m_name;
}
else if( m_parent && m_parent->IsType( labelTypes ) )
{
return SCH_LABEL_BASE::GetDefaultFieldName( m_name, aUseDefaultName );
}
else
{
wxFAIL_MSG( "Unhandled field owner type." );
return m_name;
}
}
wxString SCH_FIELD::GetCanonicalName() const
{
KICAD_T labelTypes[] = { SCH_LABEL_LOCATE_ANY_T, EOT };
if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
{
switch( m_id )
@ -703,6 +740,7 @@ wxString SCH_FIELD::GetCanonicalName() const
case VALUE_FIELD: return wxT( "Value" );
case FOOTPRINT_FIELD: return wxT( "Footprint" );
case DATASHEET_FIELD: return wxT( "Datasheet" );
default: return m_name;
}
}
else if( m_parent && m_parent->Type() == SCH_SHEET_T )
@ -711,14 +749,24 @@ wxString SCH_FIELD::GetCanonicalName() const
{
case SHEETNAME: return wxT( "Sheetname" );
case SHEETFILENAME: return wxT( "Sheetfile" );
default: return m_name;
}
}
else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T )
else if( m_parent && m_parent->IsType( labelTypes ) )
{
return wxT( "Intersheet References" );
}
// These should be stored in canonical format, but just in case:
if( m_name == _( "Net Class" ) )
return wxT( "Netclass" );
else if (m_name == _( "Sheet References" ) )
return wxT( "Intersheetrefs" );
else
return m_name;
}
else
{
wxFAIL_MSG( "Unhandled field owner type." );
return m_name;
}
}

View File

@ -88,7 +88,7 @@ public:
bool IsHypertext() const override
{
return m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T;
return m_id == 0 && m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T;
}
void DoHypertextMenu( EDA_DRAW_FRAME* aFrame ) override;

View File

@ -40,7 +40,8 @@
//#define SEXPR_SYMBOL_LIB_FILE_VERSION 20200908 // Add include in BOM and on board support.
//#define SEXPR_SYMBOL_LIB_FILE_VERSION 20201005 // Separate ki_fp_filters by spaces.
//#define SEXPR_SYMBOL_LIB_FILE_VERSION 20210619 // Change pin overbar syntax from `~...~` to `~{...}`.
#define SEXPR_SYMBOL_LIB_FILE_VERSION 20211014 // Arc formatting.
//#define SEXPR_SYMBOL_LIB_FILE_VERSION 20211014 // Arc formatting.
#define SEXPR_SYMBOL_LIB_FILE_VERSION 20220101 // Class flags.
/**
@ -68,4 +69,5 @@
//#define SEXPR_SCHEMATIC_FILE_VERSION 20210621 // Update overbar syntax in bus aliases.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20211123 // R/W uuids for junctions.
//#define SEXPR_SCHEMATIC_FILE_VERSION 20220101 // Circles, arcs, rects, polys & beziers
#define SEXPR_SCHEMATIC_FILE_VERSION 20220102 // Dash-dot-dot
//#define SEXPR_SCHEMATIC_FILE_VERSION 20220102 // Dash-dot-dot
#define SEXPR_SCHEMATIC_FILE_VERSION 20220103 // Label fields

View File

@ -165,11 +165,16 @@ public:
{
if( *p == SCH_ITEM_LOCATE_WIRE_T && m_layer == LAYER_WIRE )
return true;
else if ( *p == SCH_ITEM_LOCATE_BUS_T && m_layer == LAYER_BUS )
if ( *p == SCH_ITEM_LOCATE_BUS_T && m_layer == LAYER_BUS )
return true;
else if ( *p == SCH_ITEM_LOCATE_GRAPHIC_LINE_T && m_layer == LAYER_NOTES )
if ( *p == SCH_ITEM_LOCATE_GRAPHIC_LINE_T
&& Type() == SCH_LINE_T && m_layer == LAYER_NOTES )
{
return true;
}
}
return false;
}

View File

@ -668,6 +668,7 @@ bool SCH_LINE::CanConnect( const SCH_ITEM* aItem ) const
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
case SCH_NETCLASS_FLAG_T:
case SCH_BUS_WIRE_ENTRY_T:
case SCH_SYMBOL_T:
case SCH_SHEET_T:
@ -685,6 +686,7 @@ bool SCH_LINE::CanConnect( const SCH_ITEM* aItem ) const
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
case SCH_NETCLASS_FLAG_T:
case SCH_BUS_WIRE_ENTRY_T:
case SCH_SHEET_T:
case SCH_SHEET_PIN_T:

View File

@ -59,6 +59,26 @@ public:
return wxT( "SCH_LINE" );
}
bool IsType( const KICAD_T aScanTypes[] ) const override
{
if( SCH_ITEM::IsType( aScanTypes ) )
return true;
for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
{
if( *p == SCH_ITEM_LOCATE_WIRE_T && m_layer == LAYER_WIRE )
return true;
if ( *p == SCH_ITEM_LOCATE_BUS_T && m_layer == LAYER_BUS )
return true;
if ( *p == SCH_ITEM_LOCATE_GRAPHIC_LINE_T && m_layer == LAYER_NOTES )
return true;
}
return false;
}
bool IsEndPoint( const wxPoint& aPoint ) const
{
return aPoint == m_start || aPoint == m_end;

View File

@ -224,7 +224,8 @@ bool SCH_PAINTER::Draw( const VIEW_ITEM *aItem, int aLayer )
HANDLE_ITEM( SCH_LINE_T, SCH_LINE );
HANDLE_ITEM( SCH_SHAPE_T, SCH_SHAPE );
HANDLE_ITEM( SCH_TEXT_T, SCH_TEXT );
HANDLE_ITEM( SCH_LABEL_T, SCH_TEXT );
HANDLE_ITEM( SCH_LABEL_T, SCH_LABEL );
HANDLE_ITEM( SCH_NETCLASS_FLAG_T, SCH_NETCLASS_FLAG );
HANDLE_ITEM( SCH_FIELD_T, SCH_FIELD );
HANDLE_ITEM( SCH_HIER_LABEL_T, SCH_HIERLABEL );
HANDLE_ITEM( SCH_GLOBAL_LABEL_T, SCH_GLOBALLABEL );
@ -278,6 +279,10 @@ float SCH_PAINTER::getShadowWidth( bool aForHighlight ) const
COLOR4D SCH_PAINTER::getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows ) const
{
// We don't (yet?) have a separate color for intersheet refs
if( aLayer == LAYER_INTERSHEET_REFS )
aLayer = LAYER_GLOBLABEL;
COLOR4D color = m_schSettings.GetLayerColor( aLayer );
if( aItem->Type() == SCH_LINE_T )
@ -417,6 +422,19 @@ static VECTOR2D mapCoords( const wxPoint& aCoord )
}
static bool isFieldsLayer( int aLayer )
{
return aLayer == LAYER_REFERENCEPART
|| aLayer == LAYER_VALUEPART
|| aLayer == LAYER_INTERSHEET_REFS
|| aLayer == LAYER_NETCLASS_REFS
|| aLayer == LAYER_FIELDS
|| aLayer == LAYER_SHEETNAME
|| aLayer == LAYER_SHEETFILENAME
|| aLayer == LAYER_SHEETFIELDS;
}
void SCH_PAINTER::strokeText( const wxString& aText, const VECTOR2D& aPosition, double aAngle )
{
m_gal->StrokeText( aText, VECTOR2D( aPosition.x, aPosition.y ), aAngle );
@ -1419,6 +1437,7 @@ void SCH_PAINTER::draw( const SCH_TEXT *aText, int aLayer )
case SCH_SHEET_PIN_T: aLayer = LAYER_SHEETLABEL; break;
case SCH_HIER_LABEL_T: aLayer = LAYER_HIERLABEL; break;
case SCH_GLOBAL_LABEL_T: aLayer = LAYER_GLOBLABEL; break;
case SCH_NETCLASS_FLAG_T: aLayer = LAYER_NETCLASS_REFS; break;
case SCH_LABEL_T: aLayer = LAYER_LOCLABEL; break;
default: aLayer = LAYER_NOTES; break;
}
@ -1547,6 +1566,20 @@ static void orientSymbol( LIB_SYMBOL* symbol, int orientation )
void SCH_PAINTER::draw( SCH_SYMBOL* aSymbol, int aLayer )
{
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
if( !drawingShadows || eeconfig()->m_Selection.draw_selected_children )
{
for( const SCH_FIELD& field : aSymbol->GetFields() )
draw( &field, aLayer );
}
if( isFieldsLayer( aLayer ) )
return;
if( drawingShadows && !( aSymbol->IsBrightened() || aSymbol->IsSelected() ) )
return;
int unit = aSymbol->GetUnitSelection( &m_schematic->CurrentSheet() );
int convert = aSymbol->GetConvert();
@ -1589,10 +1622,6 @@ void SCH_PAINTER::draw( SCH_SYMBOL* aSymbol, int aLayer )
}
draw( &tempSymbol, aLayer, false, aSymbol->GetUnit(), aSymbol->GetConvert() );
// The fields are SCH_SYMBOL-specific so don't need to be copied/oriented/translated
for( const SCH_FIELD& field : aSymbol->GetFields() )
draw( &field, aLayer );
}
@ -1603,6 +1632,9 @@ void SCH_PAINTER::draw( const SCH_FIELD *aField, int aLayer )
if( drawingShadows && !( aField->IsBrightened() || aField->IsSelected() ) )
return;
if( !drawingShadows && aField->GetLayer() != aLayer )
return;
aLayer = aField->GetLayer();
COLOR4D color = getRenderColor( aField, aLayer, drawingShadows );
@ -1656,6 +1688,13 @@ void SCH_PAINTER::draw( const SCH_FIELD *aField, int aLayer )
* GetBoundingBox to know the text coordinate considered as centered
*/
EDA_RECT bbox = aField->GetBoundingBox();
if( aField->GetParent() && aField->GetParent()->Type() == SCH_GLOBAL_LABEL_T )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( aField->GetParent() );
bbox.Offset( label->GetSchematicTextOffset( &m_schSettings ) );
}
wxPoint textpos = bbox.Centre();
m_gal->SetIsStroke( true );
@ -1696,12 +1735,18 @@ void SCH_PAINTER::draw( const SCH_FIELD *aField, int aLayer )
}
void SCH_PAINTER::draw( SCH_GLOBALLABEL *aLabel, int aLayer )
void SCH_PAINTER::draw( const SCH_GLOBALLABEL *aLabel, int aLayer )
{
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
if( !drawingShadows || eeconfig()->m_Selection.draw_selected_children )
draw( aLabel->GetIntersheetRefs(), aLayer );
{
for( const SCH_FIELD& field : aLabel->GetFields() )
draw( &field, aLayer );
}
if( isFieldsLayer( aLayer ) )
return;
if( drawingShadows && !( aLabel->IsBrightened() || aLabel->IsSelected() ) )
return;
@ -1729,14 +1774,43 @@ void SCH_PAINTER::draw( SCH_GLOBALLABEL *aLabel, int aLayer )
m_gal->SetStrokeColor( color );
m_gal->DrawPolyline( pts2 );
draw( static_cast<SCH_TEXT*>( aLabel ), aLayer );
draw( static_cast<const SCH_TEXT*>( aLabel ), aLayer );
}
void SCH_PAINTER::draw( SCH_HIERLABEL *aLabel, int aLayer )
void SCH_PAINTER::draw( const SCH_LABEL *aLabel, int aLayer )
{
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
if( !drawingShadows || eeconfig()->m_Selection.draw_selected_children )
{
for( const SCH_FIELD& field : aLabel->GetFields() )
draw( &field, aLayer );
}
if( isFieldsLayer( aLayer ) )
return;
if( drawingShadows && !( aLabel->IsBrightened() || aLabel->IsSelected() ) )
return;
draw( static_cast<const SCH_TEXT*>( aLabel ), aLayer );
}
void SCH_PAINTER::draw( const SCH_HIERLABEL *aLabel, int aLayer )
{
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
if( !drawingShadows || eeconfig()->m_Selection.draw_selected_children )
{
for( const SCH_FIELD& field : aLabel->GetFields() )
draw( &field, aLayer );
}
if( isFieldsLayer( aLayer ) )
return;
if( drawingShadows && !( aLabel->IsBrightened() || aLabel->IsSelected() ) )
return;
@ -1772,10 +1846,77 @@ void SCH_PAINTER::draw( SCH_HIERLABEL *aLabel, int aLayer )
}
void SCH_PAINTER::draw( const SCH_NETCLASS_FLAG *aLabel, int aLayer )
{
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
if( !drawingShadows || eeconfig()->m_Selection.draw_selected_children )
{
for( const SCH_FIELD& field : aLabel->GetFields() )
draw( &field, aLayer );
}
if( isFieldsLayer( aLayer ) )
return;
if( drawingShadows && !( aLabel->IsBrightened() || aLabel->IsSelected() ) )
return;
COLOR4D color = getRenderColor( aLabel, LAYER_NETCLASS_REFS, drawingShadows );
if( aLayer == LAYER_DANGLING )
{
if( aLabel->IsDangling() )
{
drawDanglingSymbol( aLabel->GetTextPos(), color, Mils2iu( DANGLING_SYMBOL_SIZE / 2 ),
drawingShadows, aLabel->IsBrightened() );
}
return;
}
std::vector<wxPoint> pts;
std::deque<VECTOR2D> pts2;
aLabel->CreateGraphicShape( &m_schSettings, pts, aLabel->GetTextPos() );
for( const wxPoint& p : pts )
pts2.emplace_back( VECTOR2D( p.x, p.y ) );
m_gal->SetIsFill( false );
m_gal->SetFillColor( color );
m_gal->SetIsStroke( true );
m_gal->SetLineWidth( getTextThickness( aLabel, drawingShadows ) );
m_gal->SetStrokeColor( color );
if( aLabel->GetShape() == LABEL_FLAG_SHAPE::F_DOT )
{
m_gal->DrawLine( pts2[0], pts2[1] );
m_gal->SetIsFill( true );
m_gal->DrawCircle( pts2[2], ( pts2[2] - pts2[1] ).EuclideanNorm() );
}
else if( aLabel->GetShape() == LABEL_FLAG_SHAPE::F_ROUND )
{
m_gal->DrawLine( pts2[0], pts2[1] );
m_gal->DrawCircle( pts2[2], ( pts2[2] - pts2[1] ).EuclideanNorm() );
}
else
{
m_gal->DrawPolyline( pts2 );
}
}
void SCH_PAINTER::draw( const SCH_SHEET *aSheet, int aLayer )
{
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
if( !drawingShadows || eeconfig()->m_Selection.draw_selected_children )
{
for( const SCH_FIELD& field : aSheet->GetFields() )
draw( &field, aLayer );
}
if( aLayer == LAYER_HIERLABEL || aLayer == LAYER_SELECTION_SHADOWS )
{
for( SCH_SHEET_PIN* sheetPin : aSheet->GetPins() )
@ -1838,12 +1979,6 @@ void SCH_PAINTER::draw( const SCH_SHEET *aSheet, int aLayer )
m_gal->SetIsFill( false );
m_gal->DrawRectangle( pos, pos + size );
if( drawingShadows && !eeconfig()->m_Selection.draw_selected_children )
return;
for( const SCH_FIELD& field : aSheet->GetFields() )
draw( &field, aLayer );
}
}

View File

@ -44,6 +44,7 @@ class SCH_JUNCTION;
class SCH_LABEL;
class SCH_TEXT;
class SCH_HIERLABEL;
class SCH_NETCLASS_FLAG;
class SCH_GLOBALLABEL;
class SCH_SHEET;
class SCH_SHEET_PIN;
@ -159,8 +160,10 @@ private:
void draw( const SCH_FIELD* aField, int aLayer );
void draw( const SCH_SHAPE* shape, int aLayer );
void draw( const SCH_TEXT* aText, int aLayer );
void draw( SCH_HIERLABEL* aLabel, int aLayer );
void draw( SCH_GLOBALLABEL* aLabel, int aLayer );
void draw( const SCH_LABEL* aText, int aLayer );
void draw( const SCH_NETCLASS_FLAG* aLabel, int aLayer );
void draw( const SCH_HIERLABEL* aLabel, int aLayer );
void draw( const SCH_GLOBALLABEL* aLabel, int aLayer );
void draw( const SCH_SHEET* aSheet, int aLayer );
void draw( const SCH_NO_CONNECT* aNC, int aLayer );
void draw( const SCH_MARKER* aMarker, int aLayer );

View File

@ -1548,7 +1548,7 @@ void SCH_ALTIUM_PLUGIN::ParseSheetEntry( const std::map<wxString, wxString>& aPr
sheetIt->second->AddPin( sheetPin );
sheetPin->SetText( elem.name );
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED );
sheetPin->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED );
//sheetPin->SetLabelSpinStyle( getSpinStyle( term.OrientAngle, false ) );
//sheetPin->SetPosition( getKiCadPoint( term.Position ) );
@ -1584,16 +1584,16 @@ void SCH_ALTIUM_PLUGIN::ParseSheetEntry( const std::map<wxString, wxString>& aPr
{
default:
case ASCH_PORT_IOTYPE::UNSPECIFIED:
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED );
sheetPin->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED );
break;
case ASCH_PORT_IOTYPE::OUTPUT:
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_OUTPUT );
sheetPin->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT );
break;
case ASCH_PORT_IOTYPE::INPUT:
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_INPUT );
sheetPin->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
break;
case ASCH_PORT_IOTYPE::BIDI:
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_BIDI );
sheetPin->SetShape( LABEL_FLAG_SHAPE::L_BIDI );
break;
}
}
@ -1972,16 +1972,16 @@ void SCH_ALTIUM_PLUGIN::ParsePort( const ASCH_PORT& aElem )
{
default:
case ASCH_PORT_IOTYPE::UNSPECIFIED:
label->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED );
label->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED );
break;
case ASCH_PORT_IOTYPE::OUTPUT:
label->SetShape( PINSHEETLABEL_SHAPE::PS_OUTPUT );
label->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT );
break;
case ASCH_PORT_IOTYPE::INPUT:
label->SetShape( PINSHEETLABEL_SHAPE::PS_INPUT );
label->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
break;
case ASCH_PORT_IOTYPE::BIDI:
label->SetShape( PINSHEETLABEL_SHAPE::PS_BIDI );
label->SetShape( LABEL_FLAG_SHAPE::L_BIDI );
break;
}

View File

@ -345,7 +345,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins()
sheetPin = new SCH_SHEET_PIN( sheet );
sheetPin->SetText( name );
sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED );
sheetPin->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED );
sheetPin->SetLabelSpinStyle( getSpinStyle( term.OrientAngle, false ) );
sheetPin->SetPosition( getKiCadPoint( term.Position ) );
@ -665,13 +665,13 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances()
netLabel->SetLabelSpinStyle( getSpinStyle( sym.OrientAngle, sym.Mirror ) );
if( libSymDef.Alternate.Lower().Contains( "in" ) )
netLabel->SetShape( PINSHEETLABEL_SHAPE::PS_INPUT );
netLabel->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
else if( libSymDef.Alternate.Lower().Contains( "bi" ) )
netLabel->SetShape( PINSHEETLABEL_SHAPE::PS_BIDI );
netLabel->SetShape( LABEL_FLAG_SHAPE::L_BIDI );
else if( libSymDef.Alternate.Lower().Contains( "out" ) )
netLabel->SetShape( PINSHEETLABEL_SHAPE::PS_OUTPUT );
netLabel->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT );
else
netLabel->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED );
netLabel->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED );
SCH_SCREEN* screen = m_sheetMap.at( sym.LayerID )->GetScreen();

View File

@ -2318,17 +2318,17 @@ bool SCH_EAGLE_PLUGIN::CheckHeader( const wxString& aFileName )
void SCH_EAGLE_PLUGIN::moveLabels( SCH_LINE* aWire, const wxPoint& aNewEndPoint )
{
for( SCH_ITEM* item : m_currentSheet->GetScreen()->Items().Overlapping( aWire->GetBoundingBox() ) )
{
if( item->Type() == SCH_LABEL_T || item->Type() == SCH_GLOBAL_LABEL_T )
{
if( TestSegmentHit( item->GetPosition(), aWire->GetStartPoint(), aWire->GetEndPoint(),
0 ) )
static KICAD_T labelTypes[] = { SCH_LABEL_LOCATE_ANY_T, EOT };
SCH_SCREEN* screen = m_currentSheet->GetScreen();
for( SCH_ITEM* item : screen->Items().Overlapping( aWire->GetBoundingBox() ) )
{
if( !item->IsType( labelTypes ) )
continue;
if( TestSegmentHit( item->GetPosition(), aWire->GetStartPoint(), aWire->GetEndPoint(), 0 ) )
item->SetPosition( aNewEndPoint );
}
}
}
}

View File

@ -1752,11 +1752,11 @@ SCH_SHEET_PIN* SCH_SEXPR_PARSER::parseSchSheetPin( SCH_SHEET* aSheet )
switch( token )
{
case T_input: sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_INPUT ); break;
case T_output: sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_OUTPUT ); break;
case T_bidirectional: sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_BIDI ); break;
case T_tri_state: sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_TRISTATE ); break;
case T_passive: sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED ); break;
case T_input: sheetPin->SetShape( LABEL_FLAG_SHAPE::L_INPUT ); break;
case T_output: sheetPin->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT ); break;
case T_bidirectional: sheetPin->SetShape( LABEL_FLAG_SHAPE::L_BIDI ); break;
case T_tri_state: sheetPin->SetShape( LABEL_FLAG_SHAPE::L_TRISTATE ); break;
case T_passive: sheetPin->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED ); break;
default:
Expecting( "input, output, bidirectional, tri_state, or passive" );
}
@ -2135,6 +2135,7 @@ void SCH_SEXPR_PARSER::ParseSchematic( SCH_SHEET* aSheet, bool aIsCopyableOnly,
case T_label:
case T_global_label:
case T_hierarchical_label:
case T_netclass_flag:
screen->Append( static_cast<SCH_ITEM*>( parseSchText() ) );
break;
@ -2155,8 +2156,8 @@ void SCH_SEXPR_PARSER::ParseSchematic( SCH_SHEET* aSheet, bool aIsCopyableOnly,
default:
Expecting( "symbol, paper, page, title_block, bitmap, sheet, junction, no_connect, "
"bus_entry, line, bus, text, label, global_label, hierarchical_label, "
"symbol_instances, or bus_alias" );
"bus_entry, line, bus, text, label, class_label, global_label, "
"hierarchical_label, symbol_instances, or bus_alias" );
}
}
@ -3123,10 +3124,15 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
case T_label: text = std::make_unique<SCH_LABEL>(); break;
case T_global_label: text = std::make_unique<SCH_GLOBALLABEL>(); break;
case T_hierarchical_label: text = std::make_unique<SCH_HIERLABEL>(); break;
case T_netclass_flag: text = std::make_unique<SCH_NETCLASS_FLAG>(); break;
default:
wxCHECK_MSG( false, nullptr, "Cannot parse " + GetTokenString( CurTok() ) + " as text." );
}
// Clear any auto-created fields; we want what's in the file and only what's in the file
if( text->Type() != SCH_TEXT_T )
static_cast<SCH_LABEL_BASE*>( text.get() )->GetFields().clear();
// We'll reset this if we find a fields_autoplaced token
text->ClearFieldsAutoplaced();
@ -3169,18 +3175,35 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
switch( token )
{
case T_input: text->SetShape( PINSHEETLABEL_SHAPE::PS_INPUT ); break;
case T_output: text->SetShape( PINSHEETLABEL_SHAPE::PS_OUTPUT ); break;
case T_bidirectional: text->SetShape( PINSHEETLABEL_SHAPE::PS_BIDI ); break;
case T_tri_state: text->SetShape( PINSHEETLABEL_SHAPE::PS_TRISTATE ); break;
case T_passive: text->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED ); break;
case T_input: text->SetShape( LABEL_FLAG_SHAPE::L_INPUT ); break;
case T_output: text->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT ); break;
case T_bidirectional: text->SetShape( LABEL_FLAG_SHAPE::L_BIDI ); break;
case T_tri_state: text->SetShape( LABEL_FLAG_SHAPE::L_TRISTATE ); break;
case T_passive: text->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED ); break;
case T_dot: text->SetShape( LABEL_FLAG_SHAPE::F_DOT ); break;
case T_round: text->SetShape( LABEL_FLAG_SHAPE::F_ROUND ); break;
case T_diamond: text->SetShape( LABEL_FLAG_SHAPE::F_DIAMOND ); break;
case T_rectangle: text->SetShape( LABEL_FLAG_SHAPE::F_RECTANGLE ); break;
default:
Expecting( "input, output, bidirectional, tri_state, or passive" );
Expecting( "input, output, bidirectional, tri_state, passive, dot, round, diamond"
"or rectangle" );
}
NeedRIGHT();
break;
case T_length:
{
if( text->Type() != SCH_NETCLASS_FLAG_T )
Unexpected( T_length );
SCH_NETCLASS_FLAG* label = static_cast<SCH_NETCLASS_FLAG*>( text.get() );
label->SetPinLength( parseInternalUnits( "pin length" ) );
NeedRIGHT();
}
break;
case T_fields_autoplaced:
text->SetFieldsAutoplaced();
NeedRIGHT();
@ -3214,7 +3237,7 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
if( text->Type() == SCH_GLOBAL_LABEL_T )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( text.get() );
SCH_FIELD* field = label->GetIntersheetRefs();
SCH_FIELD* field = &label->GetFields()[0];
field->SetTextPos( parseXY() );
NeedRIGHT();
@ -3230,23 +3253,28 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
break;
case T_property:
if( text->Type() == SCH_GLOBAL_LABEL_T )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( text.get() );
SCH_FIELD* field = parseSchField( label );
if( text->Type() == SCH_TEXT_T )
Unexpected( T_property );
field->SetLayer( LAYER_GLOBLABEL );
label->SetIntersheetRefs( *field );
SCH_FIELD* field = parseSchField( text.get() );
static_cast<SCH_LABEL_BASE*>( text.get() )->GetFields().emplace_back( *field );
delete field;
}
break;
}
default:
Expecting( "at, shape, iref, uuid or effects" );
}
}
SCH_LABEL_BASE* label = dynamic_cast<SCH_LABEL_BASE*>( text.get() );
if( label && label->GetFields().empty() )
label->SetFieldsAutoplaced();
return text.release();
}

View File

@ -203,15 +203,19 @@ static float getPinAngle( int aOrientation )
}
static const char* getSheetPinShapeToken( PINSHEETLABEL_SHAPE aShape )
static const char* getSheetPinShapeToken( LABEL_FLAG_SHAPE aShape )
{
switch( aShape )
{
case PINSHEETLABEL_SHAPE::PS_INPUT: return SCHEMATIC_LEXER::TokenName( T_input );
case PINSHEETLABEL_SHAPE::PS_OUTPUT: return SCHEMATIC_LEXER::TokenName( T_output );
case PINSHEETLABEL_SHAPE::PS_BIDI: return SCHEMATIC_LEXER::TokenName( T_bidirectional );
case PINSHEETLABEL_SHAPE::PS_TRISTATE: return SCHEMATIC_LEXER::TokenName( T_tri_state );
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED: return SCHEMATIC_LEXER::TokenName( T_passive );
case LABEL_FLAG_SHAPE::L_INPUT: return SCHEMATIC_LEXER::TokenName( T_input );
case LABEL_FLAG_SHAPE::L_OUTPUT: return SCHEMATIC_LEXER::TokenName( T_output );
case LABEL_FLAG_SHAPE::L_BIDI: return SCHEMATIC_LEXER::TokenName( T_bidirectional );
case LABEL_FLAG_SHAPE::L_TRISTATE: return SCHEMATIC_LEXER::TokenName( T_tri_state );
case LABEL_FLAG_SHAPE::L_UNSPECIFIED: return SCHEMATIC_LEXER::TokenName( T_passive );
case LABEL_FLAG_SHAPE::F_DOT: return SCHEMATIC_LEXER::TokenName( T_dot );
case LABEL_FLAG_SHAPE::F_ROUND: return SCHEMATIC_LEXER::TokenName( T_round );
case LABEL_FLAG_SHAPE::F_DIAMOND: return SCHEMATIC_LEXER::TokenName( T_diamond );
case LABEL_FLAG_SHAPE::F_RECTANGLE: return SCHEMATIC_LEXER::TokenName( T_rectangle );
default: wxFAIL; return SCHEMATIC_LEXER::TokenName( T_passive );
}
}
@ -243,6 +247,7 @@ static const char* getTextTypeToken( KICAD_T aType )
case SCH_LABEL_T: return SCHEMATIC_LEXER::TokenName( T_label );
case SCH_GLOBAL_LABEL_T: return SCHEMATIC_LEXER::TokenName( T_global_label );
case SCH_HIER_LABEL_T: return SCHEMATIC_LEXER::TokenName( T_hierarchical_label );
case SCH_NETCLASS_FLAG_T: return SCHEMATIC_LEXER::TokenName( T_netclass_flag );
default: wxFAIL; return SCHEMATIC_LEXER::TokenName( T_text );
}
}
@ -822,6 +827,7 @@ void SCH_SEXPR_PLUGIN::Format( SCH_SHEET* aSheet )
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
case SCH_NETCLASS_FLAG_T:
saveText( static_cast<SCH_TEXT*>( item ), 1 );
break;
@ -967,6 +973,7 @@ void SCH_SEXPR_PLUGIN::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelect
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
case SCH_NETCLASS_FLAG_T:
saveText( static_cast< SCH_TEXT* >( item ), 0 );
break;
@ -1120,20 +1127,10 @@ void SCH_SEXPR_PLUGIN::saveField( SCH_FIELD* aField, int aNestLevel )
{
wxCHECK_RET( aField != nullptr && m_out != nullptr, "" );
wxString fieldName = aField->GetName();
wxString fieldName = aField->GetCanonicalName();
// For some reason (bug in legacy parser?) the field ID for non-mandatory fields is -1 so
// check for this in order to correctly use the field name.
if( aField->GetParent()->Type() == SCH_SYMBOL_T )
{
if( aField->GetId() >= 0 && aField->GetId() < MANDATORY_FIELDS )
fieldName = TEMPLATE_FIELDNAME::GetDefaultFieldName( aField->GetId(), false );
}
else if( aField->GetParent()->Type() == SCH_SHEET_T )
{
if( aField->GetId() >= 0 && aField->GetId() < SHEET_MANDATORY_FIELDS )
fieldName = SCH_SHEET::GetDefaultFieldName( aField->GetId(), false );
}
if( aField->GetId() == -1 /* undefined ID */ )
{
@ -1430,8 +1427,20 @@ void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
getTextTypeToken( aText->Type() ),
m_out->Quotew( aText->GetText() ).c_str() );
if( ( aText->Type() == SCH_GLOBAL_LABEL_T ) || ( aText->Type() == SCH_HIER_LABEL_T ) )
if( aText->Type() == SCH_NETCLASS_FLAG_T )
{
SCH_NETCLASS_FLAG* label = static_cast<SCH_NETCLASS_FLAG*>( aText );
m_out->Print( 0, " (length %s)",
FormatInternalUnits( label->GetPinLength() ).c_str() );
}
if( aText->Type() == SCH_GLOBAL_LABEL_T
|| aText->Type() == SCH_HIER_LABEL_T
|| aText->Type() == SCH_NETCLASS_FLAG_T )
{
m_out->Print( 0, " (shape %s)", getSheetPinShapeToken( aText->GetShape() ) );
}
if( aText->GetText().Length() < 50 )
{
@ -1457,10 +1466,12 @@ void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
m_out->Print( aNestLevel + 1, "(uuid %s)\n", TO_UTF8( aText->m_Uuid.AsString() ) );
if( ( aText->Type() == SCH_GLOBAL_LABEL_T ) )
SCH_LABEL_BASE* label = dynamic_cast<SCH_LABEL_BASE*>( aText );
if( label )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( aText );
saveField( label->GetIntersheetRefs(), aNestLevel + 1 );
for( SCH_FIELD& field : label->GetFields() )
saveField( &field, aNestLevel + 1 );
}
m_out->Print( aNestLevel, ")\n" ); // Closes text token.

View File

@ -1082,11 +1082,11 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader )
switch( parseChar( aReader, line, &line ) )
{
case 'I': sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_INPUT ); break;
case 'O': sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_OUTPUT ); break;
case 'B': sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_BIDI ); break;
case 'T': sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_TRISTATE ); break;
case 'U': sheetPin->SetShape( PINSHEETLABEL_SHAPE::PS_UNSPECIFIED ); break;
case 'I': sheetPin->SetShape( LABEL_FLAG_SHAPE::L_INPUT ); break;
case 'O': sheetPin->SetShape( LABEL_FLAG_SHAPE::L_OUTPUT ); break;
case 'B': sheetPin->SetShape( LABEL_FLAG_SHAPE::L_BIDI ); break;
case 'T': sheetPin->SetShape( LABEL_FLAG_SHAPE::L_TRISTATE ); break;
case 'U': sheetPin->SetShape( LABEL_FLAG_SHAPE::L_UNSPECIFIED ); break;
default: SCH_PARSE_ERROR( "invalid sheet pin type", aReader, line );
}
@ -1404,13 +1404,13 @@ SCH_BUS_ENTRY_BASE* SCH_LEGACY_PLUGIN::loadBusEntry( LINE_READER& aReader )
}
// clang-format off
const std::map<PINSHEETLABEL_SHAPE, const char*> sheetLabelNames
const std::map<LABEL_FLAG_SHAPE, const char*> sheetLabelNames
{
{ PINSHEETLABEL_SHAPE::PS_INPUT, "Input" },
{ PINSHEETLABEL_SHAPE::PS_OUTPUT, "Output" },
{ PINSHEETLABEL_SHAPE::PS_BIDI, "BiDi" },
{ PINSHEETLABEL_SHAPE::PS_TRISTATE, "3State" },
{ PINSHEETLABEL_SHAPE::PS_UNSPECIFIED, "UnSpc" },
{ LABEL_FLAG_SHAPE::L_INPUT, "Input" },
{ LABEL_FLAG_SHAPE::L_OUTPUT, "Output" },
{ LABEL_FLAG_SHAPE::L_BIDI, "BiDi" },
{ LABEL_FLAG_SHAPE::L_TRISTATE, "3State" },
{ LABEL_FLAG_SHAPE::L_UNSPECIFIED, "UnSpc" },
};
// clang-format on
@ -2272,11 +2272,11 @@ void SCH_LEGACY_PLUGIN::saveSheet( SCH_SHEET* aSheet )
switch( pin->GetShape() )
{
default:
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED: type = 'U'; break;
case PINSHEETLABEL_SHAPE::PS_INPUT: type = 'I'; break;
case PINSHEETLABEL_SHAPE::PS_OUTPUT: type = 'O'; break;
case PINSHEETLABEL_SHAPE::PS_BIDI: type = 'B'; break;
case PINSHEETLABEL_SHAPE::PS_TRISTATE: type = 'T'; break;
case LABEL_FLAG_SHAPE::L_UNSPECIFIED: type = 'U'; break;
case LABEL_FLAG_SHAPE::L_INPUT: type = 'I'; break;
case LABEL_FLAG_SHAPE::L_OUTPUT: type = 'O'; break;
case LABEL_FLAG_SHAPE::L_BIDI: type = 'B'; break;
case LABEL_FLAG_SHAPE::L_TRISTATE: type = 'T'; break;
}
m_out->Print( 0, "F%d %s %c %c %-3d %-3d %-3d\n",

View File

@ -1011,7 +1011,13 @@ void SCH_SCREEN::EnsureAlternateReferencesExist()
void SCH_SCREEN::GetHierarchicalItems( std::vector<SCH_ITEM*>* aItems ) const
{
static KICAD_T hierarchicalTypes[] = { SCH_SYMBOL_T, SCH_SHEET_T, SCH_GLOBAL_LABEL_T, EOT };
static KICAD_T hierarchicalTypes[] = { SCH_SYMBOL_T,
SCH_SHEET_T,
SCH_LABEL_T,
SCH_HIER_LABEL_T,
SCH_NETCLASS_FLAG_T,
SCH_GLOBAL_LABEL_T,
EOT };
for( SCH_ITEM* item : Items() )
{
@ -1113,6 +1119,7 @@ SCH_TEXT* SCH_SCREEN::GetLabel( const wxPoint& aPosition, int aAccuracy ) const
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T:
case SCH_NETCLASS_FLAG_T:
if( item->HitTest( aPosition, aAccuracy ) )
return static_cast<SCH_TEXT*>( item );

View File

@ -594,11 +594,14 @@ void SCH_SHEET::AutoplaceFields( SCH_SCREEN* aScreen, bool aManual )
void SCH_SHEET::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 4;
aCount = 7;
aLayers[0] = LAYER_HIERLABEL;
aLayers[1] = LAYER_SHEET;
aLayers[2] = LAYER_SHEET_BACKGROUND;
aLayers[3] = LAYER_SELECTION_SHADOWS;
aLayers[1] = LAYER_SHEETNAME;
aLayers[2] = LAYER_SHEETFILENAME;
aLayers[3] = LAYER_SHEETFIELDS;
aLayers[4] = LAYER_SHEET;
aLayers[5] = LAYER_SHEET_BACKGROUND;
aLayers[6] = LAYER_SELECTION_SHADOWS;
}

View File

@ -53,7 +53,7 @@ SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxStr
else
SetSide( SHEET_SIDE::LEFT );
m_shape = PINSHEETLABEL_SHAPE::PS_INPUT;
m_shape = LABEL_FLAG_SHAPE::L_INPUT;
m_isDangling = true;
m_number = 2;
}
@ -308,12 +308,12 @@ void SCH_SHEET_PIN::CreateGraphicShape( const RENDER_SETTINGS* aSettings,
* for INPUT type the icon is the OUTPUT shape of SCH_HIERLABEL
* for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL
*/
PINSHEETLABEL_SHAPE shape = m_shape;
LABEL_FLAG_SHAPE shape = m_shape;
switch( shape )
{
case PINSHEETLABEL_SHAPE::PS_INPUT: shape = PINSHEETLABEL_SHAPE::PS_OUTPUT; break;
case PINSHEETLABEL_SHAPE::PS_OUTPUT: shape = PINSHEETLABEL_SHAPE::PS_INPUT; break;
case LABEL_FLAG_SHAPE::L_INPUT: shape = LABEL_FLAG_SHAPE::L_OUTPUT; break;
case LABEL_FLAG_SHAPE::L_OUTPUT: shape = LABEL_FLAG_SHAPE::L_INPUT; break;
default: break;
}

View File

@ -228,12 +228,15 @@ EDA_ITEM* SCH_SYMBOL::Clone() const
void SCH_SYMBOL::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 4;
aCount = 7;
aLayers[0] = LAYER_DANGLING; // Pins are drawn by their parent symbol, so the parent
// symbol needs to draw to LAYER_DANGLING
aLayers[1] = LAYER_DEVICE;
aLayers[2] = LAYER_DEVICE_BACKGROUND;
aLayers[3] = LAYER_SELECTION_SHADOWS;
aLayers[2] = LAYER_REFERENCEPART;
aLayers[3] = LAYER_VALUEPART;
aLayers[4] = LAYER_FIELDS;
aLayers[5] = LAYER_DEVICE_BACKGROUND;
aLayers[6] = LAYER_SELECTION_SHADOWS;
}

View File

@ -605,6 +605,7 @@ public:
( aItem->Type() == SCH_NO_CONNECT_T ) ||
( aItem->Type() == SCH_JUNCTION_T ) ||
( aItem->Type() == SCH_SYMBOL_T ) ||
( aItem->Type() == SCH_NETCLASS_FLAG_T ) ||
( aItem->Type() == SCH_LABEL_T ) ||
( aItem->Type() == SCH_HIER_LABEL_T ) ||
( aItem->Type() == SCH_GLOBAL_LABEL_T );

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