1 # -*- coding: UTF-8 -*-
2 # for localized messages
6 from Components.MenuList import MenuList
7 from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
9 from skin import parseColor, parseFont
11 class AutoTimerList(MenuList):
12 """Defines a simple Component to show Timer name"""
14 def __init__(self, entries):
15 MenuList.__init__(self, entries, False, content = eListboxPythonMultiContent)
17 self.l.setFont(0, gFont("Regular", 22))
18 self.l.setBuildFunc(self.buildListboxEntry)
19 self.l.setItemHeight(25)
20 self.colorDisabled = 12368828
22 def applySkin(self, desktop, parent):
24 if self.skinAttributes is not None:
25 for (attrib, value) in self.skinAttributes:
27 self.l.setFont(0, parseFont(value, ((1,1),(1,1))))
28 elif attrib == "itemHeight":
29 self.l.setItemHeight(int(value))
30 elif attrib == "colorDisabled":
31 self.colorDisabled = int(parseColor(value))
33 attribs.append((attrib, value))
34 self.skinAttributes = attribs
35 return MenuList.applySkin(self, desktop, parent)
38 # | <Name of AutoTimer> |
40 def buildListboxEntry(self, timer):
41 size = self.l.getItemSize()
45 color = self.colorDisabled
49 (eListboxPythonMultiContent.TYPE_TEXT, 5, 0, size.width() - 5, size.height(), 0, RT_HALIGN_LEFT, timer.name, color, color)
53 cur = self.l.getCurrentSelection()
56 def moveToEntry(self, entry):
63 self.instance.moveSelectionTo(idx)