finish language-menu - the RT_VALIGN_CENTER doesn't work in eListboxPythonMultiConten...
[enigma2.git] / lib / python / Components / LanguageList.py
1 from HTMLComponent import *
2 from GUIComponent import *
3
4 from MenuList import MenuList
5
6 from enigma import *
7
8 RT_HALIGN_LEFT = 0
9 RT_HALIGN_RIGHT = 1
10 RT_HALIGN_CENTER = 2
11 RT_HALIGN_BLOCK = 4
12
13 RT_VALIGN_TOP = 0
14 RT_VALIGN_CENTER = 8
15 RT_VALIGN_BOTTOM = 16
16
17 def LanguageEntryComponent(file, name):
18         res = [ None ]
19         res.append((70, 0, 400, 30, 0, RT_HALIGN_LEFT, name))
20         png = loadPNG("/usr/share/enigma2/countries/" + file + ".png")
21         if png == None:
22                 png = loadPNG("/usr/share/enigma2/countries/missing.png")
23         res.append((0, 5, 60, 40, png))
24         
25         return res
26
27
28 class LanguageList(HTMLComponent, GUIComponent, MenuList):
29         def __init__(self, list):
30                 GUIComponent.__init__(self)
31                 self.l = eListboxPythonMultiContent()
32                 self.list = list
33                 self.l.setList(list)
34                 self.l.setFont(0, gFont("Arial", 25))
35         
36         def GUIcreate(self, parent):
37                 self.instance = eListbox(parent)
38                 self.instance.setContent(self.l)
39                 self.instance.setItemHeight(50)
40