Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Different Icon sizes for toolbars and menus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Different Icon sizes for toolbars and menus

 Post Reply Post Reply
Author
Message
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: Different Icon sizes for toolbars and menus
    Posted: 24 July 2007 at 5:37am
Hi, I have different sets of icons (32x32, 16x16). I want to use the large icons for toolbars, and the small icons for menus.

When I set the large icons using XTPImageManager()->SetIcons, the icons in toolbars look good, but the icons in menus look awful. Apparently XTP resizes the icons using the simple StretchBlt API function.

I made some experiments with


CXTPCommandBars* pcb = ... MainFrame.GetCommandBars(...);
pcb->GetCommandBarsOptions()->szIcons = CSize(16,16)
pcb->GetImageManager()->SetIcons(...);
...


but this usually causes all command bars to show no icons anymore.

What is please the correct sequence of method calls, and which objects to I need to tell which information?






Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 25 July 2007 at 1:51am
Hello,
I think better call
 
pcb->GetCommandBarsOptions()->bLargeIcons = TRUE;
 
it will use large icons by default - 32*32. but also allow user to change it back in customize dialog.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 25 July 2007 at 10:42am
Hi, Oleg

this does not change anything. The icons in the menus are still 16x16 pixels.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 26 July 2007 at 7:12am
Hi,
In first message you wrote that want 16x16 icons for menu....
 
if you see small icons in toolbar, temporary comment LoadCommandBars call.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 8:38am
Hi, Olec

You're right. I want 16x16 pixel bitmaps for menus.
But I don't want XTP to create these from the 32x32 pixel bitmaps I set via the XTPImageManager... call. The XTP resize algorithm creates ugly-looking bitmaps in the menu. I have better routines for that.

I want to set one set of icons to use in toolbars. I use my 32x32 icon set for that.  And another set of icons to be used in command bars (menus).  I want to use my 16x16 icon set for that. I create different sizes from my original vector sources, and the quality is hence very good for both sizes.

How do I set one set of icons for toolbars, and another for the menus?

I did not find a working solution in the samples, and neither instructions in the XTP documentation.

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 27 July 2007 at 12:15pm

Call

pCommandBars->GetImageManager()->SetIcons(IDR_MAINFRAME, IDB_MAINFRAME_SMALLICONS);
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2007 at 6:29am
Hi,

if you look at my initial post, this is exactly what I'm doing. Without success.
Seems that there needs to be done more, or in a different sequence.

Is there anywhere a working sample?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 31 July 2007 at 6:52am
Hello,
 
See
Samples\CommandBars\CommandBarIcons
and
Samples\UserInterface\GUI_WinZip
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.