Re: Displaying Multiple Dialogs from BASIC
Hal Vaughan <[email protected]> Thu, 16 Jun 2011 06:04:43 -0400
| Newsgroups | gmane.comp.openoffice.devel.api |
|---|---|
| Message-ID | <[email protected]> |
Thanks! Okay, I'll check for typos and other possible mess-ups. Hal On Jun 16, 2011, at 5:28 AM, Fernand Vanrie wrote: > Hal , >=20 > when using a Listner the Listener subroutine is called with a "EventObjec= t" > the EventObject.source is the ButtonControl > the EventObject.source.context is the DialogControl >=20 >=20 >=20 > oDialogControl =3D oEvent.source.context >> On Jun 16, 2011, at 4:59 AM, Fernand Vanrie wrote: >>=20 >>> On 16/06/2011 10:20, Hal Vaughan wrote: >>>> This leads to a couple other questions: >>>>=20 >>>> 1) On the CloseDialog() subroutine, if I want to execute it from a but= ton in the dialog, how can I pass the dialog itself to the routine? >>> you can add a listener to the button (using code) or manualy using the = GUI to place a "event" on the button who call a macro subroutine >> But when I do that, and the listener calls CloseDialog(), how do I make = sure that particular Dialog object is available to the CloseDialog() subrou= tine? I tried it as you have it written and at the dialog.setvisible(false= ) line I got an error because the object was not defined. >>=20 >>=20 >>=20 >> Hal >>=20 >>>> 2) Is there any way to run a macro when the "X" on the title bar of th= e dialog is clicked? >>> no, you can add a listener on closing the dialog or using the the "ste= tvisible" who avoid the functioning off the X and you can add a "cancelbu= ton" who call a sub who close the dialog and do someting more... >>>> Thanks! >>>>=20 >>>>=20 >>>> Hal >>>>=20 >>>>=20 >>>> On Jun 16, 2011, at 3:30 AM, Fernand Vanrie wrote: >>>>=20 >>>>> Hal , >>>>>=20 >>>>> Y ou can set a Dialogcontrol visible or not , but we need a timeloop = to keep it visible >>>>>=20 >>>>> i use 2 sub's for open and closing >>>>>=20 >>>>> Sub Opendialog >>>>> bEnd =3D false >>>>> oDialogcontrol.setvisible(true) >>>>> Do >>>>> Wait 100 ' keep computer running (should use "wait for key event" if= existed) >>>>> Loop while not bEnd >>>>> end sub >>>>>=20 >>>>> sub CloseDialog(dialog as object) >>>>> dialog.setvisible(false) >>>>> Bend =3D true >>>>> end sub >>>>>=20 >>>>> Hop it Helps >>>>>> I've mentioned the sticky-note project I'm working on yesterday in t= wo emails. >>>>>>=20 >>>>>> Now I'm running into a problem: I'd like to display a number of stic= ky-notes, but to display any kind of dialog in BASIC, I need to do somethin= g like this: >>>>>>=20 >>>>>> oSticky =3D createUnoDialog(DialogLibraries.HalLib.StickyNote) >>>>>> oSticky.Execute() >>>>>>=20 >>>>>> And the program will stop until I close the dialog, either by the cl= ose button, a cancel, or OK, or another button. >>>>>>=20 >>>>>> 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. >>>>>>=20 >>>>>> Is there some way, from BASIC, to display a dialog and leave it open= without it stopping a script? >>>>>>=20 >>>>>>=20 >>>>>> Thank you! >>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>> Hal-- >>>>>> ----------------------------------------------------------------- >>>>>> To unsubscribe send email to [email protected] >>>>>> For additional commands send email to [email protected] >>>>>> with Subject: help >>>>> --=20 >>>>> ----------------------------------------------------------------- >>>>> To unsubscribe send email to [email protected] >>>>> For additional commands send email to [email protected] >>>>> with Subject: help >>>>>=20 >>> --=20 >>> ----------------------------------------------------------------- >>> To unsubscribe send email to [email protected] >>> For additional commands send email to [email protected] >>> with Subject: help >>>=20 >=20 > --=20 > ----------------------------------------------------------------- > To unsubscribe send email to [email protected] > For additional commands send email to [email protected] > with Subject: help >=20 --=20 ----------------------------------------------------------------- To unsubscribe send email to [email protected] For additional commands send email to [email protected] with Subject: help