Revision: 2015
          http://vexi.svn.sourceforge.net/vexi/?rev=2015&view=rev
Author:   clrg
Date:     2007-07-31 08:10:44 -0700 (Tue, 31 Jul 2007)

Log Message:
-----------
Add clip property to Box

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

Modified: core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp  2007-07-31 13:11:37 UTC 
(rev 2014)
+++ core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp  2007-07-31 15:10:44 UTC 
(rev 2015)
@@ -209,7 +209,7 @@
     private static final int TILE_IMAGE              = 0x10000000;
     private static final int HAS_EMPTY_STRING        = 0x20000000;
     // unused - private static final int FLAG        = 0x40000000;
-    // unused - private static final int FLAG        = 0x80000000;
+    private static final int CLIP                    = 0x80000000;
 
     // Box Properties 
////////////////////////////////////////////////////////////
 
@@ -223,7 +223,7 @@
     private Box parent = null;
     private Box redirect = this;
     private int flags =
-        ALIGN_TOP | ALIGN_LEFT | DISPLAY | REFLOW | ORIENT | TILE_IMAGE | PACK 
| HAS_EMPTY_STRING;
+        ALIGN_TOP | ALIGN_LEFT | DISPLAY | REFLOW | ORIENT | TILE_IMAGE | PACK 
| HAS_EMPTY_STRING | CLIP;
     private BasicTree bt = null;
     // rendering properties
     public int fillcolor = 0x00000000;
@@ -403,7 +403,6 @@
         contentwidth = 0;
         contentheight = 0;
 
-        // non-packing parents clip contents
         if (test(PACK)) {
             //#repeat width/height HORIZONTAL/VERTICAL 
             // accumulate child contentwidth
@@ -423,6 +422,14 @@
                 }
             }
             //#end
+            
+        } else if (!test(CLIP)) {
+            int i = 0;
+            for (Box c = getChild(0); c != null; c = getChild(++i)) {
+                if (!c.test(DISPLAY)) continue;
+                contentwidth = max(contentwidth, c.contentwidth);
+                contentheight = max(contentheight, c.contentheight);
+            }
         }
 
         //#repeat width/height HAS_WIDTH_SLACK/HAS_HEIGHT_SLACK
@@ -1134,6 +1141,7 @@
         case "y": return JSU.N(y);
         case "orient": return test(ORIENT) ? SC_horizontal : SC_vertical;
         case "layout": return test(PACK) ? SC_pack : SC_place;
+        case "clip": return JSU.B(test(CLIP));
         case "cols": throw new JSExn("Deprecated property read: 
"+JSU.toString(name));
         case "rows": throw new JSExn("Deprecated property read: 
"+JSU.toString(name));
         case "colspan": throw new JSExn("Deprecated property read: 
"+JSU.toString(name));
@@ -1303,7 +1311,10 @@
             } else throw new JSExn("Attempt to set Box property 'layout' to 
unsupported value '"+JSU.toString(value)+"'");
             setConstrain();
             setPlace();
+        case "clip":        if (CHECKSET_FLAG(CLIP) && !test(PACK)) 
setConstrain();
         case "orient":
+            if (!test(PACK))
+                throw new JSExn("Put to property 'orient' on a box with place 
layout");
             if (JSU.toString(value).equals("horizontal")) {
                 if (test(ORIENT)) return;
                 else set(ORIENT);


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to