TEXT = 0
PIN = 1
NUMBER = 2
-
+
def __init__(self, text="", maxSize = False, type = TEXT):
GUIComponent.__init__(self)
VariableText.__init__(self)
+ self.table = 0
self.numericalTextInput = NumericalTextInput(self.right)
self.type = type
self.maxSize = maxSize
self.Text = text
self.overwrite = 0
self.update()
+
def update(self):
self.setMarkedPos(self.currPos)
if self.type == self.PIN:
self.message = "*" * len(self.Text)
else:
- self.message = convertDVBUTF8(self.Text, 0)
+ self.message = convertDVBUTF8(self.Text, self.table)
if self.instance:
self.instance.setText(self.message)
self.currPos = 0
self.Text = ""
elif isUTF8(text):
- self.Text = convertUTF8DVB(text, 0)
+ self.Text = convertUTF8DVB(text, self.table)
else:
self.Text = text
self.update()
def getText(self):
- return convertDVBUTF8(self.Text, 0)
+ return convertDVBUTF8(self.Text, self.table)
def createWidget(self, parent):
return eLabel(parent, self.currPos)
def end(self):
self.currPos = len(self.Text) - 1
self.update()
-
+
def tab(self):
if self.currPos == len(self.Text) - 1:
self.Text=self.Text+ " "
else:
self.Text = self.Text[0:self.currPos] + " " + self.Text[self.currPos:]
self.update()
-
+
def delete(self):
self.Text = self.Text[:self.currPos] + self.Text[self.currPos + 1:]
self.update()
-
+
def toggleOverwrite(self):
if self.overwrite==1:
self.overwrite=0
+# -*- coding: latin-1 -*-
from enigma import *
+from Components.Language import language
class NumericalTextInput:
- mapping = []
- mapping.append (".,?'\"0-()@/:_") # 0
- mapping.append (" 1") # 1
- mapping.append ("abc2ABC") # 2
- mapping.append ("def3DEF") # 3
- mapping.append ("ghi4GHI") # 4
- mapping.append ("jkl5JKL") # 5
- mapping.append ("mno6MNO") # 6
- mapping.append ("pqrs7PQRS") # 7
- mapping.append ("tuv8TUV") # 8
- mapping.append ("wxyz9WXYZ") # 9
-
- def __init__(self, nextFunction = None):
- self.nextFunction = nextFunction
- self.Timer = eTimer()
- self.Timer.timeout.get().append(self.nextChar)
- self.lastKey = -1
- self.pos = 0
-
- def getKey(self, num):
- self.Timer.stop()
- self.Timer.start(1000)
- if (self.lastKey != num):
- self.lastKey = num
- self.pos = 0
- else:
- self.pos += 1
- if (len(self.mapping[num]) <= self.pos):
- self.pos = 0
- return self.mapping[num][self.pos]
-
- def nextKey(self):
- self.Timer.stop()
- self.lastKey = -1
-
- def nextChar(self):
- self.Timer.stop()
- print "Timer done"
- self.nextKey()
- if (self.nextFunction != None):
- self.nextFunction()
-
\ No newline at end of file
+ mapping = []
+ lang = language.getLanguage()
+ if lang == 'de_DE':
+ mapping.append (".,?'\"0-()@/:_") # 0
+ mapping.append (" 1") # 1
+ mapping.append ("aäbc2AABC") # 2
+ mapping.append ("def3DEF") # 3
+ mapping.append ("ghi4GHI") # 4
+ mapping.append ("jkl5JKL") # 5
+ mapping.append ("mnoö6MNOÖ") # 6
+ mapping.append ("pqrsß7PQRSß") # 7
+ mapping.append ("tuüv8TUÜV") # 8
+ mapping.append ("wxyz9WXYZ") # 9
+ elif lang == 'es_ES':
+ mapping.append (".,?'\"0-()@/:_") # 0
+ mapping.append (" 1") # 1
+ mapping.append ("abcáà2ABCÁÀ") # 2
+ mapping.append ("deéèf3DEFÉÈ") # 3
+ mapping.append ("ghiíì4GHIÍÌ") # 4
+ mapping.append ("jkl5JKL") # 5
+ mapping.append ("mnñoóò6MNÑOÓÒ") # 6
+ mapping.append ("pqrs7PQRS") # 7
+ mapping.append ("tuvúù8TUVÚÙ") # 8
+ mapping.append ("wxyz9WXYZ") # 9
+ else:
+ mapping.append (".,?'\"0-()@/:_") # 0
+ mapping.append (" 1") # 1
+ mapping.append ("abc2ABC") # 2
+ mapping.append ("def3DEF") # 3
+ mapping.append ("ghi4GHI") # 4
+ mapping.append ("jkl5JKL") # 5
+ mapping.append ("mno6MNO") # 6
+ mapping.append ("pqrs7PQRS") # 7
+ mapping.append ("tuv8TUV") # 8
+ mapping.append ("wxyz9WXYZ") # 9
+
+ def __init__(self, nextFunction = None):
+ self.nextFunction = nextFunction
+ self.Timer = eTimer()
+ self.Timer.timeout.get().append(self.nextChar)
+ self.lastKey = -1
+ self.pos = 0
+
+ def getKey(self, num):
+ self.Timer.stop()
+ self.Timer.start(1000)
+ if (self.lastKey != num):
+ self.lastKey = num
+ self.pos = 0
+ else:
+ self.pos += 1
+ if (len(self.mapping[num]) <= self.pos):
+ self.pos = 0
+ return self.mapping[num][self.pos]
+
+ def nextKey(self):
+ self.Timer.stop()
+ self.lastKey = -1
+
+ def nextChar(self):
+ self.Timer.stop()
+ print "Timer done"
+ try:
+ self.nextKey()
+ if (self.nextFunction != None):
+ self.nextFunction()
+ except:
+ pass