cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
shampton82
Level VII

Sizing input boxes

I made a script to line up columns to proper names and the format showed up nice like this:

shampton82_0-1615228014035.png

Then I tried to add a check box to the right hand side and now the column name boxes are different widths.

shampton82_1-1615228046313.png

 

Any input on what I need to change to get it to look like the first image(all the boxes the same size) just with the check boxes on the end of each row?

 

 

Names Default To Here(1);

dt=current datatable();
can=0;
ok=0;
var1=0;
FC=1;
SN=1;
L1=1;
L2=1;
L3=1;
L3=1;
PN=1;
Dev=1;
LSL=1;
USL=1;

y=dt<<get column names(string);

listitems={};
ll1={};

for(i=1,i<=n items(y),i++,
	if(y[i]=="PCC_FEATURE_CODE",
		FC=0;
		FCVars = y[i];
	,
	y[i]=="SERIALNO",
		sn=0;
		SNVars = y[i] ;
	,
	y[i]=="LOCATION_1",
		L1=0;
		L1Vars = y[i];
	,
	y[i]=="LOCATION_2",
		L2=0;
		L2Vars = y[i];
	,
	y[i]=="LOCATION_3",
		L3=0;
		L3Vars = y[i] ;
	,
	y[i]=="POINT_NO",
		PN=0;
		PNVars = y[i];
	,
	y[i]=="DEVIATION",
		Dev=0;
		DVars = y[i];
	,
	y[i]=="LSL",
		USL=0;
		LSLVars = y[i];
	,
	y[i]=="USL",
		LSL=0;
		USLVars = y[i];
	);
);

if(sum(fc,sn,l1,l2,l3,pn,dev,usl,lsl)>0,
	var1=1;
);



If( can == 1,
Throw();
);


	nw = New Window( "Launch Dialog",
				<<Modal,
				V List Box(
							Align( "right" ),
							H List Box(
										Panel Box( "Select Columns",
													clb = ColListBox( dt, all, /*<<Set Data Type( "Numeric" )*/grouped )
												),
										Panel Box( "Cast Selected Columns into Roles",
													h list box(
																v list box(
																			h list box(Button Box( "PCC_FEATURE_CODE", clbFC << Append( clb << Get Selected )),
																					clbFC = Col List Box( MinItems( fc ), MaxItems( 1 );, nlines( 1 ))),
																			h list box(Button Box( "SERIALNO", clbSN << Append( clb << Get Selected )),
																					clbSN = Col List Box( MinItems( sn ), MaxItems( 1 ), nlines( 1 ))),
			/*																h list box(Button Box( "LOCATION_1", clbL1 << Append( clb << Get Selected )),
																					clbL1 = Col List Box( MinItems( l1 ), MaxItems( 1 ), nlines( 1 )),cbl1 = Check Box( "needed", 1 )),cbl1<<set(1,1);,
																			h list box(Button Box( "LOCATION_2", clbL2 << Append( clb << Get Selected )),
																					clbL2 = Col List Box( MinItems( l2 ), MaxItems( 1 ), nlines( 1 )),cbl2 = Check Box( "needed", 1 )),cbl2<<set(1,1);,
																			h list box(Button Box( "LOCATION_3", clbL3 << Append( clb << Get Selected )),
																					clbL3 = Col List Box( MinItems( l3 ), MaxItems( 1 ), nlines( 1 )),cbl3 = Check Box( "needed", 1 )),cbl3<<set(1,1);,
																			h list box(Button Box( "POINT_NO", clbPN << Append( clb << Get Selected )),
																					clbPN = Col List Box( MinItems( pn ), MaxItems( 1 ), nlines( 1 )),cbpn = Check Box( "needed", 1 )),cbpn<<set(1,1);,
																			h list box(Button Box( "DEVIATION", clbD << Append( clb << Get Selected )),
																					clbD = Col List Box( "Numeric", MinItems( dev ), MaxItems( 1 ), nlines( 1 )),cbd = Check Box( "needed", 1 )),cbd<<set(1,1);,
																			h list box(Button Box( "LSL", clbLSL << Append( clb << Get Selected )),
																					clbLSL = Col List Box( "Numeric", MinItems( 0 ), MaxItems( 1 ), nlines( 1 )),cblsl = Check Box( "needed", 1 )),cblsl<<set(1,1);,
																			h list box(Button Box( "USL", clbUSL << Append( clb << Get Selected )), 
																					clbUSL = Col List Box( "Numeric", MinItems( 0 ), MaxItems( 1 ), nlines( 1 )),cbusl = Check Box( "needed", 1 )),cbusl<<set(1,1);,
																			Button Box( "Remove",clbPC << Remove Selected,clbSN << Remove Selected,clbL1 << Remove Selected;clbL2 << Remove Selected,clbL3 << Remove Selected,clbPN << Remove Selected,clbLSL << Remove Selected,clbUSL << Remove Selected,clbD << Remove Selected;
																					)*/)
															,
															v list box(
																		cbfc = Check Box( "needed", 1 ),cbfc<<set(1,1);,
																		cbsn = Check Box( "needed", 1 ),cbsn<<set(1,1);
																
																		)
																
																
																
															)
												)		
									),
							H List Box(
										Button Box( "OK",
													/* Retrieve the selected items as column references */
													if(fc==1,FCVars = clbFC << Get Items( "Column Reference" ););
													if(sn==1,SNVars = clbSN << Get Items( "Column Reference" ););
													if(l1==1,L1Vars = clbL1 << Get Items( "Column Reference" ););
													if(l2==1,L2Vars = clbL2 << Get Items( "Column Reference" ););
													if(l3==1,L3Vars = clbL3 << Get Items( "Column Reference" ););
													if(pn==1,PNVars = clbPN << Get Items( "Column Reference" ););
													if(dev==1,DVars = clbD << Get Items( "Column Reference" ););
													if(lsl==1,LSLVars = clbLSL << Get Items( "Column Reference" ););
													if(usl==1,USLVars = clbUSL << Get Items( "Column Reference" ););
												),
										Button Box( "Cancel" )
							)
						)
			);
	

If( nw["button"] == -1,
Throw();
);

Thanks for any ideas.

 

 

Steve

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Sizing input boxes

I would most likely try doing this with Line Up Box. Something like:

Names Default To Here(1);
FC=1;
SN=1;
nw = New Window( "Launch Dialog",
	<<Modal,
	V List Box(
		Align( "right" ),
		H List Box(
			Panel Box( "Select Columns",
				clb = ColListBox( dt, all, /*<<Set Data Type( "Numeric" )*/grouped )
			),
			Panel Box( "Cast Selected Columns into Roles",
				Lineup box(N Col(3),
					Button Box( "PCC_FEATURE_CODE", clbFC << Append( clb << Get Selected )),
					clbFC = Col List Box(MinItems( fc ), MaxItems( 1 ), nlines( 1 )),
					cbfc = Check Box( "needed", 1, <<set(1,1)),
					Button Box( "SERIALNO", clbSN << Append( clb << Get Selected )),
					clbSN = Col List Box( MinItems( sn ), MaxItems( 1 ), nlines( 1 )),
					cbsn = Check Box( "needed", 1,<<set(1,1))
				)
			)
		)		
	)
);

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Sizing input boxes

I would most likely try doing this with Line Up Box. Something like:

Names Default To Here(1);
FC=1;
SN=1;
nw = New Window( "Launch Dialog",
	<<Modal,
	V List Box(
		Align( "right" ),
		H List Box(
			Panel Box( "Select Columns",
				clb = ColListBox( dt, all, /*<<Set Data Type( "Numeric" )*/grouped )
			),
			Panel Box( "Cast Selected Columns into Roles",
				Lineup box(N Col(3),
					Button Box( "PCC_FEATURE_CODE", clbFC << Append( clb << Get Selected )),
					clbFC = Col List Box(MinItems( fc ), MaxItems( 1 ), nlines( 1 )),
					cbfc = Check Box( "needed", 1, <<set(1,1)),
					Button Box( "SERIALNO", clbSN << Append( clb << Get Selected )),
					clbSN = Col List Box( MinItems( sn ), MaxItems( 1 ), nlines( 1 )),
					cbsn = Check Box( "needed", 1,<<set(1,1))
				)
			)
		)		
	)
);

 

-Jarmo