# HG changeset patch # User Edouard Tisserant <edouard.tisserant@gmail.com> # Date 1586878305 -7200 # Node ID f51c0e2e0bcb4e9cbc57b26f53e0d0476f105522 # Parent 41edcb8e0a0144961eb80ea24f95e62619309e9f SVGHMI: HMI:DropDown now temporarily takes content from widget's arguments, until HMI:List is implemented. diff -r 41edcb8e0a01 -r f51c0e2e0bcb svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Tue Apr 14 17:17:35 2020 +0200 +++ b/svghmi/gen_index_xhtml.xslt Tue Apr 14 17:31:45 2020 +0200 @@ -847,11 +847,19 @@ </xsl:text> <xsl:text> this.margins = [lmargin, tmargin].map(x => Math.max(x,0)); </xsl:text> - <xsl:text> this.content = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", -</xsl:text> - <xsl:text> "eleven", "twelve", "thirteen", "fourteen", "fifteen"]; -</xsl:text> - <xsl:text> //this.content = ["one", "two", "three", "four", "5", "6"]; + <xsl:text> //this.content = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", +</xsl:text> + <xsl:text> // "eleven", "twelve", "thirteen", "fourteen", "fifteen"]; +</xsl:text> + <xsl:text> this.content = [ +</xsl:text> + <xsl:for-each select="arg"> + <xsl:text>"</xsl:text> + <xsl:value-of select="@value"/> + <xsl:text>", +</xsl:text> + </xsl:for-each> + <xsl:text> ]; </xsl:text> <xsl:text> this.menu_offset = 0; </xsl:text> diff -r 41edcb8e0a01 -r f51c0e2e0bcb svghmi/widget_dropdown.ysl2 --- a/svghmi/widget_dropdown.ysl2 Tue Apr 14 17:17:35 2020 +0200 +++ b/svghmi/widget_dropdown.ysl2 Tue Apr 14 17:31:45 2020 +0200 @@ -14,9 +14,11 @@ lmargin = this.text_bbox.x - this.box_bbox.x; tmargin = this.text_bbox.y - this.box_bbox.y; this.margins = [lmargin, tmargin].map(x => Math.max(x,0)); - this.content = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", - "eleven", "twelve", "thirteen", "fourteen", "fifteen"]; - //this.content = ["one", "two", "three", "four", "5", "6"]; + //this.content = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", + // "eleven", "twelve", "thirteen", "fourteen", "fifteen"]; + this.content = [ + ``foreach "arg" | "«@value»", + ]; this.menu_offset = 0; this.lift = 0; this.opened = false; diff -r 41edcb8e0a01 -r f51c0e2e0bcb tests/svghmi/svghmi_0@svghmi/svghmi.svg --- a/tests/svghmi/svghmi_0@svghmi/svghmi.svg Tue Apr 14 17:17:35 2020 +0200 +++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Tue Apr 14 17:31:45 2020 +0200 @@ -2492,7 +2492,7 @@ </g> <g id="g14237" - inkscape:label="HMI:DropDown:Primes@/SELECTION" + inkscape:label="HMI:DropDown:sretgs:vfs:hgdrty:tfws:htyd:dx:treg:az:ki:qw:zvfzsdf@/SELECTION" transform="translate(0,-640)"> <rect 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:5;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"