Controls
Using the Dialog Builder, you can build controls into your custom dialogs which are used by the procedure to interact with the user during processing.
You can create the following controls:
You can change the parameters or characteristics of each control through its dialog. Although the range of parameters varies for each type of control, all have Position and Size parameters. These parameters let you specify the horizontal and vertical position of the upper left corner of the control and the height and width of the control, in pixels.
For any control, check the Auto checkboxes to have Analyzer automatically resize the control when its contents change. You can also change the Position and Size within the Dialog Builder itself. For more information, see Editing Controls.
Note: For a more consistent control look, keep the Auto checkboxes checked
Note: For a more consistent dialog look, keep the Snap to Grid right-click option active. The grid marks in the definition area indicate the option is active and facilitate more accurate and consistent placement of controls.
Text Messages
A text message displays static text which prompts or informs the user. To add a text message, do the following:
|
1.
|
In the Dialog Builder, right-click in the blank definition area where you want to place the top left of the control and select “Text”. Analyzer displays the Text dialog. |
|
2.
|
Enter the message you want to display in the Label text box. The maximum message length is 250 characters including spaces. |
|
3.
|
Specify whether the message is aligned left, center or right using the Alignment option. |
Edit Boxes
Use an edit box in your procedure for accepting user input of the specified type only (Character, Numeric, Date or Filename). To add an edit box, do the following:
|
1.
|
In the Dialog Builder, right-click in the blank definition area where you want to place the top left of the control and select “Edit Box”. Analyzer displays the Editbox dialog. |
|
2.
|
Enter the name of the variable that will contain the value of this control in the Variable text box. |
|
3.
|
Specify the variable type by choosing the appropriate radio button. |
Note: If the variable type is “filename”, the variable will be displayed in the dialog as a text box with a browse button beside it. Click the browse button to launch a standard Windows “Select File” dialog for locating and selecting the desired file. By default the starting folder will be the current Analyzer project folder unless otherwise specified.
Tip: The “filename” choice is the preferred method for users to select a data file.
Note: If the variable type is “date”, the variable will be displayed in the dialog as a text box with a date selector button beside it. Click the date selector button and select the desired date. Pre-size the text box to adequately display dates.
|
4.
|
Enter text in the Default Text box to determine the default value of the variable. |
Note: For date edit boxes, the default date must be entered as YYYYMMDD. If no date or an invalid date is specified in the default text box, then the current date will be displayed.
Note: If the EDIT variable already exists and contains a value, that value will be used to initialize the default text when the DIALOG command is run.
Checkboxes
A checkbox presents True or False (On or Off) options to the user. Users can select more than one option in a set. This control creates a logical variable that is True if the checkbox is checked and False is the checkbox is unchecked. To add a checkbox, follow these steps:
|
1.
|
In the Dialog Builder, right-click in the blank definition area where you want to place the top left of the control and select “checkbox”. Analyzer displays the checkbox dialog. |
|
2.
|
Enter the text to be displayed beside the checkbox in the Label text box. |
|
3.
|
Enter the name of the variable that will contain the value of this control in the Variable text box. |
|
4.
|
Select Checked or Unchecked to determine the default value of the variable. |
Note: If the CHECKBOX variable already exists and contains a value, that value will be used to initialize the checkboxes default state when the DIALOG command is run.
Radio Buttons
A radio button set presents mutually exclusive options to the user. Only one option can be selected in a radio button set. This control creates a numeric variable which contains 1 if the first radio button is selected, 2 if the second radio button is selected and so on. To add a radio button set, do the following:
|
1.
|
In the Dialog Builder, right-click in the blank definition area where you want to place the top left of the control and select “Radio Button”. Analyzer displays the Radiobuttons dialog. |
|
2.
|
Enter text in the Label text box to create a radio button and the text to be displayed beside it. Click [Add] to add the item to the Label List. |
|
3.
|
Create at least one more radio button and add it to the Label List. |
|
4.
|
Enter the name of the variable which will contain the value of this control in the Variable text box. |
|
5.
|
Highlight an item in the Label List box and click [Set Default] to determine the default value of the variable. |
|
6.
|
Specify whether the radio buttons are positioned horizontally side-by-side or vertically one on top of another using the Alignment option. Click [OK]. |
Note: If the RADIO variable already exists and contains a value, that value will be used to initialize the radio buttons default state when the DIALOG command is run.
Drop-Down Lists
A drop-down list presents a list of items to the user. Only one item can be selected. This control creates a character variable which contains the text of the selected item. To add a drop-down list, do the following:
|
1.
|
In the Dialog Builder, right-click in the blank definition area where you want to place the top left of the control and select “Dropdown”. Analyzer displays the Dropdown dialog. |
|
2.
|
Enter text in the Label text box to create items and click [Add] to add them to the Label List. |
|
3.
|
Enter the name of the variable which will contain the value of this control in the Variable text box. |
|
4.
|
Highlight an item in the Label List box and click [Set Default] to determine the default value of the variable. |
Note: The label list can also be supplied from a variable or variable array. For more information see Manually Editing Dialog Commands and Variables.
Project Item Lists
A Project item list displays a drop-down list of items that are in your Analyzer Project. Only one item can be selected. This control creates a text variable. You can display one or more definitions including:
|
•
|
Character, numeric, logical or date fields |
|
•
|
Character, numeric, logical or date variables |
For example, you can create a Project item list to display all the table layouts. When the user selects a table layout, the procedure can use a macro command to open that table layout and analyze the data. For more information on using macros, see Macro Substitution.
To add a Project item list, do the following:
|
1.
|
In the Dialog Builder, right-click in the blank definition area where you want to place the top left of the control and select “Project Item”. Analyzer displays the Project item list dialog. |
|
2.
|
Select items from the Category drop-down list and add them to the Category List by clicking [Add]. |
|
3.
|
Enter the name of the variable which will contain the value of this control in the Variable text box. |
|
4.
|
Enter an item from the Category List in the Default text box to determine the default value of the variable. |
Editing Controls
To edit a control, follow these steps:
|
1.
|
Double-click the control or right-click the control and select “Properties”. Analyzer displays the control’s editable dialog. |
|
2.
|
Edit the parameters for the control. |
You can change the position of a control in the Dialog Builder by clicking the control and dragging it to a new position.
You can change the size of a control in the Dialog Builder by clicking the control and dragging its resize handles.
Note: For a more consistent look, keep the Snap to Grid right-click option active. The grid marks in the definition area indicate the option is active.