Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Different bitmaps for menus and toolbar?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Different bitmaps for menus and toolbar?

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


Joined: 05 November 2007
Location: Belgium
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote swautier Quote  Post ReplyReply Direct Link To This Post Topic: Different bitmaps for menus and toolbar?
    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,
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
swautier View Drop Down
Newbie
Newbie


Joined: 05 November 2007
Location: Belgium
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote swautier Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2007 at 4:32am
:)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.047 seconds.