X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/02aac9d371ca28b52a0c0b635b38fbb912f596ed..7731625e1ec4c5b9af80a8ac241cd8b8b0c35adc:/lib/python/Components/ProgressBar.py diff --git a/lib/python/Components/ProgressBar.py b/lib/python/Components/ProgressBar.py index 00b1bbe3..f18c4672 100644 --- a/lib/python/Components/ProgressBar.py +++ b/lib/python/Components/ProgressBar.py @@ -5,21 +5,24 @@ from VariableValue import * from enigma import eSlider # a general purpose progress bar -class ProgressBar(HTMLComponent, GUIComponent, VariableValue): +class ProgressBar(VariableValue, HTMLComponent, GUIComponent, object): def __init__(self): GUIComponent.__init__(self) VariableValue.__init__(self) + self.__start = 0 + self.__end = 100 - def createWidget(self, parent): - self.g = eSlider(parent) - self.g.setRange(0, 100) - return self.g + GUI_WIDGET = eSlider - def setRange(self, start, end): - self.g.setRange(start, end) - - def setValue(self, value): - self.g.setValue(value) + def postWidgetCreate(self, instance): + instance.setRange(self.__start, self.__end) + def setRange(self, range): + (__start, __end) = range + if self.instance is not None: + self.instance.setRange(__start, __end) + def getRange(self): + return (self.__start, self.__end) + range = property(getRange, setRange)