Don't ask me again

Top  Previous  Next

There are occasions where a message could be annoying for one user, and useful for others. In such occasions you may want to give the user the choice to never see the message again. That could be accomplished introducing a "Don't ask me again" checkbox in the message box, like in the following message window:

 

clip0029

 

In this example, if your user closes the program accidentally often, this message is helpful. For other users, this is a waster of time when they want to exit your program. Now, if they mark the "Do not ask this again" checkbox prior to make their selection, this message won't show again for this particular user.

 

Now, in this same example, you see there are two possible answers; yes and no. When your user mark the checkbox, and then select and option, that option will be saved as "default answer" to be used for now on for this message. But in this particular case, what if your user selects "no"? He won't be able to exit the program any more! Don't worry, you may specify a "desired answer" in your program that will override your user's answer, so you can specify the correct default behaviour when there is not a real choice.

 

If you want that a message shows this feature, then you specify the global variable NMGLO:DoNotAksAgain as TRUE just before calling the Message() function. For example, this is the code for the window showed above:

 

 NMGLO:DoNotAksAgain = TRUE

 NMGLO:DesiredAnswer = Button:Yes

 NMGLO:Style = FONT:Bold

 CASE Message('You are about to exit this program. Are you sure?','Please confirm',ICON:Question,Button:Yes+Button:No)

   OF Button:Yes

     Message('Answered Yes')

   OF Button:No

     Message('Answered No')

 END

 

Note that the function will exit by Yes or No as long as the user won't mark the checkbox. Once he mark the "do not ask this again" checkbox, the function will exit always by the "Yes" option (as the desired answer is set to Button:Yes).

 

This is the list of available standard buttons:

Button:Yes, Button:No, Button:Ok, Button:Cancel, Button:Abort, Button:Retry, Button:Ignore, Button:Help.

 

Note: This feature requires the dictionary files to work.