Print Page | Close Window

Toolbar tooltip for custom controls

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6713
Printed Date: 03 March 2025 at 6:03am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbar tooltip for custom controls
Posted By: akur
Subject: Toolbar tooltip for custom controls
Date Posted: 23 March 2007 at 5:00am
Hello,

I've added my own control into an XTP toolbar through CXTPControlCustom, but setting a tooltip text for this control just doesn't display any tooltip.

        CXTPControlCustom* pControlEmbedder = CXTPControlCustom::CreateControlCustom(&m_MyControl);
        pControlEmbedder->SetTooltip(_T("My Tooltip Text"));
        m_pMyToolbar->GetControls()->Add(pControlEmbedder);

Do you have any idea what's wrong with this? Do I have to handle tooltips of my control window on my own?

Thank you for any suggestions, in advance!




Replies:
Posted By: akur
Date Posted: 26 March 2007 at 1:44am
One workaround would be to use a "normal" handling of tooltips for that single custom control of mine. Is there any commandbar-based solution for this?



Posted By: Simon HB9DRV
Date Posted: 06 September 2007 at 9:41am
Bump - I would like this please.

-------------
Simon HB9DRV


Posted By: Oleg
Date Posted: 07 September 2007 at 1:49am
Hi,
 
Here little workaround class:
 
template <class T>
class CToolTipRouter : public T
{
 BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
 {
  CXTPCommandBar* pCommandBar = DYNAMIC_DOWNCAST(CXTPCommandBar, GetParent());
  
  if (pCommandBar)
  {
   pCommandBar->FilterToolTipMessage(message, wParam, lParam);
  }
  if (message == XTP_TTM_WINDOWFROMPOINT)
  {
   *pResult = 1;
   return TRUE;
  }
  
  return CWnd::OnWndMsg(message, wParam, lParam, pResult);
 }
};
 
 
Now replace your m_MyControl declaration in mainfrm.h from
 
CMyClass m_MyControl;
 
to
 
CToolTipRouter<CMyClass> m_MyControl;


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


Posted By: Simon HB9DRV
Date Posted: 07 September 2007 at 3:11am
Woo-Hoo, I'll try this today or tomorrow and see if I can get it working - many thanks.

-------------
Simon HB9DRV


Posted By: Simon HB9DRV
Date Posted: 07 September 2007 at 10:32am
 Excellent - works just great :-)
 
Now for 11.2 - have a nice weekend.
 
 


-------------
Simon HB9DRV



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