Fixed tick not refreshed when in DebugVariablePanel when variable in it
authorLaurent Bessard
Wed, 05 Jun 2013 23:34:41 +0200
changeset 1227 01e86190f8c7
parent 1226 93e7a8abce5e
child 1228 b1be490594af
Fixed tick not refreshed when in DebugVariablePanel when variable in it
controls/DebugVariablePanel/DebugVariableGraphicPanel.py
controls/DebugVariablePanel/DebugVariableGraphicViewer.py
--- a/controls/DebugVariablePanel/DebugVariableGraphicPanel.py	Wed Jun 05 23:29:37 2013 +0200
+++ b/controls/DebugVariablePanel/DebugVariableGraphicPanel.py	Wed Jun 05 23:34:41 2013 +0200
@@ -161,7 +161,10 @@
         Show error message in Error Dialog
         @param message: Error message to display
         """
-        dialog = wx.MessageDialog(self.ParentWindow, message, _("Error"), wx.OK|wx.ICON_ERROR)
+        dialog = wx.MessageDialog(self.ParentWindow, 
+                                  message, 
+                                  _("Error"), 
+                                  wx.OK|wx.ICON_ERROR)
         dialog.ShowModal()
         dialog.Destroy()
 
@@ -337,6 +340,7 @@
         """
         # If tick given
         if tick is not None:
+            self.HasNewData = True
             
             # Save tick as start tick for range if data is still empty
             if len(self.Ticks) == 0:
@@ -365,6 +369,11 @@
         wx.CallAfter(self.NewDataAvailable, None, True)
     
     def SetCursorTick(self, cursor_tick):
+        """
+        Set Cursor for displaying values of items at a tick given
+        @param cursor_tick: Tick of cursor
+        """
+        # Save cursor tick
         self.CursorTick = cursor_tick
         self.Fixed = cursor_tick is not None
         self.UpdateCursorTick() 
@@ -389,6 +398,7 @@
             
     def ResetCursorTick(self):
         self.CursorTick = None
+        self.Fixed = False
         self.UpdateCursorTick()
     
     def UpdateCursorTick(self):
@@ -649,7 +659,6 @@
     def OnCurrentButton(self, event):
         if len(self.Ticks) > 0:
             self.StartTick = max(self.Ticks[0], self.Ticks[-1] - self.CurrentRange)
-            self.Fixed = False
             self.ResetCursorTick()
         event.Skip()
     
@@ -880,6 +889,9 @@
                     self.GraphicPanels.remove(source_panel)
                     self.ResetVariableNameMask()
                     self.RefreshGraphicsSizer()
+            if len(self.GraphicPanels) == 0:
+                self.Fixed = False
+                self.ResetCursorTick()
             self.ForceRefresh()
     
     def ToggleViewerType(self, panel):
@@ -901,7 +913,6 @@
     def ResetGraphicsValues(self):
         self.Ticks = numpy.array([])
         self.StartTick = 0
-        self.Fixed = False
         for panel in self.GraphicPanels:
             panel.ResetItemsData()
         self.ResetCursorTick()
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Wed Jun 05 23:29:37 2013 +0200
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Wed Jun 05 23:34:41 2013 +0200
@@ -181,7 +181,10 @@
         Show error message in Error Dialog
         @param message: Error message to display
         """
-        dialog = wx.MessageDialog(self.ParentWindow, message, _("Error"), wx.OK|wx.ICON_ERROR)
+        dialog = wx.MessageDialog(self.ParentWindow, 
+                                  message, 
+                                  _("Error"), 
+                                  wx.OK|wx.ICON_ERROR)
         dialog.ShowModal()
         dialog.Destroy()