2003/08/10 06:03:02
[org.ibex.core.git] / src / org / xwt / Trap.java
index 7966047..8d78fd1 100644 (file)
@@ -24,7 +24,7 @@ public class Trap {
     static {
         String[] p = new String[] {
             "sizetoimage", "shrink", "hshrink", "vshrink", "x", "y", "width", "height",
-            "flex", "align", "invisible", "absolute", "globalx", "globaly",
+            "flex", "hflex", "vflex", "cols", "rows", "align", "invisible", "absolute", "globalx", "globaly",
             "minwidth", "minheight", "height", "width", "maxwidth", "maxheight", 
             "numchildren", "hpad", "vpad", "doublebuffered", "cursor",
             "mousex", "mousey", "xwt", "static", "mouseinside", "root", "thisbox", "indexof", "svg"
@@ -122,9 +122,13 @@ public class Trap {
 
     private Trap() { allTraps.put(myWeak, dummy); }
 
+    /** the empty object, used for get-traps */
+    public static JS.Array emptyargs = new JS.Array();
+
     /** perform this trap -- arg.length == 0 if this is a get; otherwise it contains a single element to be put */
     public Object perform(JS.Array jsArrayArgs) throws JS.Exn {
         // TrapContext tc = TrapContext.get();
+        if (jsArrayArgs == null) jsArrayArgs = emptyargs;
         TrapArgs args = new TrapArgs(this,jsArrayArgs);
 
         // invoke the trap function
@@ -168,8 +172,10 @@ public class Trap {
             else if (cur.next == null) trapee.traps.remove(name);
             else trapee.traps.put(name, cur.next);
         }
+        /* FIXME
         if (trapee.surface != null && !trapee.is_trapped("KeyPressed") && !trapee.is_trapped("KeyReleased"))
             trapee.surface.keywatchers.removeElement(trapee);
+        */
         allTraps.remove(myWeak);
     }