addObjectCheckBox
Creates a checkbox: a small rectangle followed by text, which toggles its state and generates an event when tapped with the pen. The text is displayed in the current font.
wizCtl.addObjectCheckBox(id, x, y, text, options)
| Parameter | Description |
|---|---|
| id | String that identifies the checkbox. |
| x, y | Position of the top-left corner of the object on the pad display.
|
| text | Text to display. |
| options | A combination of |
| Return values |
|---|
| The added checkbox object. Throws an exception if an error occurs. |
The returned object has the following properties:
| Property | Description |
|---|---|
rect | The displayed area, with upperLeftXpixel, upperLeftYpixel, lowerRightXpixel and lowerRightYpixel. |
checked | Indicates whether the checkbox is checked. |
onClick | Function called when the checkbox 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 box is set with the checkbox.size property of setProperty.
The following example adds a checkbox that is checked by default and shows a cross instead of a tick:
wizCtl.addObjectCheckBox("checkbox2", 10, 120, "Checked by default, with a cross.",
sigSDK.CheckboxOptions.CheckboxChecked.value | sigSDK.CheckboxOptions.CheckboxDisplayCross.value);