User Tools

Site Tools


script-dialogs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

script-dialogs [2018/04/02 08:41] (current)
teq created
Line 1: Line 1:
 +====== Dialogs example ======
 +The scripting language supports user interaction by the means of message, question, progress, and selection dialogs.
  
 +<code javascript>​
 +/**
 + * Message dialogs example.
 + * Author: Camera Controller
 + * Web: http://​www.tequnique.com/​cameracontroller
 + * Description:​ This example shows different message dialog types which can be used in scripts.
 + */
 +
 +// Progress dialog
 +showProgressDialog("​Info",​ "This is a progress dialog which will close in 2 seconds."​);​
 +waitMilliseconds(2000);​
 +hideProgressDialog();​
 +
 +// Question dialog
 +var result = showQuestionDialog("​Question",​ "Show text input?"​);​
 +if (result) {
 +    // Text input dialog
 +    var text = showTextInputDialog("​Info",​ "What is your name?",​ ""​);​
 +    showMessageDialog("​Info",​ "Your name is: " + text);
 +}
 +else {
 +    // List selection dialog
 +    var choices = ["​A",​ "​B",​ "​C"​];​
 +    var selectedIndex = showListSelectionDialog("​title",​ ["​A",​ "​B",​ "​C"​],​ 1);
 +    if (selectedIndex > -1) {
 +        showMessageDialog("​Info",​ "​Selected item: " + choices[selectedIndex]);​
 +    }
 +}
 +</​code>​
script-dialogs.txt ยท Last modified: 2018/04/02 08:41 by teq