Skip to main content
Known Participant
March 27, 2011
Question

Layout Groups and proper expected behavoir missing

  • March 27, 2011
  • 1 reply
  • 513 views

Right if in Mobile Application developments and of course resizable windows in AIR we need to work with VGroups and HGroups to get things to scal properly.

It seems as I'm use to withover systems (IB) you can say in a HGroup there is an item or another HGroup that aligns left and a second that aligns right (maybe through a spacer in the middle). You should be able to say set the width or the encapsulating HGroup and have one item of the left and the other on the right.

In this it doesn't seem to do that?! you'd have to rewite Hroup to grow a spacer to the right length in between.

Please explain how it's possible or add that functionality.

I've noted justify as a means to scale all the buttons to the same size, but you seem to have missed a really important aspect in groups.

Another example is a text area with buttons to one side. The bottons maybe in a VGroup should say right=0 maybe a width but shouldn't need it. The TextArea would have similarly left=0 and right=0 as the containing hgroup is scaled in x or you change the width for different mobile device screen resolutions etc the text area should grow in width to fill the spaces. I'm see this I'll have to custom code since it's not doing the expected behaviour.

        <s:HGroup left="0" right="0" width="200" requestedColumnCount="3" horizontalAlign="center" verticalAlign="middle">
            <s:HGroup horizontalAlign="left">
                <s:Label left="2" width="50" text="Label:"/>
            </s:HGroup>
            <mx:Spacer left="0" right="0" top="0" />
            <s:HGroup horizontalAlign="right">
                <s:Button right="2" width="50" label="Call Action" click="callAction()" fontSize="16"/>
            </s:HGroup>
        </s:HGroup>

This topic has been closed for replies.

1 reply

as4moreAuthor
Known Participant
March 27, 2011

Oh I was going to add but of course you still can't edit initial entries.

You'll note both a 'left & right', and a 'width' which is redundant. You wouldn't need width but you need a stage with a width larger then the sum of the two columns and some more to demonstrate it would scale to fit properly (without custom coding the obvious expected behaviour).

I think each sub group is a bit of a work around and left and right alignment settings 'in' there is of a separate issue I suppose one might think? so it's really that the left and right should be allowed to function that way (if not internal only) or really the components are missing alignemnt ability like left=0 & right=0 or or align=left|right

I see only alignmentBaseline for a Label as in example.

What am I missing? Please explain.. cause it's not obvious at all or solvable again without coding it myself.

Maybe a JGroup is needed?!!

No I see now all componets need alignment it is the way it works in the old NeXT InterfaceBuilder, they also stretch and you have springs etc. I think you'r padding and width height probably give the same effect but it's just not working right yet. It might not be best to add it to all components? but encapsulation on a Group should do it as I've explained it doesn't seem to currently?

I believe  horizontalAlign="justify" is what should do this but doesn't. In text wrapping?... ya okay. It's done only when wrapping, but that behavior is not right in Groups.

A single row should sitribute... maybe gap is overriding it and shouldn't? or gap="auto" is an idea I've just had too.

as4moreAuthor
Known Participant
March 27, 2011

At this point I'm looking inside a spark button for internal align values and left wondering are we suppose to eat style sheet cake for that?