SVGHMI: add files missing in ee9e98c856a : Add TextList widget, add support for TextList in DropDown widget, move List, TextStyleList and TextList widget code in dedicated file with documentation.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/lists.ysl2 Fri Oct 01 02:52:25 2021 +0200
@@ -0,0 +1,33 @@
+// compute list widget related constants +// for details, refer to : +// widget_textstulelist.ysl2 +const "hmi_lists_descs", "$parsed_widgets/widget[@type = 'List']"; +const "hmi_lists", "$hmi_elements[@id = $hmi_lists_descs/@id]"; +const "hmi_textlists_descs", "$parsed_widgets/widget[@type = 'TextList']"; +const "hmi_textlists", "$hmi_elements[@id = $hmi_textlists_descs/@id]"; +// TextStyleList widgets +const "hmi_textstylelists_descs", "$parsed_widgets/widget[@type = 'TextStyleList']"; +const "hmi_textstylelists", "$hmi_elements[@id = $hmi_textstylelists_descs/@id]"; +const "textstylelist_related" foreach "$hmi_textstylelists" list { + attrib "listid" value "@id"; + foreach "func:refered_elements(.)" elt { + attrib "eltid" value "@id"; +const "textstylelist_related_ns", "exsl:node-set($textstylelist_related)"; --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_textlist.ysl2 Fri Oct 01 02:52:25 2021 +0200
@@ -0,0 +1,28 @@
+widget_desc("TextList") { + TextList widget is a svg:group, list items are labeled elements + To use a TextList, clone (svg:use) one of the items inside the widget + that expects a TextList. + In this list, (translated) text content is what matters. Nevertheless + text style of the cloned item will be applied in client widget. + shortdesc > A named list of ordered texts +widget_defs("TextList") { + foreach "func:refered_elements($hmi_element/*[@inkscape:label])[self::svg:text]" { + // could find a proper way in xpath to reverse() --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_textstylelist.ysl2 Fri Oct 01 02:52:25 2021 +0200
@@ -0,0 +1,28 @@
+// widget_textstylelist.ysl2 +widget_desc("TextStyleList") { + TextStyleList widget is a svg:group, list items are labeled elements + To use a TextStyleList, clone (svg:use) one of the items inside the widget + that expects a TextStyleList. + In this list, only style matters. Text content is ignored. + shortdesc > A named list of named texts +widget_defs("TextStyleList") { + foreach "$hmi_element/*[@inkscape:label]" { + const "style", "func:refered_elements(.)[self::svg:text]/@style"; + | «@inkscape:label»: "«$style»", --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widgetlib/dropdown.svg Fri Oct 01 02:52:25 2021 +0200
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + 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" + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)" + sodipodi:docname="dropdown.svg"> + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:cx="48.571429" + inkscape:cy="537.14286" + inkscape:document-units="mm" + inkscape:current-layer="svg1109" + inkscape:window-width="3840" + inkscape:window-height="2096" + inkscape:window-x="1600" + inkscape:window-maximized="1" /> + <dc:format>image/svg+xml</dc:format> + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + inkscape:label="HMI:DropDown:1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27@/SELECTION" + transform="matrix(0.21561215,0,0,0.21561215,-108.35425,-53.167319)" + style="stroke-width:0.35083869"> + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#53676c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75419343;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + inkscape:label="box" /> + inkscape:label="highlight" + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75419331;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#d42aff;fill-opacity:1;stroke:none;stroke-width:0.35083869px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="text"><tspan + style="text-align:start;text-anchor:start;fill:#d42aff;stroke-width:0.35083869px" + id="tspan421">sel_0</tspan></text> + style="opacity:1;vector-effect:none;fill:#a7a5a6;fill-opacity:1;stroke:none;stroke-width:0.12376806;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + sodipodi:r1="43.683521" + sodipodi:r2="21.841761" + sodipodi:arg1="1.5707963" + sodipodi:arg2="2.6179939" + inkscape:flatsided="false" + inkscape:randomized="0" + d="m 1200.5,1018.6835 -18.9155,-32.76262 -18.9155,-32.76264 37.831,0 37.831,0 -18.9155,32.76264 z" + inkscape:transform-center-y="10.92088" + inkscape:label="button" />