]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/CustomDragAndDrop.py
Updated DrawPolyPolygon note
[wxWidgets.git] / wxPython / demo / CustomDragAndDrop.py
index 13a78426bbc16b1eaa69de2d303e7d86411f15d7..b1c1e5a890df6ed0d8f03631091ca00584cdf8a9 100644 (file)
@@ -1,11 +1,3 @@
-# 11/5/2003 - Modified by grimmtooth@softhome.net (Jeff Grimmett)
-# 
-# o Updated for wx namespace
-#
-# 11/24/2003 - Modified by grimmtooth@softhome.net (Jeff Grimmett)
-# 
-# o Issues around line 167. I'm stuck.
-#
 
 import  cPickle
 import  wx
@@ -63,16 +55,17 @@ class DoodlePad(wx.Window):
 
 
     def OnLeftUp(self, event):
-        self.lines.append(self.curLine)
-        self.curLine = []
-        self.ReleaseMouse()
+        if self.HasCapture():
+            self.lines.append(self.curLine)
+            self.curLine = []
+            self.ReleaseMouse()
 
     def OnRightUp(self, event):
         self.lines = []
         self.Refresh()
 
     def OnMotion(self, event):
-        if event.Dragging() and not self.mode == "Drag":
+        if self.HasCapture() and event.Dragging() and not self.mode == "Drag":
             dc = wx.ClientDC(self)
             dc.BeginDrawing()
             dc.SetPen(wx.Pen(wx.BLUE, 3))