Difference between revisions of "Slider Control"

From Official Kodi Wiki
Jump to navigation Jump to search
>Jmarshall
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<section begin="main content" />
The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.
The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.
===Example===
=== Example ===
<xml>
<syntaxhighlight lang="xml" enclose="div">
<control type="slider" id="17">
<control type="slider" id="17">
       <description>My first slider control</description>
       <description>My first slider control</description>
       <posx>80</posx>
       <left>80</left>
       <posy>60</posy>
       <top>60</top>
       <width>250</width>
       <width>250</width>
       <height>30</height>
       <height>30</height>
       <visible>true</visible>
       <visible>true</visible>
       <texturebg>mybackgroundtexture.png</texturebg>
       <texturesliderbar>mybackgroundtexture.png</texturesliderbar>
       <textureslidernib>mydowntexture.png</textureslidernib>
       <textureslidernib>mydowntexture.png</textureslidernib>
       <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
       <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
       <info></info>
       <info></info>
      <action></action>
       <controloffsetx></controloffsetx>
       <controloffsetx></controloffsetx>
       <controloffsety></controloffsety>
       <controloffsety></controloffsety>
       <pulseonselect></pulseonselect>
       <pulseonselect></pulseonselect>
      <orientation>horizontal</orientation>
       <onup>2</onup>
       <onup>2</onup>
       <ondown>3</ondown>
       <ondown>3</ondown>
Line 21: Line 24:
       <onright>1</onright>
       <onright>1</onright>
</control>
</control>
</xml>
</syntaxhighlight>
===Available Tags===
 
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
=== Available tags ===
{| class="dtable"
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
|- class="userrow"
 
| class="usercell" | '''texturebg'''
{| class="prettytable"
| class="usercell" |
! Tag !! Description
|-  
| '''texturesliderbar'''
|  
Specifies the image file which should be displayed in the background of the slider control. [[Texture Attributes|See here for additional information about textures.]]
Specifies the image file which should be displayed in the background of the slider control. [[Texture Attributes|See here for additional information about textures.]]
|- class="userrow"
|-  
| class="usercell" | '''textureslidernib'''
| '''textureslidernib'''
| class="usercell" | Specifies the image file which should be displayed for the slider nib.
| Specifies the image file which should be displayed for the slider nib.
|- class="userrow"
|-  
| class="usercell" | '''textureslidernibfocus'''
| '''textureslidernibfocus'''
| class="usercell" | Specifies the image file which should be displayed for the slider nib when it has focus.
| Specifies the image file which should be displayed for the slider nib when it has focus.
|- class="userrow"
|-  
| class="usercell" | '''controloffsetx'''
| '''controloffsetx'''
| class="usercell" | Amount to offset the slider background texture from the left edge of the control. Only useful if a value is being rendered as well (ie in int or float mode).
| Amount to offset the slider background texture from the left edge of the control. Only useful if a value is being rendered as well (ie in int or float mode).
|- class="userrow"
|-  
| class="usercell" | '''controloffsety'''
| '''controloffsety'''
| class="usercell" | Amount to offset the slider background texture from the top edge of the control.
| Amount to offset the slider background texture from the top edge of the control.
|- class="userrow"
|-  
| class="usercell" | '''info'''
| '''info'''
| class="usercell" |
| Specifies the information that the slider controls. [[InfoLabels|See here for more information.]]
Specifies the information that the slider controls. [[InfoLabels|See here for more information.]]
|-
|  '''action'''
|  Can be 'volume' to adjust the volume, 'seek' to change the seek position or 'pvr.seek' for timeshifting in PVR
|-
|  '''orientation'''
|  Can be horizontal or vertical (default).
|}
|}
[[category:Skin Development]]
 
<section end="main content" />
 
== See also ==
'''Development:'''
* [[Add-on development]]
* [[Skinning]]
 
[[Category:Skin development]]

Latest revision as of 18:26, 27 January 2019

The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.

1 Example

<control type="slider" id="17">
      <description>My first slider control</description>
      <left>80</left>
      <top>60</top>
      <width>250</width>
      <height>30</height>
      <visible>true</visible>
      <texturesliderbar>mybackgroundtexture.png</texturesliderbar>
      <textureslidernib>mydowntexture.png</textureslidernib>
      <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
      <info></info>
      <action></action>
      <controloffsetx></controloffsetx>
      <controloffsety></controloffsety>
      <pulseonselect></pulseonselect>
      <orientation>horizontal</orientation>
      <onup>2</onup>
      <ondown>3</ondown>
      <onleft>1</onleft>
      <onright>1</onright>
</control>

2 Available tags

In addition to the Default Control Tags the following tags are available. Note that each tag is lower case only. This is important, as xml tags are case-sensitive.

Tag Description
texturesliderbar

Specifies the image file which should be displayed in the background of the slider control. See here for additional information about textures.

textureslidernib Specifies the image file which should be displayed for the slider nib.
textureslidernibfocus Specifies the image file which should be displayed for the slider nib when it has focus.
controloffsetx Amount to offset the slider background texture from the left edge of the control. Only useful if a value is being rendered as well (ie in int or float mode).
controloffsety Amount to offset the slider background texture from the top edge of the control.
info Specifies the information that the slider controls. See here for more information.
action Can be 'volume' to adjust the volume, 'seek' to change the seek position or 'pvr.seek' for timeshifting in PVR
orientation Can be horizontal or vertical (default).


3 See also

Development: