Dietmar Hiller escribió:
> Am Dienstag, den 11.09.2007, 10:15 +0200 schrieb
Carsten Driesner:
>> Hi Dietmar,
>>
>> ...You can use the complex toolbar controller
feature with BASIC. ...
> I am at my wits' end.
> My understanding up to now is: I have the configuration
file
> "ProtocolHandler.xcu" where I define a
handler that is passing to me
> events defined in the URL of my toolbar elements.
What you have to do in the node "HandlerSet" of
the ProtocolHandler
configuration in your add-on is declare the class with the
*implementation of the XDispatchProvider*, that is your *UNO
component*
that will be instantiated by the dispatch framework when the
user
pressed a btn. on a toolbar with a command url containing a
protocol
registered by your impl.
Read the first lines in the Dev's Guide:
"The protocol handler mechanism is an API that enables
programmers to
add arbitrary URL schemas to the existing set of command
URLs by writing
additional protocol handlers for them. Such a protocol
handler must be
implemented as a UNO component and registered in the
OpenOffice.org
configuration for the new URL schema."
I repeat "Such a protocol handler *must be* implemented
as a UNO
component": that is IMPOSSIBLE in OOo Basic. You can
not implement UNO
components in that language, sorry :-( nor a protocol
handler, an
XToolbarController, etc.
I really see no way for you to do what you want. But here is
people with
more OOo Basic knowledge (for example Andrew Pitonyak, and
Paolo
Mantovani; Paolo has done some things that were taken for
granted to be
impossible for OOoBasic).
> Now I just need to
> create an initializer
you need an UNO component implementing XDispatchProvider:
"A protocol handler implementation must follow the
service definition
com.sun.star.frame.ProtocolHandler. At least the interface
com.sun.star.frame.XDispatchProvider must be
supported"
> and a listener to catch these events. Here I am
> stuck, I admit I am not deep enough into the heart of
UNO to understand
> the online SDK sufficiently to know what to do in BASIC
now. The example
> is of course object oriented and without knowing the
objects in detail
> it is tough to understand.
> So here is the deal I want to offer. Someone please
take me by the hand
> to find my way (I already googled, obviously I am the
first) and I will
> write a comprehensive code snippet or wiki (your
choice) for followers
> in BASIC and support them through the forums.
> Next steps would be: how to create the initializer and
then listen to
> the events.
>> Anyway using C++ or Java would give you much more
flexibility.
>>
> provided that this winter will be as awful as it's
promising right now,
> I intend to learn C++ - not for OOo though. It will be
the 11th
> programming language for me after having started in
1980 with COBOL...
If you have one month free, I will suggest you to start with
Java
(despite the unjustified prejudices). You will find that
working with
the NetBeans IDE, you can create your addon schema with a
wizard!
Besides, compiling UNO Java vs. compiling UNO C++? here wins
Java/NetBeans IDE plug-in. Even without the plugin, building
the SDK
Java examples is easier (I'm having a headache trying to get
the C++
examples compiled!!!).
Bye and luck!
Ariel.
--
Ariel Constenla-Haile
La Plata, Argentina
ariel.constenla.haile gmail.com
ariel arielconstenlahaile.com.ar
http://www
.arielconstenlahaile.com.ar/ooo/
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|