In the following script, I would like to do the following:
Based on the selection of TestTech, I want the appropriate TestStage check box list to appear (appear is preferred, if not become active if all options need to be visible). So,
- if Tech1 is selected, all TestSages with _Tech1 should be available to the user for selection
- if Tech2 is selected, all TestSages with _Tech2 should be available to the user for selection. This list is commented below
- if Tech3 is selected, all TestSages with _Tech3 should be available to the user for selection. This list is commented below, and so on.
I would also like "Select All" option to be available under each checkbox list.
How to do this?
Names Default To Here( 1 );
Clear Log ();
listInd = {};
returned2 = {};
win = New Window( "Select Tech & TestStage", << modal,
V List Box (
tb1=Text Box("Select Tech", << set font style("bold")),
cb1 = List Box(
{"Tech1", "Tech2", "Tech3"},
returned1 = (cb1 << Get Selected());
listInd= cb1 << Get Selected Indices;
),
tb1=Text Box("Select one or more TestStage", << set font style("bold")),
cb2 = Check Box(
{"Sage1_Tech1", "Sage2_Tech1", "Sage3_Tech1", "Sage4_Tech1", "Sage5_Tech1", "Sage6_Tech1"},
//{"Sage1_Tech2", "Sage2_Tech2", "Sage3_Tech2", "Sage4_Tech2", "Sage5_Tech2", "Sage6_Tech2"},
//{"Sage1_Tech3", "Sage2_Tech3", "Sage3_Tech3", "Sage4_Tech3", "Sage5_Tech3", "Sage6_Tech3"},
returned2 = (cb2 << Get Selected());
),
tb3=Text Box("Query TestDate (last 6 months selected by default)", << set font style("bold")),
end_date = Today();
start_date = Date Increment(end_date, "month", -6, "actual");
cb3 = H List Box(
Text Box("From:"),
scal = Number Edit Box(
start_date,
<<Set Format(Format("yyyy-mm-dd")),
<<SetFunction(Function({this}, start_date = scal << Get)),
<<Set Show Spin Box(1)
),
Spacer Box(Size(20, 20)),
Text Box("To:"),
ecal = Number Edit Box(
end_date,
<<Set Format(Format("yyyy-mm-dd")),
<<SetFunction(Function({this}, end_date = ecal << Get)),
<<Set Show Spin Box(1)
),
);
),
);
Technology = eval (returned1[1]); show (Technology);
TestStages = eval (returned2); show (TestStages);
TestStageOne = TestStages[1]; show (TestStageOne );
sdt = Munger( Format Date( start_date, "yyyy-mm-dd" ), 1, "T", " " );
edt = Munger( Format Date( end_date, "yyyy-mm-dd" ), 1, "T", " " );
Show( sdt, edt );
When it's too good to be true, it's neither