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 self.onLayoutFinish.append(self.SelectionChanged)
28 def SelectionChanged(self):
29 selection = self["list"].getCurrent()
30 selection = selection and selection[3]
31 arrow = self["arrowup"]
32 sh_arrow = self["sh_arrowup"]
34 if selection and selection[0][:3] == "sh_":
39 if selection and selection[0][:2] == "l_":
40 self["long_key"].setText(_("Long Keypress"))
42 self["long_key"].setText("")
47 arrow.moveTo(selection[1], selection[2], 1)
53 self["helpActions"] = ActionMap( [ "HelpActions" ],
55 "displayHelp": self.showHelp,
59 self.session.openWithCallback(self.callHelpAction, HelpMenu, self.helpList)
61 def callHelpAction(self, *args):
63 (actionmap, context, action) = args
64 actionmap.action(context, action)