Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/BorderLayout.html view on Meta::CPAN
wr = myBorderPanel.layout.west;
* </code></pre></div>
* </li>
* </ul></div>
*/
Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, {
<span id='Ext-layout-BorderLayout-property-monitorResize'> // private
</span> monitorResize:true,
<span id='Ext-layout-BorderLayout-property-rendered'> // private
</span> rendered : false,
<span id='Ext-layout-BorderLayout-property-type'> type: 'border',
</span>
<span id='Ext-layout-BorderLayout-property-targetCls'> targetCls: 'x-border-layout-ct',
</span>
<span id='Ext-layout-BorderLayout-method-getLayoutTargetSize'> getLayoutTargetSize : function() {
</span> var target = this.container.getLayoutTarget();
return target ? target.getViewSize() : {};
},
<span id='Ext-layout-BorderLayout-method-onLayout'> // private
</span> onLayout : function(ct, target){
var collapsed, i, c, pos, items = ct.items.items, len = items.length;
if(!this.rendered){
collapsed = [];
for(i = 0; i < len; i++) {
c = items[i];
pos = c.region;
if(c.collapsed){
collapsed.push(c);
}
c.collapsed = false;
if(!c.rendered){
c.render(target, i);
c.getPositionEl().addClass('x-border-panel');
}
this[pos] = pos != 'center' && c.split ?
new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) :
new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos);
this[pos].render(target, c);
}
this.rendered = true;
}
var size = this.getLayoutTargetSize();
if(size.width < 20 || size.height < 20){ // display none?
if(collapsed){
this.restoreCollapsed = collapsed;
}
return;
}else if(this.restoreCollapsed){
collapsed = this.restoreCollapsed;
delete this.restoreCollapsed;
}
var w = size.width, h = size.height,
centerW = w, centerH = h, centerY = 0, centerX = 0,
n = this.north, s = this.south, west = this.west, e = this.east, c = this.center,
b, m, totalWidth, totalHeight;
if(!c && Ext.layout.BorderLayout.WARN !== false){
throw 'No center region defined in BorderLayout ' + ct.id;
}
if(n && n.isVisible()){
b = n.getSize();
m = n.getMargins();
b.width = w - (m.left+m.right);
b.x = m.left;
b.y = m.top;
centerY = b.height + b.y + m.bottom;
centerH -= centerY;
n.applyLayout(b);
}
if(s && s.isVisible()){
b = s.getSize();
m = s.getMargins();
b.width = w - (m.left+m.right);
b.x = m.left;
totalHeight = (b.height + m.top + m.bottom);
b.y = h - totalHeight + m.top;
centerH -= totalHeight;
s.applyLayout(b);
}
if(west && west.isVisible()){
b = west.getSize();
m = west.getMargins();
b.height = centerH - (m.top+m.bottom);
b.x = m.left;
b.y = centerY + m.top;
totalWidth = (b.width + m.left + m.right);
centerX += totalWidth;
centerW -= totalWidth;
west.applyLayout(b);
}
if(e && e.isVisible()){
b = e.getSize();
m = e.getMargins();
b.height = centerH - (m.top+m.bottom);
totalWidth = (b.width + m.left + m.right);
b.x = w - totalWidth + m.left;
b.y = centerY + m.top;
centerW -= totalWidth;
e.applyLayout(b);
}
if(c){
m = c.getMargins();
var centerBox = {
x: centerX + m.left,
y: centerY + m.top,
width: centerW - (m.left+m.right),
height: centerH - (m.top+m.bottom)
};
c.applyLayout(centerBox);
}
if(collapsed){
for(i = 0, len = collapsed.length; i < len; i++){
collapsed[i].collapse(false);
}
}
if(Ext.isIE9m && Ext.isStrict){ // workaround IE strict repainting issue
target.repaint();
( run in 0.546 second using v1.01-cache-2.11-cpan-adec679a428 )