X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/98c4b5bb004e9297bffa8e1c3572572741fda933..0855ea4ed4197c0fc6a8f8fff5820741d80c6d41:/lib/python/Components/ProgressBar.py diff --git a/lib/python/Components/ProgressBar.py b/lib/python/Components/ProgressBar.py index 68824d5a..d97ac832 100644 --- a/lib/python/Components/ProgressBar.py +++ b/lib/python/Components/ProgressBar.py @@ -1,17 +1,28 @@ -from HTMLComponent import * -from GUIComponent import * -from VariableValue import * +from HTMLComponent import HTMLComponent +from GUIComponent import GUIComponent +from VariableValue import VariableValue 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): - g = eSlider(parent) - g.setRange(0, 100) - return g - + GUI_WIDGET = eSlider + + 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)