View Full Version : Large Icons for ToolBar
afida
Oct 14th, 2004, 05:31 AM
How do I configure commands to they use large icons for ToolBar and small (16x16) for menus. Also how do I add differenet views to Toolbar as Toggle Buttons. Similar to Show Window menu but Toggle buttons on Toolbar?
Amad
Keith Donald
Oct 14th, 2004, 08:03 AM
Amad,
You want a custom CommandButtonConfigurer applied to toolbar buttons. See DefaultCommandServices for how they are applied: you will want to set the button's icon to the large variant in the configure method.
Currently there are no setter methods for changing the configurers but I can add those.
I am also considering adding support for multiple face descriptors per command, but I have to think about that from a configuration standpoint (don't want to introduce complexity in command configuration if possible)
afida
Oct 15th, 2004, 03:21 AM
Keith
Thanks, I have looked DefaultButtonConfigurer and tried to implement it. But I guess I am not sure how to set the large icon on button as I don't know what command key was used? What I really want to do is able to specify icons in images.properties like
deleteCommand.icon.small=delete-16x16.png
deleteCommand.icon.large=delete-32x32.png
or something similiar and then from face descriptor i can just get small or large icons and set them in configure.
Here is what i have, which is very simple and don't know how do just set all the icons to large icons, I don't think i have enough information in this method?
public class ToolBarButtonConfigurer extends DefaultButtonConfigurer {
public void configure(CommandFaceDescriptor face, AbstractButton button) {
super.configure(face, button);
}
Regards,
Amad
Keith Donald
Oct 16th, 2004, 03:55 PM
Hmm... yea, I see what you mean. I'll see what I can do here: the simplest addition would be to enhance the CommandFaceDescriptor class: specifically, add a "large" command button icon info property, in addition to the existing buttonIconInfo property.
I think it will also be beneficial to provide multiple face descriptors per command, to support different visual configurations for the same command.
Keith Donald
Oct 19th, 2004, 09:19 AM
Amad,
I just checked in initial support for: large icons (see CommandFaceDescriptor), as well as multiple face descriptors per command, as mentioned.
See the ApplicationObjectConfigurer for how large icon support is configured--it's very similiar to what you described above.
I have not yet hooked up the application object configurer for adding in configured face descriptors from a properties file.
Keith
afida
Oct 19th, 2004, 02:17 PM
Thanks Keith.. You'r the man!
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.