1 if(!dojo._hasResource["dijit.layout.LayoutContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dijit.layout.LayoutContainer"] = true;
3 dojo.provide("dijit.layout.LayoutContainer");
5 dojo.require("dijit.layout._LayoutWidget");
7 dojo.declare("dijit.layout.LayoutContainer",
8 dijit.layout._LayoutWidget,
11 // Provides Delphi-style panel layout semantics.
14 // A LayoutContainer is a box with a specified size (like style="width: 500px; height: 500px;"),
15 // that contains children widgets marked with "layoutAlign" of "left", "right", "bottom", "top", and "client".
16 // It takes it's children marked as left/top/bottom/right, and lays them out along the edges of the box,
17 // and then it takes the child marked "client" and puts it into the remaining space in the middle.
19 // Left/right positioning is similar to CSS's "float: left" and "float: right",
20 // and top/bottom positioning would be similar to "float: top" and "float: bottom", if there were such
23 // Note that there can only be one client element, but there can be multiple left, right, top,
24 // or bottom elements.
28 // | html, body{ height: 100%; width: 100%; }
30 // | <div dojoType="dijit.layout.LayoutContainer" style="width: 100%; height: 100%">
31 // | <div dojoType="dijit.layout.ContentPane" layoutAlign="top">header text</div>
32 // | <div dojoType="dijit.layout.ContentPane" layoutAlign="left" style="width: 200px;">table of contents</div>
33 // | <div dojoType="dijit.layout.ContentPane" layoutAlign="client">client area</div>
36 // | Lays out each child in the natural order the children occur in.
37 // | Basically each child is laid out into the "remaining space", where "remaining space" is initially
38 // | the content area of this widget, but is reduced to a smaller rectangle each time a child is added.
41 constructor: function(){
42 dojo.deprecated("dijit.layout.LayoutContainer is deprecated", "use BorderContainer instead", 2.0);
46 dijit.layout.layoutChildren(this.domNode, this._contentBox, this.getChildren());
49 addChild: function(/*Widget*/ child, /*Integer?*/ insertIndex){
50 dijit._Container.prototype.addChild.apply(this, arguments);
52 dijit.layout.layoutChildren(this.domNode, this._contentBox, this.getChildren());
56 removeChild: function(/*Widget*/ widget){
57 dijit._Container.prototype.removeChild.apply(this, arguments);
59 dijit.layout.layoutChildren(this.domNode, this._contentBox, this.getChildren());
64 // This argument can be specified for the children of a LayoutContainer.
65 // Since any widget can be specified as a LayoutContainer child, mix it
66 // into the base widget class. (This is a hack, but it's effective.)
67 dojo.extend(dijit._Widget, {
68 // layoutAlign: String
69 // "none", "left", "right", "bottom", "top", and "client".
70 // See the LayoutContainer description for details on this parameter.