3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * @class Ext.layout.container.VBox
17 * @extends Ext.layout.container.Box
18 * <p>A layout that arranges items vertically down a Container. This layout optionally divides available vertical
19 * space between child items containing a numeric <code>flex</code> configuration.</p>
20 * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
21 * {@img Ext.layout.container.VBox/Ext.layout.container.VBox.png Ext.layout.container.VBox container layout}
23 Ext.create('Ext.Panel', {
26 title: "VBoxLayout Panel",
31 renderTo: document.body,
34 title: 'Inner Panel One',
39 title: 'Inner Panel Two',
44 title: 'Inner Panel Three',
50 Ext.define('Ext.layout.container.VBox', {
52 /* Begin Definitions */
54 alias: ['layout.vbox'],
55 extend: 'Ext.layout.container.Box',
56 alternateClassName: 'Ext.layout.VBoxLayout',
62 * Controls how the child items of the container are aligned. Acceptable configuration values for this
64 * <div class="mdetail-params"><ul>
65 * <li><b><tt>left</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned horizontally
66 * at the <b>left</b> side of the container</div></li>
67 * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are aligned horizontally at the
68 * <b>mid-width</b> of the container</div></li>
69 * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched horizontally to fill
70 * the width of the container</div></li>
71 * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched horizontally to
72 * the size of the largest item.</div></li>
75 align : 'left', // left, center, stretch, strechmax
78 alignCenteringString: 'center',
82 direction: 'vertical',
84 // When creating an argument list to setSize, use this order
86 perpendicularSizeIndex: 0,
88 parallelPrefix: 'height',
89 parallelPrefixCap: 'Height',
92 parallelBefore: 'top',
93 parallelBeforeCap: 'Top',
94 parallelAfter: 'bottom',
95 parallelPosition: 'y',
97 perpendicularPrefix: 'width',
98 perpendicularPrefixCap: 'Width',
100 perpendicularRB: 'r',
101 perpendicularLeftTop: 'left',
102 perpendicularRightBottom: 'right',
103 perpendicularPosition: 'x',
104 configureItem: function(item) {
106 item.layoutManagedHeight = 1;
108 item.layoutManagedHeight = 2;
111 if (this.align === 'stretch' || this.align === 'stretchmax') {
112 item.layoutManagedWidth = 1;
114 item.layoutManagedWidth = 2;
116 this.callParent(arguments);