![]() |
Toolbar Tooltip Style |
Post Reply ![]() |
Author | ||
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() 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
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
Hi,
You need connect it to some CXTPCommandBars object. Serch SetCommandBars in forum.
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
|
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
|
||
![]() |
||
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
|
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
|
||
![]() |
||
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
|
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
||
![]() |
||
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
|
Thanks - I'll try it today.
|
||
Simon HB9DRV
|
||
![]() |
||
Simon HB9DRV ![]() Senior Member ![]() ![]() Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
![]() ![]() ![]() ![]() ![]() |
|
Excellent - have 100 hero points :-)
|
||
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 |