Hi Mathias,
> I know that someone successfully used a trick to achieve modality: when
> her started his Java dialog he created a 1 pixel sized modal dialog with
> the OOo toolkit with the current OOo window as parent and moved it to
> the upper left corner of the screen. This will create the desired modal
> mode.
yes, the modal-mode works using the following code, but I don't know
how to return from the xInfoBox.execute() method in a programmatic
way. I need to stop the execution of the infobox-dialog when my
jframe-dialog returns. I already tried to use dispose() on the
XComponent-Interface of xInfoBox from a different thread, but that
caused OOo to crash.
... create Toolkit ...
// describe the info box ini it's parameters
com.sun.star.awt.WindowDescriptor aDescriptor = new
com.sun.star.awt.WindowDescriptor();
aDescriptor.WindowServiceName = "infobox";
aDescriptor.Bounds = new com.sun.star.awt.Rectangle(0, 0, 300, 200);
aDescriptor.WindowAttributes = com.sun.star.awt.WindowAttribute.BORDER
| com.sun.star.awt.WindowAttribute.MOVEABLE
|
com.sun.star.awt.WindowAttribute.CLOSEABLE;
aDescriptor.Type = com.sun.star.awt.WindowClass.MODALTOP;
aDescriptor.ParentIndex = 1;
aDescriptor.Parent = (com.sun.star.awt.XWindowPeer) UnoRuntime
.queryInterface(com.sun.star.awt.XWindowPeer.class, frame
.getContainerWindow());
// create the info box window
com.sun.star.awt.XWindowPeer xPeer = xKit.createWindow(aDescriptor);
com.sun.star.awt.XMessageBox xInfoBox =
(com.sun.star.awt.XMessageBox) UnoRuntime
.queryInterface(com.sun.star.awt.XMessageBox.class, xPeer);
if (xInfoBox == null) return null;
// fill it with all given informations and show it
xInfoBox.setCaptionText(sTitle);
xInfoBox.setMessageText(sMessage);
xInfoBox.execute();
any ideas?
A particular API for modality would be fine!
best regards,
Christoph
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]