flexcomponents  

Re: [flexcomponents] How to determine the minimum container size while scroll bars still not needed

Sergey Kovalyov
Mon, 25 May 2009 06:25:57 -0700

But when I trace them, both minWidth and minHeight equals 0...

On Mon, May 25, 2009 at 1:57 AM, Manish Jethani <manish.jeth...@gmail.com>wrote:

>
>
>  On Mon, May 25, 2009 at 2:23 AM, Sergey Kovalyov
> <skovalyov.flexcod...@gmail.com <skovalyov.flexcoders%40gmail.com>> wrote:
>
> > Finally what I want to achieve is to have resize handle in the right
> bottom
> > corner that allows to resize the container, but does not allow to make it
> > smaller than the size when all children fit and no scroll bars are
> needed.
>
> That should be the minWidth and minHeight properties of the container.
>
> See this example:
>
> <mx:HBox backgroundColor="red" id="hb">
>
> <mx:Button width="100%" minWidth="30" />
> <mx:Button width="100%" minWidth="30" />
> </mx:HBox>
>
> <mx:Button click="hb.width-=5; trace(hb.minWidth, hb.width); " />
>
> Click on the last button. It'll narrow the HBox by 5px. When the width
> finally goes below the minWidth (68), the container will sprout
> scrollbars.
>
> minWidth of a container is the sum of all the minWidth of its
> children, plus any padding and borders. Ditto minHeight.
>
> Manish
>
> --
> www.manishjethani.com
>
> 
>