Yes/No/Cancel Popup

Function to return an object that can be used a Yes/No/Cancel popup box

PRIMER has many built in functions for popup windows, however the text on the popup buttons cannot be changed. This function implements a simple 3 button popup, which the user has full control over. Three functions are included:

YesNoCancelWindow – this function sets up the popup. It has no input arguments and it returns the popup object.

YesNoCancel – This function is how to call the popup, it is invoked using popup.show() where popup is the object returned by YesNoCancelWindow. It has four input arguments:
• Yes  – text to be displayed on ‘yes’ button.
• No – text to be displayed on ‘no’ button.
• Cancel – text to be displayed on the ‘cancel’ button.
• Prompt = user prompt text

YesNoCancelClick – function is called when user presses a button.  This is an internal function and not invoked by the user. When the user clicks a button the .status property is updated – this is how to determine which button was clicked by the user.

The included example shows how to setup the popup using YesNoCancelWindow() and invoke it twice using .show(). The example outputs messages to the dialogue window depending on which button the user clicks.