Print Page | Close Window

13.4.1 CXTPControlGallery::OnToolHitTest bug

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=17388
Printed Date: 15 June 2024 at 2:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: 13.4.1 CXTPControlGallery::OnToolHitTest bug
Posted By: znakeeye
Subject: 13.4.1 CXTPControlGallery::OnToolHitTest bug
Date 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/



Replies:
Posted By: Oleg
Date Posted: 08 October 2010 at 7:02am
Hi,

No, Its ok. 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 08 October 2010 at 9:53am
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/


Posted By: Oleg
Date Posted: 08 October 2010 at 1:10pm
Hi,

What problem to call additionally SetTooltip("Bla") ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 08 October 2010 at 3:49pm
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/


Posted By: znakeeye
Date Posted: 08 October 2010 at 5:03pm
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/


Posted By: Oleg
Date Posted: 09 October 2010 at 5:40am
Hi,


CXTPControlGalleryItem* pItem = m_pItemsShapes->AddItem(nShape, nShape);
pItem->SetToolTip(_T("Some Caption"));
pItem->SetDescription(_T("Some Description"));



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 09 October 2010 at 1:56pm

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/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net