setProperty
Sets one or more properties of the Wizard control. Drawing properties, such as the font and colours, apply to the objects added after the call. Only the fields included in the configuration object are changed.
wizCtl.setProperty(config)
| Parameter | Description |
|---|---|
| config | Object with one or more of the properties listed below. |
| Return values |
|---|
| A promise that resolves when the properties are applied. |
Drawing properties
| Property | Description | Default |
|---|---|---|
font | Font used for text. An object with name, size, style (for example "bold") and color. | {name: "Verdana", size: "10px", color: "black"} |
border | Border drawn around objects. An object with size (in pixels) and color. | {color: "black"} |
backColor | Background colour of objects. | "white" |
borderColor | Border colour of objects and the line colour of primitives. | "black" |
fillColor | Fill colour of primitives. | "white" |
pushed | Appearance of a button while it is pushed. An object with any of font, border, backColor, borderColor, fillColor and invert. Only applies to colour pads. | White text on black |
checkbox | An object with size, the size of the checkbox square. If not set, the box matches the text size. | — |
radiobutton | An object with size, the size of the radio button circle. If not set, the circle matches the text size. | — |
invert | If true, inverts the colours of the object. | — |
Control properties
| Property | Description |
|---|---|
mirrorDiv | Mirrors the pad screen in the browser. An object with id (the id of the parent div), width and height (default to the pad size) and enable (if true, the mirror image also accepts mouse input). |
encrypted | If true, enables encryption of the data between the pad and the browser, on pads that support it. |
sessionId | Session id used for encryption. |
forceMonochrome | If true, draws in monochrome even on colour pads. |
All properties return to their defaults when reset is called.
The following example styles the buttons added after the call:
wizCtl.setProperty({
font: {name: "verdana", size: 16, color: "black"},
backColor: "#D3D3D3",
border: {size: 2, color: "black"},
pushed: {backColor: "#A9A9A9", font: {color: "black"}, border: {size: 2, color: "#D3D3D3"}}
});
The following example turns on the browser mirror and encryption after a reset:
await wizCtl.reset(true);
wizCtl.setProperty({mirrorDiv: {id: "mirror_div", enable: true}});
await wizCtl.setProperty({encrypted: true, sessionId: 0xc0ffee});