Merge branch 'master' into dvd_scale_test
[enigma2.git] / lib / python / Components / ProgressBar.py
index 9bec1796b0df9b4afa38f73eda3c286150ece038..d97ac832b16cfd988bda01c9d468eca9cd0a32e1 100644 (file)
@@ -1,25 +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(VariableValue, HTMLComponent, GUIComponent):
+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)