Пример #1
0
 def onMouseUp(self, widget, e):
     """Respond to the mouse being released"""
     if e.button == 1:
         self.isMouseDown1 = False
         curPt = self.b2c(Point(e.x, e.y))
         self.currentPoints.append(curPt)
         stroke = Stroke( self.currentPoints)
         self.currentPoints = []
         self.addStroke(stroke)
         #self.opQueue.put(partial(GTKGui.addStroke, self, stroke))
         #self.draw()
         return True
     elif e.button == 3:
         self.isMouseDown3 = False
         curPt = self.b2c(Point(e.x, e.y))
         self.currentPoints.append(curPt)
         stroke = Stroke( self.currentPoints)
         self.currentPoints = []
         shouldRedraw = True
         for stk in list(self.strokeList):
             if len(getStrokesIntersection(stroke, stk) ) > 0:
                 self.eraseStroke(stk)
                 shouldRedraw = False
         if shouldRedraw:
             #pass
             self.draw()
         return True
Пример #2
0
 def CanvasRightMouseUp(self, event):
     delStrokes = set([])
     if len(self.CurrentPointList) > 0:
         stroke = Stroke( self.CurrentPointList )#, smoothing=True )
         self.CurrentPointList = []
         for stk in list(self.StrokeList):
             if len(getStrokesIntersection(stroke, stk) ) > 0:
                 logger.debug( "Removing Stroke")
                 self.StrokeList.remove(stk)
     self.p_x = self.p_y = None
     self.Redraw()
Пример #3
0
 def CanvasRightMouseUp(self, event):
     delStrokes = set([])
     if len(self.CurrentPointList) > 0:
         stroke = Stroke( self.CurrentPointList )#, smoothing=True )
         self.CurrentPointList = []
         for stk in list(self.StrokeList):
             if len(getStrokesIntersection(stroke, stk) ) > 0:
                 print "Removing Stroke"
                 self.Board.RemoveStroke(stk)
                 self.StrokeList.remove(stk)
     self.p_x = self.p_y = None
     #print "Redraw from RightMouseUp"
     self.Redraw()
Пример #4
0
 def CanvasRightMouseUp(self, event):
     removed = False
     if len(self.CurrentPointList) > 0:
         stroke = Stroke( self.CurrentPointList )#, smoothing=True )
         self.CurrentPointList = []
         for stk in list(self.StrokeList):
             if len(getStrokesIntersection(stroke, stk) ) > 0:
                 logger.debug( "Removing Stroke")
                 removed = True
                 self.Board.RemoveStroke(stk)
                 self.StrokeList.remove(stk)
     self.p_x = self.p_y = None
     self.Redraw(clear=removed)