Adding Controls to Your Dialog

Figure 1. Custom Dialog Builder
Custom Dialog Builder

The Tools Palette shows all of the available controls. You add controls by dragging them from the tools palette and dropping them on the canvas in the Custom Dialog Builder.

For our simple one-way ANOVA dialog, we'll need a control for the list of source variables and separate controls for the list of dependent variables and the factor variable.

  1. Drag a Source List control, two Target List controls, and a Sub-dialog Button control onto the canvas.
    Figure 2. Layout of controls on the canvas
    Layout of controls on the canvas

    The controls are automatically laid out on the canvas, which is divided into four functional columns into which you can drop controls. The first (leftmost) column is primarily intended for a Source List control. Target List controls must be in the second column. Sub-dialog buttons must be in the rightmost column (for example, the third column if only three columns are used) and no other controls can be in the same column as Sub-dialog buttons. You can change the vertical order of the controls within a column by dragging them up or down, but the exact position of the controls will be determined automatically for you. At run-time, controls will resize in appropriate ways when the dialog itself is resized. Controls such as source and target lists automatically expand to fill the available space below them.

  2. Click the source list control to display the Source Variable List Properties pane.
  3. Enter source_list for the value of the Identifier property. Each control must have a unique identifier.
  4. Leave the default value of Variables: for the Title property.
  5. Enter V for the value of the Mnemonic Key property to specify a character in the title to use as a keyboard shortcut to the control. The character appears underlined in the title. Note: The Mnemonic Key property is not supported on Mac.
  6. Leave the default value of Move Variables for the Variable Transfers property. This specifies that variables transferred from the source list to a target list are removed from the source list.

    Optionally, you can specify ToolTip text that appears when a user hovers over the control.

  7. Click the ellipsis (...) button in the Value column for the Variable Filter property to filter the types of variables contained in the source list.
    Figure 3. Filter dialog box
    Dialog Builder Filter dialog box
  8. Deselect (clear) String in the Type group.
  9. Click OK.
  10. Click the top target list control to display the Target Variable List Properties pane.
  11. Enter dependent_list for the value of the Identifier property.
  12. Enter Dependent List: for the value of the Title property.
  13. Enter E for the value of the Mnemonic Key property.
  14. Leave the default value of True for the Required for execution property. This specifies that the OK and Paste buttons will remain disabled until a value is specified for this control.

    The Syntax property specifies the command syntax to be generated by this control at run time. Notice that it has a default value of %%ThisValue%%. This specifies that the syntax generated by the control will consist of the run-time value of the control, which is the list of variables transferred to the control. Leave the default value.

  15. Click the bottom target list control to display its properties pane.
  16. Enter factor for the value of the Identifier property.
  17. Enter Factor: for the value of the Title property.
  18. Click the Value column for the Target list type property and select Single item list. This choice specifies that only a single variable can be transferred to the control.
  19. Enter F for the value of the Mnemonic Key property.
  20. As with the previous Target List control, leave the default value of %%ThisValue%% for the Syntax property. In this case, the command syntax generated by this control at run time will consist of the single factor variable.
  21. Click the sub-dialog button control to display the Sub-dialog Button Properties pane.
  22. Enter options_button for the value of the Identifier property.
  23. Enter Options... for the value of the Title property.
  24. Enter O for the value of the Mnemonic Key property.
  25. Click the ellipsis (...) button in the Value column for the Sub-dialog property to launch a Custom Dialog Builder window for the sub-dialog. You can also access the Custom Dialog Builder window for the sub-dialog by double-clicking the sub-dialog button control.

    The Custom Dialog Builder for a sub-dialog works the same way as the builder for a main dialog. Some of the controls, however, that are available for a main dialog are not available for a sub-dialog. In particular, the Source List, Target List, Tab, and Sub-dialog Button controls are not available and are displayed as disabled in the sub-dialog's tools palette.

    The Dialog Properties pane allows you to specify properties of the sub-dialog.

  26. Enter options_subdialog for the Sub-dialog Name.
  27. Enter Simple One-Way ANOVA: Options for the Title.
  28. Drag an Item Group control and a Radio Group control (in that order) into the Custom Dialog Builder window.
  29. Drag and drop five Check Box controls into the Item Group control.
    Figure 4. Sub-dialog controls displayed in Custom Dialog Builder window
    Custom Dialog Builder window for sub-dialog showing an item group consisting of five check boxes and a separate radio group

    Notice that the vertical ordering of the controls matches the order in which they were dropped onto the canvas. The item group is on top and the radio group is below it. The radio group has a default of two buttons, but more radio buttons can be added as needed.

  30. Click on the item group to display the Item Group Properties pane.
  31. Enter statistics for the value of the Identifier property.
  32. Enter Statistics for the value of the Title property.
  33. Modify the Syntax property so that it has the value:
    /STATISTICS %%ThisValue%%

    For an item group control, the value %%ThisValue%% specifies to generate a blank-separated list of the syntax generated by each control in the group--in this case, the syntax generated by each of the check boxes. If no syntax is generated by any of the controls in the group, then the group as a whole does not generate any command syntax.

  34. Click the topmost check box in the item group to display the Check Box Properties pane.
  35. Enter stats_descriptive for the value of the Identifier property.
  36. Enter Descriptives for the value of the Title property.
  37. Enter DESCRIPTIVES for the value of the Checked Syntax property. This specifies the command syntax that is generated by the control when it is checked. Leave the value of the Unchecked Syntax property empty since we only need to generate syntax when the box is checked.

    In a similar manner, specify the properties of the remaining four check boxes in the Statistics group.

  38. Specify Fixed and random effects as the title of one of the boxes and set the value of the Checked Syntax property for that box to EFFECTS. Specify a value for the Identifier property, such as stats_effects.
  39. Specify Homogeneity of variance test as the title of one of the boxes and set the Checked Syntax property to HOMOGENEITY. Specify an identifier, such as stats_homogeneity.
  40. Specify Brown-Forsythe as the title of one of the boxes and set the Checked Syntax property to BROWNFORSYTHE. Specify an identifier, such as stats_brownforsythe.
  41. Specify Welch as the title of one of the boxes and set the Checked Syntax property to WELCH. Specify an identifier, such as stats_welch.
  42. Click the radio button group to display the Radio Button Group Properties pane.
  43. Enter missing for the value of the Identifier property.
  44. Enter Missing Values for the value of the Title property.
  45. Leave %%ThisValue%% as the value of the Syntax property. It specifies to generate the syntax associated with the button that is selected at run time.
  46. Click the ellipsis (...) button in the Value column for the Radio Buttons to specify the individual radio buttons.
    Figure 5. Radio Group Properties dialog box
    Radio group properties dialog box showing the properties of the two default radio buttons.
  47. Enter missing_analysis and missing_listwise for the values of the Identifier property for the two buttons.
  48. Enter Exclude cases analysis by analysis and Exclude cases listwise for the values of the Column Name property.
  49. Leave the values of the Default property, so that the first listed button is selected by default.
  50. Enter ANALYSIS and LISTWISE for the values of the Syntax property. These are the values that will be generated at run time when one or the other of the buttons is selected.

Although not needed in this example, you can add a radio button by entering values in the blank line at the bottom of the existing list. You can delete a radio button by clicking on the Identifier cell for the button and pressing delete.

Next