incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r485070 - in /incubator/xap/trunk/src/xap: bridges/xap/ListBoxBridge.js bridges/xap/XapComboBoxBridge.js widgets/ListBox.js widgets/XapComboBox.js
Date Sat, 09 Dec 2006 22:03:39 GMT
Author: mturyn
Date: Sat Dec  9 14:03:37 2006
New Revision: 485070

URL: http://svn.apache.org/viewvc?view=rev&rev=485070
Log:
Combo box:  select box wasn't resizing to fit wider outer box.

Modified:
    incubator/xap/trunk/src/xap/bridges/xap/ListBoxBridge.js
    incubator/xap/trunk/src/xap/bridges/xap/XapComboBoxBridge.js
    incubator/xap/trunk/src/xap/widgets/ListBox.js
    incubator/xap/trunk/src/xap/widgets/XapComboBox.js

Modified: incubator/xap/trunk/src/xap/bridges/xap/ListBoxBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/ListBoxBridge.js?view=diff&rev=485070&r1=485069&r2=485070
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/ListBoxBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/xap/ListBoxBridge.js Sat Dec  9 14:03:37 2006
@@ -189,6 +189,13 @@
 	this.getPeer().setWidth( value ) ;
 }
 
+xap.bridges.xap.ListBoxBridge.prototype.setXAttribute = function(value) {
+	this.getPeer().setX( value ) ;
+}
+xap.bridges.xap.ListBoxBridge.prototype.setYAttribute = function(value) {
+	this.getPeer().setY( value ) ;
+}
+
 
 
 

Modified: incubator/xap/trunk/src/xap/bridges/xap/XapComboBoxBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/XapComboBoxBridge.js?view=diff&rev=485070&r1=485069&r2=485070
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/XapComboBoxBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/xap/XapComboBoxBridge.js Sat Dec  9 14:03:37 2006
@@ -46,7 +46,7 @@
 
 
 xap.bridges.xap.XapComboBoxBridge.prototype.setWidthAttribute = function(value) {	
-	this.getRootDomNode().style.width = value;
+	this.getPeer().setWidth(value) ;
 }
 
 /**
@@ -71,27 +71,21 @@
 
 	// Need to remove select box and then replace it
 	// in order to get height change to show up:
-	
-	var hasSelectBox = this._peer.children[0] && this._peer.children[0].select ;
+	var holder = this._peer.domNode.firstChild ;
+	if(holder){
+	var select = holder.firstChild ;
+	if(holder && select){
+//		try {
+			holder.removeChild(select) ;
+//		} catch(e){}
 
-	
-	if(hasSelectBox){
-		var sel = this._peer.children[0].select ;
-		try {
-			this._peer.children[0].removeChild(sel) ;
-			this._peer.children[0].addChild(sel) ;
-		} catch(e){}
-		
-		
-//		if( this._childListbox ){
-//			this.getPeer().removeChild(this._childListbox);		
-//			this.getPeer().addChild(this._childListbox);
-//		}
+		holder.appendChild(select) ;
+		}		
 	}
 
 	// This doesn't work under ie yet....	
 //	if( !isMozish && hasSelectBox ){
-//		// ...so resynch outer divs the the unchanged select:
+//		// ...so resynch outer divs to the unchanged select:
 //		var sel = this._peer.children[0].select ;
 //		this.getPeer().domNode.style.height 
 //			= sel.clientHeight+"px" ;
@@ -164,24 +158,30 @@
 	return node ;
 }
 
-// Attributes that need to be set on the outer dom node, a DIV that holds the
-// select box:
 
-xap.bridges.xap.XapComboBoxBridge.prototype.setVisibleAttribute = function(value){
-	this.getPeer().domNode.style.visible = value  ;
-}
 xap.bridges.xap.XapComboBoxBridge.prototype.setBackgroundColorAttribute = function(value){
-	this.getPeer().domNode.style.backgroundColor = value  ;
-	this.getRootDomNode().style.backgroundColor = value ;
+	this.getPeer().setBackgroundColor( value ) ;
 }
 xap.bridges.xap.XapComboBoxBridge.prototype.setBorderColorAttribute = function(value){
-	this.getPeer().domNode.style.borderColor = value  ;
+	this.getPeer().setBorderColor( value ) ;
 }
 xap.bridges.xap.XapComboBoxBridge.prototype.setBorderStyleAttribute = function(value){
-	this.getPeer().domNode.style.borderStyle = value  ;
+	this.getPeer().setBorderStyle( value ) ;
 }
 xap.bridges.xap.XapComboBoxBridge.prototype.setBorderWidthAttribute = function(value){
-	this.getPeer().domNode.style.borderWidth = value  ;
+	this.getPeer().setBorderWidth( value ) ;
+}
+xap.bridges.xap.XapComboBoxBridge.prototype.setVisibleAttribute = function(value){
+	this.getPeer().setVisible( value ) ;
 }
+xap.bridges.xap.XapComboBoxBridge.prototype.setXAttribute = function(value){
+	this.getPeer().setX( value ) ;
+}
+xap.bridges.xap.XapComboBoxBridge.prototype.setYAttribute = function(value){
+	this.getPeer().setY( value ) ;
+}
+
+
+
 
 

Modified: incubator/xap/trunk/src/xap/widgets/ListBox.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/ListBox.js?view=diff&rev=485070&r1=485069&r2=485070
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/ListBox.js (original)
+++ incubator/xap/trunk/src/xap/widgets/ListBox.js Sat Dec  9 14:03:37 2006
@@ -18,10 +18,10 @@
 // If size==1, get a combo box, which we don't want, so
 // start with size 2, increment if necessary as we add children:
 //(Note:onkeydown, onblur so far is only needed if this is a combobox interior.)
-		templateString: '<div style="border: 0px solid black;margin:0px;padding:0px;align:center;vertical-align:middle">'
+		templateString: '<div style="border: 1px solid black;margin:0px;align:center;">'
 						+'<select dojoAttachPoint="select" '
 							+ 'dojoAttachEvent="onkeyup;onchange;onmouseout;onkeydown;onblur;onselect"' 
-							+ 'style="border: 1px ridge darkgray;margin:0px;padding:0px"'
+							+ 'style="border: 1px ridge darkgray;padding:0px;"'
 							+ 'size="2"></select></div>',
 		templateCssPath: null,
 		widgetType: "ListBox",
@@ -171,9 +171,21 @@
 	this.domNode.style.width = value ;	
 }
 
+xap.widgets.ListBox.prototype.setX = function(value){
+	this.domNode.style.left = value  ;
+}
+
+xap.widgets.ListBox.prototype.setY = function(value){
+	this.domNode.style.top = value  ;
+}
+
 xap.widgets.ListBox.prototype.setHeight = function(value) {
 	this.select.style.height = "100%";	
-	this.domNode.style.height = value;		
+	this.domNode.style.height = value;
+}
+
+xap.widgets.ListBox.prototype.setBackgroundColor = function(value){
+	this.select.style.backgroundColor = value ;
 }
 
 xap.widgets.ListBox.prototype.setColor = function(value){

Modified: incubator/xap/trunk/src/xap/widgets/XapComboBox.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/XapComboBox.js?view=diff&rev=485070&r1=485069&r2=485070
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/XapComboBox.js (original)
+++ incubator/xap/trunk/src/xap/widgets/XapComboBox.js Sat Dec  9 14:03:37 2006
@@ -28,6 +28,7 @@
 
 	addChild: function(child) {
     	xap.widgets.XapComboBox.superclass.addChild.call(this, child); /* add dojo widget to
dojo widget */
+    	this.child = child ;
 	},
 	
     
@@ -36,4 +37,71 @@
 }
 );
 
-dojo.widget.tags.addParseTreeHandler("dojo:XapComboBox");
\ No newline at end of file
+dojo.widget.tags.addParseTreeHandler("dojo:XapComboBox");
+
+xap.widgets.XapComboBox.prototype.setVisible = function(value){
+	if( this.child ){
+		this.child.setVisible( value ) ;
+	}
+	this.domNode.style.visible = value  ;
+}
+xap.widgets.XapComboBox.prototype.setBackgroundColor = function(value){
+	if( this.child ){
+		this.child.setBackgroundColor( value ) ;
+	}
+	this.domNode.style.backgroundColor = value  ;
+}
+
+xap.widgets.XapComboBox.prototype.setColor = function(value){
+	if( this.child ){
+		this.child.setColor( value ) ;
+	}
+	this.domNode.style.color = value  ;
+}
+
+
+xap.widgets.XapComboBox.prototype.setWidth = function(value) {
+	this.domNode.style.width = value ;
+	if(this.child){
+		this.child.setWidth( value ) ;
+	}	
+}
+
+xap.widgets.XapComboBox.prototype.setHeight = function(value) {
+	this.domNode.style.height = value;
+	if(this.child){
+		this.child.setHeight( value ) ;
+	}		
+}
+
+
+
+xap.widgets.XapComboBox.prototype.setBorderColor = function(value){
+	this.domNode.style.borderColor = value  ;
+}
+xap.widgets.XapComboBox.prototype.setBorderStyle = function(value){
+	this.domNode.style.borderStyle = value  ;
+}
+xap.widgets.XapComboBox.prototype.setBorderWidth = function(value){
+	this.domNode.style.borderWidth = value  ;
+}
+
+xap.widgets.XapComboBox.prototype.setX = function(value){
+	this.domNode.style.left = value  ;
+	if(this.child){
+		this.child.setX( value ) ;
+	}		
+}
+
+xap.widgets.XapComboBox.prototype.setY = function(value){
+	this.domNode.style.top = value  ;
+	if(this.child){
+		this.child.setY( value ) ;
+	}		
+}
+
+
+
+
+
+



Mime
View raw message