From: <mk...@us...> - 2007-09-13 10:27:02
|
Revision: 2180 http://vexi.svn.sourceforge.net/vexi/?rev=2180&view=rev Author: mkpg2 Date: 2007-09-13 03:27:03 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Replace clip="false" with layout="layer" Modified Paths: -------------- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp trunk/core/org.vexi.core/src_junit/test/core/box/_lib.t Added Paths: ----------- trunk/core/org.vexi.core/src_junit/test/core/box/layout/layout.t Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2007-09-13 10:26:54 UTC (rev 2179) +++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2007-09-13 10:27:03 UTC (rev 2180) @@ -1142,7 +1142,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 "clip": return JSU.B(test(CLIP)); case "width": return (minwidth==maxwidth) ? JSU.N(minwidth) : JSU.N(width); case "height": return (minheight==maxheight) ? JSU.N(minheight) : JSU.N(height); case "minwidth": return JSU.N(minwidth); @@ -1298,15 +1298,22 @@ } case "layout": if (JSU.toString(value).equals("place")) { - if (test(PACK)) clear(PACK); + if (test(PACK) || !test(CLIP)) { + clear(PACK); set(CLIP); + } else return; - } else if (JSU.toString(value).equals("pack")) { + } else if (JSU.toString(value).equals("layer")) { + if (test(PACK) || test(CLIP)) { + clear(PACK); clear(CLIP); + } + else return; + } else if (JSU.toString(value).equals("pack")) { if (test(PACK)) return; else set(PACK); } 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 "clip": if (CHECKSET_FLAG(CLIP) && !test(PACK)) setConstrain(); case "orient": if (JSU.toString(value).equals("horizontal")) { if (test(ORIENT)) return; @@ -1319,6 +1326,8 @@ setConstrain(); setPlace(); } + case "rows": throw new JSExn("Deprecated property write to '"+JSU.toString(name)+"': "+JSU.toString(value)); + case "cols": throw new JSExn("Deprecated property write to '"+JSU.toString(name)+"': "+JSU.toString(value)); case "surface": for (int i=0; i<treeSize(); i++) getChild(i).putAndTriggerTraps(SC_surface, value); // FIXME: the call to setMinimized()/setMaximized() will trigger another call of this code in the course of triggering write traps case "Minimized": if (parent == null && getSurface() != null) getSurface().setMinimized(JSU.toBoolean(value)); Modified: trunk/core/org.vexi.core/src_junit/test/core/box/_lib.t =================================================================== --- trunk/core/org.vexi.core/src_junit/test/core/box/_lib.t 2007-09-13 10:26:54 UTC (rev 2179) +++ trunk/core/org.vexi.core/src_junit/test/core/box/_lib.t 2007-09-13 10:27:03 UTC (rev 2180) @@ -5,6 +5,11 @@ r.text = text; return r; }; + static.newBoxSize = function(w,h){ + var r = vexi.box; + r.width = w; r.height = h; + return r; + }; static.reorderWrite = function (b){ return function(v){ vexi.log.info(trapname); @@ -13,7 +18,10 @@ cascade = v; }; }; - + static.assertSize = function(w,h,b){ + .util..assertEquals(w,b.width); + .util..assertEquals(h,b.height); + }; <ui:box/> </vexi> Added: trunk/core/org.vexi.core/src_junit/test/core/box/layout/layout.t =================================================================== --- trunk/core/org.vexi.core/src_junit/test/core/box/layout/layout.t (rev 0) +++ trunk/core/org.vexi.core/src_junit/test/core/box/layout/layout.t 2007-09-13 10:27:03 UTC (rev 2180) @@ -0,0 +1,25 @@ +<vexi xmlns:ui="vexi://ui" xmlns="" xmlns:lib="_lib"> + + + var p = vexi.box; + p.orient="horizontal"; + p.layout="pack"; + p.shrink="true"; + var c1 = lib..newBoxSize(20,20); + var c2 = lib..newBoxSize(30,20); + p[0] = c1; + p[1] = c2; + p.forcereflow(); + lib..assertSize(50,20,p); + + p.layout="place"; + p.forcereflow(); + lib..assertSize(0,0,p); + + p.layout="layer"; + p.forcereflow(); + lib..assertSize(30,20,p); + + + <ui:box/> +</vexi> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |