//
// getValues() exhaustive behavior test
//
// --------------------------------------------------
// 1. Explicit TEXT input
// --------------------------------------------------
var res1 = VQ.getValues(
"Text input (explicit)",
{
"Text 1": "text",
"Text 2": ["text"],
"Text 3": ["text", "Default value"]
},
true
);
print("Text explicit:", JSON.stringify(res1));
// --------------------------------------------------
// 2. Explicit INT input
// --------------------------------------------------
var res2 = VQ.getValues(
"Int input",
{
"Int default": ["int"],
"Int value": ["int", 5],
"Int range": ["int", 5, 0, 10],
"Int full": ["int", 5, 0, 10, 2]
},
true
);
print("Int:", JSON.stringify(res2));
// --------------------------------------------------
// 3. Explicit DOUBLE input
// --------------------------------------------------
var res3 = VQ.getValues(
"Double input",
{
"Double default": ["double"],
"Double value": ["double", 0.5],
"Double range": ["double", 0.5, 0.0, 1.0],
"Double decimals": ["double", 0.5, 0.0, 1.0, 3],
"Double full": ["double", 0.5, 0.0, 1.0, 3, 0.01]
},
true
);
print("Double:", JSON.stringify(res3));
// --------------------------------------------------
// 4. Explicit ITEM (combobox)
// --------------------------------------------------
var res4 = VQ.getValues(
"Item input (explicit)",
{
"Item 1": ["item", ["Red", "Green", "Blue"]],
"Item 2": ["item", "Small", "Medium", "Large"]
},
true
);
print("Item explicit:", JSON.stringify(res4));
// --------------------------------------------------
// 5. Implicit TEXT (single unknown argument)
// warning This exercises the buggy path in C++
// --------------------------------------------------
var res5 = VQ.getValues(
"Implicit text (BUGGY PATH)",
{
"Implicit text": "Hello world"
},
true
);
print("Implicit text:", JSON.stringify(res5));
// --------------------------------------------------
// 6. Implicit COMBOBOX (multiple unknown arguments)
// --------------------------------------------------
var res6 = VQ.getValues(
"Implicit item",
{
"Implicit combo": ["Red", "Green", "Blue"]
},
true
);
print("Implicit combo:", JSON.stringify(res6));
// --------------------------------------------------
// 7. Mixed dialog (realistic usage)
// --------------------------------------------------
var res7 = VQ.getValues(
"Mixed inputs",
{
"Name": ["text", "Alice"],
"Age": ["int", 30, 0, 120],
"Threshold": ["double", 0.75, 0, 1, 2, 0.01],
"Mode": ["item", ["Fast", "Accurate"]],
"Color": ["Red", "Green", "Blue"]
},
true
);
print("Mixed:", JSON.stringify(res7));
// --------------------------------------------------
// 8. Cancel behavior test
// --------------------------------------------------
// Pressing Cancel will call abort() and stop execution
//
VQ.getValues(
"Cancel test (press Cancel)",
{
"This will abort": ["text", "Cancel me"]
},
true
);
// Code below here will NOT run if Cancel is pressed
print("This line will never execute if Cancel is clicked");