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:
@@ -63,16 +63,17 @@ class DoodlePad(wx.Window):
|
|||||||
|
|
||||||
|
|
||||||
def OnLeftUp(self, event):
|
def OnLeftUp(self, event):
|
||||||
self.lines.append(self.curLine)
|
if self.HasCapture():
|
||||||
self.curLine = []
|
self.lines.append(self.curLine)
|
||||||
self.ReleaseMouse()
|
self.curLine = []
|
||||||
|
self.ReleaseMouse()
|
||||||
|
|
||||||
def OnRightUp(self, event):
|
def OnRightUp(self, event):
|
||||||
self.lines = []
|
self.lines = []
|
||||||
self.Refresh()
|
self.Refresh()
|
||||||
|
|
||||||
def OnMotion(self, event):
|
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 = wx.ClientDC(self)
|
||||||
dc.BeginDrawing()
|
dc.BeginDrawing()
|
||||||
dc.SetPen(wx.Pen(wx.BLUE, 3))
|
dc.SetPen(wx.Pen(wx.BLUE, 3))
|
||||||
|
Reference in New Issue
Block a user