Recent

Author Topic: How does Child Sizing actually work, exactly?  (Read 3101 times)

Akira1364

  • Hero Member
  • *****
  • Posts: 539
How does Child Sizing actually work, exactly?
« on: October 04, 2015, 02:52:20 am »
Let's say I have a TForm, and then a TPanel on top of it. The TPanel is set to be the exact same height and width as the TForm, in order to fill the whole window. All my applications controls are attached to the TPanel. How do I have to set the TForm's "child sizing" settings to make the TPanel and all of its controls scale up and down automatically when the main TForm window is resized by the user? I have tried every conceivable combination of settings, and all that ever happens is the panel is either covered up when the window is downsized, or does nothing at all when the window is upsized (which of course reveals the empty gray form surface to the user.) What am I missing, exactly?

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: How does Child Sizing actually work, exactly?
« Reply #1 on: October 04, 2015, 05:47:33 am »
You should start with setting the align property of your panel to alClient.

That makes sure your panel will have the exact same size of your form's client height and client width, even when the form is being (re)sized.

Then you would have to make sure that your layout of your components on the panel either have the proper anchor set _or_ use other panels to divide your layout in a layout- scheme that fits your needs.

I don't believe (pixel)scaling is provided by default LCL components (but i would have no objection if someone can proof me wrong on that subject).

derek.john.evans

  • Guest
Re: How does Child Sizing actually work, exactly?
« Reply #2 on: October 04, 2015, 08:17:45 am »
How do I have to set the TForm's "child sizing" settings to make the TPanel and all of its controls scale up and down automatically when the main TForm window is resized by the user?

There was a proportional resizing thread here with a few solutions:

http://forum.lazarus.freepascal.org/index.php/topic,27402.0.html

« Last Edit: October 04, 2015, 08:20:07 am by Geepster »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8114
  • Programming + Glam Metal + Tae Kwon Do = Me