![]() |
13.4.1 CXTPControlGallery::OnToolHitTest bug |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() Posted: 06 October 2010 at 3:03pm |
XTP 13.4.1. This can't be right...
The call to GetTooltip should be GetCaption!
INT_PTR CXTPControlGallery::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
if (IsShowAsButton() || GetItems() == NULL)
{
return -1;
}
RECT rcItem;
int nIndex = HitTestItem(point, &rcItem);
if (nIndex != -1)
{
CXTPControlGalleryItem* pItem = GetItem(nIndex);
INT_PTR nHit = pItem->m_nImage >= 0 ? pItem->m_nImage : pItem->m_nId;
CXTPToolTipContext::FillInToolInfo(pTI, GetParent()->GetSafeHwnd(), rcItem, nHit,
pItem->GetToolTip(), pItem->GetToolTip(), pItem->GetDescription(), GetItems()->GetImageManager());
return nHit;
}
return 0;
}
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
No, Its ok.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
My gallery items don't get their caption after I explicitly set the tooltip!
pItem = new Gallery item with ID_BLA ("Bla" is loaded as caption).
pItem->SetTooltip("test"); // The caption, "Bla", will never be shown.
Is that right?!
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
What problem to call additionally SetTooltip("Bla") ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
pItem = new CXTPGalleryItem(ID_BLA); // Caption is "Bla"
pItem->SetToolTip("Test");
pItems->Add(pItem, ID_BLA);
Then, when I hover it, I only see "Test". The caption is not shown. Hence, "SetToolTip" destroys the caption functionality. I sense this is not the case with CXTPControlButton. So....?
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
I've scrutinized the code. It simply cannot be correct! Caption is never used when displaying tooltips for gallery items - even though they do have a caption.
Again, HOW do you display a gallery-item tooltip with a bold caption? The caption is never shown...
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
CXTPControlGalleryItem* pItem = m_pItemsShapes->AddItem(nShape, nShape); pItem->SetToolTip(_T("Some Caption")); pItem->SetDescription(_T("Some Description")); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Well, sometimes you need to call SetCaption() only. Sometimes SetToolTip(). It's not consistent! So far, I have found this pattern...
Inplace gallery: SetCaption + SetDescription
Popup gallery: SetToolTip + SetDescription
|
|
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 |