controls/DebugVariablePanel/DebugVariablePanel.py
changeset 1766 c1e5b9f19483
parent 1745 f9d32913bad4
child 1768 691083b5682a
equal deleted inserted replaced
1765:ccf59c1f0b45 1766:c1e5b9f19483
   239             if text == "1s":
   239             if text == "1s":
   240                 default_range_idx = idx
   240                 default_range_idx = idx
   241         self.CanvasRange.SetSelection(default_range_idx)
   241         self.CanvasRange.SetSelection(default_range_idx)
   242 
   242 
   243         for name, bitmap, help in [
   243         for name, bitmap, help in [
   244             ("CurrentButton", "current", _("Go to current value")),
   244                 ("CurrentButton",     "current",      _("Go to current value")),
   245             ("ExportGraphButton", "export_graph", _("Export graph values to clipboard"))]:
   245                 ("ExportGraphButton", "export_graph", _("Export graph values to clipboard"))]:
   246             button = wx.lib.buttons.GenBitmapButton(self,
   246             button = wx.lib.buttons.GenBitmapButton(self,
   247                   bitmap=GetBitmap(bitmap),
   247                   bitmap=GetBitmap(bitmap),
   248                   size=wx.Size(28, 28), style=wx.NO_BORDER)
   248                   size=wx.Size(28, 28), style=wx.NO_BORDER)
   249             button.SetToolTipString(help)
   249             button.SetToolTipString(help)
   250             setattr(self, name, button)
   250             setattr(self, name, button)
   438     def RefreshHighlight(self, x_mouse, y_mouse):
   438     def RefreshHighlight(self, x_mouse, y_mouse):
   439         for idx, panel in enumerate(self.GraphicPanels):
   439         for idx, panel in enumerate(self.GraphicPanels):
   440             x, y = panel.GetPosition()
   440             x, y = panel.GetPosition()
   441             width, height = panel.GetSize()
   441             width, height = panel.GetSize()
   442             rect = wx.Rect(x, y, width, height)
   442             rect = wx.Rect(x, y, width, height)
   443             if (rect.InsideXY(x_mouse, y_mouse) or
   443             if rect.InsideXY(x_mouse, y_mouse) or \
   444                 idx == 0 and y_mouse < 0 or
   444                idx == 0 and y_mouse < 0 or \
   445                 idx == len(self.GraphicPanels) - 1 and y_mouse > panel.GetPosition()[1]):
   445                idx == len(self.GraphicPanels) - 1 and y_mouse > panel.GetPosition()[1]:
   446                 panel.RefreshHighlight(x_mouse - x, y_mouse - y)
   446                 panel.RefreshHighlight(x_mouse - x, y_mouse - y)
   447             else:
   447             else:
   448                 panel.SetHighlight(HIGHLIGHT_NONE)
   448                 panel.SetHighlight(HIGHLIGHT_NONE)
   449         if wx.Platform == "__WXMSW__":
   449         if wx.Platform == "__WXMSW__":
   450             self.RefreshView()
   450             self.RefreshView()
   945 
   945 
   946     def OnGraphicsWindowResize(self, event):
   946     def OnGraphicsWindowResize(self, event):
   947         size = self.GetSize()
   947         size = self.GetSize()
   948         for panel in self.GraphicPanels:
   948         for panel in self.GraphicPanels:
   949             panel_size = panel.GetSize()
   949             panel_size = panel.GetSize()
   950             if (isinstance(panel, DebugVariableGraphicViewer) and
   950             if isinstance(panel, DebugVariableGraphicViewer) and \
   951                 panel.GraphType == GRAPH_ORTHOGONAL and
   951                panel.GraphType == GRAPH_ORTHOGONAL and \
   952                 panel_size.width == panel_size.height):
   952                panel_size.width == panel_size.height:
   953                 panel.SetCanvasHeight(size.width)
   953                 panel.SetCanvasHeight(size.width)
   954         self.RefreshGraphicsWindowScrollbars()
   954         self.RefreshGraphicsWindowScrollbars()
   955         self.GraphicsSizer.Layout()
   955         self.GraphicsSizer.Layout()
   956         event.Skip()
   956         event.Skip()
   957 
   957