>   /** @access private
>   * @modifiers override
>   */
> @@ -1073,6 +1117,9 @@
>  * The background color of the view.  Setting <code>bgcolor</code> to
>  * <code>null</code> will make the view transparent.
>  *
> + * The background color of the view is controlled by the CSS property
> + * <code>background-color</code>
> + *
>  * May be set to any valid CSS color specification.  When read, will
>  * be read as the equivalent numeric value.  To retrieve a CSS color
>  * specification, use <code>this.presentAttribute('bgcolor',
> @@ -1097,6 +1144,16 @@
>   this.bgcolor = bgc;
>   if (this.onbgcolor.ready) this.onbgcolor.sendEvent( bgc );
>  };
> +  /**
> +   * Default CSS style binder
> +   * @access private
> +   */
> +  function $lzc$style_bgcolor(ignore) {
> +    #pragma "userFunctionName=$style{'background-color'}"
> +    this.__LZstyleBindAttribute('bgcolor', 'background-color', 'color');
> +  }
> +  // Install that as the default in the class attributes table
> +  attributes.bgcolor = new LzConstraintExpr('$lzc$style_bgcolor');
>
>  /** The horizontal offset of this view's upper left corner from the
>   * upper left corner of its container.
>
>
>
A question about this approach,  there is some set of 'styleable' attributes
on view, maybe a dozen or more? (width, height, fontsize, font, bgcolor,
align, resource, etc)

Are all these defaults going to come from a default LFC stylesheet now
instead of being hardcoded into LzView?

If we use a constraint for each place we want to bind
an attribute default value to a style value, does this mean that when you
instantiate an LzView,
say, you will have to instantiate one delegate per attribute that is bound
this way? Seems like
that could the memory footprint and instantiation time noticably larger for
vanilla views, if we have
more than a handful of these stylable attributes?

Reply via email to