List Info

Thread: Re: Complex toolbars




Re: Complex toolbars
user name
2007-09-14 00:22:28
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.hailegmail.com
arielarielconstenlahaile.com.ar

http://www
.arielconstenlahaile.com.ar/ooo/

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Complex toolbars
user name
2007-09-16 03:33:58
Am Freitag, den 14.09.2007, 02:22 -0300 schrieb Ariel
Constenla-Haile:
> ...
> 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.

So that was the missing link I was not able to find - now
I've seen it
in the C++ example (and even understood).

> 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).

Well, I have also been trying a lot of things. My idea was
that because
a macro can be called by that button
"URL=macro:///something", then I
just need a handle or so to that toolbaritem to manipulate
it. No
success - and if even Paolo is at his wits' ends, there is
on point in
me trying.
> ...
> If you have one month free, I will suggest you to start
with Java 
> ... 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.
> 
Thanks to all of you. I put the complex toolbars aside for
the moment
and rather concentrate on some additional features that have
been
requested (still in BASIC) and another program (in C for
Gnome/Linux)
and if the winter is long enough I will look into Java
later-on.

Dietmar

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )