X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0dfb2393ddd200cb698351dbd44590898590d8c1..05e00ac5ef410707da86d98786cbb268100a7337:/wxPython/demo/CustomDragAndDrop.py diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index 13a78426bb..ff22fb18b0 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -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,20 +55,21 @@ 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)) - coords = ((self.x, self.y), event.GetPositionTuple()) + coords = (self.x, self.y) + event.GetPositionTuple() self.curLine.append(coords) dc.DrawLine(*coords) self.x, self.y = event.GetPositionTuple()