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()
36 selection = selection and selection[3]
37 arrow = self["arrowup"]
38 sh_arrow = self["sh_arrowup"]
40 if selection and selection[0][:3] == "sh_":
45 if selection and selection[0][:2] == "l_":
46 self["long_key"].setText(_("Long Keypress"))
48 self["long_key"].setText("")
53 arrow.moveTo(selection[1], selection[2], 1)
59 self["helpActions"] = ActionMap( [ "HelpActions" ],
61 "displayHelp": self.showHelp,
65 self.session.openWithCallback(self.callHelpAction, HelpMenu, self.helpList)
67 def callHelpAction(self, *args):
69 (actionmap, context, action) = args
70 actionmap.action(context, action)