2003/10/20 01:41:21
[org.ibex.core.git] / src / org / xwt / Box.java.pp
index 32127af..9699421 100644 (file)
@@ -931,6 +931,16 @@ public final class Box extends JS.Scope {
 
         static {
             specialBoxProperties.put("fill", new ColorBoxProperty() {
+                    public void put(Box b, Object value) {
+                        if (value != null && value instanceof Res) {
+                            b.image = Picture.fromRes((Res)value);
+                            b.minwidth = b.image.getWidth();
+                            b.minheight = b.image.getHeight();
+                            b.dirty();
+                        } else {
+                            super.put(b, value);
+                        }
+                    }
                     public int getColor(Box b) { return b.fillcolor; }
                     public void putColor(Box b, int argb) { b.fillcolor = argb; }
                 });
@@ -1156,7 +1166,7 @@ public final class Box extends JS.Scope {
                         return new Integer(b.x);
                     }
                     public void put(Box b, Object value) {
-                        if (!((b.flags & NOTPACKED_FLAG) != 0)) return;
+                        if (!((b.flags & NOTPACKED_FLAG) != 0) && (b.parent != null || b.surface == null)) return;
                         int x = stoi(value);
                         if (x == b.x) return;
                         b.dirty();