nicer
[enigma2.git] / lib / python / Components / PluginList.py
1 from HTMLComponent import *
2 from GUIComponent import *
3
4 from MenuList import MenuList
5
6 from Tools.Directories import *
7
8 from enigma import *
9
10 RT_HALIGN_LEFT = 0
11 RT_HALIGN_RIGHT = 1
12 RT_HALIGN_CENTER = 2
13 RT_HALIGN_BLOCK = 4
14
15 RT_VALIGN_TOP = 0
16 RT_VALIGN_CENTER = 8
17 RT_VALIGN_BOTTOM = 16
18
19 def PluginEntryComponent(picture, name):
20         res = [ None ]
21         res.append((eListboxPythonMultiContent.TYPE_TEXT, 80, 10, 200, 50, 0, RT_HALIGN_LEFT , name))
22         png = loadPNG(picture)
23         if png == None:
24                 png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "/plugin.png"))
25         res.append((eListboxPythonMultiContent.TYPE_PIXMAP, 10, 5, 60, 40, png))
26         
27         return res
28
29
30 class PluginList(HTMLComponent, GUIComponent, MenuList):
31         def __init__(self, list):
32                 GUIComponent.__init__(self)
33                 self.l = eListboxPythonMultiContent()
34                 self.list = list
35                 self.l.setList(list)
36                 self.l.setFont(0, gFont("Regular", 20))
37                 self.l.setFont(1, gFont("Regular", 10))
38         
39         def GUIcreate(self, parent):
40                 self.instance = eListbox(parent)
41                 self.instance.setContent(self.l)
42                 self.instance.setItemHeight(50)