home *** CD-ROM | disk | FTP | other *** search
-
- Thing.prototype.captureMouseClick = function( fcn ){
- var doc;
- if( is.ns4 ){
- doc = this.div.document;
- doc.captureEvents( Event.MOUSECLICK );
- }
- else{
- doc = this.div;
- }
- doc.thing = this;
- if( fcn ) this.mouseClick = fcn;
-
- doc.onclick = function(e){
- return this.thing.mouseClick( this.thing.getMousePosition(e) );
- }
- }
- Thing.prototype.mouseClick = function(p){ /* overwrite me */ }
-
-
- Thing.prototype.captureMouseDown = function( fcn ){
- var doc;
- if( is.ns4 ){
- doc = this.div.document;
- doc.captureEvents( Event.MOUSEDOWN );
- }
- else{
- doc = this.div;
- }
- doc.thing = this;
- if( fcn ) this.mouseDown = fcn;
- doc.onmousedown = function(e){
- return this.thing.mouseDown( this.thing.getMousePosition(e) );
- }
- }
- Thing.prototype.mouseDown = function(p){ /* overwrite me */ }
-
-
-
- Thing.prototype.captureMouseUp = function( fcn ){
- var doc;
- if( is.ns4 ){
- doc = this.div.document;
- doc.captureEvents( Event.MOUSEUP );
- }
- else{
- doc = this.div;
- }
- doc.thing = this;
- if( fcn ) this.mouseUp = fcn;
- doc.onmouseup = function(e){
- return this.thing.mouseUp( this.thing.getMousePosition(e) );
- }
- }
- Thing.prototype.mouseUp = function(p){ /* overwrite me */ }
-
- Thing.prototype.captureMouseMove = function( fcn ){
- var doc;
- if( is.ns4 ){
- doc = this.div.document;
- doc.captureEvents( Event.MOUSEMOVE );
- }
- else{
- doc = this.div;
- }
- doc.thing = this;
- if( fcn ) this.mouseMove = fcn;
- doc.onmousemove = function(e){
- return this.thing.mouseMove( this.thing.getMousePosition(e) );
- }
- }
- Thing.prototype.mouseMove = function(p){ /* overwrite me */ }
-
- Thing.prototype.captureMouseOver = function( fcn ){
- var doc;
- if( is.ns4 ){
- doc = this.div.document;
- doc.captureEvents( Event.MOUSEOVER );
- }
- else{
- doc = this.div;
- }
- doc.thing = this;
- if( fcn ) this.mouseOver = fcn;
- doc.onmouseover = function(e){
- return this.thing.mouseOver( this.thing.getMousePosition(e) );
- }
- }
- Thing.prototype.mouseOver = function(p){ /* overwrite me */ }
-
- Thing.prototype.captureMouseOut = function( fcn ){
- var doc;
- if( is.ns4 ){
- doc = this.div.document;
- doc.captureEvents( Event.MOUSEOUT );
- }
- else{
- doc = this.div;
- }
- doc.thing = this;
- if( fcn ) this.mouseOut = fcn;
- doc.onmouseout = function(e){
- return this.thing.mouseOut( this.thing.getMousePosition(e) );
- }
- }
- Thing.prototype.mouseOut = function(p){ /* overwrite me */ }
-
- Thing.prototype.getMousePosition = function(e){
- var p = ( is.ns4 || is.ns6 ) ? new Point( e.pageX - pageXOffset, e.pageY - pageYOffset ) : new Point( event.clientX, event.clientY );
- return p.sub( this.getPosition() );
- }
-