Display an Xdialog Box

Description

Procedure for displaying an xdialog box:

Overview

Xdialog boxes allow you to perform complex database operations using dialog boxes. Xdialog boxes can handle multiple variables as well as a wide range of control types. The Display an Xdialog Box action greatly simplifies the construction process of Xdialog boxes. The dialog box that you create may contain an arbitrary number of buttons, controls, and variables. For an example of returning multiple values from an Xdialog, see Returning Multiple Values from an Xdialog.

Procedure

The Xdialog box needs a variable to capture the value generated by each control.

  1. Create a new Action Script.

  2. Select "Xdialog Windows" in the Category list.

  3. Select "Display an XDialog Box" in the Action list.

  4. Click OK to display the Script Genie.

  5. In the Variable Name field enter the name of the variable for the first control.

  6. Optionally enter a prompt for the control in the Prompt field.

  7. Select the data type of the control in the Type field. There are four types to choose from:

    • "Character": One or several letters or numbers.

    • "Numeric": Numbers with optional decimals.

    • "Date": Accepts any valid date in "mm/dd/yyyy" format.

    • "Logical": Accepts a true or false value.

  8. Enter the character width of the control in the Width field. This field does not apply to buttons.

  9. Optionally check the Default Value check box and enter a default value or expression in the field to its right. Optionally, click the 'xy' button to open the Expression Builder.

  10. Select the type of control from the Style list box. To see a demonstration of the various styles listed, click the Style button next the Style selection box. The following controls are supported:

    • Button

      You can specify the border style, button text, bubble help, justification, size, and Xbasic code or script to run.

    • Check Box-List Box

      You can enter the choices to display in the combo box or enter an expression that generates a CR-LF delimited list of choices.

    • Combo Box

      You can enter the choices to display in the combo box or enter an expression that generates a CR-LF delimited list of choices.

    • Edit-Combo Box

      You can enter the choices to display in the combo box or enter an expression that generates a CR-LF delimited list of choices.

    • Email (Alpha Anywhere)

      Displays the internal Alpha Anywhere email client.

    • Email

      Displays the default third-party email client.

    • Expression

      You can specify the table or set to operate against.

    • Field Select

      You can specify the table or set to select from.

    • File Select

      You can specify one or more file types to look for, dialog title, default file selection, and whether the file must or must not exist.

    • Filter Expression

      You can specify the table or set to operate against.

    • Folder Select

      You can specify one or more drive letters, default folder, and dialog title.

    • HTML Text

      Displays HTML text that can be specified by the developer, retrieved from a file, generated by an expression, or from a URL. You can specify border style, scroll bars, enabled or disabled, and whether to respond to ActiveX events. If you specify that you want to respond to ActiveX events, the code generated by the genie contains event handler functions, into which you may insert your Xbasic code.

    • List Box

      You can enter the choices to display in the combo box or enter an expression that generates a CR-LF delimited list of choices.

    • List View Control

      Display data with a view that looks like the Windows Explorer.

    • Multi-line Text Box

      Displays a text box that will accept multiple lines.

    • Mult-select List Box

      You can enter the choices to display in the combo box or enter an expression that generates a CR-LF delimited list of choices. In addition, you can set key stroke style required to make multiple selections.

    • Order Expression

      You can specify the table or set to operate against.

    • Password

      Displays a password input dialog.

    • Property-grid style Dialog

      Creates a dialog box in the format of the property grids used extensively throughout the Web Component Builders.

    • Property Sheet Style Xdialog

      Creates a dialog box in the format of the property sheets used extensively throughout the Web Component Builders.

    • Radio Buttons

      You enter the choices to display and set the display format to either a horizontal or vertical list.

    • Record List-Combo Box

      You can specify the table or set that provides the list data, an optional record filter, the fields to display, the order of the fields, and a field or expression that defines the return value.

    • Record List-Edit Combo Box

      You can specify the table or set that provides the list data, an optional record filter, the fields to display, the order of the fields, and a field or expression that defines the return value.

    • Record List-List Box

      You can specify the table or set that provides the list data, an optional record filter, the fields to display, the order of the fields, and a field or expression that defines the return value.

    • SimpleChart

      Displays a pie, line, or bar chart based on numeric data from a table.

    • Static Text

      Displays static text with an optional image. The text may be derived from an expression.

    • Text Box

      Displays a text box that will accept a single line.

    • Tree Control

      You can enter the choices to display in the combo box or enter an expression that generates a CR-LF delimited list of choices. In addition, you can specify the delimiter character.

    • URL

      Displays a URL address input dialog and optionally displays the specified page.

    • Web Browser

      Displays a URL specified by the developer, the user, or generated by an expression. You can also specify a prompt, button label, default URL, disabled or enabled, and whether to respond to ActiveX events. If you specify that you want to respond to ActiveX events, the code generated by the genie contains event handler functions, into which you may insert your Xbasic code.

  11. Depending on the type of control selected, enter the control's height in lines in the Height field.

  12. For most of the styles, you will need to click the Define button to specify values for the style. For example, if you select "List Box", you would then press the Define List Box button to define the values within the List Box Choices dialog box. If your selection was "Property-sheet style Dialog", refer to Property-Sheet Style Dialog.

  13. If you want to put additional controls on the Xdialog, click Add New Variable and repeat steps 1 through 8. The arrow and delete buttons to the left of the window let you rearrange the order and delete the variables.

  14. Optionally click the Preview button to see what the new dialog box will look like.

  15. Click Next >.

  16. Define Title

    Optionally, enter the title of the dialog box in the Dialog Title field.

  17. Optionally, enter text to appear at the top of the dialog box into the Header Text field.

  18. Optionally, enter text to appear at the bottom of the dialog box into the Footer Text field.

  19. Optionally, modify the bottom labels in the Button Text fields.

  20. Click Next >.

  21. Optionally, modify the name of the variable in the Variable Name field that will capture the return value of the Xdialog box.

  22. Optionally, change the Scope of the return variable to one the following values. A variable's scope refers to where the variable can be seen, i.e. which other scripts can access the variable.

    • "Shared". Variables are available throughout the current form.

    • "Global". Variables are available anywhere in Alpha Anywhere.

    • "Local". Variables are available only in the current script.

  23. Click Next >.

  24. Optionally, modify the comment that describes the action.

  25. Click Finish.

See Also