From 3921df8be3570de747a5c873b144909d36f4bb8a Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 06:50:41 +0000 Subject: [PATCH] 2002/10/03 23:41:55 darcs-hash:20040130065041-2ba56-b66db7de18f2907c373e4bd1d1cc076a7659ec68.gz --- CHANGES | 5 +++-- src/org/xwt/SpecialBoxProperty.java | 31 ++++++++++++++++++------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index a5fa960..a454b2a 100644 --- a/CHANGES +++ b/CHANGES @@ -425,8 +425,9 @@ 03-Oct megacz Proxy.java: fixed bug in shMatchExp() -03-Oct megacz Box.java: fixed shrink behavior, deliver clicks to box - first (not root), id is a readable attribute +03-Oct megacz Box.java, SpecialBoxProperty.java: fixed shrink + behavior, deliver clicks to box first (not root), id is + a readable attribute 03-Oct megacz XWT.java: made recursivePrintObject public so we can access it. diff --git a/src/org/xwt/SpecialBoxProperty.java b/src/org/xwt/SpecialBoxProperty.java index dc39023..7488199 100644 --- a/src/org/xwt/SpecialBoxProperty.java +++ b/src/org/xwt/SpecialBoxProperty.java @@ -258,7 +258,7 @@ class SpecialBoxProperty { boolean newshrink = stob(value); if (b.hshrink == newshrink && b.vshrink == newshrink) return; b.hshrink = b.vshrink = newshrink; - b.mark_for_prerender(); + b.mark_for_prerender(); } }); specialBoxProperties.put("hshrink", new SpecialBoxProperty() { @@ -267,7 +267,7 @@ class SpecialBoxProperty { boolean newshrink = stob(value); if (b.hshrink == newshrink) return; b.hshrink = newshrink; - b.mark_for_prerender(); + b.mark_for_prerender(); } }); @@ -277,7 +277,7 @@ class SpecialBoxProperty { boolean newshrink = stob(value); if (b.vshrink == newshrink) return; b.vshrink = newshrink; - b.mark_for_prerender(); + b.mark_for_prerender(); } }); @@ -376,9 +376,9 @@ class SpecialBoxProperty { specialBoxProperties.put("invisible", new SpecialBoxProperty() { public Object get(Box b) { - for (Box cur = b; cur != null; cur = cur.getParent()) { if (cur.invisible) return Boolean.TRUE; } - return Boolean.FALSE; - } + for (Box cur = b; cur != null; cur = cur.getParent()) { if (cur.invisible) return Boolean.TRUE; } + return Boolean.FALSE; + } public void put(Box b, Object value) { boolean newinvisible = stob(value); if (newinvisible == b.invisible) return; @@ -480,13 +480,13 @@ class SpecialBoxProperty { SpecialBoxProperty mouseEventHandler = new SpecialBoxProperty() { public void put(String name, Box b, Object value) { if (b.surface == null) return; - for(Box c = b.prevSibling(); c != null; c = c.prevSibling()) - if (c.inside(c.surface.mousex, c.surface.mousey)) { - c.put(name, c, value); - return; - } - if (b.getParent() != null) - b.getParent().put(name, b.getParent(), value); + for(Box c = b.prevSibling(); c != null; c = c.prevSibling()) + if (c.inside(c.surface.mousex, c.surface.mousey)) { + c.put(name, c, value); + return; + } + if (b.getParent() != null) + b.getParent().put(name, b.getParent(), value); }}; specialBoxProperties.put("Press1", mouseEventHandler); @@ -657,6 +657,11 @@ class SpecialBoxProperty { public void put(Box b, Object value) { } public Object get(Box b) { return new Apply(b); } }); + + specialBoxProperties.put("id", new SpecialBoxProperty() { + public void put(Box b, Object value) { } + public Object get(Box b) { return b.id; } + }); } -- 1.7.10.4