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 "nospamfor...@gmx.de".
I use it for the OOo lists and only rarely read other mails sent to it.
--
-----------------------------------------------------------------
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help

Reply via email to