parameters: (self)
docstring: Auxiliary method used to bind a ``wx.EVT_MOTION`` event to :class:`XLSGrid`.
docstring_summary: Auxiliary method used to bind a ``wx.EVT_MOTION`` event to :class:`XLSGrid`.
docstring_tokens: Auxiliary method used to bind a wx . EVT_MOTION event to : class : XLSGrid .
function: def InstallGridHint(self):
          """
          Auxiliary method used to bind a ``wx.EVT_MOTION`` event to :class:`XLSGrid`.
          """
  
          self.prev_rowcol = [None, None]
  
          def OnMouseMotion(event):
              """
              Handles a the ``wx.EVT_MOTION`` events for :class:`XLSGrid`.
  
              :param `event`: a :class:`MouseEvent` event to be processed.
              """
              
              # evt.GetRow() and evt.GetCol() would be nice to have here,
              # but as this is a mouse event, not a grid event, they are not
              # available and we need to compute them by hand.
              position = event.GetPosition()
              x, y = self.CalcUnscrolledPosition(position)
              row = self.YToRow(y)
              col = self.XToCol(x)
  
              if [row, col] != self.prev_rowcol and row >= 0 and col >= 0:
  
                  self.prev_rowcol[:] = [row, col]
                  self.DestroyTip()
                  cell = self.cells[(row, col)]
                  rect = self.CellToRect(row, col) 
                  comment = cell.GetComment()
  
                  window = self.GetGridWindow()
                  if cell.text.IsHyperLink():
                      window.SetCursor(wx.StockCursor(wx.CURSOR_HAND))
                      window.SetToolTipString(cell.text.tooltip)
                      self.tip_shown = True
                      if not comment:
                          return
              
                  if comment:
                      self.tip_window = TransientPopup(window, comment, wx.GetMousePosition())
                      event.Skip()
                  
          self.GetGridWindow().Bind(wx.EVT_MOTION, OnMouseMotion)
function_tokens: def InstallGridHint ( self ) : self . prev_rowcol = [ None , None ] def OnMouseMotion ( event ) : """
              Handles a the ``wx.EVT_MOTION`` events for :class:`XLSGrid`.
  
              :param `event`: a :class:`MouseEvent` event to be processed.
              """ # evt.GetRow() and evt.GetCol() would be nice to have here, # but as this is a mouse event, not a grid event, they are not # available and we need to compute them by hand. position = event . GetPosition ( ) x , y = self . CalcUnscrolledPosition ( position ) row = self . YToRow ( y ) col = self . XToCol ( x ) if [ row , col ] != self . prev_rowcol and row >= 0 and col >= 0 : self . prev_rowcol [ : ] = [ row , col ] self . DestroyTip ( ) cell = self . cells [ ( row , col ) ] rect = self . CellToRect ( row , col ) comment = cell . GetComment ( ) window = self . GetGridWindow ( ) if cell . text . IsHyperLink ( ) : window . SetCursor ( wx . StockCursor ( wx . CURSOR_HAND ) ) window . SetToolTipString ( cell . text . tooltip ) self . tip_shown = True if not comment : return if comment : self . tip_window = TransientPopup ( window , comment , wx . GetMousePosition ( ) ) event . Skip ( ) self . GetGridWindow ( ) . Bind ( wx . EVT_MOTION , OnMouseMotion )