def __moveHandler(self, offset): self.__addLoupe() event = player.getCurrentEvent() eventPos = self.getRelPos(event.pos) if ((-1 <= eventPos[0] <= self.size[0]) and (0 <= eventPos[1] <= self.size[1])): self.__updateCursorPosition(event) else: self.__upHandler(None)
def __moveHandler(self, offset): self.__addLoupe() event = player.getCurrentEvent() eventPos = self.getRelPos(event.pos) if (-1 <= eventPos[0] <= self.size[0]) and (0 <= eventPos[1] <= self.size[1]): self.__updateCursorPosition(event) else: self.__upHandler(None)
def onDown(event): self.assert_(event.type == avg.Event.CURSOR_DOWN) curEvent = player.getCurrentEvent() self.assert_(curEvent.type == avg.Event.CURSOR_DOWN) self.assert_(curEvent.when == event.when) self.downCalled = True
def __detectedHandler(self): event = player.getCurrentEvent() self.__updateCursorPosition(event) self.__timerID = player.setTimeout(1000, self.__addLoupe)
def onMotion(offset): ui.DragRecognizer(self.image, detectedHandler=onDragStart, moveHandler=onDrag, initialEvent=player.getCurrentEvent()) self.image.unsubscribe(avg.Node.CURSOR_MOTION, onMotion)