cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
SDF1
Super User

JSL: How to add the red hot-button options to an Outline Box? Or can you?

Hi All,

 

  I'm interested in learning how (if possible) to add the red hot-button menu to your own defined Outline Box. For example, with the Graph Builder platform, there's a red-hot button that allows for things like "Save Script to Data Table" and other options.

SDF1_0-1699544973143.png

 

  I have other scripts I wrote where I'd like to have this option. The Outline Box comes with the small grey triangle for some options, but it doesn't offer the red hot-button options. For example:

SDF1_1-1699545097307.png

 

  I've searched the Scripting Index and the Scripting Guide, and can't find any documentation on this.

 

  Does anyone know if it's possible? And if so, how?

 

Thanks!,

DS

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

Are you possibly looking for << Set Menu Script? Example from scripting index

Names Default To Here(1);
New Window("Example",
	fontobj = ob = Outline Box("Outline Box",
		V List Box(
			ob2 = Outline Box("Outline Box 2",
				H List Box(
					Text Edit Box("Top Left"),
					Text Edit Box("Top Right")
				)
			),
			ob3 = Outline Box("Outline Box 3",
				H List Box(
					Text Edit Box("Bottom Left"),
					Text Edit Box("Bottom Right")
				)
			)
		)
	)
);
ob << Set Menu Script(
	{"A", Print("A"), "B", Print("B"), "B1", Print("B1"), "B2",
	Print("B2"), "B3", Print("B3"), "C", Print("C")}
);
ob << Set Submenu(2, 3);

jthi_0-1699546161002.png

There is also something regarding this in JMP Help, but it is very very difficult to find due to the horrible search JMP help page has (https://www.jmp.com/support/help/en/17.2/#page/jmp/construct-display-boxes-for-new-windows.shtml#ww8...)

jthi_1-1699546377931.png

 

-Jarmo

View solution in original post

12 REPLIES 12
jthi
Super User

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

Are you possibly looking for << Set Menu Script? Example from scripting index

Names Default To Here(1);
New Window("Example",
	fontobj = ob = Outline Box("Outline Box",
		V List Box(
			ob2 = Outline Box("Outline Box 2",
				H List Box(
					Text Edit Box("Top Left"),
					Text Edit Box("Top Right")
				)
			),
			ob3 = Outline Box("Outline Box 3",
				H List Box(
					Text Edit Box("Bottom Left"),
					Text Edit Box("Bottom Right")
				)
			)
		)
	)
);
ob << Set Menu Script(
	{"A", Print("A"), "B", Print("B"), "B1", Print("B1"), "B2",
	Print("B2"), "B3", Print("B3"), "C", Print("C")}
);
ob << Set Submenu(2, 3);

jthi_0-1699546161002.png

There is also something regarding this in JMP Help, but it is very very difficult to find due to the horrible search JMP help page has (https://www.jmp.com/support/help/en/17.2/#page/jmp/construct-display-boxes-for-new-windows.shtml#ww8...)

jthi_1-1699546377931.png

 

-Jarmo
hogi
Level XI

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

SDF1
Super User

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

Hi @jthi and @hogi ,

 

  Thanks for the information on where to start this process, it is very helpful. And, it's really only partly a solution right now.

 

  I've been able to add a the menu script -- right now, I'm only adding two things: a local data filter and the save script (3 options): to data table, to scripting window and to Journal.

 

  Right now, I have the local data filter and save script to Journal working just fine. What I'm having a harder time with is getting the save script to data table and save script to scripting window functionalities working. Below is the section of code where it activates the menu script and then assigns the action for each menu item selected.  

mob << Set Menu Script(
		{"Local Data Filter", ts << Local Data Filter ; gb << Local Data Filter, "Save Script", "", "To Data Table", nwin <<
		Save Script to Data Table( "Correlation Analysis of " || ycols[1] || " vs. " || xcols[1], <<Promtp( 1 ), <<Replace( 0 ) ), "To Script Window",
		nwin << Save Script to Script Window, "To Journal", mob<<Journal}
	);
	
	mob << Set Submenu( 2, 3 );

  My customized report window looks something like this:

SDF1_0-1699557513934.png

  I'd like to have the option that the user could select the save script to data table (or scripting window) and it basically saves the script that is used to generate this customized report so that this analysis can be saved to the data table and someone can click the green script arrow next to the script and re-run the analysis without having to re-run the whole add-in.

 

  From reading the about this in the scripting index, it appears that only objects like platform reports (e.g. Graph Builder or Time Series) can individually be saved to the data table, but the entire Outline Box object, which is my report window, doesn't accept that kind of send (<<) command. I'd prefer not to save each platform object individually, but rather the entire scripting code after I've used it to do the analysis to the data table/script window.

 

  I'm not sure exactly why, but perhaps it's because my code is structure differently, because I'm using several Expr statements. As a rough idea, my code is structured as follows:

Names Default To Here( 1 );

//any variable definitions
var1 = .;
var2 = .;//etc

//Expression to recall roles
RecallRoles = Expr(
//inside is the code to recall roles
);

//Expression to clear roles
ClearRoles = Expr(
//similar code to clear roles
);

//User interface window
ValueDlg = Expr(
	nwin = New Window( 
		// opens a new window with the main outline box and subpanels 
		//and action buttons
		mob = Outline Box( 
			//this is the main outline box that contains the subpanels and 
			//time series and graph builder platforms
			//it also contains the action buttons that perform certain tasks
		)
	);
	mob << Set Menu Script(
		//this is where I'm trying to save the evaluated script to the data
		//table so a usercan just cick it, and the script will execute with
		//the variables already evaluated and not have to cast columns into
		//roles, etc.
	);
);

ValueDlg;//this calls the ValueDlg Expr and evaluates it.

 

  If either of you have any ideas or thoughts on how I could do this (which I hope my explanation makes sense), I appreciate any feedback on it.

 

Thanks!,

DS

 

  

 

hogi
Level XI

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

To add Data Filter and Save Script of the Report to Data Table - if you work on a Windows PC, your could consider using the Report Toolbar:

hogi_0-1699559609268.png

 

argh ...

hogi_0-1699559891878.png

 

hogi
Level XI

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

Asking the Outline Box for the script just returns something like the Display Tree.
So, this also doesn't work.

 

When you generate the Report, you have the whole Expression to generate the report. 

So, when the user clicks on save script, you could just use this expression and save it as a script.

[then changes which the user made afterwards will not be saved]

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
	Size( 437, 413 ),
	Graph Spacing( 4 ),
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);

New Window( "test",
	ob = Outline Box( "test",
		V List Box( Text Box( "hello" ), gb = dt << Graph Builder( Variables( X( :height ), Y( :weight ), Overlay( :sex ) ) ) )
	)
);


ob << get script(); // Display Tree
ob << get scriptable Object (); // Empty 
jthi
Super User

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

Saving the script which creates that customized window will be generally very difficult as you would have to basically include whole add-in in that script, with the user choices applied (and then it would be the same as user basically re-running the add-in). I have had at least few different solutions for something like this (I don't try to save the whole window as my add-ins are usually too complicated for that):

  • Save some sort of settings variable to the data table that user can then load in your add-in to "refill" it
  • Don't save the whole script but rather some sort of "dashboard" type of solution with not that many features
  • Save just some simpler parts as table script(s)
  • And maybe few more that I don't remember for now...
-Jarmo
hogi
Level XI

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

I think the best idea is not to generate the Report NOT manually - but via Dashboard Builder.

In the generated Dashboard, there is a red-triangle menu with an option to save the (Dashboard) Script

...  and since Jmp17 there is even an option to save a simplified version which looks like a manually generated script:

hogi_0-1699560891710.png

 

 

 

Jeff_Perkinson
Community Manager Community Manager

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

Adding to the suggestions from @jthi, you could create a function that you call in your add-in and then your Save Script is just the function call. It'll take some management to make sure the function is well-designed and handles the options you need but if you're building a dialog box to launch your add-in then you've probably already defined many of the arguments.

-Jeff
SDF1
Super User

Re: JSL: How to add the red hot-button options to an Outline Box? Or can you?

Hi @jthi , @hogi , and @Jeff_Perkinson ,

 

  I appreciate the feedback, thoughts, and discussion. Well, it seems like it might be trickier than I thought. That's not to say it's not doable, but it's not going to be as "simple" as adding the menu script to the outline box. I might have to stew and chew on some of the ideas here.

 

  @hogi , I did try the Save Script to Window as well as the Save Script for All Objects to Data Table, but neither of those worked as I had intended.

 

  If I do find the solution I'm after, I'll be sure to update this post with how I solved it in case others come across this and are interested.

 

Thanks everyone!,

DS