[api-dev] UNSANSWERED: a non-modal dialog
Hi, in reply to Jurgen and Andreas ([EMAIL PROTECTED] REQUEST: unanswered questions). This hasn't been answered yet. Nicolai -- Weitergeleitete Nachricht -- Subject: [api-dev] Making of a non-modal dialog Date: Samstag 07 Oktober 2006 17:23 From: Nicolai Stange [EMAIL PROTECTED] To: dev@api.openoffice.org Hello, I want to write an Addon for Calc (implemented as an asynchronous job) that shows an non-modal dialog. It really should be non-modal because the user must input a cell-range and doing it non-modal allows him to look at his cells and scroll them while typing. Maybe he may select the desired cells within the Calc-Window and my Dialog is listening for changes in selection... So how to do that? At the moment I'm creating a dialog through the com.sun.star.awt.UnoControlDialog-service and associate a previously initialized com.sun.star.awt.UnoControlDialogModel with it. Then I create a PeerWindow for my Dialog through the XControl of the former service by calling its createPeer-method. All I get is a modal-dialog. I tried the second argument of createPeer (the parent peer) with any combination of Calc-XFrame;com.sun.star.frame.desktop-XFrame - getContainerWindow();getComponentWindow() with queryInterfacing for their return-value's XWindowPeer-interface. Debugging with jdb shows me, that the windows recived through com.sun.star.frame.desktop's methods are both null for my implementation. So is there a way to make the dialog's window open up non-modal or shall I give the following advise to my users: First think, then make a note, finally click? Thanks Nicolai Stange --- pgpMUIKv14sxa.pgp Description: PGP signature
Re: [api-dev] UNSANSWERED: a non-modal dialog
Hi Nocolai, you may also just set the window of your dialog visible. xDialog = xMultiServiceFactory.createInstance(com.sun.star.awt.UnoControlDialog); xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xDialog); xWindow.setVisible(true); After that you have to capture your programm flow in a loop because it doesn't stop like when you use the execute() method in a modal dialog. Best regards Berend Nicolai Stange wrote: Hi, in reply to Jurgen and Andreas ([EMAIL PROTECTED] REQUEST: unanswered questions). This hasn't been answered yet. Nicolai -- Weitergeleitete Nachricht -- Subject: [api-dev] Making of a non-modal dialog Date: Samstag 07 Oktober 2006 17:23 From: Nicolai Stange [EMAIL PROTECTED] To: dev@api.openoffice.org Hello, I want to write an Addon for Calc (implemented as an asynchronous job) that shows an non-modal dialog. It really should be non-modal because the user must input a cell-range and doing it non-modal allows him to look at his cells and scroll them while typing. Maybe he may select the desired cells within the Calc-Window and my Dialog is listening for changes in selection... So how to do that? At the moment I'm creating a dialog through the com.sun.star.awt.UnoControlDialog-service and associate a previously initialized com.sun.star.awt.UnoControlDialogModel with it. Then I create a PeerWindow for my Dialog through the XControl of the former service by calling its createPeer-method. All I get is a modal-dialog. I tried the second argument of createPeer (the parent peer) with any combination of Calc-XFrame;com.sun.star.frame.desktop-XFrame - getContainerWindow();getComponentWindow() with queryInterfacing for their return-value's XWindowPeer-interface. Debugging with jdb shows me, that the windows recived through com.sun.star.frame.desktop's methods are both null for my implementation. So is there a way to make the dialog's window open up non-modal or shall I give the following advise to my users: First think, then make a note, finally click? Thanks Nicolai Stange --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] UNSANSWERED: a non-modal dialog
Berend Cornelius wrote: Hi Nocolai, you may also just set the window of your dialog visible. xDialog = xMultiServiceFactory.createInstance(com.sun.star.awt.UnoControlDialog); xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xDialog); xWindow.setVisible(true); After that you have to capture your programm flow in a loop because it doesn't stop like when you use the execute() method in a modal dialog. Why should he create a loop? That's the most annoying thing in a modal dialog, why would you want to do the same with a modeless one? The better way is to keep a reference to the dialog and register a listener at it. The listener will tell you when the dialog was closed and the reference can be used to close the dialog when it is necessary or wanted. This could be e.g. when the whole view is closed or when the dialog has done its job. Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]