[Lazarus] Align property confusion

Дмитрий Курашкин dkurashkin at gmail.com
Mon Oct 4 14:44:08 CEST 2010


You need following:
1. Drop additional panel (P3) on Form
2. Make its border invisible and Aligh = alLeft
3. Drop P2 on P3 and make P2.Aligh = alBottom
4. Drop P1 on Form and make P1.Aligh = alRight

As I know, it is the only way...

2010/10/4 Graeme Geldenhuys <graemeg.lists at gmail.com>

> Hi,
>
> I came across something unexpected today. I was under the impression
> that the order in which you set the Align property, that's the order
> in which the components align themselves with the parent and
> neighbouring components.
>
> In this example, I have a Form with two Panels (P1 & P2).
> Order in which I did things:
> * Create new Form
> * Drop panel P1 on the Form
> * Set P1.Align := alRight
> * Drop panel P2 on the Form
> * Set P2.Align := alBottom.
>
> What I expected was Figure 1, where P1 is the full height of the form
> and P2 is the Width of the Form minus P1.Width. But instead I got
> Figure 2. I tried this in both Delphi 7 and Lazarus. It seems the
> alignment order is irrelevant to the component creation order or
> irrelevant to what order you set the Align properties. If fact,
> alignment is always process in the following hard-coded order: Top,
> Bottom, Left, Right, Client...
>
> As I said, for some reason I was under the impression (even from
> delphi days) that the order in which you activate the Align
> properties, that's the order in which the alignment is applied. So
> what must I do to get Figure 1? Use Anchor's instead of Align
> properties?
>
>
> [... you need a mono font to see ascii art...]
>
> Figure 1:
> +-------------+-------+
> |             |       |
> |             |       |
> |  client     |  P1   |
> |             |       |
> |             |       |
> |             |       |
> +-------------+       |
> |    P2       |       |
> +-------------+-------+
>
>
> Figure 2:
> +-------------+-------+
> |             |       |
> |             |       |
> |  client     |  P1   |
> |             |       |
> |             |       |
> |             |       |
> +-------------+-------+
> |    P2               |
> +---------------------+
>
>
>
>
> --
> Regards,
>   - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net:8080/fpgui/
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20101004/121ae834/attachment-0004.html>


More information about the Lazarus mailing list