X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e09309bd7f69dbc98f471e28e01e2ad21ab7a757..d65ce06bfed2444d9870630f095db401d78a096e:/lib/python/Components/Input.py diff --git a/lib/python/Components/Input.py b/lib/python/Components/Input.py index e7713d6d..e0a7f449 100644 --- a/lib/python/Components/Input.py +++ b/lib/python/Components/Input.py @@ -1,25 +1,28 @@ -from HTMLComponent import * -from GUIComponent import * -from VariableText import * +from HTMLComponent import HTMLComponent +from GUIComponent import GUIComponent +from VariableText import VariableText from enigma import eLabel from Tools.NumericalTextInput import NumericalTextInput -class Input(VariableText, HTMLComponent, GUIComponent): +class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput): TEXT = 0 PIN = 1 NUMBER = 2 def __init__(self, text="", maxSize = False, type = TEXT): + NumericalTextInput.__init__(self, self.right) GUIComponent.__init__(self) VariableText.__init__(self) self.type = type self.maxSize = maxSize self.currPos = 0 self.overwrite = 0 - self.numericalTextInput = NumericalTextInput(self.right) self.setText(text) + + def __len__(self): + return len(self.text) def update(self): self.setMarkedPos(self.currPos) @@ -122,7 +125,7 @@ class Input(VariableText, HTMLComponent, GUIComponent): def number(self, number): if self.type == self.TEXT: - newChar = self.numericalTextInput.getKey(number) + newChar = self.getKey(number) elif self.type == self.PIN or self.type == self.NUMBER: newChar = str(number) self.Text = self.Text[0:self.currPos] + newChar + self.Text[self.currPos + 1:]