Sign in Join

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

Mailing lists / lazarus / 2010-07

Disabling DoAllAutoSize in wincontrol.inc?

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Tobias Giesen

Hello,

DoAllAutoSize is causing problems with some of my controls. It either hangs in infinite loops or raises exceptions. Can I disable it? My controls worked fine with older LCL versions so I just want to work it like it used to.

Cheers,
Tobias

Reply by email

Mattias Gaertner
to Tobias Giesen
Hello, DoAllAutoSize is causing problems with some of my controls. It either hangs in infinite loops or raises exceptions. Can I disable it?

You can only delay it.
It is responsible for creating handles, layouting and turning handles visible in the right order.
I started a list how other users created endless loops with the new autosizing:
http://wiki.lazarus.freepascal.org/Autosize_/_Layout#I_get_an_infinite_loop_.2F_How_to_debug_autosizing.3F

If you get an exception, then you are doing something wrong.

My controls worked fine with older LCL versions so I just want to work it like it used to.

Keep in mind, that the old autosize code had to work with buggy widgetsets and therefore had to silently ignore some errors. Since these bugs were fixed the new autosize can now raise an exception when it spots an inconsistency or an endless loop.

Mattias

Reply by email

waldo kitty
to Mattias Gaertner
Mattias Gaertner wrote
Keep in mind, that the old autosize code had to work with buggy widgetsets and therefore had to silently ignore some errors. Since these bugs were fixed the new autosize can now raise an exception when it spots an inconsistency or an endless loop.

how many times thru the loop before the exception is raised? or does it count travels thru the loop to determine an endless loop?

Reply by email

Mattias Gaertner
to waldo kitty
Show quoted text 8 lines
On 7/19/2010 17:54, Mattias Gaertner wrote: > Keep in mind, that the old autosize code had to work with buggy > widgetsets and therefore had to silently ignore some errors. Since > these bugs were fixed the new autosize can now raise an exception when > it spots an inconsistency or an endless loop. how many times thru the loop before the exception is raised? or does it count travels thru the loop to determine an endless loop?

TWinControl.AlignControls and TAnchorSide.GetSidePosition stop after ControlCount number of runs.
DoAllAutoSize did not stop. I added a counter. The LCL now raises an exception.

Tobias, please test.

Mattias

Reply by email

Tobias Giesen
to Mattias Gaertner
Show quoted text 6 lines
TWinControl.AlignControls and TAnchorSide.GetSidePosition stop after ControlCount number of runs. DoAllAutoSize did not stop. I added a counter. The LCL now raises an exception. Tobias, please test.

OK, thanks! Should it be in the next daily snapshot?

Cheers,
Tobias

Reply by email

Mattias Gaertner
to Tobias Giesen
Show quoted text 8 lines
> TWinControl.AlignControls and TAnchorSide.GetSidePosition stop after > ControlCount number of runs. > DoAllAutoSize did not stop. I added a counter. The LCL now raises an > exception. > > Tobias, please test. OK, thanks! Should it be in the next daily snapshot?

I guess yes.

If you test under OS X carbon: there are still some bugs in the sizing and size computation. So maybe it is not your code and not the DoAllAutoSize, but simply one of those.

Mattias

Reply by email