From xap-commits-return-888-apmail-incubator-xap-commits-archive=incubator.apache.org@incubator.apache.org Sat Dec 09 23:30:34 2006 Return-Path: Delivered-To: apmail-incubator-xap-commits-archive@locus.apache.org Received: (qmail 10168 invoked from network); 9 Dec 2006 23:30:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Dec 2006 23:30:34 -0000 Received: (qmail 30550 invoked by uid 500); 9 Dec 2006 23:30:42 -0000 Delivered-To: apmail-incubator-xap-commits-archive@incubator.apache.org Received: (qmail 30531 invoked by uid 500); 9 Dec 2006 23:30:42 -0000 Mailing-List: contact xap-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: xap-dev@incubator.apache.org Delivered-To: mailing list xap-commits@incubator.apache.org Received: (qmail 30522 invoked by uid 99); 9 Dec 2006 23:30:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Dec 2006 15:30:42 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Dec 2006 15:30:26 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id C69641A9846; Sat, 9 Dec 2006 15:29:20 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r485088 - /incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js Date: Sat, 09 Dec 2006 23:29:20 -0000 To: xap-commits@incubator.apache.org From: mturyn@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061209232920.C69641A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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.]

" ; } + dojo.event.connect(this.body, "ondblclick",this,"transportWidget"); text = text.replace(/&/g, '&').replace(//g, '>'); text = text.replace(/\n/g,'
'); @@ -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") ; +// } + + +}