Call event.Skip in OnSize
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -98,14 +98,18 @@ else:
|
|||||||
self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp)
|
self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp)
|
||||||
self.Bind(wx.EVT_MOTION, self.OnMouseMotion)
|
self.Bind(wx.EVT_MOTION, self.OnMouseMotion)
|
||||||
|
|
||||||
|
|
||||||
def OnEraseBackground(self, event):
|
def OnEraseBackground(self, event):
|
||||||
pass # Do nothing, to avoid flashing on MSW.
|
pass # Do nothing, to avoid flashing on MSW.
|
||||||
|
|
||||||
|
|
||||||
def OnSize(self, event):
|
def OnSize(self, event):
|
||||||
size = self.GetClientSize()
|
size = self.GetClientSize()
|
||||||
if self.GetContext():
|
if self.GetContext():
|
||||||
self.SetCurrent()
|
self.SetCurrent()
|
||||||
glViewport(0, 0, size.width, size.height)
|
glViewport(0, 0, size.width, size.height)
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
|
||||||
def OnPaint(self, event):
|
def OnPaint(self, event):
|
||||||
dc = wx.PaintDC(self)
|
dc = wx.PaintDC(self)
|
||||||
@@ -115,12 +119,15 @@ else:
|
|||||||
self.init = True
|
self.init = True
|
||||||
self.OnDraw()
|
self.OnDraw()
|
||||||
|
|
||||||
|
|
||||||
def OnMouseDown(self, evt):
|
def OnMouseDown(self, evt):
|
||||||
self.CaptureMouse()
|
self.CaptureMouse()
|
||||||
|
|
||||||
|
|
||||||
def OnMouseUp(self, evt):
|
def OnMouseUp(self, evt):
|
||||||
self.ReleaseMouse()
|
self.ReleaseMouse()
|
||||||
|
|
||||||
|
|
||||||
def OnMouseMotion(self, evt):
|
def OnMouseMotion(self, evt):
|
||||||
if evt.Dragging() and evt.LeftIsDown():
|
if evt.Dragging() and evt.LeftIsDown():
|
||||||
self.x, self.y = self.lastx, self.lasty
|
self.x, self.y = self.lastx, self.lasty
|
||||||
|
Reference in New Issue
Block a user