add NumericalTextInputHelpDialog
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 2 Oct 2006 23:57:11 +0000 (23:57 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 2 Oct 2006 23:57:11 +0000 (23:57 +0000)
lib/python/Screens/NumericalTextInputHelpDialog.py [new file with mode: 0644]

diff --git a/lib/python/Screens/NumericalTextInputHelpDialog.py b/lib/python/Screens/NumericalTextInputHelpDialog.py
new file mode 100644 (file)
index 0000000..39c644b
--- /dev/null
@@ -0,0 +1,16 @@
+from Screen import Screen
+from Components.Label import Label
+
+class NumericalTextInputHelpDialog(Screen):
+       def __init__(self, session, textinput):
+               Screen.__init__(self, session)
+               for x in range(1, 10):
+                       self["key%d" % x] = Label(text=textinput.mapping[x].encode("utf-8"))
+               self.last_marked = 0
+
+       def update(self, textinput):
+               if 1 <= self.last_marked <= 9:
+                       self["key%d" % self.last_marked].setMarkedPos(-1)
+               if 1 <= textinput.lastKey <= 9:
+                       self["key%d" % textinput.lastKey].setMarkedPos(textinput.pos)
+                       self.last_marked = textinput.lastKey