Results 1 to 9 of 9

Thread: Layout Architecture

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jan 2010
    Vote Rating

    Default Answered: Layout Architecture

    This is a slightly theorectical question. Our original goal was to make the entire application resizable. To do this we had a Viewport at the hightest level and inside of it were a group of BorderLayoutContainers, VerticalLayoutContainers, and HorizontalLayoutContainers (basically we were trying to do top down structuring).

    The problem is that we're discovering things don't look good when they get really small. So my new task is to make everything still resizable BUT have a minimum size below which things can not shrink and scrollbars would be created like a tradition web page viewed on a monitor with poor resolution. I've spent some time trying to think of ways to do this but they've all been pretty complicated and essentially variations on the theme "draw the page, measure each component and if its pixel size is too small, force it to redraw bigger." I'm thinking I'd probably stick the minimum size on the panels rather than the widgets but I'm unclear if this is the right design pattern.

    It feels like I'm trying to mix top down and bottom up layout styles which makes me wonder if I'm going down the wrong path.

    I'm hoping that there's a simple solution which I'm just overlooking. If anyone else whose dealt with this issue before could tell me how they solved the problem I'd greatly appreciate it.

  2. I THINK the remaing problem is that since BorderLayout asks its parent how big it is allowed to be and FlowLayoutContainer asks its children how big they need to be, neither one is actually telling anyone how big the page is.
    This is probably a problem. Technically, BorderLC doesn't ask its parent, but it expects its parent to *tell* it, and FlowLC doesn't tell its children anything.

    Instead of FlowLC, consider something like making a SimpleContainer subclass like MinSizeContainer, and override doLayout() to check the current size before passing something down to the children.

    In any case, only a parent with the css property 'overflow' set to 'auto' or 'scroll' is able to show a scrollbar. This property should be set on either the FlowLC or the hypothetical MinSizeContainer. This could either be toggled from 'visible' to 'scroll' when the browser window gets too small, or could be left on 'auto', only drawing a scrollbar when the child is bigger than there is space.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts