"Change Button Image" icons
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=13009
Printed Date: 24 November 2024 at 2:22am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: "Change Button Image" icons
Posted By: briansweat
Subject: "Change Button Image" icons
Date Posted: 23 December 2008 at 6:17pm
I'm having trouble setting the icons for the "Change Button Image" function in the Customize menu for an individual Command Bar Control.
All icons are loaded into an ImageManager control at design-time. I've tried updating CommandBars.GlobalSettings.Icons and the Icons collections for the individual CommandBar.
Does anyone know where this icon list is located?
------------- SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat
Alterity, Inc.
http://www.acctivate.com - www.acctivate.com
http://twitter.com/briansweat - twitter.com/briansweat
|
Replies:
Posted By: Oleg
Date Posted: 24 December 2008 at 12:31am
Hi,
Catch Customization event and set CustomizeOptions.CustomIcons property.
------------- Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS
|
Posted By: briansweat
Date Posted: 26 December 2008 at 11:48am
Thanks! I'm definitely on the right track now.
However, the custom icons are not being displayed. I have 32 icons in my ImageManager and I see 32 blank placeholders now. I have both 16x16 and 24x24 variants stored for icon in my ImageManager.
I'm calling the RemoveAll method to clear the list first. Then, I'm calling Options.CustomIcons.AddIcons and passing a reference to the Icons collection of the ImageManager control...
Private Sub CommandBars_Customization(ByVal Options As XtremeCommandBars.ICustomizeOptions) Options.CustomIcons.RemoveAll Options.CustomIcons.AddIcons fCommon.ImageManager.Icons End Sub |
I initially tried the following code, but receive an "Object doesn't support this property or method" error...
Private Sub CommandBars_Customization(ByVal Options As XtremeCommandBars.ICustomizeOptions) Set Options.CustomIcons = fCommon.ImageManager.Icons End Sub |
------------- SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat
Alterity, Inc.
http://www.acctivate.com - www.acctivate.com
http://twitter.com/briansweat - twitter.com/briansweat
|
Posted By: SuperMario
Date Posted: 05 January 2009 at 12:29pm
CommandBarsMDISample for VB6 has a sample on how to do this with some helpful comments.
|
Posted By: briansweat
Date Posted: 05 January 2009 at 12:39pm
SuperMario wrote:
CommandBarsMDISample for VB6 has a sample on how to do this with some helpful comments.
|
Thanks, I've looked at the method in the CommandBarsMDISample. The LoadBitmap function uses a bitmap in the file system. However, I'm using a CodeJock ImageManager control to store my icons.
Of course, I could export the icons to a temp folder and use this method. At this point, I will probably just clear the list and remove this functionality :(
------------- SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat
Alterity, Inc.
http://www.acctivate.com - www.acctivate.com
http://twitter.com/briansweat - twitter.com/briansweat
|
Posted By: SuperMario
Date Posted: 05 January 2009 at 1:15pm
A simple modification to the end of that method:
ImageManager1.Icons.LoadBitmap App.Path & "\Icons\CustomButtonIcons.bmp", ChangeButtonImageIconArray, xtpImageNormal Options.CustomIcons.AddIcons ImageManager1.Icons
I simply added a imagemanager control to the MDI Form. I loaded the images from that same file into the imagemanager to save me time, but you can see it works from imagemanager as well.
Maybe attach your project? Must be a problem with ids or something?
|
Posted By: SuperMario
Date Posted: 05 January 2009 at 2:48pm
Was that helpful? Should be no reason to disable the feature from your software
|
Posted By: briansweat
Date Posted: 05 January 2009 at 4:42pm
Thank you so much for your help, but I'm still not getting anywhere
Using an ImageManager in conjunction with LoadBitmap works for me. Icons saved in the ImageManager at design-time do not work. I've attached a variation of the MDISample illustrating the problem...
uploads/20090105_163417_MDISample_Custo.zip - uploads/20090105_163737_MDISample_Custo.zip - uploads/20090105_163737_MDISample_Custo.zip
I added the dropper.cur image (from sample directory) to the ImageManager1 at design-time. At run-time, it's displaying the icons from the bitmap successfully, followed by one blank button where the dropper image should be.
I'm using the same Icon Id convention that's in my project (ie 10001).
------------- SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat
Alterity, Inc.
http://www.acctivate.com - www.acctivate.com
http://twitter.com/briansweat - twitter.com/briansweat
|
Posted By: SuperMario
Date Posted: 06 January 2009 at 8:35am
It is just a problem with IDs. 1001 will never work unless you are trying to display 1001 images in the menu.
I simply changed the ID in your sample from 1001 to 32 in the imagemanager and it works fine.
Here is why:
When adding icons, the IconId must start with 1 and increment by 1 for each
icon added. So the IconId will be numbered 1,2,3,4,...N.
The suite provides 42 "built-in" icons that you can choose from and they are
automatically displayed in the "Change Button Icon" popup menu if you do not
remove them. If you do not remove the "built-in" icons that are provided with
the toolkit then you should start your numbering at 43. If you start at 1 and
you did not remove the "built-in" icons, then you will overwrite some of the
"built-in" icons. So you would number your icons 43,44,45,...N. So you could
even keep some of the "built-in" icons and overwrite the ones you don't need
with your own custom icons.
I changed the Id in your sample to 32 because we removed the original 42 icons first, then we added 31 of our own in the single bitmap.
Hope this helps
|
Posted By: briansweat
Date Posted: 06 January 2009 at 12:46pm
Ah, I would have never figured that out. Thanks so much!
Instead of using my existing (shared) ImageManager, I will create another ImageManager just for the CustomIcons.
Thanks again!
------------- SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat
Alterity, Inc.
http://www.acctivate.com - www.acctivate.com
http://twitter.com/briansweat - twitter.com/briansweat
|
|