--- a/GraphicViewer.py Sun Apr 01 15:51:39 2012 +0200
+++ b/GraphicViewer.py Sun Apr 01 17:08:49 2012 +0200
@@ -117,6 +117,7 @@
self.Canvas.canvas.Bind(wx.EVT_LEFT_UP, self.OnCanvasLeftUp)
self.Canvas.canvas.Bind(wx.EVT_MOTION, self.OnCanvasMotion)
self.Canvas.canvas.Bind(wx.EVT_MOUSEWHEEL, self.OnCanvasMouseWheel)
+ self.Canvas.canvas.Bind(wx.EVT_SIZE, self.OnCanvasResize)
self.staticbox1 = wx.StaticText(id=ID_GRAPHICVIEWERSTATICTEXT1,
label=_('Range:'), name='staticText1', parent=self.Editor,
@@ -191,7 +192,7 @@
self.YCenter = 0
self.CurrentZoom = 1
self.Fixed = False
- self.Ticktime = 0#self.DataProducer.GetTicktime()
+ self.Ticktime = self.DataProducer.GetTicktime()
self.RefreshCanvasRange()
for zoom_txt, zoom in ZOOM_VALUES:
@@ -310,7 +311,6 @@
return self.InstancePath == tagname
def NewValue(self, tick, value, forced=False):
- print tick, value
self.Datas.append((float(tick), {True:1., False:0.}.get(value, float(value))))
if self.MinValue is None:
self.MinValue = value
@@ -447,6 +447,11 @@
wx.CallAfter(self.NewDataAvailable, True)
event.Skip()
+ def OnCanvasResize(self, event):
+ self.ResetLastCursor()
+ wx.CallAfter(self.RefreshCursor)
+ event.Skip()
+
## Reset the last cursor
def ResetLastCursor(self):
self.LastCursor = None