Revision: 3163
          http://vexi.svn.sourceforge.net/vexi/?rev=3163&view=rev
Author:   clrg
Date:     2008-11-02 15:15:14 +0000 (Sun, 02 Nov 2008)

Log Message:
-----------
Fix to work with core surface/visible trap change

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/clickable.t
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/focusable.t
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/popupable.t
    trunk/widgets/org.vexi.widgets/src/vexi/util/lazyload.t
    trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_columns.t
    trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_simple.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/clickable.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/clickable.t    
2008-11-02 15:13:58 UTC (rev 3162)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/clickable.t    
2008-11-02 15:15:14 UTC (rev 3163)
@@ -90,7 +90,7 @@
         }
         
         /** initialise as normal state */
-        surface ++=  function(v) {
+        surface ++= function(v) {
             cascade = v;
             normal = true;
             surface --= callee;

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/focusable.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/focusable.t    
2008-11-02 15:13:58 UTC (rev 3162)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/focusable.t    
2008-11-02 15:15:14 UTC (rev 3163)
@@ -40,7 +40,6 @@
         thisbox.focused;          // whether a focusable is focused
         thisbox.nextfocus;        // read for the focus after thisbox on the 
surface
         thisbox.prevfocus;        // read for the focus before thisbox on the 
surface
-        thisbox.v_surface;        // pseudo-private variable for tracking 
surface changes
         
         // assign checkFocus traps
         display   ++= static.checkFocus; // defocus when hidden
@@ -84,25 +83,20 @@
     
     /** write trap to handle surface change */
     static.surfaceWrite = function(v) {
-        var t = trapee;
-        var s = t.surface;
-        var o = t.v_surface;
-        cascade = v;
-        // remember old surface
-        t.v_surface = s;
-        // drop from current surface if there is one
-        if (o) o.dropFocus(t);
+        // drop from current surface
+        var s = trapee.surface;
+        if (s) s.dropFocus(trapee);
         // add to new surface
-        if (s) s.addFocus(t);
+        if (v) v.addFocus(trapee);
+        cascade = v;
     }
     
     /** write trap to focus on Press1 */
     static.pressWrite = function(v) {
         cascade = v;
-        var t = trapee;
-        var s = t.surface;
-        if (t.focusable and !s.focusrequest)
-            s.focusrequest = t;
+        var s = trapee.surface;
+        if (trapee.focusable and !s.focusrequest)
+            s.focusrequest = trapee;
     }
 
 </vexi>

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/popupable.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/popupable.t    
2008-11-02 15:13:58 UTC (rev 3162)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/popupable.t    
2008-11-02 15:15:14 UTC (rev 3163)
@@ -32,9 +32,6 @@
         thisbox.blockRelease = true;
         thisbox.v_popbox = null;
         
-        // private variables
-        thisbox.v_surface = null;
-        
         // assign static trap functions
         focused    ++= static.focusWrite;
         popdown    ++= static.popdownWrite;
@@ -133,28 +130,21 @@
     
     /** register popbox once surface is available */
     static.surfaceWrite = function(v) {
-        var o = trapee.v_surface;
-        var s = trapee.surface;
-        if (s == o) { cascade = v; return; }
-        
         // clean up old surface
+        var o = trapee.surface;
         if (o and trapee.v_popbox) { // FIXME: why is the 2nd check required?
             if (trapee.popped) o.pop(trapee, static.DOWN, 0);
             o.delPopBox(trapee);
             o.Press1 --= trapee.v_pressWrite;
             trapee.v_popbox.display --= static.displayWrite;
         }
-        
-        // remember new surface as old surface, for next time
-        cascade = v;
-        trapee.v_surface = s;
-        
         // register with new surface
-        if (s and trapee.v_popbox) {
-            s.addPopBox(trapee.v_popbox);
+        if (v and trapee.v_popbox) {
+            v.addPopBox(trapee.v_popbox);
             // must do this because v_popbox surface trap won't fire otherwise
-            trapee.v_popbox.surface = true;
+            trapee.v_popbox.surface = v;
         }
+        cascade = v;
     }
     
 </vexi>

Modified: trunk/widgets/org.vexi.widgets/src/vexi/util/lazyload.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/vexi/util/lazyload.t     2008-11-02 
15:13:58 UTC (rev 3162)
+++ trunk/widgets/org.vexi.widgets/src/vexi/util/lazyload.t     2008-11-02 
15:15:14 UTC (rev 3163)
@@ -15,9 +15,9 @@
         
         /** default to helpful $msg.text message as last resort */
         thisbox.surface ++= function(v) {
+            cascade = v;
             if (numchildren == 0 or !$msg.text) $msg.text = "Loading...";
             surface --= callee;
-            cascade = v;
         }
         
         /** initiate loading of template src */

Modified: trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_columns.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_columns.t 
2008-11-02 15:13:58 UTC (rev 3162)
+++ trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_columns.t 
2008-11-02 15:15:14 UTC (rev 3163)
@@ -43,7 +43,7 @@
              HH   /
             */
             var b = vexi.box;
-            b.visible ++= function(v) { return; };
+            b.visible ++= function() { return true; };
             .grid(b);
             b.cols=2;
             b[0] = newBox("A",1,1,"red");

Modified: trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_simple.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_simple.t  
2008-11-02 15:13:58 UTC (rev 3162)
+++ trunk/widgets/org.vexi.widgets/src_vunit/test/layout/grid_simple.t  
2008-11-02 15:15:14 UTC (rev 3163)
@@ -40,7 +40,7 @@
              CCDDD
             */
             var b = vexi.box;
-            b.visible ++= function(v) { return; };
+            b.visible ++= function() { return true; };
             .grid(b);
             b.cols=5;
             b[0] = newBox("A",2,2,"red");


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to