[Lazarus] Anchoring problem with ScrollBox and Panels

Michael W. Vogel m-w-vogel at gmx.de
Wed Jun 7 08:37:10 CEST 2017


Am 07.06.2017 um 07:45 schrieb Gabor Boros via Lazarus:
> I understand you(r description) except one thing. "Panel2 is also 
> resized (because its Bottom is anchored)" Why you think Panel2 is 
> resized? When height of Panel3 increased and the vertical scrollbox 
> showed up, height of scrollbox not changed nor top of Panel3.

You can set a DebugLn in control.inc:

procedure TControl.SetBoundsKeepBase(aLeft, aTop, aWidth, aHeight: integer);
begin
   DebugLn('TControl.SetBoundsKeepBase ', Name, ' ', DbgS(Height));
   ChangeBounds(aLeft, aTop, aWidth, aHeight, true);
end;

You will see, the resizing problem comes from Panel2.


> Attached two pictures. One before resized Panel3 and one after 
> (pressed Continue on the loop error message). You see top, bottom and 
> height of Panel1 and Panel2 is same as before.
>
> So top, bottom, height of Panel1, Panel2 and ScrollBox1 not changed. 
> Why got the loop error? Only height of Panel3 changed. Width of 
> Panel1,2,3 changed, okay but why this block the work of vertical 
> anchoring?

No, Panel2 height is changed to a invalid value, as sayed before. Panel2 
is just not visible updatet, as the height get a invalid value.

To demonstrate what happen take the added example or create a new app, 
put a panel on it and anchor Left, Top, Right to the form sides and 
anchor Bottom to nil. Start the app and change the bounds of it.

Michl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.zip
Type: application/x-zip-compressed
Size: 1759 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170607/26b1b987/attachment.bin>


More information about the Lazarus mailing list