equal
deleted
inserted
replaced
502 # Method called when a Motion event have been generated |
502 # Method called when a Motion event have been generated |
503 def OnMotion(self, event, dc, scaling): |
503 def OnMotion(self, event, dc, scaling): |
504 # If the cursor is dragging and the element have been clicked |
504 # If the cursor is dragging and the element have been clicked |
505 if event.Dragging() and self.oldPos: |
505 if event.Dragging() and self.oldPos: |
506 # Calculate the movement of cursor |
506 # Calculate the movement of cursor |
507 pos = event.GetLogicalPosition(dc) |
507 pos = GetScaledEventPosition(event, dc, scaling) |
508 movex = pos.x - self.oldPos.x |
508 movex = pos.x - self.oldPos.x |
509 movey = pos.y - self.oldPos.y |
509 movey = pos.y - self.oldPos.y |
510 # If movement is greater than MIN_MOVE then a dragging is initiated |
510 # If movement is greater than MIN_MOVE then a dragging is initiated |
511 if not self.Dragging and (abs(movex) > MIN_MOVE or abs(movey) > MIN_MOVE): |
511 if not self.Dragging and (abs(movex) > MIN_MOVE or abs(movey) > MIN_MOVE): |
512 self.Dragging = True |
512 self.Dragging = True |