3 from enigma import ePoint
5 class GUIComponent(object):
11 self.skinAttributes = None
28 # this works only with normal widgets - if you don't have self.instance, override this.
29 def applySkin(self, desktop):
33 if self.skinAttributes is None:
36 skin.applyAllAttributes(self.instance, desktop, self.skinAttributes)
39 def move(self, x, y = None):
40 # we assume, that x is already an ePoint
44 self.instance.move(ePoint(int(x), int(y)))
46 def resize(self, size):
47 self.instance.resize(size)
49 def setZPosition(self, z):
50 self.instance.setZPosition(z)
54 if self.instance is not None:
59 if self.instance is not None:
65 def setVisible(self, visible):
71 visible = property(getVisible, setVisible)
73 def setPosition(self, x, y):
74 self.instance.move(ePoint(int(x), int(y)))
76 def getPosition(self):
77 p = self.instance.position()
80 position = property(getPosition, setPosition)
82 # default implementation for only one widget per component
83 # feel free to override!
84 def GUIcreate(self, parent):
85 self.instance = self.createWidget(parent)
86 self.postWidgetCreate(self.instance)
89 self.preWidgetRemove(self.instance)
92 # default for argumentless widget constructor
93 def createWidget(self, parent):
94 return self.GUI_WIDGET(parent)
96 def postWidgetCreate(self, instance):
99 def preWidgetRemove(self, instance):