1 from HTMLComponent import *
2 from GUIComponent import *
6 class ServiceList(HTMLComponent, GUIComponent):
12 GUIComponent.__init__(self)
13 self.l = eListboxServiceContent()
16 def setCurrent(self, ref):
17 self.l.setCurrent(ref)
20 r = eServiceReference()
25 self.instance.moveSelection(self.instance.moveUp)
28 self.instance.moveSelection(self.instance.moveDown)
30 def GUIcreate(self, parent):
31 self.instance = eListbox(parent)
32 self.instance.setContent(self.l)
40 def getRootServices(self):
41 serviceHandler = eServiceCenter.getInstance()
42 list = serviceHandler.list(self.root)
48 dest.append(s.toString())
53 def setNumberOffset(self, offset):
54 self.l.setNumberOffset(offset)
56 def setRoot(self, root):
61 # stuff for multiple marks (edit mode / later multiepg)
65 def isMarked(self, ref):
66 return self.l.isMarked(ref)
68 def addMarked(self, ref):
71 def removeMarked(self, ref):
72 self.l.removeMarked(ref)
77 ref = eServiceReference()
79 while i.markedQueryNext(ref) == 0:
80 marked.append(ref.toString())
81 ref = eServiceReference()
84 #just for movemode.. only one marked entry..
85 def setCurrentMarked(self, state):
86 self.l.setCurrentMarked(state)
88 def setMode(self, mode):
89 if mode == self.MODE_NORMAL:
90 self.instance.setItemHeight(28)
91 self.l.setVisualMode(eListboxServiceContent.visModeSimple)
92 self.l.setElementFont(self.l.celServiceName, gFont("Arial", 22))
93 self.l.setElementPosition(self.l.celServiceName, eRect(0, 0, self.instance.size().width(), 28))
95 self.instance.setItemHeight(28)
96 self.l.setElementFont(self.l.celServiceName, gFont("Arial", 22))
97 self.l.setElementPosition(self.l.celServiceName, eRect(50, 0, self.instance.size().width(), 28))
98 self.l.setElementFont(self.l.celServiceNumber, gFont("Arial", 20))
99 self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 2, 50, 28))
100 self.l.setVisualMode(eListboxServiceContent.visModeComplex)