Yes, this is close.

The measure() method typically sets the measuredWidth and measuredHeight based 
on how much room a component needs to display its information. For example, a 
Button computes its measured size to be just large enough to display its label 
String. An HBox computes its measured size to be just large enough to display 
all of its children. Etc.

In addition to the measuredWidth and the explicitWidth, there is also a 
percentWidth. These are conceptually the three "inputs" that determine the 
actual width as the output of the layout process. The actual width is not known 
until the component has undergone a LayoutManager pass.

For historical reasons related to ease-of-use consideration, the "width" 
property does double duty. As a setter, it sets the explicitWidth. As a getter, 
it returns the actual width.

Gordon Smith
Adobe Flex SDK Team

From: [email protected] [mailto:[email protected]] On Behalf 
Of gwangdesign
Sent: Wednesday, March 25, 2009 8:44 AM
To: [email protected]
Subject: [flexcoders] [101] measured width vs. explicit width vs. width


Hi,

This is a really basic question about UIComponent. My understanding is that:

1. "measuredWidth" is the default or suggested or "appropriate" width that a 
(subclassing) UIComponent asks for itself;

2. "explicit width" is the value you set explicitly to the "width" property of 
the component;

3. "width" is the real or final width as the component gets drawn to the screen 
*after* the displaylist gets updated. This value is either the "explicit width" 
as the developer sets it, or something that the container ("parent") components 
finally determine based on the "measuredWidth" the component asked for and 
other factors such as the real estate available for it.

Is this something close to the truth/rules?

Please advice and/or correct. Thanks.

Reply via email to