Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] slider - add int/float support #11230

Merged
merged 1 commit into from Jan 5, 2017
Merged

Conversation

ronie
Copy link
Member

@ronie ronie commented Dec 20, 2016

for slider controls, currently only the get/set percentage method is exposed to the python api.

this adds support for setting / getting float and int as well.
this allows addons to create a slider with (for instance) a range from -10 to 10.

@tamland / @phil65

@ronie ronie added Type: Feature non-breaking change which adds functionality Component: Python labels Dec 20, 2016
@@ -451,6 +451,34 @@ namespace XBMCAddon
((CGUISliderControl*)pGUIControl)->SetPercentage(pct);
}

int ControlSlider::getInt()
{
return (pGUIControl) ? ((CGUISliderControl*)pGUIControl)->GetIntValue() : 0;

This comment was marked as spam.

/// \ingroup python_xbmcgui_control_slider
/// @brief \python_func{ setInt(value, min, delta, max) }
///-----------------------------------------------------------------------
/// Sets the value of the slider.

This comment was marked as spam.

@ronie
Copy link
Member Author

ronie commented Dec 20, 2016

thx! updated as suggested.

@ronie
Copy link
Member Author

ronie commented Jan 4, 2017

jenkins build this please

1 similar comment
@ronie
Copy link
Member Author

ronie commented Jan 5, 2017

jenkins build this please

@ronie ronie merged commit af2b069 into xbmc:master Jan 5, 2017
@MartijnKaijser MartijnKaijser added this to the L 18.0-alpha1 milestone Jan 5, 2017
{
if (pGUIControl)
static_cast<CGUISliderControl*>(pGUIControl)->SetType(SLIDER_CONTROL_TYPE_INT);
static_cast<CGUISliderControl*>(pGUIControl)->SetRange(min, max);

This comment was marked as spam.

This comment was marked as spam.

@ronie ronie deleted the python-slider branch January 11, 2017 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Python Type: Feature non-breaking change which adds functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants