[Laszlo-checkins] r12023 - in openlaszlo/trunk: WEB-INF/lps/schema lps/components/utils/replicator test test/lfc

ptw@openlaszlo.org ptw at openlaszlo.org
Tue Dec 9 06:21:07 PST 2008


Author: ptw
Date: 2008-12-09 06:21:02 -0800 (Tue, 09 Dec 2008)
New Revision: 12023

Modified:
   openlaszlo/trunk/WEB-INF/lps/schema/lfc-undeclared.lzx
   openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx
   openlaszlo/trunk/test/classes.lzx
   openlaszlo/trunk/test/lfc/states.lzx
Log:
Change 20081206-ptw-c by ptw at dueling-banjos.home on 2008-12-06 12:17:44 EST
    in /Users/ptw/OpenLaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Review comments on r11841

Bugs Fixed:
LPP-2302  Implement LZX <mixin> tag

Technical Reviewer: mamye at comcast.net (pending)

Details:
    classes: remove call to non-existent method

    states: rewrite in the modern way

    lfc-undeclared: trait -> mixin

    replicator: silence warning

Tests:
    classes.lzx, mixins.lzx, lfc/states.lzx



Modified: openlaszlo/trunk/WEB-INF/lps/schema/lfc-undeclared.lzx
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/schema/lfc-undeclared.lzx	2008-12-09 13:05:09 UTC (rev 12022)
+++ openlaszlo/trunk/WEB-INF/lps/schema/lfc-undeclared.lzx	2008-12-09 14:21:02 UTC (rev 12023)
@@ -202,7 +202,7 @@
         <element>debugger</element>
         <element>command</element>
         <element>class</element>
-        <element>trait</element>
+        <element>mixin</element>
         <element>include</element>
         <element>library</element>
         <element>layout</element>

Modified: openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx
===================================================================
--- openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx	2008-12-09 13:05:09 UTC (rev 12022)
+++ openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx	2008-12-09 14:21:02 UTC (rev 12023)
@@ -230,7 +230,7 @@
             @param n: The node to which it is being set. -->
         <method name="setData" args="v,n=null">
             if (v) {
-                v.setData( this.nodes[ n ] );
+                v.setAttribute('data', this.nodes[ n ]);
                 if (v['applyData']) v.applyData(this.nodes[n]);
             }
         </method>

Modified: openlaszlo/trunk/test/classes.lzx
===================================================================
--- openlaszlo/trunk/test/classes.lzx	2008-12-09 13:05:09 UTC (rev 12022)
+++ openlaszlo/trunk/test/classes.lzx	2008-12-09 14:21:02 UTC (rev 12023)
@@ -2,15 +2,15 @@
     <class name="mywindow" extends="view">
         <attribute name="novalue"/>
         <attribute name="aroma" value="vanilla" type="string"/>
-        <attribute name="bgcolor" value="#FFFFFF"
-                   type="color" setter="this.applyWindowColor( bgcolor)" />
+        <attribute name="flavor" value="honeydew"
+                   type="color" setter="this.setAttribute( 'bgcolor', flavor )" />
         <method name="mymethod" args="x,y,z">
          Debug.write("x is" + x + ", y * z =" + (y * z));</method>
         <text>MyWindow's Text</text> 
     </class>
     <mywindow/>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2004, 2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 </canvas>

Modified: openlaszlo/trunk/test/lfc/states.lzx
===================================================================
--- openlaszlo/trunk/test/lfc/states.lzx	2008-12-09 13:05:09 UTC (rev 12022)
+++ openlaszlo/trunk/test/lfc/states.lzx	2008-12-09 14:21:02 UTC (rev 12023)
@@ -1,25 +1,19 @@
-<canvas debug="true" width="1024">
-<view oninit="Debug.setAttribute('height', 200);
-Debug.setAttribute('width', 600);
-Debug.setAttribute('x', 400);
-Debug.setAttribute('y', 0);
-Debug.setLine(0);"/>
-
+<canvas debug="true">
     <view name="stateview" width="300" height="200" >
         <attribute name="myapply" value="true" />
         <state >
-            <attribute name="apply" value="parent.myapply" when="once" />
-            <attribute name="bgcolor" value="green" />
-            <text name="title"> This is a view with states</text>
+            <attribute name="applied" value="parent.myapply" when="once" />
+            <attribute name="bgcolor" value="green" type="color" />
+            <text name="title">This is a view with states</text>
         </state>
-        <state name="state1" onapply="Debug.write( 'Apply state 1')"
-               onremove="Debug.write( 'remove state 1')" >
+        <state name="state1"
+               onapplied="Debug.debug('%w: %s', this, this.applied?'applied':'removed')" >
             <animator start="true" attribute="y" to="200" duration="1500" />
-            <animator start="true" attribute="width" to="50" duration="1500" 
-                      relative="true"/>
-            <text y="${parent.title.height}">Im animating!</text>
+            <animator start="true" attribute="width" to="50" duration="1500" relative="true"/>
+            <text y="${parent.title.height}">I'm animating!</text>
         </state>
-        <state name="state2" pooling="true">
+        <state name="state2" pooling="true"
+               onapplied="Debug.debug('%w: %s', this, this.applied?'applied':'removed')" >
             <view name="redContainer" width="${parent.width}" y="50">
                 <view name="redOne"   bgcolor="red" height="22" options="releasetolayout;"/>
                 <view name="redTwo"   bgcolor="red" height="22" options="releasetolayout;"/>
@@ -30,8 +24,9 @@
             <attribute name="x" value="${this.y}"/>
             <attribute name="width" value="250"/>
         </state>
-        <state name="state3" onapply="this.parent.doMyApply()">
-            <text label="This is the mean state that kills others" y="22" />
+        <state name="state3" onapply="this.parent.doMyApply()"
+               onapplied="Debug.debug('%w: %s', this, this.applied?'applied':'removed')" >
+            <text text="This is the mean state that kills others" y="22" />
             <attribute name="y" value="0" />
             <method name="doMyApply" >
                 this.state1.remove();
@@ -39,26 +34,32 @@
                 this.state3.remove();
             </method>
         </state>
-
     </view>
-    <view x="${stateview.width}" oninit="Debug.write( ' got inited' )">
+    <view x="${stateview.width}" width="100%" oninit="Debug.debug('got inited' )">
         <button text="state1" onclick="stateview.state1.apply()"/>
         <button text="state2" onclick="stateview.state2.apply()"/>
         <button text="state3" onclick="stateview.state3.apply()" />
-<!-- These last two buttons need some explaination.
-     lookForViews attempts to locate a view that is not created until state2 is applied. 
-     + should return errors and undefined if clicked before state2
-     + should return true if cleicked after state2 
-     + should return false if clicked after state2 and state3
-     + Should return errors and undefined if cliked after "destroy state2" 
-     These were added to verify that pooled states and their views are fully destroyed after LzState.destroy(); 
--->
-        <button text="lookForViews" onclick="Debug.write('Should be true after state2 is applied:'+stateview.redContainer.visible);" />
-        <button text="destory state2" onclick="stateview.state2.destroy();" />
+        <text multiline="true" width="100%">
+           These last two buttons need some explanation.<br/>
+           lookForViews attempts to locate a view that is not created until state2 is applied.<br/>
+           + should return errors and undefined if clicked before state2<br/>
+           + should return true if cleicked after state2<br/>
+           + should return false if clicked after state2 and state3<br/>
+           + Should return errors and undefined if clicked after "destroy state2"<br/>
+           These were added to verify that pooled states and their views are fully destroyed after LzState.destroy();
+        </text>
+        <button text="lookForViews">
+          <handler name="onclick">
+            Debug.debug("Should be %s: %s",
+              stateview.state2.applied,
+              stateview.redContainer.visible)
+          </handler>
+        </button>
+        <button text="destroy state2" onclick="stateview.state2.destroy();" />
         <simplelayout axis="y" spacing ="4" />
     </view>
 </canvas>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2006, 2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->



More information about the Laszlo-checkins mailing list