Method XbpHTMLStyle():draw() Foundation

Draws HTML markup into a Presentation Space.

:draw( <oPS>, <aRect>, <cHTML>, [<nState>] ) --> lSuccess
The Presentation Space object for rendering.
A character string with the HTML markup. The string must be in ANSI encoding. Character strings using an OEM character set must first be converted with ConvToAnsiCP().
An array with four elements which specify the starting and ending points of the output rectangle.
A numeric value which specifies one of the draw states defined for Xbase Parts. See the :controlState member variable for further information.

The :draw() method can be used to draw arbitrary HTML markup into the Presentation Space passed in the <oPS>parameter. <aRect> specifies the output area for the operation. If the representation of the HTML markup exceeds the bounds defined for the output area, the respective content is clipped.

:draw() first computes the representation of the HTML markup, then draws it to the Presentation Space. If CSS styling information was specified when instantiating the XbpHTMLStyle object by calling the method :new(), the CSS is applied to the HTML content when the representation is computed.

The <nState> parameter can be used to activate dedicated CSS styling with respect to a certain draw state. For this, the desired representation must be defined in the CSS using a set of pre-defined CSS selectors. The selectors are activated by the :draw() method depending on the value passed in the <nState> parameter. The following table lists the CSS selectors defined along with their associated draw state.

CSS selectors with their associated draw state
CSS selector Draw state

In addition, a set of pre-defined CSS classes exist which can also be activated using the <nState> parameter. These CSS classes represent standard UI elements such as the edit field of a combo box.

Pre-defined CSS-classes with their associated draw state
CSS class Draw state


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.