Recent

Author Topic: Resizing form failing  (Read 901 times)

backprop

  • Full Member
  • ***
  • Posts: 216
Resizing form failing
« on: February 26, 2026, 10:51:12 pm »
Can anyone explain why resizing the form failing with AV if anchors for some components are aligned right?

In this case look buttons and label components and look AV.

Lazarus 4.4 and FPC 3.2.2 on Linux

« Last Edit: February 26, 2026, 11:04:05 pm by backprop »

jamie

  • Hero Member
  • *****
  • Posts: 7651
Re: Resizing form failing
« Reply #1 on: February 26, 2026, 11:27:07 pm »
32767 I believe is the max on the Pos size and -32768 is the max on the - side.

Jamie
The only true wisdom is knowing you know nothing

backprop

  • Full Member
  • ***
  • Posts: 216
Re: Resizing form failing
« Reply #2 on: February 27, 2026, 12:13:59 am »
32767 I believe is the max on the Pos size and -32768 is the max on the - side.

Jamie

And what relevance this have with my code example which you look or just assume what is in it?
Seems a bug in the Lazarus and anchors system.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12288
  • Debugger - SynEdit - and more
    • wiki
Re: Resizing form failing
« Reply #3 on: February 27, 2026, 12:17:11 am »
Sometimes this happens if their is somewhere a circular relation.

E.g. an autosized form (or container) that has several controls in it, such as they are anchored to need always a little more space than the control currently has.

Then the container grows, the child controls moves, the container grows, .... and eventually you hit 32k and get the exception.

Without a sample to reproduce, its impossible to tell more.

backprop

  • Full Member
  • ***
  • Posts: 216
Re: Resizing form failing
« Reply #4 on: February 27, 2026, 12:26:49 am »
Upper is attached small source code project, explanation and screenshot of the AV.
The rest is on you to look and fix this. I can't be more clear.

jamie

  • Hero Member
  • *****
  • Posts: 7651
Re: Resizing form failing
« Reply #5 on: February 27, 2026, 01:10:00 am »
I see you are using some form of BGRA code from the name of the file you posted, so maybe the problem is on your end.

P.S.
 Btw, if you are using the Resize event to resize some controls well, you asked for it.

Jamie
« Last Edit: February 27, 2026, 01:12:29 am by jamie »
The only true wisdom is knowing you know nothing

backprop

  • Full Member
  • ***
  • Posts: 216
Re: Resizing form failing
« Reply #6 on: February 27, 2026, 01:35:46 am »
I see you are using some form of BGRA code from the name of the file you posted, so maybe the problem is on your end.

P.S.
 Btw, if you are using the Resize event to resize some controls well, you asked for it.

Jamie

I really do not need to read this... Do not answer if you do not look code or do not understand what is wrote.
Hope Martin_fr understood that here is problem related to set anchors and that is enough.

Locked topic.


jamie

  • Hero Member
  • *****
  • Posts: 7651
Re: Resizing form failing
« Reply #7 on: February 27, 2026, 01:49:05 am »
Well you come off like its a demand.

I loaded it on a different PC that has the BGRA controls in it.

your problem is your mistake in a math equation.

Code: Pascal  [Select][+][-]
  1. Form1.Width := res_x * +100;
  2.  
Is going to multiply RES_X by a 100, that puts out at the value you are getting since RES_X is already at 358 something.

Have a good day.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018