Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-03

Align/Anchor to widest label

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Torsten Bonde Christiansen

Hi.

Please look at the picture below:

Is it possible by using align, anchor, or some third option, to always make the two edits and the drop-down box align with the widest of the three labels.

Since these labels will be translated to many languages I cannot assume that the 2nd labels is the widest, hence anchoring the filename edit to that label, and the drop-down and directory edit to the filename edit, will make the controls overlap eachother.

Regards,
Torsten Bonde Christiansen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150325/a71a750f/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: cjhhccii.png
Type: image/png
Size: 10935 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150325/a71a750f/attachment-0001.png>

Reply by email

Henry Vermaak
to Torsten Bonde Christiansen
Torsten Bonde Christiansen wrote 8 lines
Is it possible by using align, anchor, or some third option, to always make the two edits and the drop-down box align with the widest of the three labels. Since these labels will be translated to many languages I cannot assume that the 2nd labels is the widest, hence anchoring the filename edit to that label, and the drop-down and directory edit to the filename edit, will make the controls overlap eachother.

This has been quite a big problem for me, too. The only solution I've found is to use a container, like a frame or a panel, that has the ChildSizing property. Then you can set the ChildSizing.ControlsPerLine to 2 and the container will take care of making sure that everything is aligned, as long as you add the controls in the correct order, which will depend on the ChildSizing.Layout setting.

The pain comes when you need to change the controls, because the child sizing works on the order that the controls are added to the container. For this reason I usually do this in code.

Henry

Reply by email

Kiên Nguyễn Tiến Trung
to Henry Vermaak

I prefer setting property Align to alTop. Although it is not so nice, it brings me a huge advantage. There is no need to set anchors, so it will be easy while adding/removing components. As a result, designing time will be reduce considerably. Additionally, you will no longer need to be worry about the appearance in different linguistic.

It will look like this (http://i.imgur.com/vEhYjP4.png):

2015-03-25 17:20 GMT+07:00 Henry Vermaak :

Show quoted text 29 lines
On Wed, Mar 25, 2015 at 10:52:01AM +0100, Torsten Bonde Christiansen wrote: > Is it possible by using align, anchor, or some third option, to > always make the two edits and the drop-down box align with the > widest of the three labels. > > Since these labels will be translated to many languages I cannot > assume that the 2nd labels is the widest, hence anchoring the > filename edit to that label, and the drop-down and directory edit to > the filename edit, will make the controls overlap eachother. This has been quite a big problem for me, too. The only solution I've found is to use a container, like a frame or a panel, that has the ChildSizing property. Then you can set the ChildSizing.ControlsPerLine to 2 and the container will take care of making sure that everything is aligned, as long as you add the controls in the correct order, which will depend on the ChildSizing.Layout setting. The pain comes when you need to change the controls, because the child sizing works on the order that the controls are added to the container. For this reason I usually do this in code. Henry -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150325/3f569d30/attachment.html>

Reply by email

Torsten Bonde Christiansen
to Kiên Nguyễn Tiến Trung

I would prefer that too, but unfortunately that is not my decision to make... :(

I was thinking about making an "invisible" bevel inbetween the edits/dropdown and labels, then anchor the edits/dropdown to the bevel and use code to calculate the place for the bevel.

-Torsten.

Ki?n Nguy?n Ti?n Trung wrote 56 lines
I prefer setting property Align to alTop. Although it is not so nice, it brings me a huge advantage. There is no need to set anchors, so it will be easy while adding/removing components. As a result, designing time will be reduce considerably. Additionally, you will no longer need to be worry about the appearance in different linguistic. It will look like this (http://i.imgur.com/vEhYjP4.png): 2015-03-25 17:20 GMT+07:00 Henry Vermaak < <mailto:>>: On Wed, Mar 25, 2015 at 10:52:01AM +0100, Torsten Bonde Christiansen wrote: > Is it possible by using align, anchor, or some third option, to > always make the two edits and the drop-down box align with the > widest of the three labels. > > Since these labels will be translated to many languages I cannot > assume that the 2nd labels is the widest, hence anchoring the > filename edit to that label, and the drop-down and directory edit to > the filename edit, will make the controls overlap eachother. This has been quite a big problem for me, too. The only solution I've found is to use a container, like a frame or a panel, that has the ChildSizing property. Then you can set the ChildSizing.ControlsPerLine to 2 and the container will take care of making sure that everything is aligned, as long as you add the controls in the correct order, which will depend on the ChildSizing.Layout setting. The pain comes when you need to change the controls, because the child sizing works on the order that the controls are added to the container. For this reason I usually do this in code. Henry -- _______________________________________________ Lazarus mailing list <mailto:> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150325/f4cfe1c5/attachment.html>

Reply by email