A mixin that adds CSS2 box model support to view.

The boxmodel mixin adds CSS2 box model support to <view>

boxmodel implements a subset of the CSS2 box model spec http://www.w3.org/TR/CSS2/box.html

text ]]>

boxmodel is a mixin intended for use with <view> and its subclasses.

super.construct(p,a); // set these lz.view.setCSS() knows how to process these attributes var style = this.__styleinfo; style.margin = {capability: 'css2boxmodel', isdimension: true, affectsoffset: true} style.borderWidth = {capability: 'css2boxmodel', isdimension: true, affectsoffset: true} style.borderColor = {capability: 'css2boxmodel'} style.padding = {capability: 'css2boxmodel', isdimension: true, affectsoffset: true} if (this.margin != margin) { this.margin = margin; this.__widthoffset = this.__heightoffset = (margin * 2) + (this.borderwidth * 2) + (this.padding * 2); this.setCSS('margin', margin); } if (this.onmargin.ready) this.onmargin.sendEvent(margin); if (this.borderwidth != borderwidth) { this.borderwidth = borderwidth; this.__widthoffset = this.__heightoffset = (this.margin * 2) + (borderwidth * 2) + (this.padding * 2); this.setCSS('borderWidth', borderwidth); } if (this.onborderwidth.ready) this.onborderwidth.sendEvent(borderwidth); if (this.bordercolor != bordercolor) { this.bordercolor = bordercolor; this.setCSS('borderColor', LzColorUtils.torgb(bordercolor)); } if (this.onbordercolor.ready) this.onbordercolor.sendEvent(bordercolor); if (this.padding != padding) { this.padding = padding; this.__widthoffset = this.__heightoffset = (this.margin * 2) + (this.borderwidth * 2) + (padding * 2); this.setCSS('padding', padding); } if (this.onpadding.ready) this.onpadding.sendEvent(padding);