home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / MediaCoder / MediaCoder2011-R8-5188.exe / htdocs / prefs / value.xsl < prev   
Encoding:
Extensible Markup Language  |  2010-04-26  |  2.6 KB  |  94 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="xml" encoding="utf-8" doctype-public="-//MOZILLA//DTD XUL V1.0//EN"/>
  4. <xsl:template match="/MediaCoderPrefs/node/node/node">
  5.  
  6. <window xmlns:html="http://www.w3.org/1999/xhtml"
  7.         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  8.         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  9.         >
  10. <hbox>
  11. <xsl:choose>
  12. <xsl:when test="@type='bool'">
  13.  
  14.     <vbox>
  15.     <radiogroup orient="horizontal">
  16.     <radio label="Yes" oncommand="SaveValue('true')">
  17.     <xsl:if test="value='true'"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
  18.     </radio>
  19.     <radio label="No" oncommand="SaveValue('false')">
  20.     <xsl:if test="value!='true'"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
  21.     </radio>
  22.     </radiogroup>
  23.     </vbox>
  24.     <vbox flex="1"/>
  25.  
  26. </xsl:when>
  27.  
  28. <xsl:when test="@type='enum'">
  29.  
  30.     <vbox>
  31.     <xsl:if test="count(enum) <= 5">
  32.       <radiogroup orient="horizontal">
  33.       <xsl:for-each select="enum">
  34.         <radio>
  35.           <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
  36.           <xsl:attribute name="oncommand">SaveValue('<xsl:value-of select="."/>')</xsl:attribute>          <xsl:if test=".=../value">
  37.             <xsl:attribute name="selected">true</xsl:attribute>
  38.           </xsl:if>
  39.         </radio>
  40.       </xsl:for-each>
  41.       </radiogroup>
  42.     </xsl:if>
  43.     <xsl:if test="count(enum) > 5">
  44.     <menulist flex="false" oncommand="SaveValue(selectedItem.getAttribute('label'))">
  45.         <menupopup>
  46.             <xsl:for-each select="enum">
  47.             <menuitem>
  48.                 <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
  49.                 <xsl:if test=".=../value"><xsl:attribute name="selected">true</xsl:attribute></xsl:if>
  50.             </menuitem>
  51.             </xsl:for-each>
  52.         </menupopup>
  53.     </menulist>
  54.     </xsl:if>
  55.     </vbox>
  56.     <vbox flex="1"/>
  57.  
  58. </xsl:when>
  59.  
  60. <xsl:when test="@type='int' or @type='float'">
  61.  
  62.     <vbox>
  63.     <button label="Apply"/>
  64.     </vbox>
  65.     <vbox>
  66.     <textbox onchange="SaveValue(this.value)" size="8">
  67.     <xsl:attribute name="value"><xsl:value-of select="value"/></xsl:attribute>
  68.     </textbox>
  69.     </vbox>
  70.     <vbox flex="1"/>
  71.  
  72. </xsl:when>
  73.  
  74. <xsl:otherwise>
  75.  
  76.     <vbox>
  77.     <button label="Apply"/>
  78.     </vbox>
  79.     <vbox flex="1">
  80.     <textbox onchange="SaveValue(this.value)">
  81.     <xsl:attribute name="value"><xsl:value-of select="value"/></xsl:attribute>
  82.     </textbox>
  83.     </vbox>
  84.  
  85. </xsl:otherwise>
  86.  
  87. </xsl:choose>    
  88.  
  89. </hbox>
  90.  
  91. </window>
  92. </xsl:template>
  93.  
  94. </xsl:stylesheet>