Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 1 Monat
Letzter Beitrag:
vor 2 Jahren, 1 Monat
Beteiligte Autoren:
StanleyBarnett, DerekT, Arie, Al

YesNo Dialog Timeout

Startbeitrag von StanleyBarnett am 22.05.2016 08:14


Using WinDev 21... How do I create a YesNo, Dialog, Confirm, Error, OKCancel or Warning system dialog with a timeout? I also need to set a default action of Yes or No so the default action code will run if a timeout occurs.

I see the InfoWithTimeout() function, but it just closes the dialog on timeout with no options to continue code processing in an automated routine.

I use this currently in VFP in an automated routines whereas if an error occurs, I put up the dialog for a user to deal with it and if no user is available, it will timeout with a default action and continue processing the other records. Nothing more aggravating than starting the day seeing a long running process get stopped by a dialog early in its process, and just sitting there waiting for hours for a human to click a button.

Thanks, Stanley


Hello Stanlyn

The "Details" tab of the button edit window allows you to set a button as a "timer button" and when the time is up the action of the button click event runs.


von Al - am 22.05.2016 10:09
I needed something similar a good while ago.

What I ended up doing was adding a automatic timed procedure (click on the '1:30' top right of code window) set for 10 seconds delay (Option 3)
Called this from the 'End of initialization' code section.
Procedure contained the code 'ExecuteProcess(BTN_YES,trtClick)'

The call from the app - IF YesNo(1,"My Message","Line 2") = Yes - used the param 1 = Yes button selected.

If you need this to be conditional then declare a global variable, set to true before the call and action the timer based on this condition.
If you do this then remember to set the variable to false on the closing of the message window.

Remember the 'WindevMessageWindow' is just a window like any other however it is not recommended to play around too much with the code.

This is not possible for the 'WindevDialogWindow' which is a black box with no accessible code.

von DerekT - am 22.05.2016 10:22
Hi Al,

Yes, I saw that, however that is not what I'm trying to get to work. Its the system dialogs for the YesNo, Info, InfoWithTimer, Dialog, Confirm, Error, ErrorWithTimer, OKCancel and/or Warning functions.

It appears these functions are similar to VFP's messagebox function, but WinDev's implementation appears to be missing a lot of functionality that I've been using over the years in VFP... And now, I'm trying to provide the same functionality using the WinDev way...

Thanks, Stanley

von StanleyBarnett - am 22.05.2016 10:22
Hi DerekT,

What do you mean by:
(click on the '1:30' top right of code window) set for 10 seconds delay (Option 3)

And are you saying the 'WindevMessageWindow' is the same as 'WindevDialogWindow'? In not please explain...

When you say black box, are you referring that it cannot be edited because its a system window, or it comes up in a command prompt black box window?


von StanleyBarnett - am 22.05.2016 10:42

I think this is what you need

YesNo(Yes,"Hi there")
will return YES after one second

YesNo(No,"Hi there")
will return NO after 5 seconds

von Arie - am 22.05.2016 10:49
Create a new procedure.
In the code window you will see a '1:30' icon on the top right.
Click this and window will open showing the options available.
Select radio button 2, Timer/Scheduled Procedure or 3, Thread
Further options for how you require the process to function will be displayed.
Click OK, the code window will display with text describing what you have selected.
Add your code as necessary.

The 'WindevMessageWindow' is what you were describing i.e. YesNo, Confirm, Error etc.

The 'WindevDialogWindow' is filled using the wizard that pops up and allows for you to use existing message text or creat new and configure any additional buttons with return values as you require.
The result is returned as a switch statement with each CASE representing the value return by the button actioned.
By black box I mean that the 'WindevDialogWindow' contains no code for you to use - all processing is contained within the 'Dialog' function.

von DerekT - am 22.05.2016 10:59
Hi Arie and DerekT,

The DelayBeforeClosing(100) works and I can easily see how it works...

And DerekT, I found the additional options the 1:30 relates to, which begs another question... Why is all this great functionality hidden?

Thanks, Stanley

von StanleyBarnett - am 23.05.2016 02:32
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.