Laurent Godard escribió:
Hi all
Is it possible to add a menu between 2 OOo existing menu
Say in Tools menu, between entry A and B
The goal is to deploy it through an extension
Any xcu file to deal with ? how to append them
Thanks in advance
Laurent
Hi Laurent, it is possible and it works.
I just copy and paste what I wrote at [EMAIL PROTECTED]:
To check if things works (and what difference we find) I wrote an example:
http://www.arielconstenlahaile.com.ar/ooo/temp/MenuToolbarMerging.oxt
this example will *merge* menu items in every database related module
(it is possible to *replace* existing items, but I didn't find it good
for a demo extension).
To test if it work, I try to add different items to different modules.
The items are just for testing purposes, that means that:
* they have no functionality at all (other than displaying some tech.
info.),
* item names are only for testing purposes: no future features are
proposed or suggested ;-)
* the place where the items are merged isn't meant to be the right one
(for example, extensions should have their entry on Help menu with other
extensions, but just to test it was possible, I merged the item right
after OOo's .uno:About dialog.
You can check the sources as a NetBeans IDE project at:
http://www.arielconstenlahaile.com.ar/ooo/temp/MenuToolbarMerging.SRC.zip
Feel free to make comments on that (please realize that I didn't clean
them up, so may be there is some crap ;-) ).
Some points are interesting:
* the XServiceInfo.getSupportedServiceNames() is now quite useless,
because if the doc. is a form or a wiz.-report, it will tell us that is
a css.text.TextDocument. Now we must use instead
XModuleManager.identify( XInterface aReference), this will give us the
module identifier.
* XModuleManager.identify() takes an XFrame/XModel/XController as arg.,
but we must be aware that some db modules have no model; so here is
safer to use the XFrame we get when the ProtocolHandler is initialized
* in the TableDesign and the RelationDesign modules, the first menu
entry I added gets dispatched twice when I choose it (this tested only
on Linux), you can try it: a MsgBox shows up, you click OK and another
MsgBox shows up; is this a bug or a stupid thing I've done?
--
Ariel Constenla-Haile
La Plata, Argentina
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.arielconstenlahaile.com.ar/ooo/
"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]