1 from Screen import Screen
3 from Components.Pixmap import *
4 from Components.Pixmap import Pixmap
5 from Components.Pixmap import MovingPixmap
6 from Components.Label import Label
7 from Components.Slider import Slider
8 from Components.ActionMap import ActionMap
9 from Components.HelpMenuList import HelpMenuList
11 from xml.sax import make_parser
12 from xml.sax.handler import ContentHandler
13 from Components.MenuList import MenuList
15 class HelpMenu(Screen):
16 def __init__(self, session, list):
17 Screen.__init__(self, session)
18 self.onSelChanged = [ ]
19 self["list"] = HelpMenuList(list, self.close)
20 self["list"].onSelChanged.append(self.SelectionChanged)
22 self["arrowup"] = MovingPixmap()
23 self["arrowup"].hide()
24 self["sh_arrowup"] = Pixmap()
25 self["sh_arrowup"].hide()
26 self["long_key"] = Label("")
28 self["actions"] = ActionMap(["WizardActions"],
30 "ok": self["list"].ok,
34 def SelectionChanged(self):
35 selection = self["list"].getCurrent()[3]
36 arrow = self["arrowup"]
37 sh_arrow = self["sh_arrowup"]
39 if selection[0][:3] == "sh_":
44 if selection[0][:2] == "l_":
45 self["long_key"].setText(_("Long Keypress"))
47 self["long_key"].setText("")
52 arrow.moveTo(selection[1], selection[2], 1)
58 self["helpActions"] = ActionMap( [ "HelpActions" ],
60 "displayHelp": self.showHelp,
64 self.session.openWithCallback(self.callHelpAction, HelpMenu, self.helpList)
66 def callHelpAction(self, *args):
68 (actionmap, context, action) = args
69 actionmap.action(context, action)