Sign in Join

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

Mailing lists / lazarus / 2015-01

GUI design: fixed height panel at bottom

8 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Marc Santhoff

Hi,

as the subject line says, I want to have a panel attached to the bottom and the sides of a form, which is pretty easy to to using the anchor editor.

What I can't do is make this panel fixed height. Setting it's propety height in OnREsize of the form doesn't work, I think the other anchors reset the height according to their rules.

The panel will hold some components visible in any case, while the rest of the for above (in another panel) will show a set of varying components depending on context.

How can this be made?

-----------------------------------------
| |
| |
| |
| height varying when form resized |
| |
| |
| |
|---------------------------------------|
| |
| height fixed |
| |
-----------------------------------------

Marc Santhoff

Reply by email

Dmitry Boyarintsev
to Marc Santhoff

The bottom panel should have alignment alBottom. The top panel shoud have alClient

Thanks,
Dmitry

Marc Santhoff wrote 40 lines
Hi, as the subject line says, I want to have a panel attached to the bottom and the sides of a form, which is pretty easy to to using the anchor editor. What I can't do is make this panel fixed height. Setting it's propety height in OnREsize of the form doesn't work, I think the other anchors reset the height according to their rules. The panel will hold some components visible in any case, while the rest of the for above (in another panel) will show a set of varying components depending on context. How can this be made? ----------------------------------------- | | | | | | | height varying when form resized | | | | | | | |---------------------------------------| | | | height fixed | | | ----------------------------------------- -- Marc Santhoff < <javascript:;>> -- _______________________________________________ Lazarus mailing list <javascript:;> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

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

Reply by email

Marc Santhoff
to Dmitry Boyarintsev
Dmitry Boyarintsev wrote
The bottom panel should have alignment alBottom. The top panel shoud have alClient

In principle that approch is working, but seemingly using the align property and anchors together produces unexpected results - at least for me.

Are those two designed to work together?
Currently I observe them as one or the other.

Marc Santhoff

Reply by email

Dmitry Boyarintsev
to Marc Santhoff
Marc Santhoff wrote
In principle that approch is working, but seemingly using the align property and anchors together produces unexpected results - at least for me.

In this simple design you don't need to use does it for you. If you need a margin from the sides of the form you can use border property of each panel.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150107/b58d80d0/attachment.html>

Reply by email

Marc Santhoff
to Dmitry Boyarintsev
Dmitry Boyarintsev wrote 11 lines
On Wed, Jan 7, 2015 at 11:45 PM, Marc Santhoff wrote: > In principle that approch is working, but seemingly using the align > property and anchors together produces unexpected results - at least for > me. > In this simple design you don't need to use anchors at all. Alignment does it for you. If you need a margin from the sides of the form you can use border property of each panel.

Well, the question only touches a small detail of a bigger gui. But Thinking about your answer I learned to use align'ment for simple relations of only two components in one container and use anchors only at inner levels where more complex relations between three or more components have to fit in one container (TPanel). Sounds useful and more simple, I'll go that way.

Thanks!

Marc Santhoff

Reply by email

Andreas Schneider
to Marc Santhoff: as the subject line says, I want to have a panel attached to the bottom and the sides of…
Marc Santhoff wrote
What I can't do is make this panel fixed height. Setting it's propety height in OnREsize of the form doesn't work, I think the other anchors reset the height according to their rules.

Sounds like you set the anchors wrong.
What you described should work with the following anchors:

Large panel:
Top- Left- and Right-Anchor: Form
Bottom-Anchor: Fixed panel

Fixed panel:
Botom-, Left- and Right-Anchor: Form
Top-Anchor: NULL!!

That way, the bottom/fixed panel should always keep its height.

Best regards,
Andreas

Reply by email

Mattias Gaertner
to Marc Santhoff: as the subject line says, I want to have a panel attached to the bottom and the sides of…
[...] What I can't do is make this panel fixed height.

You can use Constraints.Min/MaxHeight.

Show quoted text 13 lines
----------------------------------------- | | | | | | | height varying when form resized | | | | | | | |---------------------------------------| | | | height fixed | | | -----------------------------------------

This simple case is best served using Align as Dmitry explained.

Mattias

Reply by email

Mattias Gaertner
to Marc Santhoff: In principle that approch is working, but seemingly using the align property and anchors…
Show quoted text 9 lines
On Mi, 2015-01-07 at 23:32 -0500, Dmitry Boyarintsev wrote: > The bottom panel should have alignment alBottom. The top panel shoud have > alClient In principle that approch is working, but seemingly using the align property and anchors together produces unexpected results - at least for me. Are those two designed to work together?

Yes, but Align comes first. For example alClient will not overlap with alBottom, but it will overlap controls with alNone. You can align for instance one control alLeft and anchor its right side to a control.

Mattias

Reply by email