mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Check for existing mouse capture before doing a capture/release
This commit is contained in:
@@ -324,12 +324,14 @@ class GridColMover(wx.EvtHandler):
|
||||
colImg = self._CaptureImage(rect)
|
||||
self.colWin = ColDragWindow(self.grid,colImg,col)
|
||||
self.colWin.Show(False)
|
||||
self.lwin.CaptureMouse()
|
||||
if wx.Window.GetCapture() is not None:
|
||||
self.lwin.CaptureMouse()
|
||||
evt.Skip()
|
||||
|
||||
def OnRelease(self,evt):
|
||||
if self.isDragging:
|
||||
self.lwin.ReleaseMouse()
|
||||
if self.lwin.HasCapture():
|
||||
self.lwin.ReleaseMouse()
|
||||
self.colWin.Show(False)
|
||||
self.isDragging = False
|
||||
|
||||
@@ -465,12 +467,14 @@ class GridRowMover(wx.EvtHandler):
|
||||
rowImg = self._CaptureImage(rect)
|
||||
self.rowWin = RowDragWindow(self.grid,rowImg,row)
|
||||
self.rowWin.Show(False)
|
||||
self.lwin.CaptureMouse()
|
||||
if wx.Window.GetCapture() is not None:
|
||||
self.lwin.CaptureMouse()
|
||||
evt.Skip()
|
||||
|
||||
def OnRelease(self,evt):
|
||||
if self.isDragging:
|
||||
self.lwin.ReleaseMouse()
|
||||
if self.lwin.HasCapture():
|
||||
self.lwin.ReleaseMouse()
|
||||
self.rowWin.Show(False)
|
||||
self.isDragging = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user