List Info

Thread: Addon: Menu item has an icon, but not toolbar item




Addon: Menu item has an icon, but not toolbar item
user name
1969-12-31 18:00:00
Tobias Krais wrote:
> Hi together,
> 
> one more question. At the moment I am finalizing my
component. Now I
> added a Submenu to the "Extras -> Add-ons"
menu and my icons are
> shown,... Everything works. Now I add transient via
Java API an menu
> item. The corresponding icon and the text are shown.
> 
> But adding a toolbar item the same way won't show the
icon, but the
> text. Why is there a difference?
> 
> Do I have to define something more when creating a
toolbar item?
> -----%<-----
>         PropertyValue[] menuItemProperties = new
PropertyValue[3];
> 
>         menuItemProperties[0] = new PropertyValue();
>         menuItemProperties[0].Name =
"CommandURL";
>         menuItemProperties[0].Value =
".Judas:PrintTrays";
> 
>         menuItemProperties[1] = new PropertyValue();
>         menuItemProperties[1].Name = "Label";
>         menuItemProperties[1].Value =
"Judas";
> 
>         menuItemProperties[2] = new PropertyValue();
>         menuItemProperties[2].Name = "Type";
>         menuItemProperties[2].Value = new
Short((short)0);
> -----%<-----
> Am I missing something when setting the properties of
the icon?
> 
Hi Tobias,

Your settings are ok, images are referenced by the command
URL. I think 
it depends how you provide your image. The normal toolbar
implementation 
doesn't lookup images defined in the Addons.xcu. Only the
add-on toolbar 
implementation does. The menu bar implementation also checks
for images 
in the add-on repository.
I will change this behavior in the near future (add add-on
image support 
for normal toolbars), but I have to be careful as this can
create 
negative performance issues.

Regards,
Carsten

-- 
Carsten Driesner (cd) - Project Lead OpenOffice.org
Framework
Framework wiki: ht
tp://wiki.services.openoffice.org/wiki/Framework
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )