Print Page | Close Window

Toolbar Tooltip Style

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=9230
Printed Date: 15 June 2024 at 5:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbar Tooltip Style
Posted By: Simon HB9DRV
Subject: Toolbar Tooltip Style
Date Posted: 06 January 2008 at 10:41am
Hi,
 
I have a CXTPToolBar toolbar created as a child of a CWnd.
 
How do I change the tooltip style to show title and description in balloon style? I guess this is a basic MFC question but I really can't think how to do this.
 
Many thanks,
 
Simon the stupid programmer


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



Replies:
Posted By: Oleg
Date Posted: 06 January 2008 at 2:23pm
Hi,
You need connect it to some CXTPCommandBars object. Serch SetCommandBars in forum.


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


Posted By: Simon HB9DRV
Date Posted: 15 February 2008 at 1:05pm
Originally posted by oleg oleg wrote:

Hi,
You need connect it to some CXTPCommandBars object. Serch SetCommandBars in forum.
 
Sorry Oleg, I only just saw your reply. Could I use the CommandBars in my CMDIChildWnd? I'll try now and report back.


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


Posted By: Simon HB9DRV
Date Posted: 15 February 2008 at 1:14pm
Originally posted by Simon HB9DRV Simon HB9DRV wrote:

Originally posted by oleg oleg wrote:

Hi,
You need connect it to some CXTPCommandBars object. Serch SetCommandBars in forum.
 
Sorry Oleg, I only just saw your reply. Could I use the CommandBars in my CMDIChildWnd? I'll try now and report back.
 
I can't. My class is derrived from CWnd - is there a solution at all for this, for example a Jock class derrived from CWnd with CommandBars() ?
 
I can live without it but it would be very nice...


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


Posted By: mgampi
Date Posted: 15 February 2008 at 6:05pm
Hello Simon;
 
I did it this way and it works very well:
 
class CBatchInfoContainer : public CWnd
{
public:
 CBatchInfoContainer();
 virtual ~CBatchInfoContainer();
 bool Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
private:
 CXTPCommandBars*               pCmdBars_;
 int  OnCreate(LPCREATESTRUCT lpCreateStruct);
 DECLARE_MESSAGE_MAP()
};
-------------------------------------------------------------------------------------------
 
CBatchInfoContainer::CBatchInfoContainer()
try : pCmdBars_(CXTPCommandBars::CreateCommandBars())
{
}
catch (const std::bad_alloc&) {
};
CBatchInfoContainer::~CBatchInfoContainer() {
 pCmdBars_->InternalRelease();
}

BEGIN_MESSAGE_MAP(CBatchInfoContainer, CWnd)
 ON_WM_CREATE()
END_MESSAGE_MAP()

int CBatchInfoContainer::OnCreate(LPCREATESTRUCT lpcs) {
 if (CWnd::OnCreate(lpcs)!=0)
  return -1;
 pCmdBars_->GetToolTipContext()->SetStyle(xtpToolTipOffice2007);
 pCmdBars_->SetSite(this);
 pCmdBars_->EnableCustomization(FALSE);
 pCmdBars_->EnableDocking();
// Create ToolBar
 CXTPToolBar* pToolBar = (CXTPToolBar*)pCmdBars_->Add(_T("BatchInfoToolbar"), xtpBarBottom);
 if (!pToolBar || !pToolBar->LoadToolBar(IDR_TOOLBAR_BATCHINFO))
 {
  TRACE0("Failed to create toolbar\n");
  return -1;
 }
 pToolBar->SetShowGripper(FALSE);
 pToolBar->ShowExpandButton(FALSE);
 pToolBar->EnableDocking(xtpFlagAlignBottom|xtpFlagStretched);
 return 0;
}
 
Hope this helps.


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: Simon HB9DRV
Date Posted: 16 February 2008 at 1:51am
Thanks - I'll try it today.

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


Posted By: Simon HB9DRV
Date Posted: 16 February 2008 at 4:35am
Originally posted by Simon HB9DRV Simon HB9DRV wrote:

Thanks - I'll try it today.
 
Excellent - have 100 hero points :-)


-------------
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