]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure we have the capture before releasing it.
authorRobin Dunn <robin@alldunn.com>
Tue, 30 Dec 2003 01:48:45 +0000 (01:48 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 30 Dec 2003 01:48:45 +0000 (01:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/CustomDragAndDrop.py

index 13a78426bbc16b1eaa69de2d303e7d86411f15d7..34570e1cf896722b3b15901c499985384dddbdcc 100644 (file)
@@ -63,16 +63,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))