Revision: 2475
          http://vexi.svn.sourceforge.net/vexi/?rev=2475&view=rev
Author:   clrg
Date:     2007-10-16 09:30:37 -0700 (Tue, 16 Oct 2007)

Log Message:
-----------
Fix glaring oversight - thisbox = null; was not firing Children traps (did it 
ever!?)

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp

Added Paths:
-----------
    
trunk/core/org.vexi.core/src_junit/test/core/box/childrentrap/writeAfterThisboxNull.t

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2007-10-15 16:07:18 UTC 
(rev 2474)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2007-10-16 16:30:37 UTC 
(rev 2475)
@@ -140,8 +140,8 @@
     private final boolean isVisible() throws JSExn {
         Box b=this;
         while(true) {
-               if (b.test(VISIBLE_READ_TRAP))
-                       return JSU.toBoolean(b.getAndTriggerTraps(SC_visible));
+            if (b.test(VISIBLE_READ_TRAP))
+                return JSU.toBoolean(b.getAndTriggerTraps(SC_visible));
             if (!b.test(DISPLAY)) return false;
             if (b.parent == null) return Surface.fromBox(b) != null;
             b = b.parent;
@@ -1216,7 +1216,11 @@
 
         */
         //#switch(JSU.toString(name))
-        case "thisbox":     if (value == null) removeFromParent();
+        case "thisbox":
+            if (value == null) {
+                if (parent != null) parent.put(parent.indexNode(this), null);
+                else if (getSurface() != null) getSurface().dispose(true);
+            }
         case "font": setFont(value);
 
         case "fontsize":
@@ -1429,7 +1433,7 @@
         super.addTrap(key, f);
         // We are only interested in write traps
         if (f.getFormalArgs().length != 1) {
-               if (JSU.toString(key).equals("visible")) set(VISIBLE_READ_TRAP);
+            if (JSU.toString(key).equals("visible")) set(VISIBLE_READ_TRAP);
             return;
         }
         //#switch (JSU.toString(key))

Added: 
trunk/core/org.vexi.core/src_junit/test/core/box/childrentrap/writeAfterThisboxNull.t
===================================================================
--- 
trunk/core/org.vexi.core/src_junit/test/core/box/childrentrap/writeAfterThisboxNull.t
                               (rev 0)
+++ 
trunk/core/org.vexi.core/src_junit/test/core/box/childrentrap/writeAfterThisboxNull.t
       2007-10-16 16:30:37 UTC (rev 2475)
@@ -0,0 +1,27 @@
+<vexi xmlns:ui="vexi://ui" xmlns="" xmlns:lib="_lib">
+
+    var aGone = false;
+    var bGone = false;
+    var cGone = false;
+       var b = vexi.box;
+       b.Children ++= function(v) {
+           if (v == null) {
+               if (b[trapname].text == "a") aGone = true;
+            if (b[trapname].text == "b") bGone = true;
+            if (b[trapname].text == "c") cGone = true;
+           }
+           cascade = v;
+       }
+       
+    b[0] = lib..newBox("a");
+    b[1] = lib..newBox("b");
+    b[2] = lib..newBox("c");
+    b[0].thisbox = null;
+    .util..assertEquals(true,aGone);
+    b[0].thisbox = null;
+    .util..assertEquals(true,bGone);
+    b[0].thisbox = null;
+    .util..assertEquals(true,cGone);
+    
+    <ui:box/>
+</vexi>


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to