In theory, if measure() returns different numbers than the last time it
got called, invalidateDisplayList gets called and eventually you get
updateDisplayList and go through layout again.

 

Also, in theory, measuredMinWidth/measuredWidth (and heights) will be
different if you have % on reportChrome or not which might yield a clue.
Or the updateDL gets called a different number of times.  I don't know
what each of these levels have for base classes.  That might make a
difference as well.

 

If you build up a test case base on the base classes for these
components, maybe that should be posted so we can take a closer look.
Otherwise it points to your custom code.

 

-Alex

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Richard Rodseth
Sent: Tuesday, July 29, 2008 9:52 PM
To: [email protected]
Subject: [flexcoders] Measurement and percentages (was measurement and
template components)

 

Alex requested that I start a new thread to review. Here's the
relevant portion of the hierarchy (stated values are in both x and y
directions):

TiledCanvas (100%)
..PodChrome(n of these)
....ReportModuleA (100%) (not a real module, just a VBox)
......ReportChrome (100%)
........ReportA (100%, minimum 500)
..........Grid

PodChrome and ReportModuleA are created in ActionScript at runtime.

TiledCanvas is supposed to have scrollbars. Tested in isolation (i.e.
with a bunch of buttons as children, some with minimums set, it does.
In the above hierarchy, If I remove the 100% from ReportChrome, it
does. But with the percentage sizing of ReportChrome, it doesn't.

It appears that all the measure() methods get called and return 500 or
more.
I noticed the following in Container.getScrollableRect(). Possibly
related?

// width/height can be NaN if using percentages and
// hasn't been layed out yet.
if (!isNaN(child.width))
right = Math.max(right, child.x + child.width);
if (!isNaN(child.height))
bottom = Math.max(bottom, child.y + child.height);

I also notice some code in UIComponent (I think) that was calling
invalidateDisplayList() immediately after invalidateSize(). Do those
need to be paired? Perhaps my code which constructs PodChrome and
ReportModuleA needs to call invalidateDisplayList.

 

Reply via email to