Kohei Yoshida schrieb:

Hi there,

This question is related to this thread:

http://framework.openoffice.org/servlets/ReadMsg?list=dev&msgNo=863

where I asked how best to add a menu item dynamically when
--enable-scsolver is given at configure time, which enables the calc
solver feature during the build.  On that thread, we concluded that
the best way to add the new "Solver..." menu is to use a UNO API to
insert a new menu item at a desired location.  Carsten Driesner
demonstrated this in Basic, which I later ported to C++.  I confirmed
that it works.

Now, I need to somehow find a way to make that UNO call before the
user launches Calc for the first time after installation, but I'm not
sure how that could be achieved.  I've been thinking of finding a
suitable UNO interface to implement in my Solver component and have it
called during or post installation in order to add the new menu item.
But I need some help on this.

Is there a good UNO interface to implement for a simple task like
this, and is there a way to call its exported method sometime before
the first launch of Calc after installation?

a)
You can use the job feature of OOo. Such jobs will be registered inside configuration and can be bound to several events provided by the office. E.g. for your use case the events "OnStartApp", "onFirstVisibleTask" or "OnNew", "OnLoad" can be interesting.

Please read the Developers' Guide chapter
"4.7  Integrating Components into OpenOffice.org" especialy
"4.7.2 Jobs".

The link on OOo is "http://api.openoffice.org/docs/DevelopersGuide/Components/Components#1_7_2_Jobs";

b)
Because you patch the calc module directly during build time, there is a more simple solution. Copy and change the original menu XML file. Inside the makefile you can use your "build switch" to deploy and pack these new XML file instead of the original one. It's more simple and by the way does not increase the startup performance of OOo.

Note: There exists a demand for changing the UI of an application (toolbars/menus). So we decided to support modifications on these UI elements within AddOn's. But currently there is no time to implement this feature. So please use the solution a/b) ... or wait till we find time to implement the new feature.


Thanks for your advice,

Kohei

Regards
Andreas

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

Reply via email to