Recent

Author Topic: ChildSizing and AdjustClientRect  (Read 954 times)

hennerd

  • New member
  • *
  • Posts: 7
ChildSizing and AdjustClientRect
« on: March 10, 2024, 09:54:18 am »
Using ChildSizing layout with controls that override AdjustClientRect shows that the adjusted client rectangle is not respected.

Attached:
- Screenshot with a TPanel and a extra thick bevel to demonstrate the problem.
- patch to wincontrol.inc, which uses GetAdjustedLogicalClientRect instead of LogicalClientRect in ChildSizing
- Screenshot of the same example with modified LCL
- Source of the example

But maybe there is a good reason for the current implementation and I miss something?


hennerd

  • New member
  • *
  • Posts: 7
Re: ChildSizing and AdjustClientRect
« Reply #1 on: March 11, 2024, 10:33:08 am »
Created issue https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40838
Improved patch is attached there

wp

  • Hero Member
  • *****
  • Posts: 13266
Re: ChildSizing and AdjustClientRect
« Reply #2 on: March 11, 2024, 11:07:39 am »
I don't know, looks to me as if this is intended... I can put controls into the panel so that they overlap with the bevel. Why should ChildSizing respect the bevelwidth then? And when I put   
Code: Pascal  [Select][+][-]
  1. Caption := Format('L%d, T%d, R%d, B%d', [Panel1.clientRect.Left, Panel1.Clientrect.Top, Panel1.clientRect.Right, Panel1.Clientrect.bottom]);
into the form's OnShowEvent the form's caption displays that the panel's ClientRect begins at (0/0) rather than (BevelWidth/BevelWidth)

Of course you can always set the LeftRightSpacing and TopBottomSpacing of the panel's ChildSizing accordingly to compensate for the BevelWidth.

 

TinyPortal © 2005-2018