This section contains JSL messages that apply to display boxes. For additional examples, see Display Trees in the Scripting Guide and the JMP Scripting Index.
Description
Returns the menu items used for popup menu when the button is clicked. Menu items are returned in a list.
See Also
For submenus see db<<Get Submenu(index).
Returns the menu script attached to the calling object.
Returns the page setup settings.
Example
The example below creates a new window and returns the page setup configuration.
w = New Window( "Window",
Text Box( "Page Setup Test" )
);
w << Get Page Setup();
The results of the message:
{Margins( {0.75, 0.75, 0.75, 0.75} ), Scale( 1 ), Portrait( 1 ),
Paper Size( "Letter" )}
Returns either { x, y } or { h, v } in pixels:
xy = DisplayBox << Get Size;
Returns x and y in pixels:
{ x, y } = DisplayBox << Get Size;
Returns the number of submenu items under the given menu item.
Example
The example below creates a menu containing "A", "B", and "C" with "A" having a submenu "A1" and "A2" and "B" having a submenu "B1", "B2", and "B3". <<Get Submenu(inc) returns the number of submenu items under each indexed menu item.
New Window( "Title",
obj = Outline Box( "title" ) );
submenus = { };
obj << Set Menu Script(
{"A", "", "A1", Print( "A1" ), "A2", Print( "A2" ),
"B", "", "B1", Print( "B1" ), "B2", Print( "B2" ), "B3", Print( "B3" ),
"C", Print( "C" )}
);
obj << Set Submenu( 1, 2 ); // menu A with 2 items in submenu A1 and A2
obj << Set Submenu( 4, 3 ); // menu B with 3 items in submenu B1, B2, and B3
For( inc = 1, inc <= N Items( Words( obj << Get Menu Script, "," ) )/2, inc++,
Insert Into( submenus, obj << Get Submenu( inc ) );
);
submenus;
{2, 0, 0, 3, 0, 0, 0, 0}
The log output indicates that index(1) contains two submenu items and index(3) contains three submenu items.
Example
New Window( "Example",
Outline Box( "Parent display box",
Button Box( "OK", <<Horizontal Alignment( "Center" ) )
)
);
Invalidates the display box area in the window. The window is updated the next time the operating system has an opportunity to update windows (for example, when the user resizes the display box).
Notes
Consider including the message <<Update Window rather than including Wait(0). The problem with using Wait(n) is knowing how large n should be.
Many display box messages, such as <<Set Text, automatically mark the box as invalid, so the <<Inval message is usually unnecessary. Some interactive scripts that use sliders with JSL callbacks might need <<Update Window to keep various parts of the display synchronized with the slider.
Arguments
path
A optional quoted path that specifies the location where the web page will be saved.
"Is Static"
Omits the data from the web page and saves a static version of the web page.
Examples
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = dt << Bivariate( y( weight ), x( height ) );
rbiv = (biv << Report);
rbiv << Save Interactive HTML( "$DOCUMENTS/MyInteractiveHTML.htm" );
Description
Saves a PDF of the display box in the quoted path.
Optional Arguments
path
Saves the file in the quoted path. If you omit the argument, you are prompted to name and save the file when running the script.
Show Page Setup(Boolean)
(Windows only) Displays the Page Setup window, where you can specify page orientation, headers and footers, margins, page scale, and paper size.
Portrait(Boolean)
Displays the content in portrait or landscape orientation.
Notes
The PDF file contains headers and footers. Use Save Picture to omit these components.
Description
Notes
• If you omit the quoted path argument, you are prompted to name and save the file when running the script.
• Valid file formats include "PDF", "PNG", "GIF", "JPG" or "JPEG", "EPS", "SVG", and "EMF".
• On Windows, the Windows Specific preferences determine the resolution (or DPI), or you can run the following script:
Pref( Save Image DPI( number ) );
• On macOS, the operating system determines the DPI.
• Use Save Picture to export a report as a PDF file with no headers or footers. Use Save PDF to include these components.
Optional Arguments
path
Saves the file in the quoted path. You must include the .pptx extension in the filename. If you omit the path argument, you are prompted to name and save the file when running the script.
Template(path)
Specifies the quoted path of a custom PowerPoint template. Without this argument, JMP uses the default template located in the pptx folder of the installation directory.
Include a simple table in your template, or a default table format is applied to report tables. For an example on Windows, see /pptx/JMPExportTemplate.pptx in the JMP installation folder.
Insert
Determines where the slides are inserted in an existing presentation.
– n inserts the slides as the nth slide number.
– "Begin" inserts the slides at the beginning of the presentation.
– "End" inserts the slides at the end of the presentation.
Replace
Determines which slides are replaced in an existing presentation. The arguments are n, "Begin", and "End" as described for Insert.
Append
The slides are inserted at the end of an existing presentation.
Outline Titles
The location of the outline title and any parent outline titles on the slide. By default, the immediate parent outline title appears as a slide title above the slide content, with any parent outline titles positioned in the bottom left corner of the slide.
– "None" omits the slide title above the graphic and the outline titles.
– "Hide" omits the outline titles.
– "TopLeft", "TopRight", "BottomLeft", "BottomRight" determine the position of any of the parent outline titles on the slide.
format
The format of the embedded graphics. Options are "Native", "EMF", "PNG", "JPG", "BMP", "GIF", "TIF". On Windows, the native format is EMF. On macOS, the native format is PDF. See “Notes” for compatibility issues. Without this argument, JMP applies the “Image Format for PowerPoint” General preference.
Notes
Windows does not support the native PDF graphics produced on macOS. macOS does not support the native EMF graphics produced on Windows. For cross-platform compatibility, specify "PNG", "JPG", "GIF", or "TIF".
If no arguments are provided, the user is prompted to name and save the file.
Sets the page settings. Margins are set in inches. Scale variable s is a number in the range of 10 (for 1000%) to 0.2 (for 20%) with the default as 1 (for 100%). If Portrait is True the page is oriented for portrait, otherwise the page is landscape. Paper Size is a quoted string specifying the paper size, for example, "Letter" or "Legal".
Example
The example below creates a new window and configures the page setup.
w = New Window( "Window",
Text Box( "Page Setup Test" )
);
w << Set page setup(
margins( 1, 1, 1, 1 ),
scale( 1 ),
portrait( 1 ),
paper size( "Letter" )
);
Description
Example
w = New Window( "Window", Text Box( "Header Example" ) );
w << Set Print Headers(
"Today is: &d;", // left
"&wt;", // center
"Page &pn; of &pc;" // right
);
w << Print Window;
Description
Example
w = New Window( "Window", Text Box( "Footer Example" ) );
w << Set Print Footers(
"Today is: &d;", // left
"&wt;", // center
"Page &pn; of &pc;" // right
);
w << Print Window;
Description
Sets the horizontal and vertical stretching of display boxes.
Arguments
"Window"
The box stretches to fill the space provided by the window, The sizing depends on the minimum and maximum properties for the box.
"Fill"
The box stretches to fill the available space in its container.
"Off"
The box does not stretch.
"Neutral"
Many boxes start in the neutral state. A leaf box (a box that has no children) that is neutral resolves to "Off". Most container boxes aggregate the stretching behavior (and minimum and maximum) of their child boxes.
Description
Sets the submenu items for the item (specified by index number) by specifying the number of items in the submenu.
Example
The example below creates a menu containing “A”, “B”, and “C” with “A” having a submenu “A1” and “A2” and “B” having a submenu “B1”, “B2”, and “B3”.
New Window( "title", ob = Outline Box( "title" ) );
ob << Set Menu Script(
{"A", "", "A1", Print( "A1" ), "A2", Print( "A2" ),
"B", "", "B1", Print( "B1" ), "B2", Print( "B2" ), "B3", Print( "B3" ),
"C", Print( "C" )}
);
ob << Set Submenu(1, 2); // menu A with 2 items in submenu A1 and A2
ob << Set Submenu(4, 3); // menu B with 3 items in submenu B1, B2, and B3
Notes