Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread Daft flow request
Fri, Sep 25 2015 11:29 AMPermanent Link

Matthew Jones

Okay, EWB 2 has a new "responsive" layout mechanism, and it is simply
lovely. However, there is one small little minor tweak which would be
really lovely to have. Umm, centering a row.

What I mean is, imagine you have simple TBasicPanels, and they are set
to top right and consume right. Put them on a TScrollPanel with
vertical scroll bars. Overflow set to bottom. You get a lovely bunch of
panels in a nice responsive mode. However, they are all bunched up
top-right, and there is lots of space to the right. It would be soooooo
good if the rows could be centred so that the "empty space" is divided
between left and right, thus giving a best-fit column in the middle.

Now, this seems like it would be hard to do given the current layout
options, so I'm not expecting a miracle, only asking for a wish-list.
Me, I think it might come down to an option in the parent, and perhaps
only certain components like TScrollPanel. Or, it is already there and
I haven't work out the incantation to make it so.

Thoughts?

--

Matthew Jones
Fri, Sep 25 2015 12:28 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< What I mean is, imagine you have simple TBasicPanels, and they are set to top right and consume right. >>

Do you mean "set to top *left*" and consume right ?  I can't think of why you would want to set them to top right *and* consume space to the right.  Normally you will consume space in the *opposite* direction of the positioning.

Tim Young
Elevate Software
www.elevatesoft.com
Sat, Sep 26 2015 11:06 AMPermanent Link

Matthew Jones


> Do you mean "set to top *left*" and consume right ?  I can't think of why
> you would want to set them to top right *and* consume space to the right.
>  Normally you will consume space in the *opposite* direction of the positioning.
>

Yes indeed. Top left, consume right.

--
Matthew Jones
Mon, Sep 28 2015 10:04 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Yes indeed. Top left, consume right.  >>

So, you *did* have everything set to Top-Left, Consume Right ?

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Sep 28 2015 10:07 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

And, if so, then yes, you can make it work, but it involves some calculations on your end in response to sizing events.  Essentially you'll need to set the designated "middle" control's minimum constraint to the size that you want, and that will do the trick.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Sep 28 2015 11:21 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> And, if so, then yes, you can make it work, but it involves some
> calculations on your end in response to sizing events.  Essentially
> you'll need to set the designated "middle" control's minimum
> constraint to the size that you want, and that will do the trick.

Okay, that will do nicely. I can fiddle the Padding sensibly - the
constraints don't seem to do anything but the parent component is
stretching automatically so that probably stops it. Padding is enough...

--

Matthew Jones
Tue, Sep 29 2015 7:39 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

> I can fiddle the Padding sensibly

And indeed it works very well.

--

Matthew Jones
Tue, Sep 29 2015 12:00 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Okay, that will do nicely. I can fiddle the Padding sensibly - the constraints don't seem to do anything but the parent component is stretching automatically so that probably stops it. Padding is enough... >>

Did you use a min, max, or both constraint ?

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Sep 30 2015 4:02 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> Did you use a min, max, or both constraint ?

None of the above. Just surely left padding to shift it a bit:


procedure TfrmShop.pnlProductListSize(Sender: TObject);
var
   nPadding : Integer;
   nHowManyTimes : Integer;
begin                 
   nHowManyTimes := (pnlProductList.Width div pnlProductMaster.Width);
   if nHowManyTimes < 1 then
   begin
       nPadding := 0;
   end
   else
   begin
       nPadding := ((pnlProductList.Width - (nHowManyTimes *
pnlProductMaster.Width)) div 2) - 1;
       if nPadding < 0 then
           nPadding := 0;
   end;
                       

//frmWelcome.Report('Padding w=' + IntToStr(pnlProductList.Width) + '
h=' + IntToStr(nHowManyTimes) + ' p=' + IntToStr(nPadding));

   pnlProductList.Client.Padding.Left := nPadding;
end;

--

Matthew Jones
Wed, Sep 30 2015 10:52 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< None of the above. Just surely left padding to shift it a bit: >>

Yes, I got that part. Smile

I meant this part:

"the constraints don't seem to do anything but the parent component is stretching automatically so that probably stops it"

Tim Young
Elevate Software
www.elevatesoft.com
Image