r24958: This is the final text, and the final version. I'll send the release
[jelmer/samba4-debian.git] / webapps / qooxdoo-0.6.5-sdk / frontend / framework / source / class / qx / ui / layout / FlowLayout.js
1 /* ************************************************************************
2
3    qooxdoo - the new era of web development
4
5    http://qooxdoo.org
6
7    Copyright:
8      2004-2007 1&1 Internet AG, Germany, http://www.1and1.org
9
10    License:
11      LGPL: http://www.gnu.org/licenses/lgpl.html
12      EPL: http://www.eclipse.org/org/documents/epl-v10.php
13      See the LICENSE file in the project's top-level directory for details.
14
15    Authors:
16      * Sebastian Werner (wpbasti)
17      * Andreas Ecker (ecker)
18
19 ************************************************************************ */
20
21 /* ************************************************************************
22
23 #module(ui_layout)
24
25 ************************************************************************ */
26
27 qx.OO.defineClass("qx.ui.layout.FlowLayout", qx.ui.core.Parent,
28 function() {
29   qx.ui.core.Parent.call(this);
30 });
31
32 /*!
33   The spacing between childrens. Could be any positive integer value.
34 */
35 qx.OO.addProperty({ name : "horizontalSpacing", type : "number", defaultValue : 0, addToQueueRuntime : true, impl : "layout" });
36
37 /*!
38   The spacing between childrens. Could be any positive integer value.
39 */
40 qx.OO.addProperty({ name : "verticalSpacing", type : "number", defaultValue : 0, addToQueueRuntime : true, impl : "layout" });
41
42 /*!
43   The horizontal align of the children. Allowed values are: "left" and "right"
44 */
45 qx.OO.addProperty({ name : "horizontalChildrenAlign", type : "string", defaultValue : "left", possibleValues : [ "left", "right" ], addToQueueRuntime : true });
46
47 /*!
48   The vertical align of the children. Allowed values are: "top" and "bottom"
49 */
50 qx.OO.addProperty({ name : "verticalChildrenAlign", type : "string", defaultValue : "top", possibleValues : [ "top", "bottom" ], addToQueueRuntime : true });
51
52 /*!
53   Should the children be layouted in reverse order?
54 */
55 qx.OO.addProperty({ name : "reverseChildrenOrder", type : "boolean", defaultValue : false, addToQueueRuntime : true, impl : "layout" });
56
57
58
59
60
61
62 /*
63 ---------------------------------------------------------------------------
64   INIT LAYOUT IMPL
65 ---------------------------------------------------------------------------
66 */
67
68 /*!
69   This creates an new instance of the layout impl this widget uses
70 */
71 qx.Proto._createLayoutImpl = function() {
72   return new qx.renderer.layout.FlowLayoutImpl(this);
73 }
74
75
76
77
78
79 /*
80 ---------------------------------------------------------------------------
81   DIMENSION CACHE
82 ---------------------------------------------------------------------------
83 */
84
85 qx.Proto._changeInnerWidth = function(vNew, vOld)
86 {
87   qx.ui.core.Parent.prototype._changeInnerWidth.call(this, vNew, vOld);
88
89   // allow 'auto' values for height to update when the inner width changes
90   this._invalidatePreferredInnerHeight();
91 }
92
93
94
95
96 /*
97 ---------------------------------------------------------------------------
98   MODIFIER
99 ---------------------------------------------------------------------------
100 */
101
102 qx.Proto._modifyLayout = function(propValue, propOldValue, propData)
103 {
104   // invalidate inner preferred dimensions
105   this._invalidatePreferredInnerDimensions();
106
107   return true;
108 }