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.MenuList import MenuList
7 from Components.GUIComponent import *
11 class ChoiceBox(Screen):
12 def __init__(self, session, title = "", list = []):
13 Screen.__init__(self, session)
15 self["text"] = Label(title)
17 self["list"] = MenuList(list)
19 self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
23 "1": self.keyNumberGlobal,
24 "2": self.keyNumberGlobal,
25 "3": self.keyNumberGlobal,
26 "4": self.keyNumberGlobal,
27 "5": self.keyNumberGlobal,
28 "6": self.keyNumberGlobal,
29 "7": self.keyNumberGlobal,
30 "8": self.keyNumberGlobal,
31 "9": self.keyNumberGlobal,
32 "0": self.keyNumberGlobal
41 def keyNumberGlobal(self, number):
42 print "pressed", number
43 #self["input"].number(number)
46 self.close(self["list"].l.getCurrentSelection())
47 #self.close(self["input"].getText())