- case "toback": if (parent == null && getSurface() != null && toBoolean(value)) { getSurface().toBack(); }
- case "tofront": if (parent == null && getSurface() != null && toBoolean(value)) { getSurface().toFront(); }
- case "redirect": if (redirect == this) redirect = (Box)value; else Log.log(this, "redirect can only be set once");
- case "font": font = value == null ? null : Font.getFont((Res)value, font == null ? 10 : font.pointsize); MARK_RESIZE; dirty();
- case "fontsize": font = Font.getFont(font == null ? null : font.res, toInt(value)); MARK_RESIZE; dirty();
- case "x": if (parent==null && Surface.fromBox(this)!=null) { CHECKSET_INT(x); } else { if (test(PACKED) && parent != null) return; CHECKSET_INT(x); dirty(); MARK_RESIZE; dirty(); }
- case "y": if (parent==null && Surface.fromBox(this)!=null) { CHECKSET_INT(y); } else { if (test(PACKED) && parent != null) return; CHECKSET_INT(y); dirty(); MARK_RESIZE; dirty(); }
-
- case "Press1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Press2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Press3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Release1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Release2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Release3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Click1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Click2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Click3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "DoubleClick1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "DoubleClick2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "DoubleClick3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "KeyPressed": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "KeyReleased": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Move": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Enter": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
- case "Leave": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.put(name, value);
+ case "redirect": if (redirect == this) redirect = (Box)value; else Log.info(this, "redirect can only be set once");
+ case "font":
+ if(!(value instanceof Stream)) throw new JSExn("You can only put streams to the font property");
+ font = value == null ? null : Font.getFont((Stream)value, font == null ? 10 : font.pointsize);
+ MARK_RESIZE;
+ dirty();
+ case "fontsize": font = Font.getFont(font == null ? null : font.stream, toInt(value)); MARK_RESIZE; dirty();
+ case "x": if (parent==null && Surface.fromBox(this)!=null) { CHECKSET_INT(x); } else { if (test(PACKED) && parent != null) return; dirty(); CHECKSET_INT(x); dirty(); MARK_RESIZE; dirty(); }
+ case "y": if (parent==null && Surface.fromBox(this)!=null) { CHECKSET_INT(y); } else { if (test(PACKED) && parent != null) return; dirty(); CHECKSET_INT(y); dirty(); MARK_RESIZE; dirty(); }
+ case "titlebar":
+ if (getSurface() != null && value != null) getSurface().setTitleBarText(JS.toString(value));
+ super.put(name,value);
+
+ case "Press1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Press2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Press3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Release1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Release2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Release3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Click1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Click2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Click3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "DoubleClick1": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "DoubleClick2": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "DoubleClick3": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "KeyPressed": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "KeyReleased": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Move": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Enter": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);
+ case "Leave": if (!test(STOP_UPWARD_PROPAGATION) && parent != null) parent.putAndTriggerTraps(name, value);