class radioButton

superclass(es) control
subclass(es) -
description The radiobutton control is a control which the user can select or unselect. Usually a set of radiobuttons is used together to have the user select one of the exclusive choices.

pl_img58.gif (1847 bytes)
see also panel - checkBox

tasks

Radiobuttons are controls that work in groups. In a group of radiobuttons only a single radiobutton can be checked. To create a radiobutton that is the first in a new group use the method createStartGroup/7, the remaining radiobuttons of the group can then be created by using the method create/7. To start a new separate group of radiobuttons use the createStartGroup/7 method again.

The example below creates two groups of radiobuttons:

    Panel<-addGroupBox(14, 104, 125, 72, 'Group 1:', grpBox, true),
    Panel<-addRadioButtonStartGroup(20, 120, 110, 15, 'Radio button 1', rbBtn, _RBRunError, true),
    Panel<-addRadioButton(20, 136, 110, 15, 'Radio button 2', rbBtn, _RBWarning, true),
    Panel<-addRadioButton(20, 152, 110, 15, 'Radio button 3', rbBtn, _RBFail, true),

    Panel<-addGroupBox(150, 104, 170, 54, 'Group 2:', grpBox, true),
    Panel<-addRadioButtonStartGroup(156, 120, 150, 15, 'Radio button 4:', rbBtn, _RBImmediateUpdate, true),
    Panel<-addRadioButton(156, 136, 150, 15, 'Radio button 5', rbBtn, _RBLogicalDBUpdate, true),

methods

create(Parent, Checked, X, Y, Width, Height, Output)

func Create a radiobutton control at a specified position with the specified dimensions. Because a control is a child window a parent window must always be specified. If the variable Checked contains true the radiobutton is initially checked, else not. The coordinates X, Y, Width and Height determine the dimensions, in window coordinates, of the control.
pre The variable Parent must refer to a parent window. The Checked variable must contain true or false, the X, Y, Width and Height coordinates must specify a position and dimension for the control.
post If the control was successfully created then true was assigned to Output, else was false assigned.

createStartGroup(Parent, Checked, X, Y, Width, Height, Output)

func Create a radiobutton control that is also the start of a group of radiobuttons, at a specified position with the specified dimensions. Because a radiobutton is a child window a parent window must always be specified. If the variable Checked contains true the radiobutton is initially checked, else not. The coordinates X, Y, Width and Height determine the dimensions, in window coordinates, of the control.
pre The variable Parent must refer to a parent window. The Checked variable must contain true or false, the X, Y, Width and Height coordinates must contains integer values and specify a position and dimension for the control.
post If the control was successfully created then true was assigned to Output, else it was assigned false.

putCheck(YesNo)

func Add or remove the checkmark of the radiobutton control.
pre The variable YesNo must contain the boolean value true or false.
post If YesNo was true the radiobutton is checked, else the check is removed.

checked(Output)

func Determine if the radiobutton is checked or not.
pre TRUE.
post If YesNo contains true the radiobutton is checked, else Output contains false.