Used for a volume slider.
More...
Used for a volume slider.
Class: ControlSlider(x, y, width, height[, textureback, texture, texturefocus, orientation])
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.
- Note
- This class include also all calls from Control
- Parameters
-
x | integer - x coordinate of control |
y | integer - y coordinate of control |
width | integer - width of control |
height | integer - height of control |
textureback | [opt] string - image filename |
texture | [opt] string - image filename |
texturefocus | [opt] string - image filename |
orientation | [opt] integer - orientation of slider (xbmcgui.HORIZONTAL / xbmcgui.VERTICAL (default)) |
- Note
- You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
After you create the control, you need to add it to the window with addControl().
- v17 Python API changes:
- orientation option added.
Example:
...
self.slider = xbmcgui.ControlSlider(100, 250, 350, 40)
...
◆ getFloat()
float XBMCAddon::xbmcgui::ControlSlider::getFloat |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getFloat() </big></font></span></code></h4> \endhtmlonly
Returns the value of the slider.
- Returns
- float - value of slider
- v18 Python API changes:
- New function added.
Example:
...
print(self.slider.getFloat())
...
◆ getInt()
int XBMCAddon::xbmcgui::ControlSlider::getInt |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getInt() </big></font></span></code></h4> \endhtmlonly
Returns the value of the slider.
- Returns
- int - value of slider
- v18 Python API changes:
- New function added.
Example:
...
print(self.slider.getInt())
...
◆ getPercent()
float XBMCAddon::xbmcgui::ControlSlider::getPercent |
( |
| ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getPercent() </big></font></span></code></h4> \endhtmlonly
Returns a float of the percent of the slider.
- Returns
- float - Percent of slider
Example:
...
print(self.slider.getPercent())
...
◆ setFloat()
void XBMCAddon::xbmcgui::ControlSlider::setFloat |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setFloat(value, min, delta, max) </big></font></span></code></h4> \endhtmlonly
Sets the range, value and step size of the slider.
- Parameters
-
value | float - value of slider |
min | float - min of slider |
delta | float - step size of slider |
max | float - max of slider |
- v18 Python API changes:
- New function added.
Example:
...
self.slider.setFloat(15.0, 10.0, 1.0, 20.0)
...
◆ setInt()
void XBMCAddon::xbmcgui::ControlSlider::setInt |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setInt(value, min, delta, max) </big></font></span></code></h4> \endhtmlonly
Sets the range, value and step size of the slider.
- Parameters
-
value | int - value of slider |
min | int - min of slider |
delta | int - step size of slider |
max | int - max of slider |
- v18 Python API changes:
- New function added.
Example:
...
self.slider.setInt(450, 200, 10, 900)
...
◆ setPercent()
void XBMCAddon::xbmcgui::ControlSlider::setPercent |
( |
|
... | ) |
|
@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setPercent(pct) </big></font></span></code></h4> \endhtmlonly
Sets the percent of the slider.
- Parameters
-
pct | float - Percent value of slider |
Example:
...
self.slider.setPercent(50)
...