diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-07 15:11:02 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-07 15:11:02 +0000 |
| commit | a94f85f169ef00d552d3fa4e2706fd8ccbf4c708 (patch) | |
| tree | 7d0818b69577480eee1374be94d91f7321017543 /lib/python/Components | |
| parent | 6bc9f7451c182bc2044e90cf317231d1d3927ee4 (diff) | |
| download | enigma2-a94f85f169ef00d552d3fa4e2706fd8ccbf4c708.tar.gz enigma2-a94f85f169ef00d552d3fa4e2706fd8ccbf4c708.zip | |
introduce the movingPixmap and use it to position the arrow in the start-wizard (but with some redrawing-problems :))
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Pixmap.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/python/Components/Pixmap.py b/lib/python/Components/Pixmap.py index 5f4b9691..fc7bfe27 100644 --- a/lib/python/Components/Pixmap.py +++ b/lib/python/Components/Pixmap.py @@ -25,3 +25,36 @@ class PixmapConditional(ConditionalWidget, Pixmap): ConditionalWidget.__init__(self) Pixmap.__init__(self) +class MovingPixmap(Pixmap): + def __init__(self): + Pixmap.__init__(self) + + self.moving = False + + # TODO: get real values + self.x = 0.0 + self.y = 0.0 + + self.moveTimer = eTimer() + self.moveTimer.timeout.get().append(self.doMove) + + def moveTo(self, x, y, time = 20): + self.time = time + self.destX = x + self.destY = y + self.stepX = (self.destX - self.x) / float(time) + self.stepY = (self.destY - self.y) / float(time) + + def startMoving(self): + if not self.moving: + self.moving = True + self.moveTimer.start(10) + + def doMove(self): + self.x += self.stepX + self.y += self.stepY + self.time -= 1 + self.move(int(self.x), int(self.y)) + if (self.time == 0): + self.moveTimer.stop() + self.moving = False
\ No newline at end of file |
