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
This commit is contained in:
Robin Dunn 2003-12-30 01:48:45 +00:00
parent d147c72424
commit f78241f6c0

View 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))