From: itozyun Date: Fri, 22 May 2015 06:16:43 +0000 (+0900) Subject: Version 0.6.154, working X.UI! X-Git-Url: http://git.osdn.jp/view?p=pettanr%2FclientJs.git;a=commitdiff_plain;h=e179079404973a959d1806464b7b6881b5510f2a Version 0.6.154, working X.UI! --- diff --git a/0.6.x/js/20_ui/08_Box.js b/0.6.x/js/20_ui/08_Box.js index 0725fc3..b5de649 100644 --- a/0.6.x/js/20_ui/08_Box.js +++ b/0.6.x/js/20_ui/08_Box.js @@ -28,8 +28,8 @@ var XUI_Layout_Canvas = X[ 'UI' ][ 'Layout' ][ 'Canvas' ] = XUI_createLayout( { _x = data.contentL; _y = data.contentT; - _w = data.contentWidth// !== XUI_Attr_AUTO ? data.contentWidth : data.minContentWidth; - _h = data.contentHeight// !== XUI_Attr_AUTO ? data.contentHeight : data.minContentHeight; + _w = data.contentWidth; + _h = data.contentHeight; if( ( uinodes = data.uinodes ) && ( l = uinodes.length ) ){ console.log( _w + ' x ' + _h + ' l:' + l ); diff --git a/0.6.x/js/20_ui/11_VBox.js b/0.6.x/js/20_ui/11_VBox.js index 2a6be63..298565f 100644 --- a/0.6.x/js/20_ui/11_VBox.js +++ b/0.6.x/js/20_ui/11_VBox.js @@ -43,16 +43,15 @@ var XUI_Layout_Vertical = X[ 'UI' ][ 'Layout' ][ 'Vertical' ] = XUI_createLayout 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; + _y = 0; //data.contentT; if( !detectionPhase ) ret = false; if( l ){ _w = 0; - console.log( '-----------' ); for( i = 0; i < l; ++i ){ node = uinodes[ i ]; - node.calculate( detectionPhase, _x, _y, contentW, childH ); + node.calculate( detectionPhase, 0, _y, contentW, childH ); _y += node.boxHeight + gapY; console.dir( node ); // 概算のみ @@ -76,11 +75,11 @@ var XUI_Layout_Vertical = X[ 'UI' ][ 'Layout' ][ 'Vertical' ] = XUI_createLayout if( detectionPhase ){ if( autoW ) data.contentWidth = _w; - if( autoH ) data.contentHeight = _y - data.contentT; - _y = data.contentT; + if( autoH ) data.contentHeight = _y;// - data.contentT; + _y = 0;//data.contentT; for( i = 0; i < l; ++i ){ node = uinodes[ i ]; - node.calculate( false, _x, _y, data.contentWidth, data.contentHeight ); + node.calculate( false, 0, _y, data.contentWidth, data.contentHeight ); _y += node.boxHeight + gapY; }; data.postMesure(); diff --git a/0.6.x/js/20_ui/12_HBox.js b/0.6.x/js/20_ui/12_HBox.js index 1efff7a..8429a4d 100644 --- a/0.6.x/js/20_ui/12_HBox.js +++ b/0.6.x/js/20_ui/12_HBox.js @@ -37,8 +37,8 @@ var XUI_Layout_Horizontal = X[ 'UI' ][ 'Layout' ][ 'Horizontal' ] = XUI_createLa 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; + _x = 0; //data.contentL; + _y = 0; //data.contentT; if( !detectionPhase ) ret = false; @@ -46,7 +46,7 @@ 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 ){ @@ -69,10 +69,10 @@ var XUI_Layout_Horizontal = X[ 'UI' ][ 'Layout' ][ 'Horizontal' ] = XUI_createLa 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(); diff --git a/0.6.x/js/main.js b/0.6.x/js/main.js index 77956ee..abe9b58 100644 --- a/0.6.x/js/main.js +++ b/0.6.x/js/main.js @@ -1,71 +1,168 @@ -root = X.UI.PageRoot( - X.UI.HBox( - { - width : '50%', - bgColor : 0x44ffff - }, - X.UI.Text( 'HTML4', { width : 3 } ), - X.UI.Text( 'Ruby on Rails' ), - X.UI.Text( 'js' ), - X.UI.Text( 'SVG' ), - X.UI.Text( 'heroku' ), - X.UI.Text( 'flash' ) - ), - X.UI.Box({ - width : '25%', - height : '25%', - left : '25%', - top : '50%', - bgColor : 0x0000ff - }), - X.UI.Box({ - width : '25%', - height : '25%', - left : 0, - bottom : 0, - bgColor : 0xff0000 - }), - X.UI.VBox( - { - width : '40%', - left : '55%', - top : 5, - bottom : 5, - bgColor : 0x666666, - borderColor : 0x111111, - borderWidth : [ 0, 0, 0, 0 ], - borderStyle : 'solid dotted', - padding : [ 4, 1 ], - sizing : 'border', - gapY : 1 - }, - X.UI.Box({ - width : '50%', - height : 2, - left : '25%', - bgColor : 0x999999 - }), - X.UI.Text( 'Hello, world!' ), - X.UI.Text( '----------------------------' ), - text = X.UI.Text( 'PettanR-team. rrrrrrrrrr' ) - .listen( X.UI.Event.TAP, _onClick ), - X.UI.HBox( +var scroll; + +with( X.UI ){ + PageRoot( + scroll = ScrollBox( + Layout.Canvas, { - width : '100%', - gapX : 2, - bgColor : 0xff77ff + width : '100%', + bgColor : 0x111111 }, - X.UI.Text( 'HTML4', { width : 2 } ), - X.UI.Text( 'Ruby on Rails', { width : 2 } ), - X.UI.Text( 'js' ), - X.UI.Text( 'SVG' ), - X.UI.Text( 'heroku' ), - X.UI.Text( 'flash' ) + VBox( + { + borderColor : 0x252527, + borderWidth : [ 0.15, 0, 0 ], + height : 'auto', + bgColor : 0x444643, + gapY : 0.1 + }, + Text( + 'システム情報', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + 'ユーザー設定', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + 'ソーシャル設定', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + 'ローカルストレージ利用設定', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + 'システム環境設定', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + 'ブラウザ情報', + { + //width : '100%', + sizing : 'border', + padding : [ 1.35, 1, 1.5 ], + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + '端末スコア', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + 'ブラウザ・プラグイン', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ), + Text( + 'デバッグ情報', + { + //width : '100%', + sizing : 'border', + fontColor : 0xAAAAAA, + fontBold : true, + bgColor : 0x34383B, + borderColor : 0x252527, + padding : [ 1.35, 1, 1.5 ], + borderWidth : [ 0, 0, 0.15 ], + height : 4, + left : 0, + right : 0 + } + ) + ) ) - ) -); + ); +} -function _onClick( e ){ - alert( e.type ); - console.log( e.type + ' -----------' ); -}; +var __scroll = X.Pair.get( scroll );