Toss in a few Refresh() calls to make this sample work better on wxMac

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-05-13 02:19:08 +00:00
parent 991dc050e0
commit a6b501a057

View File

@@ -211,7 +211,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
if shape.Selected(): if shape.Selected():
shape.Select(False, dc) shape.Select(False, dc)
canvas.Redraw(dc) #canvas.Redraw(dc)
canvas.Refresh(False)
else: else:
redraw = False redraw = False
shapeList = canvas.GetDiagram().GetShapeList() shapeList = canvas.GetDiagram().GetShapeList()
@@ -230,7 +231,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
for s in toUnselect: for s in toUnselect:
s.Select(False, dc) s.Select(False, dc)
canvas.Redraw(dc) ##canvas.Redraw(dc)
canvas.Refresh(False)
self.UpdateStatusBar(shape) self.UpdateStatusBar(shape)
@@ -251,9 +253,11 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
def OnMovePost(self, dc, x, y, oldX, oldY, display): def OnMovePost(self, dc, x, y, oldX, oldY, display):
shape = self.GetShape()
ogl.ShapeEvtHandler.OnMovePost(self, dc, x, y, oldX, oldY, display) ogl.ShapeEvtHandler.OnMovePost(self, dc, x, y, oldX, oldY, display)
self.UpdateStatusBar(self.GetShape()) self.UpdateStatusBar(shape)
if "wxMac" in wx.PlatformInfo:
shape.GetCanvas().Refresh(False)
def OnRightClick(self, *dontcare): def OnRightClick(self, *dontcare):
self.log.WriteText("%s\n" % self.GetShape()) self.log.WriteText("%s\n" % self.GetShape())
@@ -334,8 +338,8 @@ class TestWindow(ogl.ShapeCanvas):
s.SetBitmap(bmp) s.SetBitmap(bmp)
self.MyAddShape(s, 225, 130, None, None, "Bitmap") self.MyAddShape(s, 225, 130, None, None, "Bitmap")
dc = wx.ClientDC(self) #dc = wx.ClientDC(self)
self.PrepareDC(dc) #self.PrepareDC(dc)
for x in range(len(self.shapes)): for x in range(len(self.shapes)):
fromShape = self.shapes[x] fromShape = self.shapes[x]