X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F20_ui%2F12_HBox.js;h=1e7439110e3c4460ce5853a537fec6dc6a8e614d;hb=f01f21c6d473692d016cb2b286a61d55380be3b3;hp=52b9bdf2936c0411592db9d7c5221de83c2da3bc;hpb=d836e6243878426d4cfd7a14ceb9b77db9f92b57;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/20_ui/12_HBox.js b/0.6.x/js/20_ui/12_HBox.js index 52b9bdf..1e74391 100644 --- a/0.6.x/js/20_ui/12_HBox.js +++ b/0.6.x/js/20_ui/12_HBox.js @@ -1,14 +1,14 @@ -X.UI.Layout.Horizontal = X.UI.Layout.create( { +var XUI_Layout_Horizontal = X[ 'UI' ][ 'Layout' ][ 'Horizontal' ] = XUI_createLayout( { name : 'HorizontalLayout', overrideAttrsForSelf : { selectable : false, - 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' ], - 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 ], - 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 ], - 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 ], - 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 ], - gapX : [ 0, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH ] + role : [ 0, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.INIT_ONLY | XUI_Attr_Type.LIST, 'none,chrome,container' ], + width : [ '100%', XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ], + height : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ], + childWidth : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ], + childHeight : [ XUI_Attr_AUTO, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH | XUI_Attr_Type.PERCENT | XUI_Attr_Type.AUTO ], + gapX : [ 0, XUI_Dirty.LAYOUT, XUI_Attr_USER.LAYOUT, XUI_Attr_Type.LENGTH ] }, overrideAttrsForChild : { @@ -31,8 +31,8 @@ X.UI.Layout.Horizontal = X.UI.Layout.create( { contentW = data.contentWidth; contentH = data.contentHeight; - autoW = contentW === X.UI.Attr.AUTO; - autoH = contentH === X.UI.Attr.AUTO; + autoW = contentW === XUI_Attr_AUTO; + autoH = contentH === XUI_Attr_AUTO; detectionPhase = autoW || autoH; gapX = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.gapX.No ], contentW ); childW = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.childWidth.No ], contentW ); @@ -49,10 +49,10 @@ X.UI.Layout.Horizontal = X.UI.Layout.create( { node.calculate( detectionPhase, _x, _y, childW, childH ); _x += node.boxWidth + gapX; if( autoH ){ - if( node.boxHeight !== X.UI.Attr.AUTO ){ + if( node.boxHeight !== XUI_Attr_AUTO ){ h = node.boxHeight; } else - if( node.minBoxHeight !== X.UI.Attr.AUTO ){ + if( node.minBoxHeight !== XUI_Attr_AUTO ){ h = node.minBoxHeight; minFlag = true; } else { @@ -63,7 +63,7 @@ X.UI.Layout.Horizontal = X.UI.Layout.create( { }; _x -= gapX; } else { - _h = data.minContentHeight !== X.UI.Attr.AUTO ? data.minContentHeight : 0; + _h = data.minContentHeight !== XUI_Attr_AUTO ? data.minContentHeight : 0; }; if( detectionPhase ){ @@ -78,14 +78,16 @@ X.UI.Layout.Horizontal = X.UI.Layout.create( { data.postMesure(); }; - !isNeedsDetection && data.updateLayout( x + data.boxX, y + data.boxY ); - + if( !isNeedsDetection ){ + data.boxX += x; + data.boxY += y; + }; return !ret; } }); X.UI.HBox = X.UI.Box.presets( - X.UI.Layout.Horizontal, + XUI_Layout_Horizontal, 'HBox', { gapX : '0.2em'