Hi people,

FIRST of all, I would like to thank the one who wrote the code of the
GUI examples on the new SDK
(OpenOffice.org_2.3_SDK/examples/DevelopersGuide/GUI): it answers some
questions I had for a long time! Thanks hr (I don't know your real name!)!

THEN, some questions about the code examples:

****************************************************************************

* FIRST QUESTION: On the API reference, I always founded the XMenu and
XPopupMenu interfaces (and related ones), but as there is no service
specification at all, I just didn't know how to instantiate this
interfaces. Well, now I've learn that the services names used in the
examples are

"stardiv.Toolkit.VCLXMenuBar" and
"stardiv.Toolkit.VCLXPopupMenu"

At first sight, they look like the implementation names you use
internally, but not like service names published as UNO services, I
mean, com.sun.star.awt.MenuBar, and com.sun.star.awt.PopupMenu

But to my surprise, I used XComponentContext::getServiceManager() to get
the XMultiComponentFactory, then used its method
getAvailableServiceNames() and got a sequence that DOES contain these
service names:

"com.sun.star.awt.MenuBar"
"com.sun.star.awt.PopupMenu"
"stardiv.vcl.MenuBar"
"stardiv.vcl.PopupMenu"

And we can use any of the names:

1. "com.sun.star.awt.PopupMenu"
2. "stardiv.vcl.PopupMenu"
3. "stardiv.Toolkit.VCLXPopupMenu"

as they instantiate the same type.

And again to my surprise, "com.sun.star.awt.MenuBar" and
"com.sun.star.awt.PopupMenu" are not included on OOo2.3 SDK API
reference, nor in the source/offapi/com/sun/star/awt IDL files.

So, are they going to be included in the API? Is it safe to use them?
What service name shall we use, out of the tree options? Since which OOo
version can they be used?

*********************************************************************

* SECOND QUESTION: the excellent example uses a fixed text control to
execute the PopupMenu. I played with an implementation of the dbaccess
SQL Direct dialog: I wanted to add a pop up menu to the edit control to
insert SQL templates in it (just like OOo Math commands window's context
menu).

You can find a picture of the result here:

http://www.arielconstenlahaile.com.ar/ooo/temp/DBExtras_XSQLDirect_04.png


But I found some problems: when I right click on the edit control
window, my implementation of the XMouseListener isn't call first, but
the edit control own implementation, and it consumes the event,
executing its context menu (the "Paste/Select all/Special chars". one),
and my XMouseListener  implementation gets called just if I right clik
on that context menu.

The problem here: FIRST the context menu of the edit control is
executed, THEN my pop up menu IF I right click on this context menu.
What I really need here is an XContextMenuInterceptor, but how do I get
the XContextMenuInterception for the edit control when it has no
com.sun.star.frame.Controller ? (as long as I know, UnoControls
implement the Model-View Paradigm, NOT the Frame-Controller-Model Paradigm)


The example on the SDK works OK, because the fixed text implementation
has no context menu, but how do I intercept the context menu of
UnoControls? Is it possible at all? (I mean, using API, not hacking
OOo's C++ code).


****************************************************************************


Well, that's all! Sorry for the extension, but maybe someone gets
something useful from this!


Bye and thanks!



--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

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

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

Reply via email to