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
7 class HelpMenu(Screen):
8 def __init__(self, session, list):
9 Screen.__init__(self, session)
10 self.onSelChanged = [ ]
11 self["list"] = HelpMenuList(list, self.close)
12 self["list"].onSelChanged.append(self.SelectionChanged)
14 self["arrowup"] = MovingPixmap()
15 self["arrowup"].hide()
16 self["sh_arrowup"] = Pixmap()
17 self["sh_arrowup"].hide()
18 self["long_key"] = Label("")
20 self["actions"] = ActionMap(["WizardActions"],
22 "ok": self["list"].ok,
26 def SelectionChanged(self):
27 selection = self["list"].getCurrent()
28 selection = selection and selection[3]
29 arrow = self["arrowup"]
30 sh_arrow = self["sh_arrowup"]
32 if selection and selection[0][:3] == "sh_":
37 if selection and selection[0][:2] == "l_":
38 self["long_key"].setText(_("Long Keypress"))
40 self["long_key"].setText("")
45 arrow.moveTo(selection[1], selection[2], 1)
51 self["helpActions"] = ActionMap( [ "HelpActions" ],
53 "displayHelp": self.showHelp,
57 self.session.openWithCallback(self.callHelpAction, HelpMenu, self.helpList)
59 def callHelpAction(self, *args):
61 (actionmap, context, action) = args
62 actionmap.action(context, action)