Author Topic: Re-sizeable custom icons in user toolbars  (Read 12418 times)

LBCEi

  • Senior Community Member
  • Posts: 199
  • Hero Points: 20
Re-sizeable custom icons in user toolbars
« on: April 11, 2007, 09:55:00 pm »
The icons for the standard toolbars resize to three different sizes with the option in the Toolbar Customization, Options tab. 

It is possible to use a bitmap other than those supplied with SlickEdit for buttons added to a user created toolbar.  When I do this these icons do not resize with the toolbar button size and spacing options. 

If I look at the icon files that are installed with SE they don't appear to be special multi-size icon files.  They seem to be simple 32x32 true color icon files.

Is there a special icon file format that needs to be used so that user-supplied bitmaps will resize along with the other toolbar buttons?  Or are there some other conditions (location of the icon/bitmap file, for example) that are required to achieve the resizing behavior?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: Re-sizeable custom icons in user toolbars
« Reply #1 on: May 01, 2007, 10:08:10 pm »
We use Microsoft Windows format .ico files and require a minimum of three formats to be in the icon:  1) 16x16 @ 256 color, 2) 24x24 @ 256 color, and 3) 32x32 @ 256 color.  Do not confuse these .ico files with Mac .icon files or anything else named .icon or .ico that isn't a Microsoft ICO format file. You can create and edit these using Visual Studio or PaintShop, but a much better tool on a much more reasonable budget is iconxp (http://www.iconxp.com).  I like to think of IconXP as the SlickEdit of "Paint" programs.

The other trick is to be consistent with our naming scheme.  The name of the .ico file must start with "bb" (meaning it is for a button bar).  When you select your icon size, we reload all the images whose names start with "bb".  We do this to save time instead of reloading every image (the class browser alone has around 200 bitmaps).  My guess is that in your attempt, you missed this (probably undocumented and impossible to guess) detail, so SlickEdit just selected the first format available from the icon.

Lisa

  • Senior Community Member
  • Posts: 238
  • Hero Points: 23
  • User-friendly geek-speak translator extraordinaire
Re: Re-sizeable custom icons in user toolbars
« Reply #2 on: May 02, 2007, 01:52:24 pm »
Good information - I've put this on the doc todo list!

-Lisa

LBCEi

  • Senior Community Member
  • Posts: 199
  • Hero Points: 20
Re: Re-sizeable custom icons in user toolbars
« Reply #3 on: May 03, 2007, 08:31:15 am »
Thank you

These details are indeed very informative.  Without this information and just trying what seemed to work, I found that bmp images looked better (but the ico file I was trying was a single format file and did not follow the naming convention).  I selected the bmp file instead of the ico file because of the better appearance.

I had no idea about the naming scheme (starting with bb_).  Apparently the file must also be a .ico file, not a simple bitmap (e.g. bmp) file?

I'm also glad to hear that this may be included in future documentation.

I haven't tried correcting this but the additional information provides me with some things to try.  When I have time to try these suggestions I'll post the results so, hopefully, this will help others who wish to use custom buttonbar icons. 

Thanks again
Les

LBCEi

  • Senior Community Member
  • Posts: 199
  • Hero Points: 20
Re: Re-sizeable custom icons in user toolbars
« Reply #4 on: June 01, 2007, 08:29:58 am »
FYI to the forum

I tried creating an ico file using the icon editor suggested by Dennis and was successfully able to create an ico file with three different icon sizes.  I saved the new ico file using the bb_ prefix and was successful in getting the right icon size for my custom button on the toolbar when I changed the toolbar button size in the Toolbar Customization, Options tab.

I guess my point is (for those who weren't prescient enough to know about the specific icon size/color depth requirements and the naming convention) that the information provided by Dennis in this thread should work for you if you wish to create custom buttons on a toolbar.

I also found, using IconXP, that the SE provided icons provide the 16x16, 24x24, and 32x32 pixel sizes at both 8 bit (256 color) and 32 bit color depth (some even provide 48x48 with the two color depths -- not sure what that is for).  I was unable to discern that these ico files contained all of these different icon formats when I looked at these files before -- by examining 'Properties' using Windows Explorer.

After updating to 12.0.1, these custom buttons ceased to work but I suspect that that is a separate issue -- which I'll either post separately or send directly to support after doing some more testing with the update.

I have not checked the 12.0.1 documentation to see if they included the minimum requirements for the three specific icon sizes and color depth (256 color) and the naming convention for the ico file. 

@SlickTeam:
Any comments on the documentation update for this??

Lisa

  • Senior Community Member
  • Posts: 238
  • Hero Points: 23
  • User-friendly geek-speak translator extraordinaire
Re: Re-sizeable custom icons in user toolbars
« Reply #5 on: June 01, 2007, 01:42:17 pm »
@SlickTeam:
Any comments on the documentation update for this??


It's on our list of "things to do", documentation-wise. You can probably expect to see something in the next major release.

-Lisa

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: Re-sizeable custom icons in user toolbars
« Reply #6 on: June 01, 2007, 03:36:59 pm »
I think I can explain what happened when you upgraded to 12.0.1.

1) we reload tool bar changes from macro source (vusrobjs.e) when updating your configuration for a new release.

2) in the macro source, the bitmap is specified by name only.

3) The icons fail to load if your bitmaps were not in the SlickEdit bitmaps directory or your configuration directory, or a directory on your VSLICKBITMAPS path.  This can be set in your vslick.ini, look in the help under Environment Variables for more details.

I agree, it would be good if these rules were a little more obvious or at least documented.  I'm going to file a feature request to automatically copy non-path bitmaps to the user's configuration directory.

As for the formats of the bitmaps.  16,24,32 at 8-bit is the bare minimum.  One vendor we acquired a large quantity of bitmaps from also supplied the 48x48 dimension bitmaps, but we do not use them...that size is insanely huge, in fact, if we had a setting on the toolbars GUI to select 48x48, it would say "Small, Medium, Large, Insanely Huge"  The 32-bit color versions are also there in our bitmaps, in anticipation of the day when we can re-address our bitmap rendering code to support alpha-blending (on all platforms).

LBCEi

  • Senior Community Member
  • Posts: 199
  • Hero Points: 20
Re: Re-sizeable custom icons in user toolbars
« Reply #7 on: June 01, 2007, 05:17:14 pm »
Thanks for the responses Lisa and Dennis.

So, the suggestion for now would be to copy the bb_xxxx.ico file(s) to the configuration directory (My Documents\My SlickEdit Config\12.0.1 in Windows)?  Do I still need to update the VSLICKBITMAPS path definition in vslick.ini?  If so, should I maybe create a "bitmaps" folder in the configuration directory and add that folder to the VSLICKBITMAPS path definition?

Thanks again
Les

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: Re-sizeable custom icons in user toolbars
« Reply #8 on: June 01, 2007, 05:22:04 pm »
Copying the icons to your configuration directory is your best bet.

When you upgrade next time, they will be copied along with the rest of your configuration directory to "My SlickEdit Config\12.0.2".

Setting up the path is a viable alternative, but creating the copies is the simplest solution.

LBCEi

  • Senior Community Member
  • Posts: 199
  • Hero Points: 20
Re: Re-sizeable custom icons in user toolbars
« Reply #9 on: June 01, 2007, 05:30:19 pm »
Thanks -- that's what I'll do.

pdebonte

  • Community Member
  • Posts: 43
  • Hero Points: 1
Re: Re-sizeable custom icons in user toolbars
« Reply #10 on: August 20, 2010, 05:39:10 pm »
You can create and edit these using Visual Studio or PaintShop, but a much better tool on a much more reasonable budget is iconxp (http://www.iconxp.com).  I like to think of IconXP as the SlickEdit of "Paint" programs.

If anyone would like a freeware option, today I received a recommendation for IcoFX <http://en.wikipedia.org/wiki/IcoFX> from Stefan Küng, author of TortoiseSVN <http://tortoisesvn.tigris.org/>.

Share & Enjoy,
-Pete