Revision: 3831
          http://vexi.svn.sourceforge.net/vexi/?rev=3831&view=rev
Author:   clrg
Date:     2010-04-07 16:39:52 +0000 (Wed, 07 Apr 2010)

Log Message:
-----------
Fix shrink reading true when one of vshrink/hshrink is false

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2010-03-30 16:04:02 UTC 
(rev 3830)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2010-04-07 16:39:52 UTC 
(rev 3831)
@@ -489,15 +489,21 @@
     }
     private final void setConstrainInTree() throws JSExn {
         Box b=this;
-        // FIXME: box tree is getting into inconsistent states with 
CONSTRAIN_DESCENDENT
-        while (b.test(DISPLAY) && b.parent!=null) {// && 
!b.parent.test(CONSTRAIN_DESCENDENT)) {
-            b = b.parent;
-            b.set(CONSTRAIN_DESCENDENT);
+        try {
+            // FIXME: box tree is getting into inconsistent states with 
CONSTRAIN_DESCENDENT
+            while (b.test(DISPLAY) && b.parent!=null) {// && 
!b.parent.test(CONSTRAIN_DESCENDENT)) {
+                b = b.parent;
+                b.set(CONSTRAIN_DESCENDENT);
+            }
+            Surface s = b.getSurface();
+            if (s!=null) {
+                s.abortReflow();
+            }
+        } catch (JSExn e) {
+            Log.warn(Box.class,"Caught JS Exception while putting to trap 
\""+name+"\"");
+            e.printStackTrace(Logger.WARN, Log.user, Box.class);
+            throw e;
         }
-        Surface s = b.getSurface();
-        if (s!=null) {
-            s.abortReflow();
-        }
     }
     
     private final void setPlace() throws JSExn { set(PLACE); setPlaceInTree(); 
}
@@ -508,14 +514,20 @@
     }
     private final void setPlaceInTree() throws JSExn {
         Box b=this;
-        while (b.test(DISPLAY) && b.parent!=null && 
!b.parent.test(PLACE_DESCENDENT)) {
-            b = b.parent;
-            b.set(PLACE_DESCENDENT);
+        try {
+            while (b.test(DISPLAY) && b.parent!=null && 
!b.parent.test(PLACE_DESCENDENT)) {
+                b = b.parent;
+                b.set(PLACE_DESCENDENT);
+            }
+            Surface s = b.getSurface();
+            if (s!=null) {
+                s.abortReflow();
+            }
+        } catch (JSExn e) {
+            Log.warn(Box.class,"Caught JS Exception while putting to trap 
\""+name+"\"");
+            e.printStackTrace(Logger.WARN, Log.user, Box.class);
+            throw e;
         }
-        Surface s = b.getSurface();
-        if (s!=null) {
-            s.abortReflow();
-        }
     }
     private final void setPlaceNoAbort () {
         Box b=this;
@@ -1999,13 +2011,16 @@
          * @type(Boolean)
          * @initial_value(false)
          * */
-        case "shrink": return JSU.B(test(HSHRINK) || test(VSHRINK));
+        case "shrink": return JSU.B(test(HSHRINK) && test(VSHRINK));
         
         /* <p>Affects how a box is shrunk in the horizontal and vertical 
dimensions.</p>
          * 
          * <p>A <em>horizontally</em> shrunk (<code>hshrink</code) box will 
decline any horizontal
          * slack available to it within a parent box, and a 
<em>vertically</em> shrunk
          * (<code>vshrink</code) box will decline vertical slack.</p>
+         * 
+         * <p>If this box is the root box of a window, setting it to shrink 
will make
+         * it unresizable.</p>
          *  
          * @group(vshrink)
          * @type(Boolean)
@@ -2098,6 +2113,9 @@
         
         /* <p>Whether to display a box and it's contents.</p>
          * 
+         * <p>If this box is the root box of a window, its display property 
will determine whether
+         * or not the window is visible.</p>
+         * 
          * @type(Boolean)
          * @initial_value(true)
          * */
@@ -3074,6 +3092,8 @@
                     newparent.setConstrain();
                 }
                 newparent.setPlace();
+                newparent.set(PLACE_DESCENDENT);
+                newparent.set(CONSTRAIN_DESCENDENT);
             }
             // assign new parent
             parent = newparent;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to