Tobias Krais wrote:
Hi Carsten,
sounds very good. At the moment I am reading your document
http://specs.openoffice.org/ui_in_general/api/ProgrammaticControlOfMenuAndToolbarItems.sxw
You are right that examples are missing. The most important task of the
document is to describe the design and the implementation of the API in
OpenOffice.org. I will add some examples how to use the new user
interface API.
I am excited on the examples :-). Because I have exactly the same error
as described here:
http://www.mail-archive.com/[email protected]/msg02401.html
Did you meanwhile find the error?
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.
Hi Tobias,
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.
Regards,
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]