Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPToolBar can’t use BITMAPS?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPToolBar can’t use BITMAPS?

 Post Reply Post Reply
Author
Message
JoWi View Drop Down
Newbie
Newbie


Joined: 07 November 2003
Location: Netherlands
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote JoWi Quote  Post ReplyReply Direct Link To This Post Topic: CXTPToolBar can’t use BITMAPS?
    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

Back to Top
Sven View Drop Down
Senior Member
Senior Member


Joined: 21 August 2003
Location: Germany
Status: Offline
Points: 127
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sven Quote  Post ReplyReply Direct Link To This Post 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);

Back to Top
JoWi View Drop Down
Newbie
Newbie


Joined: 07 November 2003
Location: Netherlands
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote JoWi Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Sven View Drop Down
Senior Member
Senior Member


Joined: 21 August 2003
Location: Germany
Status: Offline
Points: 127
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sven Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2004 at 4:34am
You can call SetIcons(...) more than once, for each button you like to add.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.