Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - 13.4.1 CXTPControlGallery::OnToolHitTest bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

13.4.1 CXTPControlGallery::OnToolHitTest bug

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: 13.4.1 CXTPControlGallery::OnToolHitTest bug
    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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2010 at 7:02am
Hi,

No, Its ok. 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2010 at 1:10pm
Hi,

What problem to call additionally SetTooltip("Bla") ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.