Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
//1. use << return result
nw = New Window("test window", << modal, << return result,
fls = Filter Col Selector(dt, all, << set selected(1)),
clb = Col List Box(dt, all, << set selected(2)),
cb = combo box({"selection1", "selection2"}),
rb = Radio Box({"a", "b", "c"}),
teb = Text Edit Box("teb"),
neb = Number edit box(10),
);
show(nw);
//2. get values in button
aa_results = Associative Array();
nw = New Window("test window", << modal, << return result,
fls = Filter Col Selector(dt, all, << set selected(1)),
clb = Col List Box(dt, all, << set selected(2)),
cb = combo box({"selection1", "selection2"}),
rb = Radio Box({"a", "b", "c"}),
teb = Text Edit Box("teb"),
neb = Number edit box(10),
Button Box("OK",
aa_results["fls"] = fls << Get selected;
aa_results["clb"] = clb << get items;
aa_results["cb"] = cb << get;
aa_results["rb"] = rb << get;
aa_results["teb"] = teb << get text;
aa_results["neb"] = neb << get;
);
);
If(nw["Button"] == 1,
show(aa_results);
);
//3. get values during on close
aa_results = Associative Array();
nw = New Window("test window", << modal, << return result,
<< on close(
aa_results["fls"] = fls << Get selected;
aa_results["clb"] = clb << get items;
aa_results["cb"] = cb << get;
aa_results["rb"] = rb << get;
aa_results["teb"] = teb << get text;
aa_results["neb"] = neb << get;
),
fls = Filter Col Selector(dt, all, << set selected(1)),
clb = Col List Box(dt, all, << set selected(2)),
cb = combo box({"selection1", "selection2"}),
rb = Radio Box({"a", "b", "c"}),
teb = Text Edit Box("teb"),
neb = Number edit box(10),
);
If(nw["Button"] == 1,
show(aa_results);
);
//4. would be to set script to each of elements, but I prefer other methods
//5. create wrapper with onclose and return result?
/*
//some of the ways to get values from different display boxes
nw = New Window("test window",
fls = Filter Col Selector(dt, all, << set selected(1)),
clb = Col List Box(dt, all, << set selected(2)),
cb = combo box({"selection1", "selection2"}),
rb = Radio Box({"a", "b", "c"}),
teb = Text Edit Box("teb"),
neb = Number edit box(10),
);
show(nw);
fls << Get selected;
clb << get items; clb << get selected; clb << Get Selected Indices;
cb << get; cb << get selected;
rb << get; rb << Get Selected;
teb << get text;
neb << get; neb << get text;