![]() |
Toolbar tooltip for custom controls |
Post Reply ![]() |
Author | |
akur ![]() Senior Member ![]() Joined: 16 May 2006 Status: Offline Points: 139 |
![]() ![]() ![]() ![]() ![]() 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! |
|
![]() |
|
akur ![]() Senior Member ![]() Joined: 16 May 2006 Status: Offline Points: 139 |
![]() ![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
Bump - I would like this please.
|
|
Simon HB9DRV
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
Woo-Hoo, I'll try this today or tomorrow and see if I can get it working - many thanks.
|
|
Simon HB9DRV
|
|
![]() |
|
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
![]() Now for 11.2 - have a nice weekend.
|
|
Simon HB9DRV
|
|
![]() |
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 |