aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-06-11 22:11:07 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-06-11 22:11:07 +0000
commite77779c4822c7c860f5006b24445960722c7a46e (patch)
treeef97f27ee11cb0924b0135d49bfa37411cb265ca /lib
parent0a7e2ed8d31048eee98bf2ffd794743d30d9b953 (diff)
downloadenigma2-e77779c4822c7c860f5006b24445960722c7a46e.tar.gz
enigma2-e77779c4822c7c860f5006b24445960722c7a46e.zip
skip separation lines in a ChoiceBox when pressing up/down (a choicebox of only separation lines will cause an endless loop. so don't do it :))
Diffstat (limited to 'lib')
-rw-r--r--lib/python/Screens/ChoiceBox.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py
index 60aa5e10..522ee3c5 100644
--- a/lib/python/Screens/ChoiceBox.py
+++ b/lib/python/Screens/ChoiceBox.py
@@ -30,7 +30,7 @@ class ChoiceBox(Screen):
pos += 1
self["list"] = ChoiceList(list = self.list, selection = selection)
- self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions"],
+ self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions", "DirectionActions"],
{
"ok": self.go,
"back": self.cancel,
@@ -47,7 +47,9 @@ class ChoiceBox(Screen):
"red": self.keyRed,
"green": self.keyGreen,
"yellow": self.keyYellow,
- "blue": self.keyBlue
+ "blue": self.keyBlue,
+ "up": self.up,
+ "down": self.down
}, -1)
def keyLeft(self):
@@ -56,6 +58,17 @@ class ChoiceBox(Screen):
def keyRight(self):
pass
+ def up(self):
+ while 1:
+ self["list"].instance.moveSelection(self["list"].instance.moveUp)
+ if self["list"].l.getCurrentSelection()[0][0] != "--":
+ break
+
+ def down(self):
+ while 1:
+ self["list"].instance.moveSelection(self["list"].instance.moveDown)
+ if self["list"].l.getCurrentSelection()[0][0] != "--":
+ break
def keyNumberGlobal(self, number):
print "pressed", number
if self.keymap.has_key(str(number)):