Print Page | Close Window

Toolbar icons do not appear!

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=9326
Printed Date: 21 November 2024 at 7:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbar icons do not appear!
Posted By: znakeeye
Subject: Toolbar icons do not appear!
Date Posted: 16 January 2008 at 9:50am

In my CMainFrame-window I have multiple toolbars. They look OK.

Note that in this project CFrameWnd-windows are used frequently, but without associated document templates (and frames).
 
I have a CXTPFrameWnd-derived window, CMyFrame, as a member in one of the views (don't blame me ;). These calls are done in CMyFrame::OnCreate():
 
InitCommandBars();
CXTPToolBar *pToolbar = (CXTPToolBar*)GetCommandBars()->Add("My tool", xtpBarTop);
pToolBar->LoadToolBar(IDR_TOOL);
XTPImageManager()->SetIcons(IDR_TOOL, IDB_TOOL;
 
The problem is that the icons from IDB_TOOL are not shown! What could be the reason for this? Please help me out on this one.



Replies:
Posted By: Oleg
Date Posted: 16 January 2008 at 11:11am
Hi,
What do you have in resources for IDR_TOOL and IDB_TOOL ? Check How many icons you have in IDR_TOOL  and what size of IDB_TOOL bitmap.


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


Posted By: znakeeye
Date Posted: 17 January 2008 at 3:34am

It turned out that IDR_TOOL had a bitmap resource with no icons. Still, I think this is weird:

IDR_TOOL points to "tool.bmp" (contains a gray bitmap)
IDB_TOOL points to "tool_hicolor.bmp" (contains the icons)
 
LoadToolBar(IDR_TOOL)
SetIcons(IDR_TOOL, IDB_TOOL) // This does not overwrite the previous icons!
 
I solved it by remapping IDR_TOOL to "tool_hicolor.bmp" and removing the call to SetIcons. Why did I have to do that?



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