Setting Choices for Radio Buttons

Description

Describes how to set radio button choices, including how to set user defined choices.

A data field displayed as a set of radio buttons accepts only values that are in its choice list. These images show the same radio buttons where the bounding rectangle is narrow and wide.

  1. Select the control, choose Object > Properties and display the Setup tab.

  2. Select "Radio Button" in the Field-Type list.

  3. Display the Choices tab.

  4. Select one of the Choices for control. The options are:

    • "User Defined"

    • "Populated using Xbasic"

  5. Optionally, make a selection from the Radio style list. The options are:

    • "Checkmarked"

    • "Default Style"

    • "Indented Checkmarked"

    • "Indented Diamonds"

    • "Indented Style"

      images/Radio_Button_Styles.gif
  6. User Defined Choices

    If you selected "User Defined" in step 4:

    • 1. Select the Display style. The options are:

      • "Bitmap followed by text"

      • "Bitmap only"

      • "Bitmap over text"

      • "Text followed by bitmap"

      • "Text only"

      • "Text over bitmap"

    • 2. Enter choices one per line. Refer to Specifying User Defined Choices.

    • 3. Optionally, click the 'AZ up' or the 'ZA down' icon to sort the entries in ascending or descending order.

    • 4. If the selection in step 5a included bitmaps, click Define bitmaps... to display the Define Bitmaps dialog box. Otherwise, click OK to save your choices definition.

    • 5. In the Define Bitmaps dialog box select each entry in turn and click Define Bitmap to display the Define Picture dialog box.

    • 6. In the Define Picture dialog box optionally check Button displays a different picture when a button is pressed. This causes the Pressed tab to appear.

    • 7. Optionally, on the Default tab click Embedded and Select Embedded Bitmap. Navigate to the image, select it, and click Open.

    • 8. Optionally, on the Default tab click File and the 'up' icon. Navigate to the image, select it, and click Open.

    • 9. Optionally, on the Default tab click Internal and the 'up' icon. Select the image from the Insert Image dialog box, and click Insert.

    • 10. If the Pressed tab is visible, display it, and select another image in the same manner as Described by steps 5h through 5j.

    • 11. Click OK, OK and OK to save your choices definition.

  7. If you selected "Computed Automatically" in step 4:

    • Click OK to save your property settings.

    • Right click on the form and select Events > OnInit.

    • In the Create new Event Script dialog select Create using Xbasic and click OK.

    • Enter Xbasic code structured as follows. Substitute your control's name for .

    • Optionally, substitute your list of choices, one per line, for:

      ... 
      
      DIM pObj as P
      pObj = topparent:.this
      pObj.settings.dynamic_list = <<%str%
      
      
      ...
      
      %str%
    • Optionally, substitute a call to a function that returns a CR-LF delimited list for:

      <<%str% 
      ...
      %str%
      DIM pObj as P
      pObj = topparent:.this
      pObj.settings.dynamic_list = MyFunction()

See Also