Print Page | Close Window

Different Icon sizes for toolbars and menus

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7652
Printed Date: 13 November 2025 at 7:59am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Different Icon sizes for toolbars and menus
Posted By: MacW
Subject: Different Icon sizes for toolbars and menus
Date 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?









Replies:
Posted By: Oleg
Date 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


Posted By: MacW
Date Posted: 25 July 2007 at 10:42am
Hi, Oleg

this does not change anything. The icons in the menus are still 16x16 pixels.


Posted By: Oleg
Date 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


Posted By: MacW
Date 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.



Posted By: Oleg
Date Posted: 27 July 2007 at 12:15pm

Call

pCommandBars->GetImageManager()->SetIcons(IDR_MAINFRAME, IDB_MAINFRAME_SMALLICONS);
 


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


Posted By: MacW
Date 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?


Posted By: Oleg
Date Posted: 31 July 2007 at 6:52am
Hello,
 
See
Samples\CommandBars\CommandBarIcons
and
Samples\UserInterface\GUI_WinZip


-------------
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