c2fd6c6233b3338d59922cfd69e3fee3e1052fa5.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*
  2. * Ext JS Library 2.0 Copyright(c) 2006-2007, Ext JS, LLC. licensing@extjs.com
  3. *
  4. * http://extjs.com/license
  5. */
  6. Ext.CenterLayoutRegion = function(B, A) {
  7. Ext.CenterLayoutRegion.superclass.constructor.call(this, B, A, "center");
  8. this.visible = true;
  9. this.minWidth = A.minWidth || 20;
  10. this.minHeight = A.minHeight || 20
  11. };
  12. Ext.extend(Ext.CenterLayoutRegion, Ext.LayoutRegion, {
  13. hide : function() {
  14. },
  15. show : function() {
  16. },
  17. getMinWidth : function() {
  18. return this.minWidth
  19. },
  20. getMinHeight : function() {
  21. return this.minHeight
  22. }
  23. });
  24. Ext.NorthLayoutRegion = function(C, A) {
  25. Ext.NorthLayoutRegion.superclass.constructor.call(this, C, A, "north",
  26. "n-resize");
  27. if (this.split) {
  28. this.split.placement = Ext.SplitBar.TOP;
  29. this.split.orientation = Ext.SplitBar.VERTICAL;
  30. this.split.el.addClass("x-layout-split-v")
  31. }
  32. var B = A.initialSize || A.height;
  33. if (typeof B != "undefined") {
  34. this.el.setHeight(B)
  35. }
  36. };
  37. Ext.extend(Ext.NorthLayoutRegion, Ext.SplitLayoutRegion, {
  38. orientation : Ext.SplitBar.VERTICAL,
  39. getBox : function() {
  40. if (this.collapsed) {
  41. return this.collapsedEl.getBox()
  42. }
  43. var A = this.el.getBox();
  44. if (this.split) {
  45. A.height += this.split.el.getHeight()
  46. }
  47. return A
  48. },
  49. updateBox : function(A) {
  50. if (this.split && !this.collapsed) {
  51. A.height -= this.split.el.getHeight();
  52. this.split.el.setLeft(A.x);
  53. this.split.el.setTop(A.y + A.height);
  54. this.split.el.setWidth(A.width)
  55. }
  56. if (this.collapsed) {
  57. this.updateBody(A.width, null)
  58. }
  59. Ext.NorthLayoutRegion.superclass.updateBox.call(this, A)
  60. }
  61. });
  62. Ext.SouthLayoutRegion = function(C, A) {
  63. Ext.SouthLayoutRegion.superclass.constructor.call(this, C, A, "south",
  64. "s-resize");
  65. if (this.split) {
  66. this.split.placement = Ext.SplitBar.BOTTOM;
  67. this.split.orientation = Ext.SplitBar.VERTICAL;
  68. this.split.el.addClass("x-layout-split-v")
  69. }
  70. var B = A.initialSize || A.height;
  71. if (typeof B != "undefined") {
  72. this.el.setHeight(B)
  73. }
  74. };
  75. Ext.extend(Ext.SouthLayoutRegion, Ext.SplitLayoutRegion, {
  76. orientation : Ext.SplitBar.VERTICAL,
  77. getBox : function() {
  78. if (this.collapsed) {
  79. return this.collapsedEl.getBox()
  80. }
  81. var B = this.el.getBox();
  82. if (this.split) {
  83. var A = this.split.el.getHeight();
  84. B.height += A;
  85. B.y -= A
  86. }
  87. return B
  88. },
  89. updateBox : function(B) {
  90. if (this.split && !this.collapsed) {
  91. var A = this.split.el.getHeight();
  92. B.height -= A;
  93. B.y += A;
  94. this.split.el.setLeft(B.x);
  95. this.split.el.setTop(B.y - A);
  96. this.split.el.setWidth(B.width)
  97. }
  98. if (this.collapsed) {
  99. this.updateBody(B.width, null)
  100. }
  101. Ext.SouthLayoutRegion.superclass.updateBox.call(this, B)
  102. }
  103. });
  104. Ext.EastLayoutRegion = function(C, A) {
  105. Ext.EastLayoutRegion.superclass.constructor.call(this, C, A, "east",
  106. "e-resize");
  107. if (this.split) {
  108. this.split.placement = Ext.SplitBar.RIGHT;
  109. this.split.orientation = Ext.SplitBar.HORIZONTAL;
  110. this.split.el.addClass("x-layout-split-h")
  111. }
  112. var B = A.initialSize || A.width;
  113. if (typeof B != "undefined") {
  114. this.el.setWidth(B)
  115. }
  116. };
  117. Ext.extend(Ext.EastLayoutRegion, Ext.SplitLayoutRegion, {
  118. orientation : Ext.SplitBar.HORIZONTAL,
  119. getBox : function() {
  120. if (this.collapsed) {
  121. return this.collapsedEl.getBox()
  122. }
  123. var B = this.el.getBox();
  124. if (this.split) {
  125. var A = this.split.el.getWidth();
  126. B.width += A;
  127. B.x -= A
  128. }
  129. return B
  130. },
  131. updateBox : function(B) {
  132. if (this.split && !this.collapsed) {
  133. var A = this.split.el.getWidth();
  134. B.width -= A;
  135. this.split.el.setLeft(B.x);
  136. this.split.el.setTop(B.y);
  137. this.split.el.setHeight(B.height);
  138. B.x += A
  139. }
  140. if (this.collapsed) {
  141. this.updateBody(null, B.height)
  142. }
  143. Ext.EastLayoutRegion.superclass.updateBox.call(this, B)
  144. }
  145. });
  146. Ext.WestLayoutRegion = function(C, A) {
  147. Ext.WestLayoutRegion.superclass.constructor.call(this, C, A, "west",
  148. "w-resize");
  149. if (this.split) {
  150. this.split.placement = Ext.SplitBar.LEFT;
  151. this.split.orientation = Ext.SplitBar.HORIZONTAL;
  152. this.split.el.addClass("x-layout-split-h")
  153. }
  154. var B = A.initialSize || A.width;
  155. if (typeof B != "undefined") {
  156. this.el.setWidth(B)
  157. }
  158. };
  159. Ext.extend(Ext.WestLayoutRegion, Ext.SplitLayoutRegion, {
  160. orientation : Ext.SplitBar.HORIZONTAL,
  161. getBox : function() {
  162. if (this.collapsed) {
  163. return this.collapsedEl.getBox()
  164. }
  165. var A = this.el.getBox();
  166. if (this.split) {
  167. A.width += this.split.el.getWidth()
  168. }
  169. return A
  170. },
  171. updateBox : function(B) {
  172. if (this.split && !this.collapsed) {
  173. var A = this.split.el.getWidth();
  174. B.width -= A;
  175. this.split.el.setLeft(B.x + B.width);
  176. this.split.el.setTop(B.y);
  177. this.split.el.setHeight(B.height)
  178. }
  179. if (this.collapsed) {
  180. this.updateBody(null, B.height)
  181. }
  182. Ext.WestLayoutRegion.superclass.updateBox.call(this, B)
  183. }
  184. });