2003/11/27 05:05:09
[org.ibex.core.git] / src / org / xwt / Surface.java
index 3a083cc..ac2a837 100644 (file)
@@ -108,7 +108,7 @@ public abstract class Surface extends PixelBuffer {
             final Box who = Box.whoIs(root, mousex, mousey);
             Scheduler.add(new Scheduler.Task() { public void perform() {
                 Platform.clipboardReadEnabled = true;
-                root.putAndTriggerJSTraps("Press3", Boolean.TRUE);
+                root.putAndTriggerTraps("Press3", Boolean.TRUE);
                 Platform.clipboardReadEnabled = false;
             }});
         }
@@ -175,7 +175,7 @@ public abstract class Surface extends PixelBuffer {
                 Box b = (Box)keywatchers.elementAt(i);
                 for(Box cur = b; cur != null; cur = cur.parent)
                     if (!cur.test(cur.VISIBLE)) continue outer;
-                b.putAndTriggerJSTraps("KeyPressed", key);
+                b.putAndTriggerTraps("KeyPressed", key);
             }
             Platform.clipboardReadEnabled = false;
         }
@@ -195,7 +195,7 @@ public abstract class Surface extends PixelBuffer {
                 Box b = (Box)keywatchers.elementAt(i);
                 for(Box cur = b; cur != null; cur = cur.parent)
                     if (!cur.test(cur.VISIBLE)) continue outer;
-                b.putAndTriggerJSTraps("KeyReleased", key);
+                b.putAndTriggerTraps("KeyReleased", key);
             }
         }});
     }
@@ -223,7 +223,7 @@ public abstract class Surface extends PixelBuffer {
 
                 // Root gets motion events outside itself (if trapped, of course)
                 if (!root.inside(oldmousex, oldmousey) && !root.inside(mousex, mousey) && (button1 || button2 || button3))
-                    root.putAndTriggerJSTraps("Move", Boolean.TRUE);
+                    root.putAndTriggerTraps("Move", Boolean.TRUE);
 
                 root.Move(oldmousex, oldmousey, mousex, mousey);
                 if (!cursor.equals(oldcursor)) syncCursor();
@@ -246,7 +246,7 @@ public abstract class Surface extends PixelBuffer {
         Scheduler.add(new Scheduler.Task() { public void perform() {
             root.x = x;
             root.y = y;
-            root.putAndTriggerJSTraps("PosChange", Boolean.TRUE);
+            root.putAndTriggerTraps("PosChange", Boolean.TRUE);
         }});
     }
 
@@ -298,7 +298,7 @@ public abstract class Surface extends PixelBuffer {
         this.root = root;
         Surface old = fromBox(root);
         if (old != null) old.dispose(false);
-        else root.remove();
+        else root.put("thisbox", null);
 
         // make sure the root is properly sized
         do { abort = false; root.reflow(root.width, root.height); } while(abort);
@@ -371,7 +371,7 @@ public abstract class Surface extends PixelBuffer {
             Scheduler.add(this);
         }
         
-        public void perform() { boxContainingMouse.putAndTriggerJSTraps(name, value); }
+        public void perform() { boxContainingMouse.putAndTriggerTraps(name, value); }
         public String toString() { return "SimpleMessage [name=" + name + ", value=" + value + "]"; }
 
     }