From 7a900d0687c0c35396396d9fdedc454283312e55 Mon Sep 17 00:00:00 2001 From: Ronny Strutz Date: Wed, 17 Aug 2005 00:13:11 +0000 Subject: [PATCH] added working slider --- lib/python/Components/config.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index f8e8fd1..4571fd4 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -30,19 +30,28 @@ def configEntry(obj): class Config: def __init__(self): pass - def Slider(self,reg): # ok??? - pass - def getControlType(self, reg): - print "getControlType " + reg - - #find the correct type in class-members - if reg == "blasel": - return configBoolean(reg) - - return configBoolean(reg) config = Config(); +class ConfigSlider: + def __init__(self, parent): + self.parent = parent + self.val = parent.value + def handleKey(self, key): + if key == 1: + self.val = self.val - 1 + if key == 2: + self.val = self.val + 1 + + if self.val < 0: + self.val = 0 + + if self.val > 10: + self.val = 10 + + def __str__(self): #needed by configlist + return ("0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100")[self.val] + class ConfigSubsection: def __init__(self): pass -- 2.7.4