Language:


Adding Radio Buttons to a Record Window

Radio buttons are useful when a field must contain one of a limited number of optional values. Usually, the optional values are all numbers and therefore the field must be an integer field.

Radio buttons should be grouped together in the record window. When you click a radio button option, all other options in the same group are switched off automatically. A group of radio buttons sets the value of a single field. When a radio button is selected, the field is set to a pre-defined value.

To add a set of radio button options to a record window, follow these steps:

  1. In the first empty row in the grid, set the Type to "radio button". Use one row for each radio button.

  2. Enter the name of the field in the Field column. This should be the internal name of the integer field, as specified in the Register Definition. You can use the 'Paste Special' function to choose the correct field and to ensure the spelling and capitalisation is correct (it is case sensitive). Use the same field for each radio button in the group.

  3. If the record window will have several cards, use the Tile column to specify the card on which the check box will appear. This is described in more detail on the Adding Cards to a Record Window page.

  4. Use the H and V columns to specify where you want the radio button to be placed in the record window. Enter the number of pixels to the top left-hand corner of the radio button (not the label) as follows:
    H (horizontal)
    from the left-hand edge of the record window.

    V (vertical)
    from the top edge of the record window. A vertical spacing of 16 pixels between radio buttons is recommended.

    -H
    from the right-hand edge of the record window.

    -V
    from the bottom edge of the record window.
    The maximum values of H and V depend on the Device: please refer to the Window Sizes for each Platform page for details.

    If you are using negative figures, remember to leave room for the width of the radio button and its label (in the case of H) or the depth of the radio button (in the case of V). If you don't leave enough room, the radio button may not be drawn in the way you expect.

  5. Enter a Label for the radio button: this is the name that will appear beside the radio button in the record window.

  1. You will usually choose to depict an integer field in a window using radio buttons because the field will be one that can only contain a limited number of fixed values, such as 0, 1, 2. In this case, you will need one radio button for the value 0, one for the value 1, and one for the value 2. You must have a radio button for the value 0, but the other values are up to you: you could choose 0, 2, 4, 6, for example.

    Each numeric value will have some significance. Using radio buttons means the person using the window does not have to choose between options 0, 1 and 2, but instead between some more meaningful text options. In the example illustrated above, if the user clicks the radio button marked "In progress - some Items counted", the value 1 will be stored in the Status field.

    The next step is to assign numeric values to each radio button option. Enter the numeric values in the Sel. Val. column on flip B:

    By default (i.e. in a new record), the value of an integer field is 0. Therefore, you must have a radio button option that represents the value 0. This is the option that will be selected by default in a new record. In the example illustrated above, choosing the second radio button option will mean the value 1 will be saved in the integer field, while choosing the third radio button option will mean the value 2 will be saved.
  1. The usual practice is for a group of radio buttons to be enclosed in a button frame. This indicates to a person using the window that the radio buttons are all part of the same group. The button frame should contain a name for the group as a whole.

    Insert a new row with Type "button frame". Do not specify a Field, but specify its position using H and V and its size using Width. H and V for the frame should be the same as for the top radio button. The Width should be large enough for the frame to contain the radio button labels. Use the Label column to assign a name to the group of radio buttons:

This is how the radio buttons and the button frame will appear in the window:

Please click the links below for more details about:
---

Go back to:

See also: