[Lazarus] Dynamic layout. Behavior of anchor + BorderSpacing

silvioprog silvioprog at gmail.com
Tue Nov 8 02:48:00 CET 2011


2011/11/7 Luiz Americo Pereira Camara <luizmed at oi.com.br>:
> I'm trying to do a dynamic layout using the Anchors feature of LCL
>
> The Layout consists of:
>
> - A TListView that should be aligned as alClient
> - A Button to show the details (a TPanel)
> - A TPanel containing the details
>
> Initially the TPanel should be hidden. See image_1
> Pressing the Show button should show the details panel moving the button and
> shrinking the list view See image_2
>
> To get this i did:
>
> - TListView.Align:= alClient
> - To get space to the button TListView.BorderSpacing.Bottom := 40
> - TPanel.Align := alBottom
> - TPanel.Visible := False
>
> The problem is with the button:
> - I set the button.Top anchor to match the bottom side of TListView but it
> uses the original ListView bottom side instead of the effective bottom
> (considering BorderSpacing). The result is that the button gets out of the
> screen.
>
> Is that the expected behavior (ignoring BorderSpacing to calculate anchor
> sides)?
>
> Any idea how i can get the layout without using layers of TPanel?
>
> Follows a test project
>
> Luiz

'Improvised' solution in attached.

Thx.

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
Facebook - <facebook.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LayoutDynamic2.zip
Type: application/zip
Size: 2649 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111107/d1ca5d58/attachment-0003.zip>


More information about the Lazarus mailing list