* MouseMove event of the grid class: LPARAMETERS nButton, nShift, nXCoord, nYCoord if NOT (this.ToolTipText == this.OriginalToolTip) * determine the part where mouse is currently local nWhere_Out, nRelRow_Out, nRelCol_Out, nView_Out this.GridHitTest(m.nXCoord, m.nYCoord, ; @nWhere_Out) * if we're in the header or row height resizing area, * we probably want to display tool tip for the column, * so we do not restore Grid's tool tip. if NOT INLIST(m.nWhere_Out,13,14) this.ToolTipText = this.OriginalToolTip endif * Here tool tips could be defined for each grid part * except columns and headers. Use nWhere_Out returned * from GridHitTest method for this. * ..... endif
* Put in the Init method of the grid class. this.OriginalToolTip = this.ToolTipText * also, add the OriginalToolTip property to grid class.
LPARAMETERS lcNewToolTip if NOT (this.ToolTipText == left(m.lcNewToolTip,254)) HideToolTip() this.ToolTipText = left(m.lcNewToolTip,254) endif
local lcStr, lnX, lnY declare integer GetCursorPos in Win32API as _GetCursorPos string @lcStr declare integer SetCursorPos in Win32API as _SetCursorPos integer x, integer y lcStr = replicate(chr(0), 8) = _GetCursorPos(@lcStr) lnX = ((( asc(substr(m.lcStr, 4, 1)) * 256) + asc(substr(m.lcStr, 3, 1))) * 256 + ; asc(substr(m.lcStr, 2, 1))) * 256 + asc(left(m.lcStr, 1)) lnY = ((( asc(substr(m.lcStr, 8, 1)) * 256) + asc(substr(m.lcStr, 7, 1))) * 256 + ; asc(substr(m.lcStr, 6, 1))) * 256 + asc(substr(m.lcStr, 5, 1)) = _SetCursorPos(0, 0) DOEVENTS = _SetCursorPos(m.lnX, m.lnY)