1476ba8393b02f0f6ae2da89916df7cff74acb96
[enigma2.git] / lib / python / Components / GUIComponent.py
1 import skin
2
3 from enigma import ePoint
4
5 class GUIComponent:
6         """ GUI component """
7         
8         SHOWN = 0
9         HIDDEN = 1
10         
11         def __init__(self):
12                 self.state = self.SHOWN
13                 self.instance = None
14         
15         def execBegin(self):
16                 pass
17         
18         def execEnd(self):
19                 pass
20         
21         # this works only with normal widgets - if you don't have self.instance, override this.
22         def applySkin(self, desktop):
23                 if self.state == self.HIDDEN:
24                         self.instance.hide()
25                 skin.applyAllAttributes(self.instance, desktop, self.skinAttributes)
26
27         def move(self, x, y):
28                 self.instance.move(ePoint(int(x), int(y)))
29
30         def show(self):
31                 self.state = self.SHOWN
32                 if self.instance is not None:
33                         self.instance.show()
34
35         def hide(self):
36                 self.state = self.HIDDEN
37                 if self.instance is not None:
38                         self.instance.hide()