OSDN Git Service

Version 0.6.55, working uinode.listen(...)!
[pettanr/clientJs.git] / 0.6.x / js / ui / 08_Box.js
index 3ccf225..cdd5433 100644 (file)
@@ -42,7 +42,7 @@ X.UI.Layout.Canvas = X.UI.Layout.create( {
                };\r
                \r
                data.postMesure();\r
-               data.updateLayout( x, y );\r
+               data.updateLayout( x + data.boxX, y + data.boxY );\r
        }\r
 });\r
 \r
@@ -59,6 +59,9 @@ var _Box = _AbstractUINode.inherits(
                pointerChildren : true,\r
                through         : false,\r
 \r
+               scrollingX      : 0,\r
+               scrollingY      : 0,\r
+\r
                Constructor : function( layout, args ){\r
                        var i = 0,\r
                                l = args.length,\r
@@ -150,8 +153,7 @@ var _Box = _AbstractUINode.inherits(
                                };                              \r
                        };\r
                        \r
-                       this.phase = 3;\r
-                       this.User.dispatch( { type : X.UI.Event.CREATION_COMPLETE } );\r
+                       _AbstractUINode.prototype.creationComplete.apply( this, arguments );\r
                },\r
                \r
                calculate : function( isNeedsDetection, x, y, w, h ){\r
@@ -170,9 +172,9 @@ var _Box = _AbstractUINode.inherits(
                                _y = y - this.scrollingY;\r
                                for( ; i; ){\r
                                        child = uinodes[ --i ];\r
-                                       if( !child.pointerDisabled && child.boxX <= _x && _x < child.boxX + child.boxWidth && child.boxY <= _y && _y < child.boxY + child.boxHeight ){\r
-                                               !child.hovering && ( child.rootData.hoverList[ child.rootData.hoverList.length ] = child );\r
-                                               this.hitChildData = child.rootData.targetNodeData = child;\r
+                                       if( !child.pointerDisabled && child.boxX <= _x && _x < child.boxX + child.boxWidth && child.boxY <= _y && _y < child.boxY + child.boxHeight && child.capcher( _x, _y ) ){\r
+                                               //console.log( 'hit child ' + _x + ' ' + _y + ' boxX:' + child.boxX + ' boxY:' + child.boxY );\r
+                                               this.hitChildData = child;\r
                                                break;\r
                                        };\r
                                };\r
@@ -181,7 +183,7 @@ var _Box = _AbstractUINode.inherits(
                                this.hitChildData && !this.hovering && ( this.rootData.hoverList[ this.rootData.hoverList.length ] = this );\r
                                return !!this.hitChildData;\r
                        };\r
-                       hit = 0 <= x && x < this.w && 0 <= y && y < this.h;\r
+                       hit = 0 <= x && x < this.boxWidth && 0 <= y && y < this.boxHeight;\r
                        ( this.hitChildData || hit ) && !this.hovering && ( this.rootData.hoverList[ this.rootData.hoverList.length ] = this );\r
                        if( hit && this.hitChildData === null ) this.rootData.targetNodeData = this;\r
                        return hit || !!this.hitChildData;\r
@@ -213,8 +215,7 @@ var _Box = _AbstractUINode.inherits(
                                        _p2 && data.addToParent( this.xnode );\r
                                        uinodes[ uinodes.length ] = data;       \r
                                };\r
-                               //p3 && data.phase < 3 && data.afterAddition();\r
-                               p3 && data.phase < 4 && data.creationComplete();\r
+                               p3 && data.phase < 3 && data.creationComplete();\r
                        };\r
                        4 <= this.phase && this.rootData.reserveCalc();\r
                },\r