Example #1
0
BOOL CEnHeaderCtrl::SetItemToolTip(int nItem, LPCTSTR szTip)
{
	ASSERT (nItem >= 0 && nItem < GetItemCount());
	ASSERT (szTip);

	if (InitializeTooltips())
	{
		CToolInfo ti;

		if (!m_tooltips.GetToolInfo(ti, this, (nItem + 1)))
		{
			CRect rItem;
			GetItemRect(nItem, rItem);

			m_tooltips.AddTool(this, szTip, rItem, (nItem + 1));
		}
		else
		{
			lstrcpyn(ti.szText, szTip, ((sizeof(ti.szText) / sizeof(TCHAR)) - 1)); 
			m_tooltips.SetToolInfo(&ti);
		}

		return TRUE;
	}

	return FALSE;
}
Example #2
0
void CEnEdit::OnSize(UINT nType, int cx, int cy) 
{
	CMaskEdit::OnSize(nType, cx, cy);
	
	InitializeTooltips();

	// update tool rects
	RecalcBtnRects();
}
Example #3
0
BOOL CEnHeaderCtrl::EnableToolTips(BOOL bEnable)
{
	if (bEnable)
		return InitializeTooltips();
	
	// else 
	if (m_tooltips.GetSafeHwnd())
		m_tooltips.DestroyWindow();

	return TRUE;
}