self["text"] = Label(title)
self.list = []
if keys is None:
- self.keys = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ] + (len(list) - 10) * [""]
+ self.keys = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "red", "green", "yellow", "blue" ] + (len(list) - 10) * [""]
else:
self.keys = keys
pos += 1
self["list"] = ChoiceList(self.list)
- self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
+ self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions"],
{
"ok": self.go,
"back": self.cancel,
"7": self.keyNumberGlobal,
"8": self.keyNumberGlobal,
"9": self.keyNumberGlobal,
- "0": self.keyNumberGlobal
+ "0": self.keyNumberGlobal,
+ "red": self.keyRed,
+ "green": self.keyGreen,
+ "yellow": self.keyYellow,
+ "blue": self.keyBlue
}, -1)
def keyLeft(self):
def go(self):
self.close(self["list"].l.getCurrentSelection()[0])
#self.close(self["input"].getText())
-
+
+ def keyRed(self):
+ if self.keymap.has_key("red"):
+ self.close(self.keymap["red"])
+
+ def keyGreen(self):
+ if self.keymap.has_key("green"):
+ self.close(self.keymap["green"])
+
+ def keyYellow(self):
+ if self.keymap.has_key("yellow"):
+ self.close(self.keymap["yellow"])
+
+ def keyBlue(self):
+ if self.keymap.has_key("blue"):
+ self.close(self.keymap["blue"])
+
def cancel(self):
self.close(None)
\ No newline at end of file