1 from MenuList import MenuList
2 from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename
3 from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont
4 from Tools.LoadPixmap import LoadPixmap
7 def ChoiceEntryComponent(key = "", text = ["--"]):
10 x, y, w, h = skin.parameters.get("ChoicelistDash",(0, 0, 800, 25))
11 res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, "-"*200))
13 x, y, w, h = skin.parameters.get("ChoicelistName",(45, 0, 800, 25))
14 res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, text[0]))
16 png = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/key_" + key + ".png"))
18 x, y, w, h = skin.parameters.get("ChoicelistIcon",(5, 0, 35, 25))
19 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, x, y, w, h, png))
23 class ChoiceList(MenuList):
24 def __init__(self, list, selection = 0, enableWrapAround=False):
25 MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
26 font = skin.fonts.get("ChoiceList", ("Regular", 20, 25))
27 self.l.setFont(0, gFont(font[0], font[1]))
28 self.l.setItemHeight(font[2])
29 self.selection = selection
31 def postWidgetCreate(self, instance):
32 MenuList.postWidgetCreate(self, instance)
33 self.moveToIndex(self.selection)