Re: Displaying Multiple Dialogs from BASIC

Mathias Bauer <[email protected]> Thu, 16 Jun 2011 11:17:06 +0200
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
On 16.06.2011 09:22, Hal Vaughan wrote:
> I've mentioned the sticky-note project I'm working on yesterday in two emails.
>
> Now I'm running into a problem: I'd like to display a number of sticky-notes, but to display any kind of dialog in BASIC, I need to do something like this:
>
> 	oSticky = createUnoDialog(DialogLibraries.HalLib.StickyNote)
> 	oSticky.Execute()
>
> And the program will stop until I close the dialog, either by the close button, a cancel, or OK, or another button.
>
> That means the only way to have multiple dialogs open is to open one and from there, open the next, and then open the next and so on.
>
> Is there some way, from BASIC, to display a dialog and leave it open without it stopping a script?

Execute() starts a modal mode, so it is not only understandable but also 
required that further *linear* execution of the script stops (handlers 
registered to buttons still we be called).

If you want to have more than one dialog, you have to execute them in a 
modeless way. I don't know if

oSticky.SetVisible(True)

works (I even don't know if UnoDialogs export an XWindow interface), but 
that's how it is done with C++ dialogs.

Besides that you will need to redesign your dialog a bit, modeless 
dialogs usually don't have "OK" or "Cancel" buttons, because they 
directly act on the document when their buttons are operated by the user.

If your dialog logic makes it necessary to have an "OK" button, most 
probably a modal dialog is recommended and no other dialogs (except sub 
dialogs) should be operable while it is visible.

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.
-- 
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help