07-26-2024, 12:44 AM
Can I do a Yes/No Dialog box with a time out (say pick the default value if the user doesn't choose within a specific interval) ?
Dialog box with Time out. ?
|
07-26-2024, 12:44 AM
Can I do a Yes/No Dialog box with a time out (say pick the default value if the user doesn't choose within a specific interval) ?
07-26-2024, 05:14 AM
(07-26-2024, 12:44 AM)ahenry3068 Wrote: Can I do a Yes/No Dialog box with a time out (say pick the default value if the user doesn't choose within a specific interval) ?Sure. Pcopy your screen to another page, draw your dialog box and yes/no buttons, and then have code that checks for mouse input along with a timer. When the timer runs out Pcopy the other page back to your screen to remove the dialog box and choose the default value.
07-26-2024, 06:00 AM
Here is something I whipped up real quick to give you an idea of how to accomplish this.
Code: (Select All) Inputbox = _NEWIMAGE(300, 100, 32)
07-26-2024, 07:16 AM
I found one error in Terry's code...
Code: (Select All) LOCATE 5, 28: PRINT "NO"; Code: (Select All) LOCATE 5, 28: PRINT "HELL YES"; Basically the IDE uses this pcopy method for all of the drop-down menus. Things that take very creative solutions are timers for INPUT and _MESSAGEBOX. These pause your program until a reply is made. The way around that is to make two programs. Program 1 calls the second _MESSAGEBOX program via a SHELL statement. When the timer in program 1 runs out, the message box is terminated by a SHELL to TASKKILL. You also need a small database to communicate, or a TCP/IP connection. _SCREENHIDE, Win32 AP minimization, etc. can be used to make it seem like only one program is running. Pete
07-26-2024, 04:24 PM
it could probably be done with _messagebox. if the user didn't have to supply an answer, then _notifydialog is good enough.
if not, on linux could use Zenity or probably Yad. Yad is more complicated for me. either one is an external separate program which will require using shell _hide. this is from man zenity. the last item has the most interest. Quote:General optionsalso the type of dialog. (choose yes or no) Quote:--questionone disadvantage is that Zenity might not be installed with linux distribution "by default." Yad is present in even fewer distributions such as endeavouros. |
« Next Oldest | Next Newest »
|