Print Page | Close Window

CXTPTabToolBar

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=13119
Printed Date: 28 February 2025 at 12:36pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabToolBar
Posted By: gmail
Subject: CXTPTabToolBar
Date Posted: 08 January 2009 at 12:32pm
How can we dynamically add buttons and icons to tabbed toolbar? I'm studying your TabbedToolbar example but I cannot figure it out:

CXTPTabToolBar* pToolBar = (CXTPTabToolBar*)
        pCommandBars->Add(_T("Standard"), xtpBarTop, RUNTIME_CLASS(CXTPTabToolBar));

    pToolBar->SetBarID(IDR_MAINFRAME);

    CXTPTabManagerItem* pItem = pToolBar->InsertCategory(0, _T("Standard"), StandardIcons, _countof(StandardIcons));
    pItem->SetImageIndex(IDR_MAINFRAME);

How to add buttons (i.e. icons) to pToolBar object? Thanks for help!



Replies:
Posted By: Oleg
Date Posted: 09 January 2009 at 1:55am
Hi,
This code will add buttons defined in StandardIcons array.


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


Posted By: gmail
Date Posted: 09 January 2009 at 7:44am
Yes, but how can we add buttons in manner of (code from normal toolbar):

HICON icon=(HICON)LoadImage(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_PHONE),IMAGE_ICON,96,96,0);
pToolBar->GetControls()->Add(xtpControlButton, 51000)->SetStyle(xtpButtonIconAndCaption);
pToolBar->GetControls()->GetAt(0)->SetCaption(_T("cp"));
pToolBar->GetControls()->GetAt(0)->SetFlags(xtpFlagManualUpdate);
pToolBar->GetControls()->GetAt(0)->SetCustomIcon(icon);

This would add button one at a time dynamically. How to do this in tabbed toolbar?


Posted By: Oleg
Date Posted: 09 January 2009 at 11:22am
Hi,
Same for TabToolbar + call pControl->SetCategory(lpszItem);
and maybe UpdateTabs after.


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



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