Toolbar icons do not appear! |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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?
|
|
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 |