[Laszlo-dev] For Review: Change 20081028-maxcarlson-7 Summary: Move colors out of global namespace

Henry Minsky hminsky at laszlosystems.com
Wed Oct 29 15:54:01 PDT 2008


I get this error compiling swf9 smokecheck, has base/style.lzx been updated?
I'm at r11641
org.openlaszlo.sc.CompilerError: base/style.lzx: 29: Error: Access of
undefined property gray10, in line: this.setAttribute("textcolor", gray10)
base/style.lzx: 33: Error: Access of undefined property white, in line:
this.setAttribute("textfieldcolor", white)
base/style.lzx: 38: Error: Access of undefined property iceblue1, in line:
this.setAttribute("texthilitecolor", iceblue1)
base/style.lzx: 43: Error: Access of undefined property black, in line:
this.setAttribute("textselectedcolor", black)
base/style.lzx: 47: Error: Access of undefined property gray60, in line:
this.setAttribute("textdisabledcolor", gray60)
base/style.lzx: 52: Error: Access of undefined property offwhite, in line:
this.setAttribute("basecolor", offwhite)
base/style.lzx: 58: Error: Access of undefined property white, in line:
this.setAttribute("bgcolor", white)
base/style.lzx: 63: Error: Access of undefined property iceblue4, in line:
this.setAttribute("hilitecolor", iceblue4)
base/style.lzx: 67: Error: Access of undefined property iceblue3, in line:
this.setAttribute("selectedcolor", iceblue3)
base/style.lzx: 71: Error: Access of undefined property gray30, in line:
this.setAttribute("disabledcolor", gray30)
base/style.lzx: 76: Error: Access of undefined property gray40, in line:
this.setAttribute("bordercolor", gray40)



On Wed, Oct 29, 2008 at 9:23 AM, P T Withington <ptw at laszlosystems.com>wrote:

> One comment: In LzColorUtils, you should issue a deprecation warning for
> strings that happen to parse as hex integers.  We do everywhere else.
>
> Otherwise, approved.  Great stuff!
>
>
> On 2008-10-28, at 19:24EDT, Max Carlson wrote:
>
>  Change 20081028-maxcarlson-7 by maxcarlson at Bank on 2008-10-28 15:23:04
>> PDT
>>   in /Users/maxcarlson/openlaszlo/trunk-clean
>>   for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: Move colors out of global namespace
>>
>> Bugs Fixed: LPP-6985 - Move colors out of global namespace
>>
>> Technical Reviewer: ptw
>> QA Reviewer: promanik
>>
>> Documentation:  Global colors have been moved to the 'lz.colors' object,
>> so any scripts referring to colors will need to change, e.g.
>>  var col = red;
>>
>> should be:
>>  var col = lz.colors.red;
>>
>> In most cases, setting the type of the attribute you intend to set to a
>> color will work, e.g. changing from:
>>
>>  <class name="kitten" extends="animal" >
>>   <attribute name="furcolor" value="white" />
>>  </class>
>>
>> to:
>>  <class name="kitten" extends="animal" >
>>   <attribute name="furcolor" value="white" type="color"/>
>>  </class>
>>
>> will set the furcolor to the color 'white', resolving the issue.
>>
>> See 'lps/components/base/colors.lzx' for an example of defining new global
>> colors.
>>
>> Release Notes: Global colors have been moved to the 'lz.colors' object.
>>
>> Details: neighborhoodclasses.lzx - Add type to attribute so the color is
>> found
>>
>> subclassing.lzx - Look up global color values in 'lz.colors'
>>
>> LzUtils.lzs - Look up global color values in 'lz.colors'.  Move color
>> processing routines to static methods in LzColorUtils class so they are
>> available early enough to be called by the compiler.
>>
>> LzNode.lzs - Add type argument to __LZstyleBindAttribute, so the style id
>> can be applied based on type using acceptAttribute().
>>
>> LzConstants.lzs - Move deprecated global color declarations to lz.colors.
>>
>> Library.lzs - Move LzConstants include after LzDefs - so the 'lz' in
>> 'lz.colors' is defined.
>>
>> LzDefs.lzs - Change LzStyleIdent to store the style id as a type, to be
>> looked up based on type when the style is applied.
>>
>> LaszloView.lzs,LaszloCanvas.lzs - Use LzColorUtils.hextoint() to avoid
>> deprecation warnings.
>>
>> CSSHandler.java - Look up value of CSS identifiers later when they're
>> applied to the attribute at runtime, based on type.
>>
>> NodeModel.java - Add type to emitted __LZstyleBindAttribute()
>> declarations.  Use LzColorUtils.convertColor() to do color conversions at
>> runtime.
>>
>> lzunit.lzx - Look up the value of 'red' in lz.colors.
>>
>> colors.lzx - Declare new colors in lz.colors.
>>
>> Tests: test/style/metasuite.lzx, test/lfc/lzunit-lzutils.lzx, components
>> (which rely extensively on color values/attributes for styling) run as
>> before in component sampler.
>>
>> Files:
>> M      test/style/neighborhood/neighborhoodclasses.lzx
>> M      test/style/constraints/subclassing.lzx
>> M      test/lfc/lzunit-lzutils.lzx
>> M      WEB-INF/lps/lfc/services/LzUtils.lzs
>> M      WEB-INF/lps/lfc/core/LzNode.lzs
>> M      WEB-INF/lps/lfc/core/LzConstants.lzs
>> M      WEB-INF/lps/lfc/core/Library.lzs
>> M      WEB-INF/lps/lfc/core/LzDefs.lzs
>> M      WEB-INF/lps/lfc/views/LaszloView.lzs
>> M      WEB-INF/lps/lfc/views/LaszloCanvas.lzs
>> M      WEB-INF/lps/server/src/org/openlaszlo/css/CSSHandler.java
>> M      WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
>> M      lps/components/lzunit/lzunit.lzx
>> M      lps/components/base/colors.lzx
>>
>> Changeset:
>> http://svn.openlaszlo.org/openlaszlo/patches/20081028-maxcarlson-7.tar
>>
>
>


-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20081029/7c2234c5/attachment.html


More information about the Laszlo-dev mailing list