Brush.Enabled

Syntax

Enabled: Boolean

Description

The Enabled property determines whether the brush can be applied to component.

Comments

Use JSON or the setEnabled method to set the property value, and the getEnabled method to get the property value.

The property is set to True if the brush can be applied to the component, and False if otherwise.

Example

To execute the example, the HTML page must contain links to the PP.js scenario file and the PP.css styles file. "Create a div element and set fill for it:

// Create a div element
var divElem = PP.createElement(document.body);
// Set up styles for this element
divElem.style.cssText = "width: 100px; height: 100px; border: 1px solid rgb(102,102, 102);";
// Determine a brush and set fill for the div element 
var brush = new PP.SolidColorBrush();
brush.setColor("#dfdfff");
divElem.style.cssText += brush.toCSSFormat();

After executing the example a div element is created in the document, for which solid fill was applied:

Prohibit the use of brush and again set fill for the div element:

// Prohibit the use of brush
brush.setEnabled(False);
// Set fill for div element
divElem.style.cssText += brush.toCSSFormat();

As a result empty fill is set:

See also:

Brush