1.1 --- a/XSLForms/XSL/QtDesigner.xsl Thu Oct 27 16:30:58 2005 +0000
1.2 +++ b/XSLForms/XSL/QtDesigner.xsl Thu Oct 27 16:31:26 2005 +0000
1.3 @@ -183,23 +183,42 @@
1.4 <xsl:template match="widget[@class='QComboBox']">
1.5 <select xmlns="http://www.w3.org/1999/xhtml">
1.6 <xsl:variable name="name-prop" select="property[@name='name']"/>
1.7 - <xsl:attribute name="template:attribute-field"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute>
1.8 - <xsl:attribute name="name"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute>
1.9 - <xsl:apply-templates select="item"/>
1.10 + <xsl:variable name="field-name" select="$name-prop/cstring/text()"/>
1.11 + <xsl:variable name="enum-name" select="concat($name-prop/cstring/text(), '-enum')"/>
1.12 + <xsl:attribute name="template:multiple-choice-field"><xsl:value-of select="$field-name"/>,value</xsl:attribute>
1.13 + <xsl:attribute name="name"><xsl:value-of select="$field-name"/></xsl:attribute>
1.14 + <xsl:apply-templates select="item">
1.15 + <xsl:with-param name="enum-name" select="$enum-name"/>
1.16 + </xsl:apply-templates>
1.17 </select>
1.18 </xsl:template>
1.19
1.20 <xsl:template match="widget[@class='QListBox']">
1.21 <select xmlns="http://www.w3.org/1999/xhtml" multiple="multiple">
1.22 <xsl:variable name="name-prop" select="property[@name='name']"/>
1.23 - <xsl:attribute name="template:attribute-field"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute>
1.24 - <xsl:attribute name="name"><xsl:value-of select="$name-prop/cstring/text()"/></xsl:attribute>
1.25 - <xsl:apply-templates select="item"/>
1.26 + <xsl:variable name="field-name" select="$name-prop/cstring/text()"/>
1.27 + <xsl:variable name="enum-name" select="concat($name-prop/cstring/text(), '-enum')"/>
1.28 + <xsl:attribute name="template:multiple-choice-list-field"><xsl:value-of select="$field-name"/>,<xsl:value-of select="$enum-name"/></xsl:attribute>
1.29 + <xsl:attribute name="name"><xsl:value-of select="$field-name"/></xsl:attribute>
1.30 + <xsl:apply-templates select="item">
1.31 + <xsl:with-param name="enum-name" select="$enum-name"/>
1.32 + <xsl:with-param name="item-type">list</xsl:with-param>
1.33 + </xsl:apply-templates>
1.34 </select>
1.35 </xsl:template>
1.36
1.37 <xsl:template match="item">
1.38 + <xsl:param name="enum-name"/>
1.39 + <xsl:param name="item-type"/>
1.40 <option xmlns="http://www.w3.org/1999/xhtml">
1.41 + <xsl:choose>
1.42 + <xsl:when test="$item-type = 'list'">
1.43 + <xsl:attribute name="template:multiple-choice-list-value"><xsl:value-of select="$enum-name"/>,value,selected</xsl:attribute>
1.44 + </xsl:when>
1.45 + <xsl:otherwise>
1.46 + <xsl:attribute name="template:multiple-choice-value"><xsl:value-of select="$enum-name"/>,value,selected</xsl:attribute>
1.47 + </xsl:otherwise>
1.48 + </xsl:choose>
1.49 <xsl:variable name="value-prop" select="property[@name='text']"/>
1.50 <xsl:attribute name="value"><xsl:value-of select="$value-prop/string/text()"/></xsl:attribute>
1.51 <xsl:value-of select="$value-prop/string/text()"/>