Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Summarize(dt, col_options_num = By(:age));
Insert Into(col_options_num, "<SELECT>", 1);
numeric_options = {"==", ">=", ">", "<=", "<"};
Summarize(dt, col_options_char = By(:name));
Insert Into(col_options_char, "</SELECT><SELECT>", 1);
character_options = {"==", "!="};
lub_expr_numeric = Expr(Lineup Box(N Col(3),
Combo Box(col_options_num, << Set Function(function({this},
If(this << get selected != "</SELECT><SELECT>",
((this << parent) << parent) << Append(lub_expr_numeric);
);
))),
Combo Box(numeric_options),
Number Edit Box(.)
));
lub_expr_character = Expr(Lineup Box(N Col(3),
Combo Box(col_options_char, << Set Function(function({this},
If(this << get selected != "</SELECT><SELECT>",
((this << parent) << parent) << Append(lub_expr_character);
);
))),
Combo Box(character_options),
Text Edit Box("")
));
// could also be built with Table Box
nw = New Window("Demo", << modal,
H List Box(
Panel Box("Numeric - age",
Lineup Ruler Box(
Widths({100,70,50}),
Lineup Box(N Col(3),
Text Box("Row Value"),
Text Box("Compare"),
Text Box("Value")
),
V List Box(
lub_expr_numeric,
),
Text Box("..."),
Lineup Box(N Col(3),
Text Box("Else"),
Combo Box({""}, << Enabled(0)),
Number Edit Box(.)
)
)
),
Spacer Box(Size(50,0)),
Panel Box("Character - name",
Lineup Ruler Box(
Widths({100,70,50}),
Lineup Box(N Col(3),
Text Box("Row Value"),
Text Box("Compare"),
Text Box("Value")
),
V List Box(
lub_expr_character,
),
Text Box("..."),
Lineup Box(N Col(3),
Text Box("Else"),
Combo Box({""}, << Enabled(0)),
Text Edit Box("")
)
)
),
Panel Box("Actions",
Button Box("OK",
num_vals = .
),
Button Box("Cancel")
)
)
);
</SELECT>