Record item tooltip with Caption + Description? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 03 March 2010 at 1:39pm |
And an icon!
Is it possible? I keep getting simple tooltips with the text only, even though m_bShowTitleAndDescription is set to true...
XTP 13.3.0.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
how do you fill the item out? There are 2 prototypes for
CXTPToolTipContext::FillInToolInfo which you call from within your OnToolHitTest function. (neither of which seem to be in the documentation BTW). The second one takes 3 strings, tooltip (leave empty), title and description. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
I guess I have to override MyItem::OnToolHitTest. Thanks.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
This is rather hacky! Is there another way? INT_PTR CMyRecordItem::OnToolHitTest(CPoint /*point*/, TOOLINFO* pTI)
{ CXTPReportRow *pRow = m_pControl->GetRows()->GetAt(GetIndex()); // Not sure if this is even correct! CRect rcItem = pRow->GetItemRect(this); INT_PTR nHit = ID_MY_ICON;
CXTPToolTipContext::FillInToolInfo(pTI, m_pControl->m_hWnd, rcItem, nHit, GetTooltip(), m_strTooltipText, m_strDescription, XTPImageManager()); return nHit; } |
|
PokerMemento - http://www.pokermemento.com/
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
ah.. from a report control?
don't know sorry! That way is how I do it in my own custom controls (CWnd-derived) |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
yeah, looks like CJ code won't support title and description no matter what...
INT_PTR CXTPReportRow::OnToolHitTest(CPoint point, TOOLINFO* pTI) { CRect rcItem; CXTPReportRecordItem* pItem = HitTest(point, &rcItem); if (!pItem) return -1; INT_PTR nHit = pItem->OnToolHitTest(point, pTI); if (nHit != -1) return nHit; nHit = (INT_PTR) pItem; CString strTip = pItem->GetTooltip(); m_pControl->OnGetToolTipInfo(this, pItem, strTip); if (strTip.IsEmpty() || strTip == _T(" ")) return -1; if (m_pControl->GetPaintManager()->m_bCleanTooltip) { //Clean markup CString s(strTip), u, v; int j = s.Find(_T("<")); int k = s.Find(_T(">")); while (j > -1 && k > -1) { u = s.Left(j); v = s.Mid(k + 1); s = u + v; strTip = s; j = s.Find(_T("<")); k = s.Find(_T(">")); } } CXTPToolTipContext::FillInToolInfo(pTI, m_pControl->m_hWnd, rcItem, nHit, strTip); return nHit; } |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Look at my code. It works, but it's ugly!
I hope there is a better way...
|
|
PokerMemento - http://www.pokermemento.com/
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
I think codejock needs to go through all their code wherever it calls CXTPToolTipContext::FillInToolInfo, and make sure it's compatible with the concept of a caption and tooltip (2 strings).
I even had to derive from CXTPButton in order to get tooltips like this without having to have text on the button face itself. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
I agree.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |