When the LayoutManager sizes a component, it considers three inputs (measuredWidth, percentWidth, and explicitWidth) -- and produces one output (width).

 

The measuredWidth is the component's own notion of how big it should be by default. You don't set the measuredWidth; it is up to the component to do this itself in its measure() method. For example, a Button automatically sets its measuredWidth to be just big enough to display its label.

 

If you want to override the measuredWidth so that the component's output width is a percentage of its parent's available width, set percentWidth. Setting the 'width' to a percent (which you can do in MXML but not in AS) is simply a shorthand for setting the percentWidth. When the LayoutManager computes the output width based on the percentWidth, it will take the minWidth into account.

 

If you want to override the measuredWidth so that the component's output width is a fixed number of pixels, set explicitWidth. Setting the 'width' to a number of pixels is simply a shorthand for setting the explicitWidth.

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of tddclare
Sent: Thursday, July 20, 2006 1:07 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] concise explanation of sizing (measured, explicit, preferred) custom components

 

Does anyone know of a good (reasonably plain language) writeup of how
(and why and when) to use the various sizing properties when extending
UIComponent?

I've read the documentation in Help, but it hasn't fully sunk through
my thick head yet.

I'd like to understand enough to know not only WHAT they are, but WHY
I'm setting them and HOW Flex uses them:

( ... means "Height" or "Width". I DO understand that those mean! : ))
- measured...
- measuredPreferred...
- explicit...
- ...

Thanks for any leads or any explanations you can give me!

--TC

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to