1 var XUI_Layout_Vertical = X[ 'UI' ][ 'Layout' ][ 'Vertical' ] = XUI_createLayout( {
\r
3 name : 'VerticalLayout',
\r
5 overrideAttrsForSelf : {
\r
7 role : [ 0, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.INIT_ONLY | XUI_Attr_Type.LIST, 'none,chrome,container' ],
\r
8 width : [ '100%', XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],
\r
9 height : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],
\r
10 childWidth : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],
\r
11 childHeight : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],
\r
12 gapY : [ 0, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH ]
\r
15 overrideAttrsForChild : {
\r
22 calculate : function( data, isNeedsDetection, x, y, w, h ){
\r
23 var ret = isNeedsDetection,
\r
24 attrs = data.attrObject || data.attrClass.prototype,
\r
25 uinodes = data.uinodes,
\r
26 l = uinodes && uinodes.length,
\r
28 childW, childH, gapY,
\r
29 i, _x, _y, _w, node,
\r
30 contentW, contentH, autoW, autoH, detectionPhase;
\r
32 data.preMesure( w, h );
\r
34 contentW = data.contentWidth;
\r
35 contentH = data.contentHeight;
\r
36 autoW = contentW === XUI_Attr_AUTO;
\r
37 autoH = contentH === XUI_Attr_AUTO;
\r
38 detectionPhase = autoW || autoH;
\r
39 gapY = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.gapY.No ], contentH );
\r
40 childW = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.childWidth.No ], contentW );
\r
41 childH = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.childHeight.No ], contentH );
\r
45 if( !detectionPhase ) ret = false;
\r
49 for( i = 0; i < l; ++i ){
\r
50 node = uinodes[ i ];
\r
51 node.calculate( detectionPhase, _x, _y, contentW, childH );
\r
52 _y += node.boxHeight + gapY;
\r
55 if( node.boxWidth !== XUI_Attr_AUTO ){
\r
58 if( node.minBoxWidth !== XUI_Attr_AUTO ){
\r
59 w = node.minBoxWidth;
\r
64 if( _w < w ) _w = w;
\r
69 _y = data.minContentHeight !== XUI_Attr_AUTO ? data.minContentHeight : 0;
\r
72 if( detectionPhase ){
\r
73 if( autoW ) data.contentWidth = _w;
\r
74 if( autoH ) data.contentHeight = _y;
\r
76 for( i = 0; i < l; ++i ){
\r
77 node = uinodes[ i ];
\r
78 node.calculate( false, _x, _y, data.contentWidth, data.contentHeight );
\r
79 _y += node.boxHeight + gapY;
\r
84 if( !isNeedsDetection ){
\r
92 X.UI.VBox = X.UI.Box.presets(
\r
93 XUI_Layout_Vertical,
\r