Author: hqm
Date: 2008-03-16 09:16:50 -0700 (Sun, 16 Mar 2008)
New Revision: 8283

Modified:
   openlaszlo/trunk/lps/components/base/resizeview.lzx
Log:
Change 20080316-hqm-B by [EMAIL PROTECTED] on 2008-03-16 12:10:41 EDT
    in /Users/hqm/openlaszlo/trunk2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: convert applyConstraint to applyConstraintMethod call

New Features:

Bugs Fixed:

Technical Reviewer: ptw
QA Reviewer:  max
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

update component to use applyConstraintMethod

This defines a method 'adjheight' to do the work, and defines it
on the three views that need it.

If there were more than three callers, I would consider defining a new
class with this method, but
this seemed like the most expedient solution.

Tests:

examples/components/window_example.lzx



Modified: openlaszlo/trunk/lps/components/base/resizeview.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/resizeview.lzx 2008-03-16 16:14:43 UTC 
(rev 8282)
+++ openlaszlo/trunk/lps/components/base/resizeview.lzx 2008-03-16 16:16:50 UTC 
(rev 8283)
@@ -13,28 +13,34 @@
             // be constrained to that height, otherwise they will be sized
             // to the height of their resource
             if (hassetheight) {
-                var f = function (){
-                    this.setAttribute( "height" , this.immediateparent.height);
-                }
                 var d = [  this , 'height' ];
-                leftview.applyConstraint( 'height' , f , d );
-                middleview.applyConstraint( 'height' , f , d );
-                rightview.applyConstraint( 'height' , f , d );
+                leftview.applyConstraintMethod('adjheight' , d );
+                middleview.applyConstraintMethod('adjheight' , d );
+                rightview.applyConstraintMethod( 'adjheight' , d );
             }
         </handler>
         <view name="leftview" stretches="height">
+            <method name="adjheight">
+                 this.setAttribute('height', this.immediateparent.height);
+            </method>
             <attribute name="frame" value="${parent.frame}"/>
             <handler name="onconstruct">
                 this.setResource(parent.left);
             </handler>
         </view>
         <view name="middleview" stretches="both">
+            <method name="adjheight">
+                 this.setAttribute('height', this.immediateparent.height);
+            </method>
             <attribute name="frame" value="${parent.frame}"/>
             <handler name="onconstruct">
                 this.setResource(parent.middle);
             </handler>
         </view>
         <view name="rightview" stretches="height">
+            <method name="adjheight">
+                 this.setAttribute('height', this.immediateparent.height);
+            </method>
             <attribute name="frame" value="${parent.frame}"/>
             <handler name="onconstruct">
                 this.setResource(parent.right);
@@ -87,7 +93,7 @@
 
 </library>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <!-- @LZX_VERSION@                                                         -->


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to