Julien Galand wrote:

Le 17 oct. 06, à 17:02, Carsten Driesner a écrit :

You're right that these APIs are not well documented, only the IDL files have comments. That's one reason why they are currently not published. We want to finalize them for OpenOffice.org 2.2 (a formal process) and after finalization they cannot be changed in the future. As these services/interfaces are more than two years old and no big issues have been reported so far I would be very surprised, if there will be changes during the finalization process. Therefore we want to encourage you to use these services/interfaces to implement your add-on.


Thank you for this confirmation.

I have tried your alternative solution (using transient changes of the menu bar), and of course it works perfectly. It is far more better than my first implementation (persistent modifications through OO configuration), and as you have just told me, also reliable for the future. Thank you very much !
Hi Julien,

You're welcome and I am glad that you want to use the API.


One last question about it :
Mathias Bauer has already answered to me that assigning keyboard shortcuts (such as Ctrl+F12) to add-on menus is presently not possible in OO 2.0.

You cannot assign keyboard shortcuts with the Addons.xcu, but we also have an API to do it. The problem with a declarative solution (like Addons.xcu) is, what should the implementation do if you have collisions.


But is it possible to DISPLAY only the shortcut (say, Ctrl+F12) in the menu line, so that it is right-justified on the line ? (Typically in the "transient change of the menu bar" method)
(and I implement the shortcut detection itself by a system hook).

I think you should use the API to set your keyboard shortcut. Just have a look the a the following code snippet how to do it:
http://codesnippets.services.openoffice.org/Office/Office.ManagingKeyboardShortcuts.snip
There are many examples on the code snippet page and you should take a look, may be you can find other interesting things.


Note :
I have tried to scan the OO menu bar to check what "Label" property it assigns to menu lines with a displayed shortcut, but I always get an empty string.
Maybe I made it wrong, but anyway I couldn't get any hint by this.

It's a "feature" that you only get an empty string. An empty string means that a default label should be used. The menu uses the command URL as a reference to the language dependent label (via the *Commands.xcu files). If you find a non-empty label, it has been changed by a user.

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to