1 from Screen import Screen
2 from Components.Pixmap import Pixmap, MovingPixmap
3 from Components.Label import Label
4 from Components.ActionMap import ActionMap
5 from Components.HelpMenuList import HelpMenuList
6 from Screens.Rc import Rc
8 class HelpMenu(Screen, Rc):
9 def __init__(self, session, list):
10 Screen.__init__(self, session)
11 self.onSelChanged = [ ]
12 self["list"] = HelpMenuList(list, self.close)
13 self["list"].onSelChanged.append(self.SelectionChanged)
15 self["long_key"] = Label("")
17 self["actions"] = ActionMap(["WizardActions"],
19 "ok": self["list"].ok,
23 self.onLayoutFinish.append(self.SelectionChanged)
25 def SelectionChanged(self):
26 self.clearSelectedKeys()
27 selection = self["list"].getCurrent()
28 selection = selection[3]
29 #arrow = self["arrowup"]
30 print "selection:", selection
32 if selection and len(selection) > 1 and selection[1] == "SHIFT":
33 self.selectKey("SHIFT")
35 if selection and len(selection) > 1 and selection[1] == "long":
36 self["long_key"].setText(_("Long Keypress"))
38 self["long_key"].setText("")
40 self.selectKey(selection[0])
41 #if selection is None:
43 # arrow.moveTo(selection[1], selection[2], 1)
49 self["helpActions"] = ActionMap( [ "HelpActions" ],
51 "displayHelp": self.showHelp,
55 self.session.openWithCallback(self.callHelpAction, HelpMenu, self.helpList)
57 def callHelpAction(self, *args):
59 (actionmap, context, action) = args
60 actionmap.action(context, action)