![]() |
CXTPTabToolBar |
Post Reply ![]() |
Author | |
gmail ![]() Groupie ![]() Joined: 24 February 2008 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() 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! |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
This code will add buttons defined in StandardIcons array.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
gmail ![]() Groupie ![]() Joined: 24 February 2008 Status: Offline Points: 45 |
![]() ![]() ![]() ![]() ![]() |
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? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Same for TabToolbar + call pControl->SetCategory(lpszItem);
and maybe UpdateTabs after. |
|
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 |