Skip to main content

addObjectRadioButton

Creates a radio button: a small circle followed by text. Radio buttons are used in groups. Tapping one with the pen selects it and deselects the currently selected button in the same group. Tapping also generates an event. The text is displayed in the current font.

wizCtl.addObjectRadioButton(id, x, y, text, options)
ParameterDescription
id

String that identifies the radio button.
Cannot be any of the values reserved for text or button objects: who, why, ok, clear, cancel, delete.

x, y

Position of the top-left corner of the object on the pad display.
The value is either an absolute position in pixels or one of the following strings:

  • x: "left", "right", "centre"
  • y: "top", "middle", "bottom"
textText to display.
options

Object with the following fields:

  • Group - Name of the group the radio button belongs to. (Required)
  • Checked - If true, the radio button is initially selected. (Optional)
Return values
The added radio button object. Throws an exception if an error occurs.

The returned object has the following properties:

PropertyDescription
rectThe displayed area, with upperLeftXpixel, upperLeftYpixel, lowerRightXpixel and lowerRightYpixel.
onClickFunction called when the radio button is tapped. It receives the object as a parameter and returns a boolean. Return true to stop capturing pen input, or false to continue.

The size of the circle is set with the radiobutton.size property of setProperty.

The following example adds a group of two radio buttons, with the second one selected:

wizCtl.addObjectRadioButton("radio1", 10, 80, "First option", {Group: "group1"});
wizCtl.addObjectRadioButton("radio2", 10, 120, "Second option", {Group: "group1", Checked: true});