From: Robin Dunn Date: Tue, 30 Dec 2003 01:48:45 +0000 (+0000) Subject: Ensure we have the capture before releasing it. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f78241f6c031ba1b33ce0c6b300567947248c61b Ensure we have the capture before releasing it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index 13a78426bb..34570e1cf8 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -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))