This section shows the differences between display boxes in New Window() and the deprecated Dialog() scripts. Display Boxes in New Window and Deprecated Dialog Scripts summarizes those differences. Details are in the sections that follow the table.
<<Modal,
<<ReturnResult,
|
Dialog( Title( "Combo Box" ),
|
|
<<Modal,
<<ReturnResult,
|
||
<<Modal,
<<ReturnResult,
|
dlg = Dialog(
Line Up(2,
|
|
<<Modal,
<<ReturnResult,
|
||
<<Modal,
<<ReturnResult,
|
dlg = Dialog(
Title( "Edit Text" ),
str1 = Edit Text( "The" ),
str2 = Edit Text( "quick" ), )
|
|
<<Modal,
<<ReturnResult,
num1 = Number Edit Box(
num2 = Number Edit Box(
|
dlg = Dialog(
Title( "Edit Number" ),
|
A major difference between the New Window() and the deprecated Dialog() functions is how you specify lists and strings as arguments. In New Window(), the items must be placed in a list. In the deprecated Dialog(), items are generally separated by commas. For example, compare the following two instances of a combo box.
<<Modal,
<<Return Result,
Additionally, the deprecated Dialog() could include " " to indicate empty text. New Window() requires that empty text appear in a Text Box (" ").
In New Window(), boxes are horizontally aligned with H List Box() and vertically aligned with V List Box(). In the deprecated Dialog(), you use H List and V List instead.
<<Modal,
<<Return Result,
In New Window(), use Line Up Box() to arrange items in the number of columns that you specify. In the deprecated Dialog(), you used Line Up.
<<Modal,
<<Return Result,
Clicking OK returns the following result in the log window:
dlg = Dialog(
Line Up( 2,
Clicking OK returns the following result in the log window:
注意:JMP does exert some control over OK and Cancel button positions to ensure that dialog boxes are consistent with what the operating system expects. In certain cases, JMP needs to override your H List Box(), V List Box(), and Line Up Box() settings for Button( "OK" ) and Button( "Cancel" ). Do not be alarmed if the result is slightly different from what you expect.
In New Window(), you must define the Panel Box() container for Radio Box() if you want the radio buttons in a box.
<<Modal,
<<Return Result,
In New Window(), use Text Edit Box() to create editable boxes that contain specified strings. In the deprecated Dialog(), you used Edit Text().
<<Modal,
<<Return Result,
dlg = Dialog(
Title( "Edit Text" ),
str1 = Edit Text( "The" ),
str2 = Edit Text( "quick" ),
str3 = Edit Text( "brown" ),
str4 = Edit Text( "fox" ),
str5 = Edit Text( "jumps" ),
str6 = Edit Text( "over" ),
str7 = Edit Text( "the" ),
str8 = Edit Text( "lazy" ),
str9 = Edit Text( "dog" )
Alternatively, use String Col Edit Box() to create editable boxes within in a table structure that contains specified strings. For example, the following script creates a window named “String Col Edit Box”. The window contains a column (labeled “Strings”) of editable boxes, each of which contains the specified string:
<<Modal,
<<Return Result,
steb = String Col Edit Box(
注意:In the preceding example, the String Col Edit Box() assigns only two elements to the list ("Strings" and the specified list items). The New Window() and deprecated Dialog() examples for Text Edit Box() assign 10 elements to the list.
In New Window(), use Number Edit Box() to create editable boxes that contains the specified numbers. In the deprecated Dialog(), you used Edit Number().
<<Modal,
<<ReturnResult,
dlg = Dialog(
Title( "Edit Number" ),
num1 = Edit Number( Random Uniform() ),
Another method for creating the same window uses Number Col Edit Box() to create editable boxes within in a table structure that contains specified numbers. For example, the following script creates a window named “Number Col Edit Box”. The window contains a column (labeled “Random Numbers”) of editable boxes, each of which shows the specified type of random number:
<<Modal,
<<ReturnResult,
nceb = Number Col Edit Box(
注意:In the preceding example, the Number Col Edit Box() assigns only two elements to the list. The New Window() and deprecated Dialog() examples for Number Col Edit Box() assign five elements to the list.