Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Understanding question: VLayout / HLayout and setAlign()-call for breadth-axis

    Hi Isomorphic,

    is it correct to say, that on a VLayout calling setAlign(Alignment a) is useless? Same for HLayout and setAlign(VerticalAlignment va)?
    These docs let let me strongly assume so:

    setAlign() docs text:
    Alignment of all members in this Layout on the length axis. Defaults to "top" for vertical Layouts, and "left" for horizontal Layouts.
    Class description VLayout:
    A subclass of Layout that applies a sizing policy along the vertical axis, interpreting percent and "*" sizes as proportions of the height of the layout. VLayouts will set any members that do not have explicit widths to match the layout.
    Class description HLayout:
    A subclass of Layout that applies a sizing policy along the horizontal axis, interpreting percent and "*" sizes as proportions of the width of the layout. HLayouts will set any members that do not have explicit heights to match the layout.
    Parent Layout class description:
    Arranges a set of "member" Canvases in horizontal or vertical stacks, applying a layout policy to determine member heights and widths. A Layout manages a set of "member" Canvases provided as members. Layouts can have both "members", whose position and size are managed by the Layout, and normal Canvas children, which manage their own position and size.
    Rather than using the Layout class directly, use the HLayout, VLayout, HStack and VStack classes, which are subclasses of Layout preconfigured for horizontal or vertical stacking, with the "fill" (VLayout) or "none" (VStack) policies already set.
    Layouts and Stacks may be nested to create arbitrarily complex layouts.
    Since Layouts can be either horizontally or vertically oriented, throughout the documentation of Layout and it's subclasses, the term "length" refers to the axis of stacking, and the term "breadth" refers to the other axis. Hence, "length" means height in the context of a VLayout or VStack, but means width in the context of an HLayout or HStack.
    To show a resizer bar after (to the right or bottom of) a layout member, set showResizeBar to true on that member component (not on the HLayout or VLayout). Resizer bars override membersMargin spacing.
    Like other Canvas subclasses, Layout and Stack components may have % width and height values. To create a dynamically-resizing layout that occupies the entire page (or entire parent component), set width and height to "100%".
    Until now, when I had problems with Layouts, I used to call setAlign() quite arbitrary until I eventually got the desired design.
    If those calls are really unnecessary and have no effect, could you add warnings in the Developer Console if a HLayout or VLayout gets called with a wrong/no-op Align-Type?
    If not, could you explain where such a call makes sense?

    Thank you & Best regards
    Blama

    #2
    Using the wrong type of alignment for a layout (horizontal for a vertical layout, or vertical for a horizontal layout) is indeed useless.

    Comment


      #3
      Hi Isomorphic,

      OK, thanks. That's what I assumed.
      Could you add a warning then if one calls setAlign() with a useless parameter? I'd think that this will be very useful.

      Regarding the Layout class description: I just read Canvas.setLayoutAlign() and that's the puzzle piece missing for me IMHO.
      Could you add a reference to it and aligning on the on the breadth axis of the layout to the Layout class description?

      Best regards
      Blama

      Comment


        #4
        We have just applied your suggested change, you'll can test it on next nightly build dated April 8th

        Thanks,
        Isomorphic

        Comment


          #5
          Hi Isomorphic,

          I have been seeing the warning now for a long time.

          Thank you,
          Blama

          Comment

          Working...
          X