fix cancel handling
[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, desc = "Plugin"):
20         res = [ None ]
21         res.append((eListboxPythonMultiContent.TYPE_TEXT, 80, 5, 300, 25, 0, RT_HALIGN_LEFT , name))
22         res.append((eListboxPythonMultiContent.TYPE_TEXT, 80, 26, 300, 17, 1, RT_HALIGN_LEFT , desc))
23         png = loadPNG(picture)
24         if png == None:
25                 png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "/plugin.png"))
26         res.append((eListboxPythonMultiContent.TYPE_PIXMAP, 10, 5, 60, 40, png))
27         
28         return res
29
30
31 class PluginList(HTMLComponent, GUIComponent, MenuList):
32         def __init__(self, list):
33                 GUIComponent.__init__(self)
34                 self.l = eListboxPythonMultiContent()
35                 self.list = list
36                 self.l.setList(list)
37                 self.l.setFont(0, gFont("Regular", 20))
38                 self.l.setFont(1, gFont("Regular", 14))
39         
40         def GUIcreate(self, parent):
41                 self.instance = eListbox(parent)
42                 self.instance.setContent(self.l)
43                 self.instance.setItemHeight(50)