Actually, you tripped over one of the subleties of the Flex Framework.
 
Scrollbars are not always calculated into the width/height of a
component and the content does not always resize.  The scrollPolicy
affects the computation, and the component determines whether to resize
the content.  This is done because of the top-down layout rules in Flex
where if a scrollbar appeared at the top and forced content resize, the
content might be forced to put up scrollbars and you end up with a
cascade of scrollbars on the screen.
 
The rules are:
 
scrollPolicy="off".  Scrollbars are not factored into the measured size
(because they'll never be shown)
scrollPolicy="on"  Scrollbars are factored into the measured size
(because they are always shown)
scrollPolicy="auto"  Scrollbars are not factored into the measured size
and if forced to appear will clip content, except for the list classes
which will try to resize the width of the content.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Matt
Sent: Friday, September 28, 2007 2:09 PM
To: [email protected]
Subject: [flexcoders] Re: ResizeEvent.RESIZE Not Very Smart?



Sorry about that, I went to create a simple example and realized it
isn't Flex that's not very smart, but rather me. :)

Next time I'll try to create the simple example BEFORE coming in here
and making bold and outrageous claims. ;)

Thanks for the help.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Are you sure the GridItems resize and don't just get clipped by the
> scrollbar? The code looks like it should send the event if the size
> changed.
> 
> If you have a small test case, feel free to post it
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Matt
> Sent: Friday, September 28, 2007 12:06 PM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: ResizeEvent.RESIZE Not Very Smart?
> 
> 
> 
> I guess my real question is:
> 
> Is there any way to receive an event every time a component's pixel
> size actually changes for any reason?
> 
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> , "Matt" <matt@> wrote:
> >
> > I have a Grid with GridRows and GridItems. I have three GridItems
per
> > row and their size is set to 33% width. This works fine but when
> > enough GridRows are added to cause a vertical scroll bar to be
> > displayed I want to know that the actual pixel width of those
> > GridItems has changed and Flex doesn't seem to want to let me find
> > that out. I addEventListener(ResizeEvent.RESIZE, eventHandler) to
the
> > GridItems but apart from the very first layout on the screen I never
> > receive another ResizeEvent. Is there something I'm doing wrong or
> > something more I need to be doing in order to be notified when that
> > resize occurs?
> >
>



 

Reply via email to