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()
29 selection = selection[3]
30 #arrow = self["arrowup"]
31 print "selection:", selection
34 if selection and len(selection) > 1:
35 if selection[1] == "SHIFT":
36 self.selectKey("SHIFT")
37 elif selection[1] == "long":
38 longText = _("Long Keypress")
39 self["long_key"].setText(longText)
41 self.selectKey(selection[0])
42 #if selection is None:
44 # arrow.moveTo(selection[1], selection[2], 1)
50 self["helpActions"] = ActionMap( [ "HelpActions" ],
52 "displayHelp": self.showHelp,
56 self.session.openWithCallback(self.callHelpAction, HelpMenu, self.helpList)
58 def callHelpAction(self, *args):
60 (actionmap, context, action) = args
61 actionmap.action(context, action)