I was happy with the JSL formatting on the last test. Here is one final one, with more standard JSL code:
gui:nw = New Window("Select Variable",<<Modal,
<< On Validate(
gui = Namespace("gui.ambr-connector250.pega-analytics.co.uk");
sel = gui:lbFiles << Get Selected Indices;
If (NItems(sel)==0,
retVal = 0;
Beep();
,
retVal = 1
);
retVal
),
Border Box(Top(10),Bottom(10),Left(10),Right(10),
V List Box(
gui:lbFiles = List Box(lstFilteredFiles,Width(320),NLines(20)),
H List Box(
Spacer Box(Size(0,0)),
V List Box(
Spacer Box(Size(0,0)),
gui:tebFilter = Text Edit Box("",<<Set Hint("search string"),<<Set Width(250),
<<Set Text Changed(
Function({this,value},
gui = Namespace("gui.ambr-connector250.pega-analytics.co.uk");
If (Length(Trim(value))==0,
gui:btnApplyFilter << Enable(0)
,
gui:btnApplyFilter << Enable(1)
)
)
)
)
),
Spacer Box(Size(4,0)),
gui:btnApplyFilter = Button Box("search",<<Enable(0),<<Set Tip("apply the filter"),<<Set Script(DoAmbr250VariableSelectionFilter())),
Spacer Box(Size(4,0)),
V List Box(
Spacer Box(Size(0,0)),
gui:btnEraseFilter = Button Box("", DoAmbr250EraseVariableSelectionFilter(), <<Set Icon(nsPROJPATH:ICONS_DIR || "erase-12.png"),<<Set Tip("Clear filter"), <<Enable(0))
)
),
)
)
);
If (gui:nw["Button"]==-1,
Throw()
);