cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Yngeinstn
Level IV

Button Boxes - Steps into different .jsl

// First Option [Of course the doSomethingElse is accomplished by an Include(C:\doSomethingElse.jsl)
win = New Window( "DataBase",
//	<<Modal,
	<<ReturnResult, // ensures that you get the same result as with Dialog
	V List Box(
		V List Box(
			Text Box( "Database" ),
			Line Up Box(
				NCol( 1 ),
				Panel Box(" Lot Number ", LotListBox ), // pull in list of lots from database
				Panel Box( "Test Type",
					Button Box( "S_PARAMS", doSelection_SS),
					Button Box( "NF", doSelection_NF),
					Button Box( "DC_DATA", doSelection_DC),
					Button Box( "TIMING", doSelection_TIME),
					Button Box( "BITREAD", doSelection_BIT),
					Button Box( "GCA_I", doSelection_GCA),
				)
			)
		),
		
		H List Box(
			Align( Right ),
			Spacer Box(),
				Button Box( "Exit", win << Close Window),
		)
	)
);

// What I am wanting to accomplish the doSomethingElse could include one, two or even three different tasks
win = New Window( "DataBase",
//	<<Modal,
	<<ReturnResult, // ensures that you get the same result as with Dialog
	V List Box(
		V List Box(
			Text Box( "Database" ),
			Line Up Box(
				NCol( 1 ),
				Panel Box(" Lot Number ", LotListBox ), // pull in list of lots from database
				Panel Box( "Test Type",
					Button Box( "S_PARAMS", doSelection_SS, doSomethingElse),
					Button Box( "NF", doSelection_NF,doSomethingElse),
					Button Box( "DC_DATA", doSelection_DC, doSomethingElse),
					Button Box( "TIMING", doSelection_TIME,doSomethingElse),
					Button Box( "BITREAD", doSelection_BIT),
					Button Box( "GCA_I", doSelection_GCA),
				)
			)
		),
		
		H List Box(
			Align( Right ),
			Spacer Box(),
				Button Box( "Exit", win << Close Window),
		)
	)
);

After looking through the community boards i found how to use botton boxes when creating windows. Unlike using Check Box() or Radio Box() that require clicking through different selection and the hitting  'OK' to excute a varitey of If() statements. I then learned that you have to not use << Modal in order to get the 'OK and 'Cancel' button but insteat using 'Exit' which just exits the window. I find this to be more user friendly when it comes to others executing  a wide variety of options. The button boxes then allow you to use different icons for each button.

 

 

Now to my problem:

 

Is there a way to do a multiple of .jsl (which envolves the Include() function)? Can you introduce If() statements inside these button box windows?

 

Each doSomethingElse steps into another window with a different set of button boxes

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Button Boxes - Steps into different .jsl

Yes. In the example, the two statements are separated by a semicolon. Each statement is an expression that is evaluated. I imagine 

doSelection_SS

 does something that selects some data and

doSomethingElse

processes the selected data. 

Craige

View solution in original post

3 REPLIES 3
Craige_Hales
Super User

Re: Button Boxes - Steps into different .jsl

ButtonBox has one script that runs when the button is pressed. I think the 3rd argument is being quietly ignored:

Button Box( "S_PARAMS", doSelection_SS, doSomethingElse)

You probably want this

Button Box( "S_PARAMS", if( doSelection_SS, doSomethingElse) )

or (semicolon, not comma)

Button Box( "S_PARAMS", doSelection_SS; doSomethingElse)

both of which have only two arguments, separated by a comma, for the ButtonBox function.

Craige
Yngeinstn
Level IV

Re: Button Boxes - Steps into different .jsl

Thank you for the reply..


Question: If i use the 3rd option that would execute both subscripts and not treat it like an IF() statement?

Craige_Hales
Super User

Re: Button Boxes - Steps into different .jsl

Yes. In the example, the two statements are separated by a semicolon. Each statement is an expression that is evaluated. I imagine 

doSelection_SS

 does something that selects some data and

doSomethingElse

processes the selected data. 

Craige