from Tools.NumericalTextInput import NumericalTextInput
-class Input(HTMLComponent, GUIComponent, VariableText):
+class Input(VariableText, HTMLComponent, GUIComponent):
TEXT = 0
PIN = 1
NUMBER = 2
self.update()
def up(self):
- if self.text[self.currPos] == "9":
+ if self.text[self.currPos] == "9" or self.text[self.currPos] == " ":
newNumber = "0"
else:
newNumber = str(int(self.text[self.currPos]) + 1)
self.update()
def down(self):
- if self.text[self.currPos] == "0":
+ if self.text[self.currPos] == "0" or self.text[self.currPos] == " ":
newNumber = "9"
else:
newNumber = str(int(self.text[self.currPos]) - 1)
+
self.text = self.text[0:self.currPos] + newNumber + self.text[self.currPos + 1:]
self.update()
+ def delete(self):
+ self.text = self.text[:self.currPos] + self.text[self.currPos + 1:]
+ self.update()
+
def number(self, number):
if self.type == self.TEXT:
newChar = self.numericalTextInput.getKey(number)
if self.type == self.PIN or self.type == self.NUMBER:
self.right()
self.update()
-
- def show(self):
- self.instance.show()
-
- def hide(self):
- self.instance.hide()
\ No newline at end of file