addObjectButton
Creates a button: text surrounded by a rectangle, which generates a click event when tapped with the pen. The text is displayed in the current font.
wizCtl.addObjectButton(id, x, y, text, options)
| Parameter | Description |
|---|---|
| id | String that identifies the button.
The following values have special meanings when used with a signature or input object: |
| x, y | Position of the top-left corner of the object on the pad display.
|
| text | Text to display. |
| options | Either an integer that specifies the button width in pixels, or a combination of |
| Return values |
|---|
| The added button 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. |
onClick | Function called when the 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 following example adds a button that moves the wizard to the next step:
const nextBtn = wizCtl.addObjectButton("next", "right", "bottom", "Next >>", 100);
nextBtn.onClick = async function() {
await showNextStep();
return true;
}
Do not use the onClick function of the ok button to read a captured signature.
The event is raised even when no signature has been captured.
Use the onSignatureCaptured function of the object returned by addObjectSignature instead.