What are radio buttons and check boxes

Option buttons and option images

Radio buttons and option pictures are objects that allow the user to select a value or picture from a group of buttons or pictures. A radio button shows a small porthole and text. Option images show an icon or image and are superimposed on an image.

Note: 3D radio buttons work the same way as radio buttons. Their display, on the other hand, is defined via the properties of the 3D button family. Further information can be found in the section 3D buttons, 3D check boxes, 3D radio buttons.

Each type of radio button is selected by clicking on it. If an option image is selected, you can deselect it by clicking on it; this is not possible with an option field.
Like inverted buttons, option images are transparent when inactive. When selected, the image behind it is highlighted until it is deactivated again or another option image from the same group is activated. Option buttons and images are used in the form of coordinated elements. Only one field can be selected at a time. In order for radio buttons to work in a coordinated manner, they must be grouped. To do this, go to the form editor and select in the menu object the command Group or the corresponding button on the form in the toolbar:

In previous versions of 4D, coordinated behavior of a group of radio buttons was possible if the assigned variables had the same initial letter, e.g. m_button1, m_button2, m_button3. This principle is retained by default in converted databases to maintain compatibility. However, you can also stipulate the use of the new working method via the database properties (see Compatibility page).

The behavior of the radio buttons is controlled by methods. Like all buttons, an option button is set to 0 when the form is first opened. The associated method is executed when the radio button is selected.

Here is an example of a set of 3D radio buttons in a video collection application to set the recording speed (SP, LP or EP).

Selecting an option button in a group sets that option button to 1 and the others in the group to 0. Only one option button can be selected at a time.

Note: You can also assign Boolean variables to radio buttons. In this case, if a radio button in a group is selected, its variable is true and the variables for all other radio buttons are false.

Here is an example of a set of option images. The selected image appears inverted:

The value of an option field or image is not automatically saved, except when a field of the Boolean type is displayed. The values ​​must be saved in variables and managed using methods.