1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
6
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
7
<meta content="LayoutContainer,com.yahoo.astra.layout.LayoutContainer,autoMask,contentHeight,contentWidth,layoutMode,invalidateLayout,validateLayout" name="keywords">
8
<title>com.yahoo.astra.layout.LayoutContainer</title>
11
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
13
asdocTitle = 'LayoutContainer - YUI Flash Component Documentation';
14
var baseRef = '../../../../';
15
window.onload = configPage;
17
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
19
<td align="left" class="titleTableTitle">YUI Flash Component Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All Packages</a> | <a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All Classes</a> | <a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a> | <a href="../../../../index.html?com/yahoo/astra/layout/LayoutContainer.html&com/yahoo/astra/layout/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
21
<tr class="titleTableRow2">
22
<td align="left" id="subTitle" class="titleTableSubTitle">Class LayoutContainer</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a> | <a href="#methodSummary">Methods</a> | <a href="#eventSummary">Events</a></td>
24
<tr class="titleTableRow3">
25
<td colspan="2"> </td>
28
<script type="text/javascript" language="javascript">
30
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class LayoutContainer"); titleBar_setSubNav(false,true,false,false,true,false,true,false,false,false,false,false,false,false);}
32
<div class="MainContent">
33
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
35
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.yahoo.astra.layout</a></td>
38
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class LayoutContainer</td>
41
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">LayoutContainer <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.display.Sprite</td>
44
<td class="classHeaderTableLabel">Implements</td><td><a href="ILayoutContainer.html">ILayoutContainer</a></td>
48
Children of this display object are subject to being positioned, and
49
possibly resized, based on a specified layout algorithm. LayoutContainer
50
integrates with LayoutManager to refresh its the layout of its children
51
when properties on the container itself change or when one of its
52
children dispatches a registered invalidating event. This is the default
53
implementation of ILayoutContainer.
57
<span class="label">Example</span>
58
<br>The following code demonstrates the usage of LayoutContainer:
59
<div class='listing'><pre>
60
// create an instance of a layout mode
61
var mode:ILayoutMode = new BoxLayout();
62
mode.direction = "horizontal";
63
mode.horizontalGap = 10;
65
// one may pass the mode to the constructor or the layoutMode property.
66
// note: by default, a LayoutContainer will automatically determine
67
// its size based on its content.
68
var container:LayoutContainer = new LayoutContainer( mode );
69
this.addChild(container);
71
for( var i:int = 0; i < 5; i++ )
73
var square:Shape = new Shape();
74
square.graphics.beginFill(0xcccccc);
75
square.graphics.drawRect(0, 0, 25, 25);
76
square.graphics.endFill();
77
container.addChild(square);
81
<p><strong>Important Note:</strong> LayoutContainer leaves certain
82
functionality to the implementor to complete. No scrollbars or other user
83
interface controls will appear when the contents are larger than the
84
LayoutContainer's dimensions.</p>
86
<p>This limitation is deliberate and by design. The philosophy behind
87
this choice centers on allowing an ActionScript developer to use these
88
classes as a basis for implementing layout controls for nearly any user
89
interface library available for Flash Player.</p>
91
<p>For a reference implementation of full-featured UI controls that
92
implement masking and scrolling, please take a look at the Layout
93
Containers available in the <a href="http://developer.yahoo.com/flash/astra-flash/">Yahoo! Astra Components for Flash CS3</a>.</p>
97
<span class="classHeaderTableLabel">See also</span>
100
<a href="LayoutManager.html" target="">LayoutManager</a>
102
<a href="ILayoutContainer.html" target="">ILayoutContainer</a>
104
<a href="modes/package-detail.html" target="">Available Layout Modes (com.yahoo.astra.layout.modes)</a>
109
<a name="propertySummary"></a>
110
<div class="summarySection">
111
<div class="summaryTableTitle">Public Properties</div>
112
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
114
<th> </th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined by</th>
117
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#autoMask">autoMask</a> : Boolean<div class="summaryTableDescription">
118
If true, the conent will automatically update the scrollRect to fit
119
the dimensions.</div>
120
</td><td class="summaryTableOwnerCol">LayoutContainer</td>
123
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#contentHeight">contentHeight</a> : Number<div class="summaryTableDescription">[read-only]
125
The height of the content displayed by the layout container.</div>
126
</td><td class="summaryTableOwnerCol">LayoutContainer</td>
129
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#contentWidth">contentWidth</a> : Number<div class="summaryTableDescription">[read-only]
131
The width of the content displayed by the layout container.</div>
132
</td><td class="summaryTableOwnerCol">LayoutContainer</td>
135
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#layoutMode">layoutMode</a> : <a href="modes/ILayoutMode.html">ILayoutMode</a>
136
<div class="summaryTableDescription">
138
The layout algorithm used to display children of the layout container.</div>
139
</td><td class="summaryTableOwnerCol">LayoutContainer</td>
143
<a name="methodSummary"></a>
144
<div class="summarySection">
145
<div class="summaryTableTitle">Public Methods</div>
146
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
148
<th> </th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined by</th>
151
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
152
<div class="summarySignature">
153
<a class="signatureLink" href="#LayoutContainer()">LayoutContainer</a>(mode:<a href="modes/ILayoutMode.html">ILayoutMode</a> = null)</div>
154
<div class="summaryTableDescription">
156
</td><td class="summaryTableOwnerCol">LayoutContainer</td>
159
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
160
<div class="summarySignature">
161
<a class="signatureLink" href="#invalidateLayout()">invalidateLayout</a>():void</div>
162
<div class="summaryTableDescription">
164
Informs the layout container that it should update the layout of its
166
</td><td class="summaryTableOwnerCol">LayoutContainer</td>
169
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
170
<div class="summarySignature">
171
<a class="signatureLink" href="#validateLayout()">validateLayout</a>():void</div>
172
<div class="summaryTableDescription">
174
Immediately updates the layout of the container's children.</div>
175
</td><td class="summaryTableOwnerCol">LayoutContainer</td>
179
<a name="eventSummary"></a>
180
<div class="summarySection">
181
<div class="summaryTableTitle">Events</div>
182
<table id="summaryTableEvent" class="summaryTable " cellpadding="3" cellspacing="0">
184
<th> </th><th colspan="2">Event</th><th>Summary</th><th class="summaryTableOwnerCol">Defined by</th>
187
<td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
188
<div class="summarySignature">
189
<a class="signatureLink" href="#event:layoutChange">layoutChange</a>
191
</td><td class="summaryTableDescription summaryTableCol">
192
Dispatched when this container's layout changes.</td><td class="summaryTableOwnerCol">LayoutContainer</td>
196
<script type="text/javascript" language="javascript">
200
<div class="MainContent">
201
<a name="propertyDetail"></a>
202
<div class="detailSectionHeader">Property detail</div>
203
<a name="autoMask"></a>
204
<table cellspacing="0" cellpadding="0" class="detailHeader">
206
<td class="detailHeaderName">autoMask</td><td class="detailHeaderType">property</td>
209
<div class="detailBody">
210
<code>autoMask:Boolean</code> [read-write]<p>
211
If true, the conent will automatically update the scrollRect to fit
212
the dimensions. Uses explicit dimensions if width or height is set by
213
the developer. Otherwise, uses the content dimensions. If false, it
214
is up to the implementor to set the mask or scrollRect.
215
</p><span class="label">Implementation</span>
217
<code> public function get autoMask():Boolean</code>
219
<code> public function set autoMask(value:Boolean):void</code>
222
<a name="contentHeight"></a>
223
<table cellspacing="0" cellpadding="0" class="detailHeader">
225
<td class="detailHeaderName">contentHeight</td><td class="detailHeaderType">property</td><td class="detailHeaderRule"> </td>
228
<div class="detailBody">
229
<code>contentHeight:Number</code> [read-only]<p>
231
The height of the content displayed by the layout container.
232
</p><span class="label">Implementation</span>
234
<code> public function get contentHeight():Number</code>
237
<a name="contentWidth"></a>
238
<table cellspacing="0" cellpadding="0" class="detailHeader">
240
<td class="detailHeaderName">contentWidth</td><td class="detailHeaderType">property</td><td class="detailHeaderRule"> </td>
243
<div class="detailBody">
244
<code>contentWidth:Number</code> [read-only]<p>
246
The width of the content displayed by the layout container.
247
</p><span class="label">Implementation</span>
249
<code> public function get contentWidth():Number</code>
252
<a name="layoutMode"></a>
253
<table cellspacing="0" cellpadding="0" class="detailHeader">
255
<td class="detailHeaderName">layoutMode</td><td class="detailHeaderType">property</td><td class="detailHeaderRule"> </td>
258
<div class="detailBody">
259
<code>layoutMode:<a href="modes/ILayoutMode.html">ILayoutMode</a></code> [read-write]<p>
261
The layout algorithm used to display children of the layout container.
263
</p><span class="label">Implementation</span>
265
<code> public function get layoutMode():<a href="modes/ILayoutMode.html">ILayoutMode</a></code>
267
<code> public function set layoutMode(value:<a href="modes/ILayoutMode.html">ILayoutMode</a>):void</code>
270
<a name="constructorDetail"></a>
271
<div class="detailSectionHeader">Constructor detail</div>
272
<a name="LayoutContainer()"></a>
273
<table cellspacing="0" cellpadding="0" class="detailHeader">
275
<td class="detailHeaderName">LayoutContainer</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
278
<div class="detailBody">
279
<code>public function LayoutContainer(mode:<a href="modes/ILayoutMode.html">ILayoutMode</a> = null)</code><p>
282
</p><span class="label">Parameters</span>
283
<table border="0" cellspacing="0" cellpadding="0">
285
<td width="20px"></td><td><code><span class="label">mode</span>:<a href="modes/ILayoutMode.html">ILayoutMode</a></code> (default = <code>null</code>)<code></code> — The ILayoutMode implementation to use.
290
<a name="methodDetail"></a>
291
<div class="detailSectionHeader">Method detail</div>
292
<a name="invalidateLayout()"></a>
293
<table cellspacing="0" cellpadding="0" class="detailHeader">
295
<td class="detailHeaderName">invalidateLayout</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
298
<div class="detailBody">
299
<code>public function invalidateLayout():void</code><p>
301
Informs the layout container that it should update the layout of its
304
<a name="validateLayout()"></a>
305
<table cellspacing="0" cellpadding="0" class="detailHeader">
307
<td class="detailHeaderName">validateLayout</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td>
310
<div class="detailBody">
311
<code>public function validateLayout():void</code><p>
313
Immediately updates the layout of the container's children.
315
<div class="detailSectionHeader">Event detail</div>
316
<a name="event:layoutChange"></a>
317
<table cellspacing="0" cellpadding="0" class="detailHeader">
319
<td class="detailHeaderName">layoutChange</td><td class="detailHeaderType">event </td>
322
<div class="detailBody">
323
<span class="label">Event object type: </span><a href="events/LayoutEvent.html"><code>com.yahoo.astra.layout.events.LayoutEvent</code></a>
325
<span class="label">LayoutEvent.type property = </span><a href="events/LayoutEvent.html#LAYOUT_CHANGE"><code>com.yahoo.astra.layout.events.LayoutEvent.LAYOUT_CHANGE</code></a>
327
Dispatched when this container's layout changes.
329
The <code>LayoutEvent.LAYOUT_CHANGE</code> event type constant indicates that
330
the layout of an ILayoutContainer needs to be redrawn.
338
<center class="copyright">