tags:

views:

10

answers:

1

I am trying to build a sort of button bar in Flex - something like the horizontally laid-out bookmark bar you'd see in most modern web browsers, where when you run out of horizontal space, you can click on the arrows button(>>) to get a drop-down to see the rest of the items which did not fit into the horizontal space. Problem is, how can I know how much horizontal space is available for me to tell how many buttons to render into the button bar? This need doesn't appear to be support by the general layout manager framework.

+2  A: 

You can check the width of the parent container, and if that is less than the combined widths of your objects that you've attached with AddChild or AddElement, then you don't have enough space and need use your arrow functionality.

cyberconte
Thanks. This is what I am thinking, but it doesn't address components within a HDividedBox. I guess for that case I'd have find the ancestor which is an HDividedBox, which isn't elegant because I have to check for many different corner cases. But it looks as if there isn't an elegant way.
toby