Lazarus

Programming => LCL => Topic started by: lainz on May 09, 2018, 04:50:32 pm

Title: Size / Position overflow in SendMoveSizeMessages
Post by: lainz on May 09, 2018, 04:50:32 pm
Hi, I get this error message sometimes, I have a lot of panels and labels, on this application:
https://github.com/Arandusoft/fpcpaymowidget

Each panel has AutoSize property, and these are shown / hidden and sized, depending on user interaction.

The attached screenshot is from yesterday I think.

Today I get this:
"position range in send move sizes message"

But I can't take screenshot, since app closed, so is what I remember, not the exact error.
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: Blaazen on May 09, 2018, 05:42:38 pm
Seems to some bug in autosizing routine. Those messages, like WMSize, have parameters Word, so anything >65535 is range overflow.
You need to debug it using Call Stack window.
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: lainz on May 09, 2018, 05:49:03 pm
So my panel can't be that big?
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: Blaazen on May 09, 2018, 05:56:22 pm
Just put panel on the form and try to set its height. I got: TWinControl.SetBounds (Panel1:TPanel): Height 65536 not allowed.
But Lazarus limits it more than just high(Word), max height I can set is 9999.
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: lainz on May 09, 2018, 05:59:28 pm
Ok, well, seems that I need to redesign the containers, maybe using a TScrollBox instead.
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: lainz on May 09, 2018, 06:26:15 pm
I put a single button on a TScrollBox and the max top position can be 32767, 1 more and I get the error of position range overflow. Regular form has also the same number.

So, what I need to do, is creating a virtual scroll, or using an already made one. Anyone knows about a virtual scroll component? ( I will try to google of course, but I ask if someone has already the knowledge here ).
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: Blaazen on May 09, 2018, 06:32:15 pm
This seems to be limitation of button (or any control in general) rather than srollbox.
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: lainz on May 09, 2018, 06:36:58 pm
This seems to be limitation of button (or any control in general) rather than srollbox.

Yes, I have no problem with that, If I can for example:
- Load only a panel at a time, and when user scrolls then load the other panel, but also remove the first one... then the max top property will never be reached.

The problem is that I also have a search tool that filters the controls, not the data..
Title: Re: Size / Position overflow in SendMoveSizeMessages
Post by: HeavyUser on May 10, 2018, 01:24:48 am
So, what I need to do, is creating a virtual scroll, or using an already made one. Anyone knows about a virtual scroll component? ( I will try to google of course, but I ask if someone has already the knowledge here ).
I have my doubts that it will help but here is one for delphi http://www.simdesign.nl/virtualscrollbox.html
TinyPortal © 2005-2018