1 from ConditionalWidget import ConditionalWidget
2 from GUIComponent import GUIComponent
4 from enigma import ePixmap, eTimer
6 class Pixmap(GUIComponent):
9 class PixmapConditional(ConditionalWidget, Pixmap):
10 def __init__(self, withTimer = True):
11 ConditionalWidget.__init__(self)
14 class MovingPixmap(Pixmap):
20 # TODO: get real values
26 self.moveTimer = eTimer()
27 self.moveTimer.timeout.get().append(self.doMove)
29 def clearPath(self, repeated = False):
36 self.repeated = repeated
38 def addMovePoint(self, x, y, time = 20):
39 self.path.append((x, y, time))
41 def moveTo(self, x, y, time = 20):
43 self.addMovePoint(x, y, time)
45 def startMoving(self):
47 self.time = self.path[self.currDest][2]
48 self.stepX = (self.path[self.currDest][0] - self.x) / float(self.time)
49 self.stepY = (self.path[self.currDest][1] - self.y) / float(self.time)
52 self.moveTimer.start(100)
63 self.move(int(self.x), int(self.y))
64 except: # moving not possible... widget not there any more... stop moving
71 if (self.currDest >= len(self.path)): # end of path