Short Description

Creates a Dialog behaving like ImageJ macros'.

Versions

  • Version 1 • Released on: 2013-03-11 14:02:13
    Download
    Description:

    initial version

    importClass(Packages.plugins.tprovoost.scripteditor.uitools.userdialogs.Dialog)
    
    dlg = new Dialog("My Dialog") // creation
    dlg.addNumber("A number", 12)
    
    // Combo Box with the array as choices, last value is the default
    dlg.addChoice("A choice", ["Choice 1", "Choice 2", "Choice 3"], "Choice 2")
    
    // Text Fields
    dlg.addString("A String", "Hello world!")
    dlg.addString("Another String", "Bye world!")
    
    // A slider and the min / max / default values
    dlg.addSlider("A slider", 0, 10, 5)
    
    dlg.show()
    
    res = dlg.getResult()
    if (!res) throw "User canceled"
    
    println(dlg.getNumber())
    println(dlg.getChoice())
    println(dlg.getString())
    println(dlg.getString())
    println(dlg.getNumber())

Leave a Review