/*!
- * Ext JS Library 3.0.3
+ * Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
* The width of this component in pixels (defaults to auto).
* <b>Note</b> to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
*/
+ /**
+ * @cfg {Number} boxMinHeight
+ * <p>The minimum value in pixels which this BoxComponent will set its height to.</p>
+ * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+ */
+ /**
+ * @cfg {Number} boxMinWidth
+ * <p>The minimum value in pixels which this BoxComponent will set its width to.</p>
+ * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+ */
+ /**
+ * @cfg {Number} boxMaxHeight
+ * <p>The maximum value in pixels which this BoxComponent will set its height to.</p>
+ * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+ */
+ /**
+ * @cfg {Number} boxMaxWidth
+ * <p>The maximum value in pixels which this BoxComponent will set its width to.</p>
+ * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+ */
/**
* @cfg {Boolean} autoHeight
* <p>True to use height:'auto', false to use fixed height (or allow it to be managed by its parent
});
</code></pre>
*/
+ /**
+ * @cfg {Boolean} autoScroll
+ * <code>true</code> to use overflow:'auto' on the components layout element and show scroll bars automatically when
+ * necessary, <code>false</code> to clip any overflowing content (defaults to <code>false</code>).
+ */
/* // private internal config
* {Boolean} deferHeight
* @return {Ext.BoxComponent} this
*/
setSize : function(w, h){
+
// support for standard size objects
if(typeof w == 'object'){
- h = w.height;
- w = w.width;
+ h = w.height, w = w.width;
+ }
+ if (Ext.isDefined(w) && Ext.isDefined(this.boxMinWidth) && (w < this.boxMinWidth)) {
+ w = this.boxMinWidth;
+ }
+ if (Ext.isDefined(h) && Ext.isDefined(this.boxMinHeight) && (h < this.boxMinHeight)) {
+ h = this.boxMinHeight;
+ }
+ if (Ext.isDefined(w) && Ext.isDefined(this.boxMaxWidth) && (w > this.boxMaxWidth)) {
+ w = this.boxMaxWidth;
+ }
+ if (Ext.isDefined(h) && Ext.isDefined(this.boxMaxHeight) && (h > this.boxMaxHeight)) {
+ h = this.boxMaxHeight;
}
// not rendered
if(!this.boxReady){
- this.width = w;
- this.height = h;
+ this.width = w, this.height = h;
return this;
}
return this;
}
this.lastSize = {width: w, height: h};
- var adj = this.adjustSize(w, h);
- var aw = adj.width, ah = adj.height;
+ var adj = this.adjustSize(w, h),
+ aw = adj.width,
+ ah = adj.height,
+ rz;
if(aw !== undefined || ah !== undefined){ // this code is nasty but performs better with floaters
- var rz = this.getResizeEl();
+ rz = this.getResizeEl();
if(!this.deferHeight && aw !== undefined && ah !== undefined){
rz.setSize(aw, ah);
}else if(!this.deferHeight && ah !== undefined){
rz.setWidth(aw);
}
this.onResize(aw, ah, w, h);
- this.fireEvent('resize', this, aw, ah, w, h);
}
return this;
},
* contains both the <code><input></code> Element (which is what would be returned
* by its <code>{@link #getEl}</code> method, <i>and</i> the trigger button Element.
* This Element is returned as the <code>resizeEl</code>.
+ * @return {Ext.Element} The Element which is to be resized by size managing layouts.
*/
getResizeEl : function(){
return this.resizeEl || this.el;
},
- // protected
- getPositionEl : function(){
- return this.positionEl || this.el;
+ /**
+ * Sets the overflow on the content element of the component.
+ * @param {Boolean} scroll True to allow the Component to auto scroll.
+ * @return {Ext.BoxComponent} this
+ */
+ setAutoScroll : function(scroll){
+ if(this.rendered){
+ this.getContentTarget().setOverflow(scroll ? 'auto' : '');
+ }
+ this.autoScroll = scroll;
+ return this;
},
/**
this.positionEl = Ext.get(this.positionEl);
}
this.boxReady = true;
+ this.setAutoScroll(this.autoScroll);
this.setSize(this.width, this.height);
if(this.x || this.y){
this.setPosition(this.x, this.y);
* @param {Number} rawHeight The height that was originally specified
*/
onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
-
+ this.fireEvent('resize', this, adjWidth, adjHeight, rawWidth, rawHeight);
},
/* // protected