Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Ideas on aligning controls with layout
Wed, May 6 2015 5:48 PMPermanent Link

Raul

Team Elevate Team Elevate

Hello,

I'm experimenting with the layout and like it a lot.

One question i have is how does one align the controls : for example get
TLabel and TEdit to be aligned based on vertical centre when using layout.

I've been using Margins->Top for the TLabel to do the align but wanted
to check if anybody has a better solution ? (i.e. that i'm just missing
the "Auto align control vertical centers" setting).

The downside with the top margin is that i have to figure out the actual
margin if i change the font (and i'd prefer not to have to compute it
runtime in code based on control heights).

Raul
Thu, May 7 2015 3:17 AMPermanent Link

Uli Becker

Raul,

> One question i have is how does one align the controls : for example get
> TLabel and TEdit to be aligned based on vertical centre when using layout.

Do you mean a number of controls aligned all vertically or just one
label and one edit?

Attached a sample - maybe that helps.

Another idea would be use a centered panel with the controls aligned
from top to bottom. The only thing to compute on runtime would be the
size of the panel when changing the font size.

Attached another sample for that - the only problem here is the
different height of TLabel and TEdit controls, thus setting fix top and
bottom margins for the labels is not ok for all font sizes.

Uli



Attachments: Test Align.zip Test Centered Panel.zip
Thu, May 7 2015 4:07 AMPermanent Link

Matthew Jones

Raul wrote:

> One question i have is how does one align the controls : for example
> get TLabel and TEdit to be aligned based on vertical centre when
> using layout.

Strikes me that this is something to be done in the interface design.
Have the label default to the text align of the edit box and it is just
automatic.
Thu, May 7 2015 5:35 AMPermanent Link

Uli Becker

Matthew,

> Strikes me that this is something to be done in the interface design.
> Have the label default to the text align of the edit box and it is just
> automatic.

After reading your post, I realized that I completely misunderstood
Raul's question. Never mind, Raul.

Uli
Thu, May 7 2015 6:01 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Raul,

<< One question i have is how does one align the controls : for example get
TLabel and TEdit to be aligned based on vertical centre when using layout.
>>

What you really need is a combo TLabel/TEdit control that does this
alignment for you.  In this particular case you really need a container, and
such a control would automatically provide one.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, May 7 2015 11:52 AMPermanent Link

Raul

Team Elevate Team Elevate

On 5/7/2015 6:01 AM, Tim Young [Elevate Software] wrote:
> What you really need is a combo TLabel/TEdit control that does this
> alignment for you.  In this particular case you really need a container,
> and such a control would automatically provide one.

Thanks - i will give this a try and see what i can come up with up (it
looks straightforward enough on surface for somebody who has not
progressed past ideas stage yet in EWB component development to do)

Raul


Image