>LPARAMETERS nButton, nShift, nXCoord, nYCoord >LOCAL loCalledBy AS OBJECT, nWhere_Out, lnRow, ; > lnCol, nView_Out, nr, lnColumn, lcValue, lcTip, lcSource >lcTip = "" >#DEFINE MAX_LEN 10 >AEVENTS[aCurEvent,0] >loCalledBy = aCurEvent[1] && should be a column object >THIS.TOOLTIPTEXT = '' > >IF VARTYPE(m.loCalledBy)= "O" AND NOT EMPTY(m.loCalledBy.CONTROLSOURCE) > lnColumn = m.loCalledBy.COLUMNORDER > lcSource = m.loCalledBy.CONTROLSOURCE > STORE 0 TO nWhere_Out, nRelRow_Out, nRelCol_Out, nView_Out > WITH THIS > .GridHitTest(m.nXCoord, m.nYCoord, @nWhere_Out, @lnRow, @lnCol) > IF m.nWhere_Out = 3 && In a Cell >*!* lnCol = m.lnCol + .LeftColumn - 1 >*!* lnCol = .GetColumnIndex(m.lnCol) > IF .RELATIVEROW # 0 > lnRow = m.lnRow - .RELATIVEROW > IF m.lnRow # 0 > SKIP m.lnRow IN (.RECORDSOURCE) > lcTip = ; > ALLTRIM(TRANSFORM (EVALUATE (m.lcSource))) > SKIP -m.lnRow IN (.RECORDSOURCE) > ELSE > lcTip = ; > ALLTRIM(TRANSFORM (EVALUATE (m.lcSource))) > ENDIF > ELSE > MOUSE CLICK LEFT && Limitation of the current approach > lcTip = ; > ALLTRIM(TRANSFORM (EVALUATE(m.lcSource))) > ENDIF > ELSE >* We're not on the column with data >*lcCaption = "Nothing to display" > ENDIF > > > IF LEN(m.lcTip) > MAX_LEN > .TOOLTIPTEXT = m.lcTip > ENDIF > ENDWITH >ENDIF >>