Hello,
I am currently developing a user interface with text and corresponding checkboxes. My code is :
strGroupColName = "Group";
lstGroupId = {"A", "B","C","D","E","F","G","H","I","J","K","L"};
strCompareControl = "Compare";
strCompareAddButton = "Add";
strCompareRemoveButton = "Remove";
Compare_String_Col_Box = function({strGroupColName,lstGroupId},
//Get number of groups
intNGpId = NItems(lstGroupId);
strStringColBox =
"VListBox(
BorderBox( Bottom(3),
TextBox(strGroupColName),
)";
For(ig = 1, ig<= intNGpId, ig++,
strStringColBox = strStringColBox || ",
BorderBox( Bottom(3),
TextBox(\!" " || lstGroupId[ig] || "\!",<<Justify Text( \!"left\!" ),<<Set Wrap(4000 )),
)";
);
strStringColBox = strStringColBox || ")";
return( eval( parse(strStringColBox) ) );
);
//Run display box containing comparison groups for user interface
winGroupComparison = function({lstGroupId},
//Get number of groups
intNGpId = NItems(lstGroupId);
//Construct string of String Col Box() containing border box to align labels with checkboxes
strStringColBox =
"VListBox(
BorderBox( Bottom(2),
TextBox(strGroupColName),
)";
For(ig = 1, ig<= intNGpId, ig++,
strStringColBox = strStringColBox || ",
BorderBox( Bottom(2),
TextBox(\!" " || lstGroupId[ig] || "\!",<<Justify Text( \!"left\!" ),<<Set Wrap(4000 )),
)";
);
strStringColBox = strStringColBox || ")";
//Construct string of 2 columns (Grp and Ctrl) of check boxes
strNCheckBox = ConcatItems(repeat(list("CheckBox({\!"\!"})"),intNGpId),",");
strCheckBx = "HListBox( VListBox(TextBox(\!"Grp\!"), "||strNCheckBox||"),
VListBox(TextBox(\!"Ctrl\!"),"||strNCheckBox||"))";
//Initialize to empty list of added comparison columns of check boxes
lstcomparedpbx = list();
//Script of display box containing all the check boxes and add and remove comparison buttons
win = "BorderBox(Left(0),Top(20),
VListBox(
OutlineBox(strCompareControl,
HListBox(
bbxAdd = ButtonBox(strCompareAddButton,
If(NItems(lstcomparedpbx)==0, lastcompbx = comparedpbx_5, lastcompbx = lstcomparedpbx[NItems(lstcomparedpbx)]);
lastcompbx << SibAppend(BorderBox(Left(10),HListBox(comparedpbx_i = "||strCheckBx||")));
insertinto(lstcomparedpbx,comparedpbx_i);
),
bbxRemove = ButtonBox(strCompareRemoveButton,
Try(lstcomparedpbx[nitems(lstcomparedpbx)] << delete) ;
lstcomparedpbx = remove(lstcomparedpbx,nitems(lstcomparedpbx));
))
,
BorderBox(Top(20),
HListBox(
strcolbx = VListBox(
Compare_String_Col_Box(strGroupColName,lstGroupId)),
BorderBox(Left(10), HListBox(comparedpbx_1 = "||strCheckBx||")),
BorderBox(Left(10), HListBox(comparedpbx_2 = "||strCheckBx||")),
BorderBox(Left(10), HListBox(comparedpbx_3 = "||strCheckBx||")),
BorderBox(Left(10), HListBox(comparedpbx_4 = "||strCheckBx||")),
BorderBox(Left(10), HListBox(comparedpbx_5 = "||strCheckBx||")),
))
)))";
return( win );
);//end function
groupwin = winGroupComparison(lstGroupId);
Newwindow("Test", eval( parse( groupwin )));
The problem is that the checkboxes are not aligned with the corresponding text, and this issue occurs only on certain computers (same version of JMP used on these different computers). I believe this is due to the different screen sizes. For exemple :
How can I ensure that the checkboxes are always aligned with the text, regardless of the computer being used?
I use JMP 17.2.0
Thank you in advance for your help.