Skip to main content

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)
ParameterDescription
configObject with one or more of the properties listed below.
Return values
A promise that resolves when the properties are applied.

Drawing properties​

PropertyDescriptionDefault
fontFont used for text. An object with name, size, style (for example "bold") and color.{name: "Verdana", size: "10px", color: "black"}
borderBorder drawn around objects. An object with size (in pixels) and color.{color: "black"}
backColorBackground colour of objects."white"
borderColorBorder colour of objects and the line colour of primitives."black"
fillColorFill colour of primitives."white"
pushedAppearance 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
checkboxAn object with size, the size of the checkbox square. If not set, the box matches the text size.—
radiobuttonAn object with size, the size of the radio button circle. If not set, the circle matches the text size.—
invertIf true, inverts the colours of the object.—

Control properties​

PropertyDescription
mirrorDivMirrors 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).
encryptedIf true, enables encryption of the data between the pad and the browser, on pads that support it.
sessionIdSession id used for encryption.
forceMonochromeIf 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});