Recent

Author Topic: How to avoid 'position range overflow' when filling a TScrollBox or TflowPanel  (Read 10872 times)

Fish

  • New Member
  • *
  • Posts: 14
Even in your button click event, your trying to create panels that top value exceeds the limits of smallint.

Yes, but that's what this thread is all about.

Quote
I appreciate this does not solve your problem, but it shows what is causing your design to fail.

Not really. What I wanted to show with this demo is that I'm able to add panels whose top values exceed the limits of smallint without any problems. I can select them, I can change their color or caption and I can even read their top values. Everything is fine, as if there is no 15 (or 16) bit limitation. Problems arise only if I want to change their position subsequently.
But, okay, seems as if I have to live with that.

Fish

  • New Member
  • *
  • Posts: 14
yes you are obviously over doing the client scrolling area..
Yes, intentionally. See above post.

Quote
The best solution and most practiced is to use a DrawGrid or in your case since you are
already miles deep into your methods of coding is to limit the actual number of panels made.

Seems to be the only way, sigh. I don't like the fact, that you quite likely won't be able to scroll up and down fast and smooth, e.g. to search or compare pictures. I'll check it out.

Quote
   its all about design.. I suppose the limit could be fixed if the issues for the reason the limit was put there in the first place are corrected.
Well the reason seems to be Windows (as always). Maybe dating back to the times where first class computer monitors showed a resolution of 640x480 and 640K ought to be enough for anybody.
I've heard the rumors that some producers will introduce so called 4k monitors within the next years. ;)

Thanks
Chris   

Josh

  • Hero Member
  • *****
  • Posts: 1274
Quote
Not really. What I wanted to show with this demo is that I'm able to add panels whose top values exceed the limits of smallint without any problems.

When I run your example using trunk, I get an error when creating panels exceeding the smallint limit. Hense why I added in the check before the panel is created.

AFAIR screen x and y ordinates of components and even the mouse on windows are stored in 4 bytes ( 2 bytes for each ordinate), which is the windows limitation.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Fish

  • New Member
  • *
  • Posts: 14
Quote
When I run your example using trunk, I get an error when creating panels exceeding the smallint limit. Hense why I added in the check before the panel is created.

I don't, as shown in the screenshots. Maybe because I'm running it on Linux (?)

jamie

  • Hero Member
  • *****
  • Posts: 6130
its possible limited to the LCL maybe, checking the SetwindowPos shows me it is using INT, which for 32
bit system should be vary large.
I do know the WM_VSCROLL is limited to a WORD and should range to 0..65535 so I don't know exactly what is
happening here much be a limit in the LCL set.

The only true wisdom is knowing you know nothing

taazz

  • Hero Member
  • *****
  • Posts: 5368
if positioning it at the bottom gives you so much trouble then do it backwards. Create the objects from last to first and set their top property to 0 or -1 before setting the align to altop that should push the rest of the frames down placing the last added frame on top. Just make sure you have the window locked for refresh before adding the frames to speed things up.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Fish

  • New Member
  • *
  • Posts: 14
If I set the align to alTop I get the overflow error whether forwards or backwards. Even the previously working example (for me under Linux) crashes if I add the alignment.

I guess we (or I) have to realize that there's no way out of this limited conditions and close this thread. I will have a look on the alternative suggestions, which may raise other problems and questions (I promise I will bother you again)

Thanks guys for all your help and contributions
Chris   

 

TinyPortal © 2005-2018