Auto-close |
Top Previous Next |
Sometimes you need to left a program run unattended, for example during the night. What a surprise if the next morning you find the program halted with a silly message! With NeatMessage you have the option to make the message "auto-close" itself if it isn't answered in a desired time. You need to set some variables to achieve this:
NMGLO:AutoClose = TRUE NMGLO:Delay = 10 NMGLO:DefaultAC = Button:Ok NMGLO:Show = FALSE Message(loc:message2,'Title',ICON:ASTERISK,'Continue')
You set NMGLO:AutoClose to TRUE to enable the "Auto-Close" feature. With NMGLO:Delay you set how much time, in seconds, the message will wait to shut down itself. If the message have many buttons, you may specify the one to be pressed using NMGLO:DefaultAC. If you don't specify NMGLO:DefaultAC the the default button will be pressed. Finally, you will see no warning that the window is going to close, unless you set NMGLO:Show to TRUE. If you do that, the default button will show the seconds remaining to the auto-close.
With NMGLO:Show = TRUE you will see something like this:
Old (version 1.x) method:
You may easily enable the "auto close" feature using the hooked Message() function. You just need a button with the text "Continue|nn" where "nn" is the time in seconds that the windows will wait to the user to press the button before to auto closes itself.
The calling function will be something like
Message('There are no records in the range especified','Warning',ICON:EXCLAMATION,'Continue|3')
This will show the following window:
As you can see, you are using the normal Message() syntax, except that you will specify a compound button where you have the text of the button and the time in seconds it takes to close. If you don't hook the message function and still use this syntax, Clarion's Message() function will not give an error, but it will show 2 buttons (you can see this in the example as well).
If you prefer to replace the text that triggers the auto close feature ("Continue", by default) you can easily do by changing the text option inside the local extension of the NeatMessage() function (See Local Extension, Auto-Close).
|