Print Page | Close Window

CXTPToolBar can’t use BITMAPS?

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=501
Printed Date: 15 May 2024 at 9:49am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPToolBar can’t use BITMAPS?
Posted By: JoWi
Subject: CXTPToolBar can’t use BITMAPS?
Date Posted: 08 March 2004 at 4:45am

Hello,

I need to dynamically create a CXTPToolbar (8.61 suite) at runtime. I add controls using

CXTPControls* pControls = m_pSnapInToolBar->GetControls(); 
CXTPControl* pControl = pControls->Add( xtpControlButton, nID );

where m_pSnapinToolbar is a CXTPToolbar and nID is the ID of the (corresponding menu) item(s). I also need to create images for the toolbar, the images will be provided by an external DLL as HBITMAP handles. The problem is that i cannot find a way to add my CBitmap images (which are 15x15 pixels) to the toolbar. I tried using the different formats of CImageManager->SetIcons(...) but i can't get any of them to work with bitmaps. When i use HICON's which are 32x32 it all seems to be ok, but i *must* use bitmaps. (Also icons of 16x16 size will not work)

So what i need is a way to add a CXTPControl to a toolbar, set it's ID, tooltip, description AND IMAGE using a bitmap.

Thanks, jowi




Replies:
Posted By: Sven
Date Posted: 08 March 2004 at 9:38am

Use

BOOL CXTPImageManager::SetIcons(CBitmap& bmpIcons, UINT* pCommands, int nCount, CSize szIcon, XTPImageState imageState = xtpImageNormal, BOOL bAlpha = FALSE);



Posted By: JoWi
Date Posted: 09 March 2004 at 2:04am

Thanks Sven, but i can't get that to work either. COuld you give me an example ? The function you describe probably expects a CBitmap which contains images for ALL buttons, concatenated one after another, like a toolbar resource i guess. I need to set ONE bitmap for ONE particular button.

Let's say i want a toolbar with ONE button, and i only have a BITMAP for that button ( NO icon, NO Imagelist, NO resource usage or entries whatsoever) , how do i create the toolbar ?

Thanks



Posted By: Sven
Date Posted: 09 March 2004 at 4:34am
You can call SetIcons(...) more than once, for each button you like to add.



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