Author: ben
Date: 2007-07-07 20:08:17 -0700 (Sat, 07 Jul 2007)
New Revision: 5610

Modified:
   sandbox/ben/smush/smush.lzx
Log:
using animator to move image into central area

Modified: sandbox/ben/smush/smush.lzx
===================================================================
--- sandbox/ben/smush/smush.lzx 2007-07-08 02:35:48 UTC (rev 5609)
+++ sandbox/ben/smush/smush.lzx 2007-07-08 03:08:17 UTC (rev 5610)
@@ -10,8 +10,18 @@
             this.thumbnail.setSource(this.urlText.text);
         </method>
         <method event="onclick">
-            gDetails.showImage(this);
+            this.setSelected(true);
         </method>
+
+        <method name="setSelected" args="s" >
+            // copy image to floatimage
+            // animate floatimage to destination view
+            // set  destination view with correct image
+            if ( s ) {
+                floatview.setTarget( this );
+            } 
+        </method>
+
     </class>
 
     <class name="rsslabel" bgcolor="0x333333">
@@ -32,9 +42,7 @@
         </handler>
         
     </class>
-
-    
-    
+ 
     <class name="mygridlayout" extends="layout" >
         <attribute name="spacing"     value="2" />
         <attribute name="xoffset"     value="2" />
@@ -75,12 +83,10 @@
         </method>
     </class>
     
-
-    
     <view width="${parent.width}" height="${parent.height}" bgcolor="black" >
         <simplelayout axis="y"  />
 
-        <view bgcolor="blue" height="29" width="${parent.width}" />   
+        <view resource="topbar.png"  stretches="width" height="29" 
width="${parent.width}" />   
         <view>
             <simplelayout axis="x" spacing="3" />
             <view>          
@@ -108,12 +114,12 @@
             <method name="showImage" args="item">
                 this.currentImageSelection = item;
                 this.imgpreview.setSource(item.urlText.text);
-                gResult.showResult(this.checkForMatch());
+                // gResult.showResult(this.checkForMatch());
             </method>
             <method name="showTitle" args="item">
                 this.currentTitleSelection = item;
                 this.infoArea.title.setText(item.title.text);
-                gResult.showResult(this.checkForMatch());               
+                // gResult.showResult(this.checkForMatch());               
             </method>
             
             <method name="checkForMatch"><![CDATA[
@@ -158,7 +164,34 @@
             this.setVisible(false);
         </method>
     </view>
+
+    <view id="floatview" bgcolor="0xb10db3"  visible="false" >
+        <view name="shadow" bgcolor="0x000000" x="2" y="2" 
width="${parent.width}" height="${parent.height}" opacity=".5" />
+        <view name="image"  width="${parent.width-3}" 
height="${parent.height-3}" stretches="both"/>
+        <method name="setTarget" args="v" >
+            this.movingView = v; 
+            this.setX( v.getAttributeRelative('x',canvas) );
+            this.setY( v.getAttributeRelative('y',canvas) );
+            this.setWidth(v.width);
+            this.setHeight(v.height);  
+            this.image.setSource(v.urlText.text);
+            this.setVisible( true );
+            animSlide.doStart(); 
+        </method>     
+        <animatorgroup name="animSlide" start="false" process="simultaneous" >
+            <animator attribute="y" to="160" duration="1000" />             
+            <animator attribute="x" to="260" duration="1000" />                
         
+            <method event="onstop">
+                gDetails.showImage(floatview.movingView);               
+                floatview.setVisible(false);
+            </method>
+        </animatorgroup>
         
+        <method name="setColor" args="c" >
+            this.bg.setBGColor( c);
+        </method>
+    </view>
+
     
 </canvas>
 


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

Reply via email to