-X.UI.Layout.Vertical = X.UI.Layout.create( {\r
+var XUI_Layout_Vertical = X[ 'UI' ][ 'Layout' ][ 'Vertical' ] = XUI_createLayout( {\r
\r
name : 'VerticalLayout',\r
\r
+ /*\r
+ * \r
+ */\r
overrideAttrsForSelf : {\r
selectable : false,\r
- role : [ 0, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.INIT_ONLY | X.UI.Attr.Type.LIST, 'none,chrome,container' ],\r
- width : [ '100%', X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],\r
- height : [ X.UI.Attr.AUTO, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],\r
- childWidth : [ X.UI.Attr.AUTO, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],\r
- childHeight : [ X.UI.Attr.AUTO, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],\r
- gapY : [ 0, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH ]\r
+ role : [ 0, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.INIT_ONLY | XUI_Attr_Type.LIST, 'none,chrome,container' ],\r
+ width : [ '100%', XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],\r
+ height : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],\r
+ childWidth : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],\r
+ childHeight : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ],\r
+ gapY : [ 0, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH ]\r
},\r
\r
overrideAttrsForChild : {\r
\r
contentW = data.contentWidth;\r
contentH = data.contentHeight;\r
- autoW = contentW === X.UI.Attr.AUTO;\r
- autoH = contentH === X.UI.Attr.AUTO;\r
+ autoW = contentW === XUI_Attr_AUTO;\r
+ autoH = contentH === XUI_Attr_AUTO;\r
detectionPhase = autoW || autoH;\r
- gapY = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.gapY.No ], contentH );\r
- childW = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.childWidth.No ], contentW );\r
- childH = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.childHeight.No ], contentH );\r
+ gapY = XUI_AbstractUINode_calcValue( attrs[ data.usableAttrs.gapY.No ], contentH );\r
+ childW = XUI_AbstractUINode_calcValue( attrs[ data.usableAttrs.childWidth.No ], contentW );\r
+ childH = XUI_AbstractUINode_calcValue( attrs[ data.usableAttrs.childHeight.No ], contentH );\r
_x = data.contentL;\r
- _y = data.contentT;\r
+ _y = 0; //data.contentT;\r
\r
if( !detectionPhase ) ret = false;\r
\r
_w = 0;\r
for( i = 0; i < l; ++i ){\r
node = uinodes[ i ];\r
- node.calculate( detectionPhase, _x, _y, contentW, childH );\r
+ node.calculate( detectionPhase, 0, _y, contentW, childH );\r
_y += node.boxHeight + gapY;\r
- // 概算のみ\r
+ //console.dir( node );\r
+ // 概算のみ, 子要素の最大幅を調べる _w\r
if( autoW ){\r
- if( node.boxWidth !== X.UI.Attr.AUTO ){\r
+ if( node.boxWidth !== XUI_Attr_AUTO ){\r
w = node.boxWidth;\r
} else\r
- if( node.minBoxWidth !== X.UI.Attr.AUTO ){\r
- w = node.minBoxWidth;\r
+ if( node.boxWidthMin !== XUI_Attr_AUTO ){\r
+ w = node.boxWidthMin;\r
minFlag = true;\r
} else {\r
w = 0;\r
};\r
- if( _w < w ) _w = w; \r
- }; \r
+ if( _w < w ) _w = w;\r
+ };\r
};\r
_y -= gapY;\r
} else {\r
- _y = data.minContentHeight !== X.UI.Attr.AUTO ? data.minContentHeight : 0;\r
+ _y = data.contentHeightMin !== XUI_Attr_AUTO ? data.contentHeightMin : 0;\r
};\r
\r
if( detectionPhase ){\r
if( autoW ) data.contentWidth = _w;\r
- if( autoH ) data.contentHeight = _y;\r
- _y = data.contentT;\r
+ if( autoH ) data.contentHeight = _y;// - data.contentT;\r
+ _y = 0;//data.contentT;\r
for( i = 0; i < l; ++i ){\r
node = uinodes[ i ];\r
- node.calculate( false, _x, _y, data.contentWidth, data.contentHeight );\r
+ node.calculate( false, 0, _y, data.contentWidth, data.contentHeight );\r
_y += node.boxHeight + gapY;\r
};\r
data.postMesure();\r
};\r
\r
- !isNeedsDetection && data.updateLayout( x + data.boxX, y + data.boxY );\r
- \r
+ if( !isNeedsDetection ){\r
+ data.boxX += x;\r
+ data.boxY += y;\r
+ };\r
return !ret;\r
}\r
});\r
\r
-X.UI.VBox = X.UI.Box.presets(\r
- X.UI.Layout.Vertical,\r
+var XUI_VBox;\r
+\r
+X.UI.VBox = X.UI.Box.inherits(\r
'VBox',\r
+ X_Class.NONE,\r
{\r
- gapY : '0.2em',\r
- childWidth : '100%'\r
- }\r
-);\r
+ Constructor : function(){\r
+ var supports;\r
+ \r
+ if( !XUI_VBox ){\r
+ supports = XUI_Attr_createAttrDef( XUI_Box.prototype.usableAttrs, XUI_Layout_Vertical.overrideAttrsForSelf );\r
+ \r
+ XUI_VBox = XUI_Box.inherits(\r
+ {\r
+ layout : XUI_Layout_Vertical,\r
+ usableAttrs : supports,\r
+ attrClass : XUI_Attr_preset( XUI_Box.prototype.attrClass, supports, {\r
+ gapY : '0.2em',\r
+ childWidth : '100%'\r
+ } )\r
+ }\r
+ );\r
+ };\r
+ X_Pair_create( this, XUI_VBox( this, XUI_Layout_Vertical, arguments ) );\r
+ }\r
+ });\r
+\r