Where I need to ask the user a question with a dialog I've been using this:
- Code: Select all
var thePressedButton = plugins.dialogs.showQuestionDialog('Warning', 'This SQL has NOT been applied to the Database yet - do you want to continue without applying it ?','OK', 'Cancel');
if(thePressedButton =='OK'){
//Get the current record index or do some work etc.
} }
else {return;}
A technique I used in VB seems to work well here too:
- Code: Select all
if('OK' == plugins.dialogs.showQuestionDialog('Warning', 'Lets see which button you press ?','OK', 'Cancel')){ //do some work}
else {return;}
Doesn't save a lot of code but is more readable IMHO.