Creating the Dialog

To create a new custom dialog, from the menus choose:

Extensions > Custom Dialog Builder for Extensions

This will launch the Custom Dialog Builder, which is an interactive window that allows you to design and preview a custom dialog.

Figure 1. Custom Dialog Builder
The Custom Dialog Builder showing the dialog properties

In the Dialog Properties pane:

  1. Enter the value Rboxplot_Demo for the Dialog Name.
  2. Enter Rboxplot Demo for the Title.
  3. Click the ellipsis (...) button in the Value column for the Menu Location property to specify the location of a new menu item for your dialog.
Figure 2. Menu Location dialog box
The Dialog Builder Menu Location dialog box
  1. In the Menu Location dialog, expand the items for the Graphs menu.
  2. Choose the last item on the Graphs menu that is above the Legacy Dialogs submenu.
  3. Click Add to add the new item and then enter Rboxplot Demo for the name of the item.
  4. Click Move Down to position the new menu item just above the Legacy Dialogs submenu, and then click OK.
Figure 3. Source Variable List Properties
Custom Dialog Builder with source list control selected and showing source variable list properties
  1. Drag a Source List control, two Target List controls, two Text controls, a Check Box control, and a Static Text control from the Tools Palette and drop them into the Custom Dialog Builder window as shown.
  2. Click the source list control to display the Source Variable List Properties pane.
  3. Enter source_vars for the value of the Identifier property.
  4. Enter A for the value of the Mnemonic Key property.
  5. Click the upper target list control to display the Target Variable List Properties pane.
Figure 4. Target Variable List Properties for Dependent Variable
Custom Dialog Builder with target list control for dependent variable selected and showing its properties
  1. Enter Variable for the value of the Identifier property.
  2. Enter Variable: for the value of the Title property.
  3. Select Single item list for the Target list type property.
  4. Enter V for the value of the Mnemonic Key property.
  5. Click the ellipsis (...) button in the Value column for the Variable Filter property.
Figure 5. Filter dialog box
Filter dialog box showing string and nominal variable types not checked

The Filter dialog allows you to specify the types of variables allowed for the associated control.

Deselect (clear) the boxes for String and Nominal and click OK.

Note: The Syntax property for the target variable list control specifies the command syntax to be generated by the control at run time. The default value %%ThisValue%% specifies that the syntax generated by the control will consist of the run-time value of the control, which is the single variable transferred to the control. This will be the dependent variable depvar needed for the formula argument to the boxplot function. Leave the default value.

Specify the lower target list control as follows:

  1. Click the lower target list control to display its properties.
  2. In the Target Variable List Properties pane, enter catvar for the Identifier.
  3. Enter Category axis: for the Title.
  4. Select Single item list for the Target list type property.
  5. Enter C for the mnemonic.
  6. Click the ellipsis (...) button in the Value column for the Variable Filter property and deselect (clear) Scale in the Filter dialog box.
  7. Click the upper Text control to display the Text Control Properties pane.
Figure 6. Text Control Properties for Box Colors
Custom Dialog Builder with upper text control selected and showing its properties
  1. Enter col for the value of the Identifier property.
  2. Enter Box colors: for the value of the Title property.
  3. Enter the following for the ToolTip: Enter a comma-separated list with each color in quotes
  4. Enter B for the value of the Mnemonic Key property.
  5. Enter "blue" for the value of the Default Value property.
  6. Select True for the value of the Required for Execution property. This specifies that the Paste and OK buttons will be disabled if the text box is empty.
  7. Click the lower text control to display its properties. Enter title for the Identifier, Title: for the Title, and enter T for the mnemonic.
  8. Click the Check Box control to display the Check Box Properties pane.
Figure 7. Check Box Control Properties
Custom Dialog Builder with check box control selected and showing its properties
  1. Enter orientation for the value of the Identifier property.
  2. Enter Horizontal orientation for the value of the Title property.
  3. Enter H for the value of the Mnemonic Key property.
  4. Enter TRUE for the value of the Checked Syntax property.
  5. Enter FALSE for the value of the Unchecked Syntax property.
  6. Click the Static Text control to display the Static Text Properties pane.
Figure 8. Static Text Control Properties
Custom Dialog Builder with static text control selected and showing its properties
  1. Enter requires for the value of the Identifier property.
  2. For the value of the Title property, enter This dialog requires the Integration Plug-in for R.

It is good practice to add static text that reminds users about what is required to run the dialog.

Next