Print Page | Close Window

Different bitmaps for menus and toolbar?

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=8666
Printed Date: 02 March 2025 at 3:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Different bitmaps for menus and toolbar?
Posted By: swautier
Subject: Different bitmaps for menus and toolbar?
Date Posted: 05 November 2007 at 10:19am
Env.: XTP 11.20 VS2003
 
Hi,
I have a toolbar with big images (24x24). It works fine, including loading the separate image list for disabled buttons.
 
m_pToolBar = (CXTPToolBar*)pCommandBars->Add(_T("Toolbar"), xtpBarTop);
m_pToolBar->LoadToolBar(IDR_TOOLBAR);
XTPImageManager()->SetIcons(IDR_MAINFRAME, IDR_TOOLBAR, xtpImageNormal);
XTPImageManager()->SetIcons(IDR_MAINFRAME, IDB_TOOLBAR_BIG_GRAY, xtpImageDisabled);
How do I specify a different image list/bitmap for the small images displayed in the menus (for the corresponding items)? (and one for small disabled images).
 
TIA,
 
 



Replies:
Posted By: Oleg
Date Posted: 05 November 2007 at 1:27pm
Just same.
 
XTPImageManager()->SetIcons(IDR_MAINFRAME, IDR_TOOLBAR_SMALL, xtpImageNormal);

XTPImageManager()->SetIcons(IDR_MAINFRAME, IDB_TOOLBAR_SMALL_GRAY, xtpImageDisabled);
 
Where IDR_TOOLBAR_SMALL is resource for bitmap, IDR_MAINFRAME is resource for toolbar with buttons.


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


Posted By: swautier
Date Posted: 06 November 2007 at 4:26am
Great! Problem solved.
 
For the archive: People, please make sure that your toolbar image lists contain the same amount of images than defined buttons. I just spent one hour scratching my head wondering why the buttons were incorrectly drawn/resized in the menu items.
 
It appears that my image list had 5 unused images at the end. It never was a problem so far (old XT version) but XTP 11.20 seems to support non rectangular imagees and guesses button size based on the amount of buttons defined in the toolbar.
 
Maybe it was only very bad luck for me since I had 21 images and 16 buttons. Bad luck since buttons are 16x16. So XTP figured I had 16 buttons sized 21x16 instead of 21 16x16 images :-(
 
Also, XTP11 makes a great job at computing grayed images. Actually, I discovered that the result is better than the separate gray images I was using so far.


Posted By: Oleg
Date Posted: 06 November 2007 at 4:32am
:)


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



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