![]() |
CXTPToolBar, CImageList problem |
Post Reply ![]() |
Author | |
hpesata ![]() Groupie ![]() Joined: 16 July 2004 Status: Offline Points: 60 |
![]() ![]() ![]() ![]() ![]() Posted: 17 February 2005 at 9:52am |
Hi!
XTreme Toolkit Pro V 9.51: I am trying to create a toolbar with bitmaps loaded from files instead of resource-bitmaps. I am creating the CXTPToolBar with pStandardBar = GetCommandBars()->Add(_T("Standard"), xtpBarTop). I am saving the bitmap-objects into a CImageList-object and use the following code to add it to the toolbar: XTPImageManager()->SetIcons(myimagelist, CmdIds, nImgs, CSize(16, 16)); RecalcLayout(FALSE); GetCommandBars()->RedrawCommandBars(); The images appear in my menu at the correct position, but they dont appear in the toolbar, it stays empty. What do I have to do to make the images visible in the toolbar too ? Many thanx in advance! best regards, Hans Pesata |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
How do you set controls for Toolbar? Are you sure it has Ids from CmdIds collection?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
hpesata ![]() Groupie ![]() Joined: 16 July 2004 Status: Offline Points: 60 |
![]() ![]() ![]() ![]() ![]() |
Hi!
// XTPImageManager()->SetIcons(myimagelist, CmdIds, nImgs, CSize(16, 16)); CmdIds is a UINT* with the size of nImgs. this seems to be working, because the images are displayed correctly within my menu. I am not using LoadToolbar(), because I dont have a resource. do I have to do something that is done within LoadToolbar() ? what do you mean by "how do you set controls" ? all I currently do is the code I posted. best regards, Hans |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
When you call pStandardBar = GetCommandBars()->Add(_T("Standard"), xtpBarTop). Now you must add buttons you need: pStandardBar->GetControls()->Add(xtpControlButton, CmdIds[0]); pStandardBar->GetControls()->Add(xtpControlButton, CmdIds[1]);
or pStandardBar->SetButtons(CmdIds, nImgs); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
hpesata ![]() Groupie ![]() Joined: 16 July 2004 Status: Offline Points: 60 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg!
thanx for your support! I added your code and the toolabr buttons are displayed now too. I am using the following code: XTPImageManager()->SetMaskColor(RGB(0, 255, 0)); XTPImageManager()->SetIcons(myimagelist, CmdIds, nCmdIds, size, CSize(16,16)); XTPImageManager()->RefreshAll(); the problem I have now is, that the mask-color doesnt work. I am using green RGB(0, 255, 0) within my bitmaps to mark the transparent pixels and also use the appropriate SetmaskColor() call, but the green pixels within the bitmaps stays visible instead of being replaced by the underlying colors. any hints on how to solve that ? best regards, Hans |
|
![]() |
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 |