aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-10-12 23:27:18 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-10-12 23:27:18 +0000
commita6178fc05f6d296533718694bf8d4ae4bb80f994 (patch)
tree7937a74a796ab484f95db40543175ad82c2edbf0 /lib
parent2b8587722d707e88dbc8d381a74c12c380c6db04 (diff)
downloadenigma2-a6178fc05f6d296533718694bf8d4ae4bb80f994.tar.gz
enigma2-a6178fc05f6d296533718694bf8d4ae4bb80f994.zip
fix drawing of configSequence string
can now be used for input of: - IPs - MACs (just decimal values up to now) - Integers of a defined size - real numbers with a defined size before and after the decimal point
Diffstat (limited to 'lib')
-rw-r--r--lib/python/Components/config.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index 93479b66..9c2c3f43 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -137,8 +137,12 @@ class configSequence:
self.valueBounds = self.parent.vals[1]
def checkValues(self):
- maxPos = len(self.parent.value) * len(self.valueBounds) + len(self.parent.value)
-
+ maxPos = 0
+ num = 0
+ for i in self.parent.value:
+ maxPos += len(str(self.valueBounds[num][1]))
+ num += 1
+
if self.markedPos >= maxPos:
self.markedPos = maxPos - 1
if self.markedPos < 0:
@@ -188,6 +192,7 @@ class configSequence:
value = ""
mPos = self.markedPos
print "Positon: " + str(mPos)
+ num = 0;
for i in self.parent.value:
if len(value): #fixme no heading separator possible
value += self.seperator
@@ -198,9 +203,9 @@ class configSequence:
#if diff > 0:
## if this helps?!
#value += " " * diff
- print (("%0" + str(len(str(self.valueBounds[0][1]))) + "d") % i)
- value += ("%0" + str(len(str(self.valueBounds[0][1]))) + "d") % i
-
+ print (("%0" + str(len(str(self.valueBounds[num][1]))) + "d") % i)
+ value += ("%0" + str(len(str(self.valueBounds[num][1]))) + "d") % i
+ num += 1
# only mark cursor when we are selected
# (this code is heavily ink optimized!)
return ("mtext"[1-selected:], value, [mPos])