fix progressbar, slider
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 1 May 2006 12:27:54 +0000 (12:27 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 1 May 2006 12:27:54 +0000 (12:27 +0000)
lib/python/Components/ProgressBar.py
lib/python/Components/Slider.py

index 9bec179..f18c467 100644 (file)
@@ -5,21 +5,24 @@ from VariableValue import *
 from enigma import eSlider
 
 # a general purpose progress bar
 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)
        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)
index e61b47f..b8144bb 100644 (file)
@@ -13,7 +13,7 @@ class Slider(VariableValue, HTMLComponent, GUIComponent):
                self.min = min
                self.max = max
 
                self.min = min
                self.max = max
 
-       def createWidget(self, parent):
-               g = eSlider(parent)
-               g.setRange(self.min, self.max)
-               return g
+       GUI_WIDGET = eSlider
+       
+       def postWidgetCreate(self, instance):
+               instance.setRange(self.min, self.max)