Hi Carsten,
>> For explanation: I create a menu called
"JUDAS" and this menu is shown.
>> Then I want to create a menu item called
"JUDAS_Test" and I add it to
>> the menu. But only a separator is shown. When I
copy e.g. the "File"
>> menu into the JUDAS menu (as a submenu), the item
"JUDAS_Test" is
>> suddenly visible and the separator is gone.
> I cannot exactly remember, but I think it was related
to the missing
> property "Type". It must be set to a value
defined by
> com.sun.star.ui.ItemType. So every menu item definition
must have a
> property called "Type"!
>
> constants ItemType
> {
>
//----------------------------------------------------------
---------------
>
> /** a normal item
> */
> const short DEFAULT = 0;
>
//----------------------------------------------------------
---------------
>
> /** a separarator is inserted as a line.
> */
> const short SEPARATOR_LINE = 1;
>
>
//----------------------------------------------------------
---------------
> /** a separarator is inserted as a space.
> */
> const short SEPARATOR_SPACE = 2;
>
>
//----------------------------------------------------------
---------------
> /** a linebreak is inserted.
> */
> const short SEPARATOR_LINEBREAK = 3;
>
> };
>
> The strange behavior is related to the fact that the
variable in the
> code, which reads and interprets the property value, is
not predefined
> and therefore the result is random. Most of the time
the menu item will
> be a separator.
wow that worked out. Here the properties that worked:
-----%<-----
PropertyValue[] loadProps = new PropertyValue[3];
loadProps[0] = new PropertyValue();
loadProps[1] = new PropertyValue();
loadProps[2] = new PropertyValue();
loadProps[0].Name = "CommandURL";
loadProps[0].Value = ".uno:PickList";
loadProps[1].Name = "Label";
loadProps[1].Value = "NameOfItem";
loadProps[2].Name = "Type";
loadProps[2].Value = (short)0;
-----%<-----
Thanks a lot!
Greetings, Tobias
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|