Print Page | Close Window

xtpButtonIconAndCaption icon size problem

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=9842
Printed Date: 17 May 2024 at 10:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: xtpButtonIconAndCaption icon size problem
Posted By: foleypt
Subject: xtpButtonIconAndCaption icon size problem
Date Posted: 10 March 2008 at 2:03pm
I have a toolbar which is set with icons at size 24x24  but I want one control to have icon at 16x16 and a caption below.

I use control.Style = xtpButtonIconAndCaptionBelow, but I find with this style I end up with an icon 24x24 EVEN if I set the icon in question and all the other icons to 16x16, this has the affect of making the whole toolbar higher

How can I set the icon to 16x16? I link to a zipped up example project exhibiting the problem

http://services.beacon-dodsworth.co.uk/iconsize_problem.zip - http://services.beacon-dodsworth.co.uk/iconsize_problem.zip

Dim toolbar As CommandBar
Dim control As CommandBarControl

Set toolbar = CommandBars.Add("MyToolbar", xtpBarTop)

CommandBars.ActiveMenuBar.Visible = False

CommandBars.Icons = ImageManager1.Icons

toolbar.SetIconSize 24, 24
'toolbar.SetIconSize 16, 16

toolbar.Controls.Add xtpControlButton, 100, ""
Set control = toolbar.Controls.Add(xtpControlButton, 101, "my button")
toolbar.Controls.Add xtpControlButton, 102, ""

control.Style = xtpButtonIconAndCaptionBelow
control.SetIconSize 16, 16



Replies:
Posted By: Oleg
Date Posted: 10 March 2008 at 4:17pm
Hi,
 
Yes xtpButtonIconAndCaptionBelow always use icon size defined as "Large" icon size.
as workaround afd this line:
 
CommandBars.Options.SetIconSize True, 16, 16


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


Posted By: foleypt
Date Posted: 10 March 2008 at 6:54pm
Thanks Oleg,

That does produce the affect I want, however what are the implications of setting this option?

I set the iconsize for each control and commandbar elsewhere in the menus and toolbars but I seem to remember that some of the codejock controls will reference off this large icon setting size and so will hence appear at 16x16 not say the perhaps desired 24x24?

Are you planning on altering this behaviour of xtpButtonIconAndCaptionBelow?

Could you advise me as to the implications of setting the workaround?


Posted By: Dieter
Date Posted: 26 March 2008 at 11:40am
Hi,

I have a similar problem, but I use Visual C++/MFC Xtreme Toolkit Pro:

My application has a toolbar in a client window and I needed text below the icons.
I tested the style xtpButtonIconAndCaptionBelow and set the icon size with SetIconSize(CSize(16, 16));
But the icons were still large and the caption used two lines.

So I searched in the samples and found the following line in the HelpContext-Sample:
pCommandBars->GetCommandBarsOptions()->bShowTextBelowIcons = TRUE;

Now the icons are small, the text is below the icons and the caption has only one line.

Maybe there is a similar setting in the ActiveX-Control?


Oleg,
Is the behaviour (large icons, caption has two lines) of xtpButtonIconAndCaptionBelow and SetIconSize(CSize(16, 16))
working as designed or is this an error. 

With GetCommandBarsOptions()->bShowTextBelowIcons everything is much better!



-------------
Dieter

Product: Xtreme ToolkitPro version 15.2.1
Platform: Windows XP (32bit) - SP 3
Language: Visual C++ 6.0, Visual Studio 2010



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