1 var LayoutManagerBase = X.Class.create(
6 define : function( src ){
7 return X.Class._override( this, src, true );
11 reflow : function( nodeData, allowW, allowH ){
12 nodeData.preMesure( allowW, allowH );
14 var children = nodeData.children,
15 contentW = nodeData.contentWidth,
16 contentH = nodeData.contentHeight,
17 autoW = contentW === AUTO,
18 autoH = contentH === AUTO,
19 auto, calc, childW, childH, child, i, style, data,
22 auto = autoW && autoH;
25 calc = BasicLayoutManager.calcValue;
26 for( i = children.length; i; ){
27 child = children[ --i ];
28 style = child.__style;
31 t = calc( data[ X.Css.AttrNo.top ], contentH );
32 r = calc( data[ X.Css.AttrNo.right ], contentW );
33 b = calc( data[ X.Css.AttrNo.bottom ], contentH );
34 l = calc( data[ X.Css.AttrNo.left ], contentW );
38 if( child.instanceOf( LayoutBoxPrivate ) ){
39 child.layoutManager.reflow( child, contentW - r - l, contentH - t - b );
41 child.preMesure( contentW - r - l, contentH - t - b );
46 if( autoW && childW < child.boxWidth + r + l ) childW = child.boxWidth + r + l;
47 if( autoH && childH < child.boxHeight + t + b ) childH = child.boxHeight + t + b;
49 if( autoW ) nodeData.contentWidth = childW;
50 if( autoH ) nodeData.contentHeight = childH;
52 ( autoW || autoH ) && nodeData.postMesure();
54 delete nodeData.dirty;
56 redraw : function( nodeData ){
57 var root = nodeData.rootData;
58 root.dirty === X.Css.Dirty.REFLOW && this.reflow( root );