1 var XUI_ChromeBox = XUI_Box.inherits(
\r
6 containerNode : null,
\r
8 Constructor : function( user, layout, args ){
\r
9 var uinodes, i, l, node, after, index = 0;
\r
11 this[ 'Super' ]( user, layout, args );
\r
13 uinodes = this.uinodes;
\r
14 l = i = uinodes.length;
\r
17 node = uinodes[ --i ];
\r
18 if( node.role === 3 ){
\r
19 if( this.containerNode ){
\r
20 //throw new Error( 'ContainerNode が複数設定されています!ContainerNode はクロームボックスにひとつ、生成時に設定できます ' + node );
\r
22 this.containerNode = node.User;
\r
23 this._containerNode = node;
\r
25 if( !this.chromeNodes ) this.chromeNodes = [];
\r
26 this.chromeNodes[ this.chromeNodes.length ] = node;
\r
29 if( !this.containerNode ){
\r
30 //throw new Error( 'ContainerNode が設定されてい\ません!ContainerNode はクロームボックスにひとつ、生成時に設定できます ' );
\r
33 for( i = 0, l = args.length; i < l; ++i ){
\r
35 if( node === this.containerNode ){
\r
39 if( node[ 'instanceOf' ] && node[ 'instanceOf' ]( Node ) ){
\r
47 X.UI.ChromeBox = X.UI.Box.inherits(
\r
51 Constructor : function(){
\r
52 X_Pair_create( this, XUI_ChromeBox( this, XUI_Layout_Canvas, arguments ) );
\r
54 add : function( node /* , node, node ... */ ){
\r
55 X_Pair_get( this ).containerNode.addAt( this.numNodes(), Array.prototype.slice.call( arguments ) );
\r
58 addAt : function( index, node /* , node, node ... */ ){
\r
59 X_Pair_get( this ).containerNode.addAt( index, Array.prototype.slice.call( arguments, 1 ) );
\r
62 remove : function( node /* , node, node ... */ ){
\r
63 X_Pair_get( this ).containerNode[ 'remove' ]( arguments );
\r
66 removeAt : function( from, length ){
\r
67 X_Pair_get( this ).containerNode.removeAt( from, length );
\r
70 getNodesByClass : function( klass ){
\r
71 return X_Pair_get( this ).containerNode.User.getNodesByClass( klass );
\r
73 getFirstChild : function(){
\r
74 return X_Pair_get( this ).containerNode.User.getFirstChild();
\r
76 getLastChild : function(){
\r
77 return X_Pair_get( this ).containerNode.User.getLastChild();
\r
79 getNodeByUID : function( uid ){
\r
80 return X_Pair_get( this ).containerNode.User.getNodeByUID();
\r
82 getNodeAt : function( index ){
\r
83 return X_Pair_get( this ).containerNode.User.getNodeAt( index );
\r
85 numNodes : function(){
\r
86 return X_Pair_get( this ).containerNode.User.numNodes();
\r
88 getContainerNode : function(){
\r
89 return X_Pair_get( this ).containerNode.User;
\r
91 getChromeNodeAt : function( index ){
\r
92 if( index < 0 ) return null;
\r
93 var nodes = X_Pair_get( this ).chromeNodes;
\r
94 return nodes ? nodes[ index ].User || null : null;
\r
96 numChromeNodes : function(){
\r
97 var nodes = X_Pair_get( this ).chromeNodes;
\r
98 return nodes ? nodes.length : 0;
\r