![]() |
How to set a CXTPToolTipContext on a CXTPToolBar |
Post Reply
|
| Author | |
scottp
Groupie
Joined: 16 October 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
Quote Reply
Topic: How to set a CXTPToolTipContext on a CXTPToolBarPosted: 21 March 2007 at 11:02pm |
|
I have a CXTPToolBar that is manually attached to a CWnd housed in a docking pane. I can find no way to set a CXTPToolTipContext on the toolbar as the m_pToolTipContext member of CXTPCommandBar is protected.
In this case the m_pToolTipContext member is NULL and I would like to set the style to match the rest of my standard commandbars. Can some way pleased be added to allow the m_pToolTipContext member to be set (and get). |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2007 at 2:03am |
|
you can create some CXTPCommandBars object :
m_pCommandBars = CXTPCommandBars ::CreateObject()
...
m_pCommandBars->InternalrRelease();
and assign it to this toolbar.
pT->SetCommandBars(m_pC);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
scottp
Groupie
Joined: 16 October 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2007 at 2:39am |
|
Hi Oleg,
I tried your suggestion int CDisplayPane::OnCreate(LPCREATESTRUCT lpCreateStruct) { VERIFY(m_wndToolBar.CreateToolBar(WS_TABSTOP|WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS, this)); m_wndToolBar.SetButtons(Buttons,6); CXTPCommandBars *pCommandBars = (CXTPCommandBars *)CXTPCommandBars::CreateObject(); CXTPToolTipContext* pToolTipContext = pCommandBars->GetToolTipContext(); pToolTipContext->SetStyle(xtpToolTipLuna); pToolTipContext->ShowTitleAndDescription(); pToolTipContext->SetFont(m_pCommandBars->GetPaintManager()->GetIconFont()); pToolTipContext->ShowImage(true); m_wndToolBar.SetCommandBars(m_pCommandBars); pCommandBars->InternalRelease(); But this crashes in CalcDockingLayout void CDisplayPane::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); int nTop = 0; if (m_wndToolBar.GetSafeHwnd()) { CSize sz = m_wndToolBar.CalcDockingLayout(cx, /*LM_HIDEWRAP|*/ LM_HORZDOCK|LM_HORZ | LM_COMMIT); m_wndToolBar.MoveWindow(0, nTop, cx, sz.cy); m_wndToolBar.Invalidate(FALSE); nTop += sz.cy; } Any suggestions? |
|
![]() |
|
scottp
Groupie
Joined: 16 October 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2007 at 2:53am |
|
Hi Oleg,
I misunderstood part of your suggestion, I need to release the commandbar in the destructor. This code works :) CXTPCommandBars *m_pCommandBars = (CXTPCommandBars *)CXTPCommandBars::CreateObject(); CXTPToolTipContext* pToolTipContext = m_pCommandBars->GetToolTipContext(); pToolTipContext->SetStyle(xtpToolTipLuna); pToolTipContext->ShowTitleAndDescription(); m_pCommandBars->SetSite(this); m_wndToolBar.SetCommandBars(m_pCommandBars); VERIFY(m_wndToolBar.CreateToolBar(WS_TABSTOP|WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS, this)); |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 March 2007 at 2:48am |
|
all right :)
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
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 |