Auto-closing user dialogue (macro, Basic)

classic Classic list List threaded Threaded
3 messages Options
Johnny Rosenberg Johnny Rosenberg
Reply | Threaded
Open this post in threaded view
|

Auto-closing user dialogue (macro, Basic)

Hi!
For some reason I can't figure this out…

I have made a simple dialogue with two buttons and a numeric field. Those
buttons triggers two different subroutines that does two different things
and then closes the entire dialogue.

I want the dialogue to close automatically after ten seconds if neither of
the buttons have been pushed. The remaining time is to be displayed in the
numeric field mentioned above.

However, I couldn't find a way to trig a function ”when nothing else
happens”. Here's what I want to do:
Dialogue opens.
User does nothing, so a subroutine is called checking the remaining time
and displays it in the numeric field.
User still doesn't do anything and the above repeats until remaining time
is zero, then the dialogue is closed.

Any suggestions?

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Luuk Luuk
Reply | Threaded
Open this post in threaded view
|

Re: Auto-closing user dialogue (macro, Basic)


On 9-12-2018 19:02, Johnny Rosenberg wrote:

> Hi!
> For some reason I can't figure this out…
>
> I have made a simple dialogue with two buttons and a numeric field. Those
> buttons triggers two different subroutines that does two different things
> and then closes the entire dialogue.
>
> I want the dialogue to close automatically after ten seconds if neither of
> the buttons have been pushed. The remaining time is to be displayed in the
> numeric field mentioned above.
>
> However, I couldn't find a way to trig a function ”when nothing else
> happens”. Here's what I want to do:
> Dialogue opens.
> User does nothing, so a subroutine is called checking the remaining time
> and displays it in the numeric field.
> User still doesn't do anything and the above repeats until remaining time
> is zero, then the dialogue is closed.
>
> Any suggestions?
>

I do not think its possible to create a user-defined event in a Macro in
LibreOffice.


The docs say nothing about how it can be done.

https://wiki.openoffice.org/wiki/Documentation/DevGuide/Basic/Adding_Event_Handlers

https://help.libreoffice.org/Basic/Event-Driven_Macros




--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Windows7 / LibreOffice  3.3 330m19(Build:6)
Jean-Francois Nifenecker Jean-Francois Nifenecker
Reply | Threaded
Open this post in threaded view
|

Re: Auto-closing user dialogue (macro, Basic)

In reply to this post by Johnny Rosenberg
Hi Johnny,

Le 09/12/2018 à 19:02, Johnny Rosenberg a écrit :

> Hi!
> For some reason I can't figure this out…
>
> I have made a simple dialogue with two buttons and a numeric field. Those
> buttons triggers two different subroutines that does two different things
> and then closes the entire dialogue.
>
> I want the dialogue to close automatically after ten seconds if neither of
> the buttons have been pushed. The remaining time is to be displayed in the
> numeric field mentioned above.
>
> However, I couldn't find a way to trig a function ”when nothing else
> happens”. Here's what I want to do:
> Dialogue opens.
> User does nothing, so a subroutine is called checking the remaining time
> and displays it in the numeric field.
> User still doesn't do anything and the above repeats until remaining time
> is zero, then the dialogue is closed.
>
> Any suggestions?
>

Not sure if that can be of help. Have a look at that page:
https://documentation.libreoffice.org/en/english-documentation/macro/

get the Dialogs RefCard
(https://documentation.libreoffice.org/assets/Uploads/Documentation/en/MACROS/RefCards/LibOBasic-6-Dialogs-Flat-A4-EN-v103.pdf).
The Non-Modal dialog part might give you some ideas.

HTH,
--
Jean-Francois Nifenecker, Bordeaux


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy