Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Tooltip for cells - Reminder Collapse All
Subject Author Date
Offer Har Dec 26, 2007 - 8:48 AM

Any progress?
Any estimations?

Thanks,
Ron.

Offer Har Dec 27, 2007 - 4:09 PM

Dear Support,

Because the lack of support in this matter, I wrote this functionality myself, It is something like this:

void CMyGrid::OnMouseMove(UINT nFlags, CPoint point)
{
	static int nLastCellCol=-1;
	static int nLastCellRow=-1;

	CExtGridHitTestInfo hti;
	hti.m_ptClient = point;
	HitTest(hti,true,true);
	if (__EGBWA_INNER_CELLS&hti.m_dwAreaFlags)
	{
		if (hti.m_nRowNo!=-1 && hti.m_nColNo!=-1)
		{
			CExtGridCell* pCell = GridCellGet(hti.m_nColNo, hti.m_nRowNo);
			if (pCell)
			{
				CString str;
				pCell->TextGet(str);

				if (nLastCellCol!=hti.m_nColNo || nLastCellRow!=hti.m_nRowNo)
				{
					CPoint ptToolTip(point);
					ptToolTip.x = hti.m_rcItem.left;
					ptToolTip.y = hti.m_rcItem.top;
					ClientToScreen(&ptToolTip);
					CString strTooltip;
					strTooltip.Format("Row:%d - Col:%d : %s", hti.m_nRowNo, hti.m_nColNo, str.GetString());
					CRect rc(hti.m_rcItem);
					ClientToScreen(&rc);
					int nHalfWidth = rc.Width()/2;
					rc.left-=nHalfWidth;
					rc.right-=nHalfWidth;
					m_info.SetTipStyle(CExtPopupMenuTipWnd::__ETS_INV_RECTANGLE);
					m_info.SetText(strTooltip);
					m_info.Show(this,rc,true);
					nLastCellCol=hti.m_nColNo;
					nLastCellRow=hti.m_nRowNo;
					CBaseGrid::OnMouseMove(nFlags, point);
					return;
				}
			}
		}
	}

	m_info.Hide();
	nLastCellCol=-1;
	nLastCellRow=-1;
	CBaseGrid::OnMouseMove(nFlags, point);
}



In my base class I added:
CExtPopupMenuTipWnd m_info

And the OnMouseMove event handling.

Please note that I need to change the base cell class to add a GetComment function, currently I am using GetString.

If you could add this functionality to the next version it will be wonderful.

Thanks,
Ron.