VBox.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-layout-container-VBox'>/**
  19. </span> * A layout that arranges items vertically down a Container. This layout optionally divides available vertical space
  20. * between child items containing a numeric `flex` configuration.
  21. *
  22. * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
  23. *
  24. * @example
  25. * Ext.create('Ext.Panel', {
  26. * width: 500,
  27. * height: 400,
  28. * title: &quot;VBoxLayout Panel&quot;,
  29. * layout: {
  30. * type: 'vbox',
  31. * align: 'center'
  32. * },
  33. * renderTo: document.body,
  34. * items: [{
  35. * xtype: 'panel',
  36. * title: 'Inner Panel One',
  37. * width: 250,
  38. * flex: 2
  39. * },
  40. * {
  41. * xtype: 'panel',
  42. * title: 'Inner Panel Two',
  43. * width: 250,
  44. * flex: 4
  45. * },
  46. * {
  47. * xtype: 'panel',
  48. * title: 'Inner Panel Three',
  49. * width: '50%',
  50. * flex: 4
  51. * }]
  52. * });
  53. */
  54. Ext.define('Ext.layout.container.VBox', {
  55. /* Begin Definitions */
  56. alias: ['layout.vbox'],
  57. extend: 'Ext.layout.container.Box',
  58. alternateClassName: 'Ext.layout.VBoxLayout',
  59. /* End Definitions */
  60. <span id='Ext-layout-container-VBox-cfg-align'> /**
  61. </span> * @cfg {String} align
  62. * Controls how the child items of the container are aligned. Acceptable configuration values for this property are:
  63. *
  64. * - **left** : **Default** child items are aligned horizontally at the **left** side of the container
  65. * - **center** : child items are aligned horizontally at the **mid-width** of the container
  66. * - **stretch** : child items are stretched horizontally to fill the width of the container
  67. * - **stretchmax** : child items are stretched horizontally to the size of the largest item.
  68. */
  69. align : 'left', // left, center, stretch, strechmax
  70. type: 'vbox',
  71. direction: 'vertical',
  72. horizontal: false,
  73. names: {
  74. // parallel
  75. lr: 'tb',
  76. left: 'top',
  77. leftCap: 'Top',
  78. right: 'bottom',
  79. position: 'top',
  80. width: 'height',
  81. contentWidth: 'contentHeight',
  82. minWidth: 'minHeight',
  83. maxWidth: 'maxHeight',
  84. widthCap: 'Height',
  85. widthModel: 'heightModel',
  86. widthIndex: 1,
  87. x: 'y',
  88. scrollLeft: 'scrollTop',
  89. overflowX: 'overflowY',
  90. hasOverflowX: 'hasOverflowY',
  91. invalidateScrollX: 'invalidateScrollY',
  92. // perpendicular
  93. center: 'center',
  94. top: 'left',// 'before',
  95. topPosition: 'left',
  96. bottom: 'right',// 'after',
  97. height: 'width',
  98. contentHeight: 'contentWidth',
  99. minHeight: 'minWidth',
  100. maxHeight: 'maxWidth',
  101. heightCap: 'Width',
  102. heightModel: 'widthModel',
  103. heightIndex: 0,
  104. y: 'x',
  105. scrollTop: 'scrollLeft',
  106. overflowY: 'overflowX',
  107. hasOverflowY: 'hasOverflowX',
  108. invalidateScrollY: 'invalidateScrollX',
  109. // Methods
  110. getWidth: 'getHeight',
  111. getHeight: 'getWidth',
  112. setWidth: 'setHeight',
  113. setHeight: 'setWidth',
  114. gotWidth: 'gotHeight',
  115. gotHeight: 'gotWidth',
  116. setContentWidth: 'setContentHeight',
  117. setContentHeight: 'setContentWidth',
  118. setWidthInDom: 'setHeightInDom',
  119. setHeightInDom: 'setWidthInDom'
  120. },
  121. sizePolicy: {
  122. flex: {
  123. '': {
  124. setsWidth: 0,
  125. setsHeight: 1
  126. },
  127. stretch: {
  128. setsWidth: 1,
  129. setsHeight: 1
  130. },
  131. stretchmax: {
  132. readsWidth: 1,
  133. setsWidth: 1,
  134. setsHeight: 1
  135. }
  136. },
  137. '': {
  138. setsWidth: 0,
  139. setsHeight: 0
  140. },
  141. stretch: {
  142. setsWidth: 1,
  143. setsHeight: 0
  144. },
  145. stretchmax: {
  146. readsWidth: 1,
  147. setsWidth: 1,
  148. setsHeight: 0
  149. }
  150. }
  151. });
  152. </pre>
  153. </body>
  154. </html>