2 from Screens.Screen import Screen
3 from Screens.MessageBox import MessageBox
4 from Components.ActionMap import NumberActionMap
5 from Components.Label import Label
6 from Components.Input import Input
7 from Components.GUIComponent import *
11 class InputBox(Screen):
12 def __init__(self, session, title = "", **kwargs):
13 Screen.__init__(self, session)
15 self["text"] = Label(title)
16 self["input"] = Input(**kwargs)
18 self["actions"] = NumberActionMap(["WizardActions", "InputBoxActions"],
23 "right": self.keyRight,
24 "delete": self.keyDelete,
25 "1": self.keyNumberGlobal,
26 "2": self.keyNumberGlobal,
27 "3": self.keyNumberGlobal,
28 "4": self.keyNumberGlobal,
29 "5": self.keyNumberGlobal,
30 "6": self.keyNumberGlobal,
31 "7": self.keyNumberGlobal,
32 "8": self.keyNumberGlobal,
33 "9": self.keyNumberGlobal,
34 "0": self.keyNumberGlobal
43 def keyNumberGlobal(self, number):
44 self["input"].number(number)
47 self["input"].delete()
50 self.close(self["input"].getText())