incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r479431 - in /incubator/xap/trunk: WebContent/examples/widgets/textArea.xal src/xap/bridges/dojo/TextFieldBridge.js
Date Sun, 26 Nov 2006 21:26:12 GMT
Author: mturyn
Date: Sun Nov 26 13:26:11 2006
New Revision: 479431

URL: http://svn.apache.org/viewvc?view=rev&rev=479431
Log:
RE: http://issues.apache.org/jira/browse/XAP-159
BUG: alignHorizontal not working for textArea
Resolution:  Needed a method for it, put change into the superclass,
TextFieldBridge because it also needed one.
Know issue:  alignVertical still doesn't work.

Modified:
    incubator/xap/trunk/WebContent/examples/widgets/textArea.xal
    incubator/xap/trunk/src/xap/bridges/dojo/TextFieldBridge.js

Modified: incubator/xap/trunk/WebContent/examples/widgets/textArea.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/textArea.xal?view=diff&rev=479431&r1=479430&r2=479431
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/textArea.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/textArea.xal Sun Nov 26 13:26:11 2006
@@ -2,7 +2,8 @@
 	xmlns:xm="http://openxal.org/core/xmodify">
 	
 	
-	<mco:mco xmlns:mco="http://openxal.org/core/mco" id="attributeSetter" src="AttributeTester"/>
+	<mco:mco xmlns:mco="http://openxal.org/core/mco" 
+	id="attributeSetter" src="AttributeTester" path="AttributeTester" />
 	
 	
 	<!-- Page title -->
@@ -37,7 +38,28 @@
 	
 	<xm:modifications>
 		<xm:append select="/xal">
-			
+				<xal:textArea width="200px" 
+					text="This is some text" id="testComponent"
+					alignHorizontal="right" alignVertical="center"
+					onActiveGained="mco:attributeSetter.reportEvent(event)"
+					onActiveLost="mco:attributeSetter.reportEvent(event)"
+					onBeforeActiveLost="mco:attributeSetter.reportEvent(event)"
+					onContextMenu="mco:attributeSetter.reportEvent(event)"
+					onDoubleClick="mco:attributeSetter.reportEvent(event)"
+					onDragDrop="mco:attributeSetter.reportEvent(event)"
+					onDragEnd="mco:attributeSetter.reportEvent(event)"
+					onDragStart="mco:attributeSetter.reportEvent(event)"
+					onEdit="mco:attributeSetter.reportEvent(event)"
+					onKeyChar="mco:attributeSetter.reportEvent(event)"
+					onKeyDown="mco:attributeSetter.reportEvent(event)"
+					onKeyUp="mco:attributeSetter.reportEvent(event)"
+					onMouseDown="mco:attributeSetter.reportEvent(event)"
+					onMouseDrag="mco:attributeSetter.reportEvent(event)"
+					onMouseMove="mco:attributeSetter.reportEvent(event)"
+					onMouseOut="mco:attributeSetter.reportEvent(event)"
+					onMouseOver="mco:attributeSetter.reportEvent(event)"
+					onMouseUp="mco:attributeSetter.reportEvent(event)"
+					onTextChange="mco:attributeSetter.reportEvent(event)"/>			
 			<horizontalBoxPane>
 				<verticalBoxPane>
 					<!-- button specific properties -->
@@ -74,26 +96,6 @@
 				<verticalBoxPane>
 					<include href="standardButtons.xal" xmlns="http://openxal.org/core/xinclude"/>
 				</verticalBoxPane>
-				<xal:textArea width="200px" text="This is some text" id="testComponent"
-					onActiveGained="mco:attributeSetter.reportEvent(event)"
-					onActiveLost="mco:attributeSetter.reportEvent(event)"
-					onBeforeActiveLost="mco:attributeSetter.reportEvent(event)"
-					onContextMenu="mco:attributeSetter.reportEvent(event)"
-					onDoubleClick="mco:attributeSetter.reportEvent(event)"
-					onDragDrop="mco:attributeSetter.reportEvent(event)"
-					onDragEnd="mco:attributeSetter.reportEvent(event)"
-					onDragStart="mco:attributeSetter.reportEvent(event)"
-					onEdit="mco:attributeSetter.reportEvent(event)"
-					onKeyChar="mco:attributeSetter.reportEvent(event)"
-					onKeyDown="mco:attributeSetter.reportEvent(event)"
-					onKeyUp="mco:attributeSetter.reportEvent(event)"
-					onMouseDown="mco:attributeSetter.reportEvent(event)"
-					onMouseDrag="mco:attributeSetter.reportEvent(event)"
-					onMouseMove="mco:attributeSetter.reportEvent(event)"
-					onMouseOut="mco:attributeSetter.reportEvent(event)"
-					onMouseOver="mco:attributeSetter.reportEvent(event)"
-					onMouseUp="mco:attributeSetter.reportEvent(event)"
-					onTextChange="mco:attributeSetter.reportEvent(event)"/>
 			</horizontalBoxPane>
 		</xm:append>
 	</xm:modifications>

Modified: incubator/xap/trunk/src/xap/bridges/dojo/TextFieldBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/TextFieldBridge.js?view=diff&rev=479431&r1=479430&r2=479431
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/TextFieldBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/TextFieldBridge.js Sun Nov 26 13:26:11 2006
@@ -75,7 +75,9 @@
  * No new dynamic attributes
  */
 xap.bridges.dojo.TextFieldBridge.prototype.getNewAllowedAttributes = function(){
-	return ["text","maxLength","selectable","editable"];
+	return ["text","maxLength","selectable",
+				"editable", "alignVertical","alignHorizontal"
+			];
 }	
 
 xap.bridges.dojo.TextFieldBridge.prototype.setTextAttribute = function( value ){
@@ -172,6 +174,21 @@
 	// We might have moved out without blurring:
 	this.writeBackAttribute("text",text);	
 }	
+
+
+xap.bridges.dojo.TextFieldBridge.prototype.setAlignHorizontalAttribute = function(direction)
{
+	xap.bridges.basic.AbstractWidgetBridge.prototype.setTextAlignAttribute.call(this,direction)
;
+}
+  
+xap.bridges.dojo.TextFieldBridge.prototype.setAlignVerticalAttribute = function(direction)
{
+	if (direction == "top" || direction == "bottom" || direction == "center") {
+		direction = ((direction == "center") ? "middle" : direction ) ;
+		var vAlignmentObj = {verticalAlign: direction } ;
+		xap.widgets.styleSet(this.getPeer().domNode, vAlignmentObj);		
+//		this.getPeer().domNode.style.verticalAlign = direction ;
+	}
+}	
+ 
 
 
 



Mime
View raw message