Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / docs / source / VBox.html
index 4f78626..8ee2466 100644 (file)
@@ -1,37 +1,55 @@
-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-layout.container.VBox'>/**
-</span> * @class Ext.layout.container.VBox
- * @extends Ext.layout.container.Box
- * &lt;p&gt;A layout that arranges items vertically down a Container. This layout optionally divides available vertical
- * space between child items containing a numeric &lt;code&gt;flex&lt;/code&gt; configuration.&lt;/p&gt;
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>The source code</title>
+  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+  <style type="text/css">
+    .highlight { display: block; background-color: #ddd; }
+  </style>
+  <script type="text/javascript">
+    function highlight() {
+      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+    }
+  </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+  <pre class="prettyprint lang-js"><span id='Ext-layout-container-VBox'>/**
+</span> * A layout that arranges items vertically down a Container. This layout optionally divides available vertical space
+ * between child items containing a numeric `flex` configuration.
+ *
  * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
- * {@img Ext.layout.container.VBox/Ext.layout.container.VBox.png Ext.layout.container.VBox container layout}
- * Example usage:
-       Ext.create('Ext.Panel', {
-               width: 500,
-               height: 400,
-               title: &quot;VBoxLayout Panel&quot;,
-               layout: {                        
-                       type: 'vbox',
-                       align: 'center'
-               },
-               renderTo: document.body,
-               items: [{                        
-                       xtype: 'panel',
-                       title: 'Inner Panel One',
-                       width: 250,
-                       flex: 2                      
-               },{
-                       xtype: 'panel',
-                       title: 'Inner Panel Two',
-                       width: 250,                     
-                       flex: 4
-               },{
-                       xtype: 'panel',
-                       title: 'Inner Panel Three',
-                       width: '50%',                   
-                       flex: 4
-               }]
-       });
+ *
+ *     @example
+ *     Ext.create('Ext.Panel', {
+ *         width: 500,
+ *         height: 400,
+ *         title: &quot;VBoxLayout Panel&quot;,
+ *         layout: {
+ *             type: 'vbox',
+ *             align: 'center'
+ *         },
+ *         renderTo: document.body,
+ *         items: [{
+ *             xtype: 'panel',
+ *             title: 'Inner Panel One',
+ *             width: 250,
+ *             flex: 2
+ *         },
+ *         {
+ *             xtype: 'panel',
+ *             title: 'Inner Panel Two',
+ *             width: 250,
+ *             flex: 4
+ *         },
+ *         {
+ *             xtype: 'panel',
+ *             title: 'Inner Panel Three',
+ *             width: '50%',
+ *             flex: 4
+ *         }]
+ *     });
  */
 Ext.define('Ext.layout.container.VBox', {
 
@@ -40,23 +58,17 @@ Ext.define('Ext.layout.container.VBox', {
     alias: ['layout.vbox'],
     extend: 'Ext.layout.container.Box',
     alternateClassName: 'Ext.layout.VBoxLayout',
-    
+
     /* End Definitions */
 
-<span id='Ext-layout.container.VBox-cfg-align'>    /**
+<span id='Ext-layout-container-VBox-cfg-align'>    /**
 </span>     * @cfg {String} align
-     * Controls how the child items of the container are aligned. Acceptable configuration values for this
-     * property are:
-     * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
-     * &lt;li&gt;&lt;b&gt;&lt;tt&gt;left&lt;/tt&gt;&lt;/b&gt; : &lt;b&gt;Default&lt;/b&gt;&lt;div class=&quot;sub-desc&quot;&gt;child items are aligned horizontally
-     * at the &lt;b&gt;left&lt;/b&gt; side of the container&lt;/div&gt;&lt;/li&gt;
-     * &lt;li&gt;&lt;b&gt;&lt;tt&gt;center&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;child items are aligned horizontally at the
-     * &lt;b&gt;mid-width&lt;/b&gt; of the container&lt;/div&gt;&lt;/li&gt;
-     * &lt;li&gt;&lt;b&gt;&lt;tt&gt;stretch&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;child items are stretched horizontally to fill
-     * the width of the container&lt;/div&gt;&lt;/li&gt;
-     * &lt;li&gt;&lt;b&gt;&lt;tt&gt;stretchmax&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;child items are stretched horizontally to
-     * the size of the largest item.&lt;/div&gt;&lt;/li&gt;
-     * &lt;/ul&gt;&lt;/div&gt;
+     * Controls how the child items of the container are aligned. Acceptable configuration values for this property are:
+     *
+     * - **left** : **Default** child items are aligned horizontally at the **left** side of the container
+     * - **center** : child items are aligned horizontally at the **mid-width** of the container
+     * - **stretch** : child items are stretched horizontally to fill the width of the container
+     * - **stretchmax** : child items are stretched horizontally to the size of the largest item.
      */
     align : 'left', // left, center, stretch, strechmax
 
@@ -86,5 +98,21 @@ Ext.define('Ext.layout.container.VBox', {
     perpendicularRB: 'r',
     perpendicularLeftTop: 'left',
     perpendicularRightBottom: 'right',
-    perpendicularPosition: 'x'
-});</pre></pre></body></html>
\ No newline at end of file
+    perpendicularPosition: 'x',
+    configureItem: function(item) {
+        if (item.flex) {
+            item.layoutManagedHeight = 1;
+        } else {
+            item.layoutManagedHeight = 2;
+        }
+
+        if (this.align === 'stretch' || this.align === 'stretchmax') {
+            item.layoutManagedWidth = 1;
+        } else {
+            item.layoutManagedWidth = 2;
+        }
+        this.callParent(arguments);
+    }
+});</pre>
+</body>
+</html>