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 * A layout that arranges items vertically down a Container. This layout optionally divides available vertical space
17 * between child items containing a numeric `flex` configuration.
19 * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
22 * Ext.create('Ext.Panel', {
25 * title: "VBoxLayout Panel",
30 * renderTo: document.body,
33 * title: 'Inner Panel One',
39 * title: 'Inner Panel Two',
45 * title: 'Inner Panel Three',
51 Ext.define('Ext.layout.container.VBox', {
53 /* Begin Definitions */
55 alias: ['layout.vbox'],
56 extend: 'Ext.layout.container.Box',
57 alternateClassName: 'Ext.layout.VBoxLayout',
63 * Controls how the child items of the container are aligned. Acceptable configuration values for this property are:
65 * - **left** : **Default** child items are aligned horizontally at the **left** side of the container
66 * - **center** : child items are aligned horizontally at the **mid-width** of the container
67 * - **stretch** : child items are stretched horizontally to fill the width of the container
68 * - **stretchmax** : child items are stretched horizontally to the size of the largest item.
70 align : 'left', // left, center, stretch, strechmax
73 alignCenteringString: 'center',
77 direction: 'vertical',
79 // When creating an argument list to setSize, use this order
81 perpendicularSizeIndex: 0,
83 parallelPrefix: 'height',
84 parallelPrefixCap: 'Height',
87 parallelBefore: 'top',
88 parallelBeforeCap: 'Top',
89 parallelAfter: 'bottom',
90 parallelPosition: 'y',
92 perpendicularPrefix: 'width',
93 perpendicularPrefixCap: 'Width',
96 perpendicularLeftTop: 'left',
97 perpendicularRightBottom: 'right',
98 perpendicularPosition: 'x',
99 configureItem: function(item) {
101 item.layoutManagedHeight = 1;
103 item.layoutManagedHeight = 2;
106 if (this.align === 'stretch' || this.align === 'stretchmax') {
107 item.layoutManagedWidth = 1;
109 item.layoutManagedWidth = 2;
111 this.callParent(arguments);