controls/VariablePanel.py
changeset 738 1ccd08cfae0c
parent 731 4e30c1c0922d
child 747 f36838792511
equal deleted inserted replaced
737:85a4bc7dc31e 738:1ccd08cfae0c
   817 
   817 
   818     def AddVariableHighlight(self, infos, highlight_type):
   818     def AddVariableHighlight(self, infos, highlight_type):
   819         if isinstance(infos[0], TupleType):
   819         if isinstance(infos[0], TupleType):
   820             for i in xrange(*infos[0]):
   820             for i in xrange(*infos[0]):
   821                 self.Table.AddHighlight((i,) + infos[1:], highlight_type)
   821                 self.Table.AddHighlight((i,) + infos[1:], highlight_type)
       
   822             cell_visible = infos[0][0]
   822         else:
   823         else:
   823             self.Table.AddHighlight(infos, highlight_type)
   824             self.Table.AddHighlight(infos, highlight_type)
       
   825             cell_visible = infos[0]
       
   826         colnames = [colname.lower() for colname in self.Table.colnames]
       
   827         self.VariablesGrid.MakeCellVisible(cell_visible, colnames.index(infos[1]))
       
   828         self.RefreshHighlightsTimer.Start(int(REFRESH_HIGHLIGHT_PERIOD * 1000), oneShot=True)
       
   829 
       
   830     def RemoveVariableHighlight(self, infos, highlight_type):
       
   831         if isinstance(infos[0], TupleType):
       
   832             for i in xrange(*infos[0]):
       
   833                 self.Table.RemoveHighlight((i,) + infos[1:], highlight_type)
       
   834         else:
       
   835             self.Table.RemoveHighlight(infos, highlight_type)
   824         self.RefreshHighlightsTimer.Start(int(REFRESH_HIGHLIGHT_PERIOD * 1000), oneShot=True)
   836         self.RefreshHighlightsTimer.Start(int(REFRESH_HIGHLIGHT_PERIOD * 1000), oneShot=True)
   825 
   837 
   826     def ClearHighlights(self, highlight_type=None):
   838     def ClearHighlights(self, highlight_type=None):
   827         self.Table.ClearHighlights(highlight_type)
   839         self.Table.ClearHighlights(highlight_type)
   828         self.Table.ResetView(self.VariablesGrid)
   840         self.Table.ResetView(self.VariablesGrid)