2002/10/03 23:41:55
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:50:41 +0000 (06:50 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:50:41 +0000 (06:50 +0000)
darcs-hash:20040130065041-2ba56-b66db7de18f2907c373e4bd1d1cc076a7659ec68.gz

CHANGES
src/org/xwt/SpecialBoxProperty.java

diff --git a/CHANGES b/CHANGES
index a5fa960..a454b2a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
 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.
index dc39023..7488199 100644 (file)
@@ -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; }
+            });
     }