Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / src / layout / container / VBox.js
1 /**
2  * @class Ext.layout.container.VBox
3  * @extends Ext.layout.container.Box
4  * <p>A layout that arranges items vertically down a Container. This layout optionally divides available vertical
5  * space between child items containing a numeric <code>flex</code> configuration.</p>
6  * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
7  * {@img Ext.layout.container.VBox/Ext.layout.container.VBox.png Ext.layout.container.VBox container layout}
8  * Example usage:
9         Ext.create('Ext.Panel', {
10                 width: 500,
11                 height: 400,
12                 title: "VBoxLayout Panel",
13                 layout: {                        
14                         type: 'vbox',
15                         align: 'center'
16                 },
17                 renderTo: document.body,
18                 items: [{                        
19                         xtype: 'panel',
20                         title: 'Inner Panel One',
21                         width: 250,
22                         flex: 2                      
23                 },{
24                         xtype: 'panel',
25                         title: 'Inner Panel Two',
26                         width: 250,                     
27                         flex: 4
28                 },{
29                         xtype: 'panel',
30                         title: 'Inner Panel Three',
31                         width: '50%',                   
32                         flex: 4
33                 }]
34         });
35  */
36 Ext.define('Ext.layout.container.VBox', {
37
38     /* Begin Definitions */
39
40     alias: ['layout.vbox'],
41     extend: 'Ext.layout.container.Box',
42     alternateClassName: 'Ext.layout.VBoxLayout',
43     
44     /* End Definitions */
45
46     /**
47      * @cfg {String} align
48      * Controls how the child items of the container are aligned. Acceptable configuration values for this
49      * property are:
50      * <div class="mdetail-params"><ul>
51      * <li><b><tt>left</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned horizontally
52      * at the <b>left</b> side of the container</div></li>
53      * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are aligned horizontally at the
54      * <b>mid-width</b> of the container</div></li>
55      * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched horizontally to fill
56      * the width of the container</div></li>
57      * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched horizontally to
58      * the size of the largest item.</div></li>
59      * </ul></div>
60      */
61     align : 'left', // left, center, stretch, strechmax
62
63     //@private
64     alignCenteringString: 'center',
65
66     type: 'vbox',
67
68     direction: 'vertical',
69
70     // When creating an argument list to setSize, use this order
71     parallelSizeIndex: 1,
72     perpendicularSizeIndex: 0,
73
74     parallelPrefix: 'height',
75     parallelPrefixCap: 'Height',
76     parallelLT: 't',
77     parallelRB: 'b',
78     parallelBefore: 'top',
79     parallelBeforeCap: 'Top',
80     parallelAfter: 'bottom',
81     parallelPosition: 'y',
82
83     perpendicularPrefix: 'width',
84     perpendicularPrefixCap: 'Width',
85     perpendicularLT: 'l',
86     perpendicularRB: 'r',
87     perpendicularLeftTop: 'left',
88     perpendicularRightBottom: 'right',
89     perpendicularPosition: 'x'
90 });