aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Label.py
blob: 5ad071abbfcdb2843548836751c2ce0ccac95972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from HTMLComponent import *
from GUIComponent import *
from VariableText import *

from ConditionalWidget import *

from enigma import eLabel

class Label(HTMLComponent, GUIComponent, VariableText):
	def __init__(self, text=""):
		GUIComponent.__init__(self)
		VariableText.__init__(self)
		self.setText(text)
	
# html:	
	def produceHTML(self):
		return self.getText()

# GUI:
	def createWidget(self, parent):
		return eLabel(parent)
	
	def getSize(self):
		s = self.instance.calculateSize()
		return (s.width(), s.height())

class LabelConditional(Label, ConditionalWidget):
	def __init__(self, text = "", withTimer = True):
		ConditionalWidget.__init__(self, withTimer = withTimer)
		Label.__init__(self, text = text)
		
class BlinkingLabel(Label, BlinkingWidget):
	def __init__(self, text = ""):
		Label.__init__(text = text)
		BlinkingWidget.__init__()

	def GUIcreate(self, parent):
		LabelConditional.GUIcreate(self, parent)
	
	def GUIdelete(self):
		LabelConditional.GUIcreate(self)
		
class BlinkingLabelConditional(BlinkingWidgetConditional, LabelConditional):
	def __init__(self, text = ""):
		LabelConditional.__init__(self, text = text)
		BlinkingWidgetConditional.__init__(self)
		
	def GUIcreate(self, parent):
		LabelConditional.GUIcreate(self, parent)
	
	def GUIdelete(self):
		LabelConditional.GUIcreate(self)