aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/GUIComponent.py
blob: 1476ba8393b02f0f6ae2da89916df7cff74acb96 (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
import skin

from enigma import ePoint

class GUIComponent:
	""" GUI component """
	
	SHOWN = 0
	HIDDEN = 1
	
	def __init__(self):
		self.state = self.SHOWN
		self.instance = None
	
	def execBegin(self):
		pass
	
	def execEnd(self):
		pass
	
	# this works only with normal widgets - if you don't have self.instance, override this.
	def applySkin(self, desktop):
		if self.state == self.HIDDEN:
			self.instance.hide()
		skin.applyAllAttributes(self.instance, desktop, self.skinAttributes)

	def move(self, x, y):
		self.instance.move(ePoint(int(x), int(y)))

	def show(self):
		self.state = self.SHOWN
		if self.instance is not None:
			self.instance.show()

	def hide(self):
		self.state = self.HIDDEN
		if self.instance is not None:
			self.instance.hide()