diff options
| author | Fraxinas <andreas.frisch@multimedia-labs.de> | 2008-12-08 13:43:31 +0100 |
|---|---|---|
| committer | Fraxinas <andreas.frisch@multimedia-labs.de> | 2008-12-08 13:43:31 +0100 |
| commit | 22e4755ccb4820da1a50c7301951978dc45eaab3 (patch) | |
| tree | 73857e0dc91582397ec48214eb2866f0f98b35df /lib/python/Tools | |
| parent | 5d283dd8a7936fe8cc53fff4962c39dde1a6d22a (diff) | |
| download | enigma2-22e4755ccb4820da1a50c7301951978dc45eaab3.tar.gz enigma2-22e4755ccb4820da1a50c7301951978dc45eaab3.zip | |
add search parameter for NumericalTextInput which supplies a mapping with only lowercase and standard ascii characters plus number plus SQL wildcards
Diffstat (limited to 'lib/python/Tools')
| -rw-r--r-- | lib/python/Tools/NumericalTextInput.py | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py index 5954c9c3..be4cf01f 100644 --- a/lib/python/Tools/NumericalTextInput.py +++ b/lib/python/Tools/NumericalTextInput.py @@ -3,12 +3,33 @@ from enigma import eTimer from Components.Language import language class NumericalTextInput: - def __init__(self, nextFunc=None, handleTimeout = True): + def __init__(self, nextFunc=None, handleTimeout = True, search = False): self.mapping = [] self.lang = language.getLanguage() self.useableChars=None self.nextFunction=nextFunc - + + if handleTimeout: + self.timer = eTimer() + self.timer.callback.append(self.timeout) + else: + self.timer = None + self.lastKey = -1 + self.pos = -1 + + if search: + self.mapping.append (u"%_0") # 0 + self.mapping.append (u" 1") # 1 + self.mapping.append (u"abc2") # 2 + self.mapping.append (u"def3") # 3 + self.mapping.append (u"ghi4") # 4 + self.mapping.append (u"jkl5") # 5 + self.mapping.append (u"mno6") # 6 + self.mapping.append (u"pqrs7") # 7 + self.mapping.append (u"tuv8") # 8 + self.mapping.append (u"wxyz9") # 9 + return + if self.lang == 'de_DE': self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 @@ -54,14 +75,6 @@ class NumericalTextInput: self.mapping.append (u"tuv8TUV") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 - if handleTimeout: - self.timer = eTimer() - self.timer.callback.append(self.timeout) - else: - self.timer = None - self.lastKey = -1 - self.pos = -1 - def setUseableChars(self, useable): self.useableChars = useable |
