X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FBox.java;h=e00ecf78af3b5ed7688fe6772c54e8b434c88974;hb=456bc0af52725d0babe8db1a6cec88943a3cbed1;hp=c4f34e599ae38e2032334d9cf47884ac1bb29159;hpb=9c2602143956cd39ecf5ef4c9eb31f5f56b5bd66;p=org.ibex.core.git diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index c4f34e5..e00ecf7 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -175,7 +175,7 @@ public final class Box extends JSScope implements Scheduler.Task { // as external events have occured, check the state of box if (texture != null) { if (texture.isLoaded) { minwidth = min(texture.width, maxwidth); minheight = min(texture.height, maxheight); } - else { Stream res = texture.res; texture = null; throw new JSExn("image not found: "+res); } + else { JS res = texture.res; texture = null; throw new JSExn("image not found: "+res); } } MARK_REPACK; @@ -472,7 +472,7 @@ public final class Box extends JSScope implements Scheduler.Task { throw new Error("unreachable"); // unreachable } - private class Mouse extends JS { + private class Mouse extends JS.Cloneable { public Object get(Object key) { //#switch(key) case "x": return N(globalToLocalX(getSurface()._mousex)); @@ -509,8 +509,12 @@ public final class Box extends JSScope implements Scheduler.Task { case "height": put("maxheight", value); put("minheight", value); MARK_RESIZE; case "maxwidth": setMaxWidth(value); case "minwidth": CHECKSET_INT(minwidth); MARK_RESIZE; + if (parent == null && getSurface() != null) + getSurface().setMinimumSize(minwidth, minheight, minwidth != maxwidth || minheight != maxheight); case "maxheight": setMaxHeight(value); case "minheight": CHECKSET_INT(minheight); MARK_RESIZE; + if (parent == null && getSurface() != null) + getSurface().setMinimumSize(minwidth, minheight, minwidth != maxwidth || minheight != maxheight); case "colspan": CHECKSET_SHORT(colspan); MARK_REPACK_parent; case "rowspan": CHECKSET_SHORT(rowspan); MARK_REPACK_parent; case "rows": CHECKSET_SHORT(rows); if (rows==0){set(FIXED, COLS);if(cols==0)cols=1;} else set(FIXED, ROWS); MARK_REPACK; @@ -642,10 +646,10 @@ public final class Box extends JSScope implements Scheduler.Task { int newfillcolor = stringToColor((String)value); if (newfillcolor == fillcolor) return; fillcolor = newfillcolor; - } else if(value instanceof Stream) { - texture = Picture.load((Stream)value, this); + } else if(value instanceof JS) { + texture = Picture.load((JS)value, this); } else { - throw new JSExn("fill must be null, a String, or a stream"); + throw new JSExn("fill must be null, a String, or a stream, not a " + value.getClass()); } dirty(); }