X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F20_ui%2F12_HBox.js;h=6639a7c40908e00ae6eb0373d1b2addbb509388b;hb=3d352d8bf476ab57cc333e8d02d0e6ea5efa69b7;hp=1e7439110e3c4460ce5853a537fec6dc6a8e614d;hpb=f01f21c6d473692d016cb2b286a61d55380be3b3;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 1e74391..6639a7c 100644 --- a/0.6.x/js/20_ui/12_HBox.js +++ b/0.6.x/js/20_ui/12_HBox.js @@ -34,11 +34,11 @@ var XUI_Layout_Horizontal = X[ 'UI' ][ 'Layout' ][ 'Horizontal' ] = XUI_createLa 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 ); - childH = XUI_AbstractUINode_calcValue( attrs[ data.supportAttrs.childHeight.No ], contentH ); - _x = data.contentL; - _y = data.contentT; + gapX = XUI_AbstractUINode_calcValue( attrs[ data.usableAttrs.gapX.No ], contentW ); + childW = XUI_AbstractUINode_calcValue( attrs[ data.usableAttrs.childWidth.No ], contentW ); + childH = XUI_AbstractUINode_calcValue( attrs[ data.usableAttrs.childHeight.No ], contentH ); + _x = 0; //data.contentL; + _y = 0; //data.contentT; if( !detectionPhase ) ret = false; @@ -46,14 +46,14 @@ var XUI_Layout_Horizontal = X[ 'UI' ][ 'Layout' ][ 'Horizontal' ] = XUI_createLa _h = 0; for( i = 0; i < l; ++i ){ node = uinodes[ i ]; - node.calculate( detectionPhase, _x, _y, childW, childH ); + node.calculate( detectionPhase, _x, 0, childW, childH ); _x += node.boxWidth + gapX; if( autoH ){ if( node.boxHeight !== XUI_Attr_AUTO ){ h = node.boxHeight; } else - if( node.minBoxHeight !== XUI_Attr_AUTO ){ - h = node.minBoxHeight; + if( node.boxHeightMin !== XUI_Attr_AUTO ){ + h = node.boxHeightMin; minFlag = true; } else { h = 0; @@ -63,16 +63,16 @@ var XUI_Layout_Horizontal = X[ 'UI' ][ 'Layout' ][ 'Horizontal' ] = XUI_createLa }; _x -= gapX; } else { - _h = data.minContentHeight !== XUI_Attr_AUTO ? data.minContentHeight : 0; + _h = data.contentHeightMin !== XUI_Attr_AUTO ? data.contentHeightMin : 0; }; if( detectionPhase ){ if( autoW ) data.contentWidth = _x; if( autoH ) data.contentHeight = _h; - _x = data.contentL; + _x = 0; //data.contentL; for( i = 0; i < l; ++i ){ node = uinodes[ i ]; - node.calculate( false, _x, _y, data.contentWidth, data.contentHeight ); + node.calculate( false, _x, 0, data.contentWidth, data.contentHeight ); _x += node.boxWidth + gapX; }; data.postMesure(); @@ -86,10 +86,37 @@ var XUI_Layout_Horizontal = X[ 'UI' ][ 'Layout' ][ 'Horizontal' ] = XUI_createLa } }); +/* X.UI.HBox = X.UI.Box.presets( XUI_Layout_Horizontal, 'HBox', { gapX : '0.2em' } -); +);*/ + +var XUI_HBox; + +X.UI.HBox = X.UI.Box.inherits( + 'HBox', + X_Class.NONE, + { + Constructor : function(){ + var supports; + + if( !XUI_HBox ){ + supports = XUI_Attr_createAttrDef( XUI_Box.prototype.usableAttrs, XUI_Layout_Horizontal.overrideAttrsForSelf ); + + XUI_HBox = XUI_Box.inherits( + { + layout : XUI_Layout_Horizontal, + usableAttrs : supports, + attrClass : XUI_Attr_preset( XUI_Box.prototype.attrClass, supports, { + gapX : '0.2em' + } ) + } + ); + }; + X_Pair_create( this, XUI_HBox( this, XUI_Layout_Horizontal, arguments ) ); + } + }); \ No newline at end of file