incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r485088 - /incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js
Date Sat, 09 Dec 2006 23:29:20 GMT
Author: mturyn
Date: Sat Dec  9 15:29:16 2006
New Revision: 485088

URL: http://svn.apache.org/viewvc?view=rev&rev=485088
Log:
Added method to help test positioning by trying to move a widget to a mouse position---transportWidget().

Modified:
    incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js

Modified: incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js?view=diff&rev=485088&r1=485087&r2=485088
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js Sat Dec  9 15:29:16
2006
@@ -6,6 +6,7 @@
 
 AttributeTester.prototype.setAttribute = function(element, name, value){
 	element.setAttribute(name, value);
+	this._lastElement = element ;
 }
 
 // Hit 'return' in the "value" field, set the attribute:
@@ -70,9 +71,10 @@
 	    l.style.padding = '5px';
 	    document.body.appendChild(l);   
 	    this._logDiv = l;
-		dojo.event.connect(this._logDiv, "ondblclick",this,"clearLog");	  	    
+		dojo.event.connect(this._logDiv, "ondblclick",this,"clearLog");		  	    
 	    this._logDiv.innerHTML="[Double-click to clear.]<br/><br/>" ;        
 	}
+	dojo.event.connect(this.body, "ondblclick",this,"transportWidget");	
 	
 	text = text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g,
'&gt;');
 	text = text.replace(/\n/g,'<br>');
@@ -87,7 +89,7 @@
 
 
 AttributeTester.prototype.clearLog = function(event){
-
+	this._dblClickedLogLast = true ;
 	if( event.layerY && (event.layerY - this._logDiv.scrollTop) < 125){
 
 		if( this._logDiv.style.height=="350px" ){
@@ -191,4 +193,24 @@
 	element.setAttribute("onSort","mco:attributeSetter.reportEvent(event)");
 	element.setAttribute("onStateChange","mco:attributeSetter.reportEvent(event)");
 	element.setAttribute("onTextChange","mco:attributeSetter.reportEvent(event)"); 
-}
\ No newline at end of file
+}
+
+
+AttributeTester.prototype.transportWidget = function(event){
+
+	var testComponent = 
+		event.session.getDocumentContainer().getUiDocument().getElementById("testComponent") ;
+
+
+	var x = event.clickX ;
+	var y = event.clickY ;//- this._logDiv.scrollTop ;
+	this.setAttribute(testComponent,"x",""+ x +"px") ;
+	this.setAttribute(testComponent,"y",""+ y +"px") ;
+	
+//	for( var xx=0; xx<800; xx += 40 ){
+//		this.setAttribute(testComponent,"x",""+ (xx) +"px") ;
+//		this.setAttribute(testComponent,"y",""+ (xx/20) +"px") ;			
+//	}
+	
+		
+}



Mime
View raw message