TScrollbox bug? lazarus / 31-LCL ---------------------------------------------------------------------- kpeters58 · 2014-10-08 03:00 Looks like a bug to me - could not find a workaround.... Anybody with an idea out there? Reproduce like so: 1) Create a new GUI application 2) Drop a TScrollbox on form and set its width to 200 3) Set scrollbox's  HorzScrollbar.Range := 300 so that horizontal scrollbar appears 3) Drop a panel on scrollbox and align it to top 4) Scroll to the right notice that panel is not as wide as the scrollbar range (which is what I would expect since it's aligned to top) ---------------------------------------------------------------------- riad02 · 2014-10-08 06:12 Panel1.Align := alLeft; replace the corresponding width you like. panel1 such as a container for other components. ---------------------------------------------------------------------- kpeters58 · 2014-10-08 15:51 Thanks - though your solution doesn't really work well for me as my app may have dozens/hundreds of panels on the scrollbox and I use the top alignment to maintain their display order. Reported as bug since all Delphi versions I have access to are doing this properly: http://bugs.freepascal.org/view.php?id=26834 ---------------------------------------------------------------------- riad02 · 2014-10-09 08:30 Yaps,, good luck. ---------------------------------------------------------------------- User137 · 2014-10-09 09:03 It works for me at least. ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-09 15:49 I can see from User137's signature that he's using Trunk (excellent, thanks for that info), but @kpeters58, I've no idea which version of Lazarus you're using.  (Well, I see from the Bug Report that you're using 1.2.4, but it would have been nice to not go digging for that information) Can you please try this again using Lazarus Trunk, see if it's solved there for you as well?  If you need help getting Trunk, the best advice I can give you is fpcup :-) http://wiki.lazarus.freepascal.org/fpcup https://bitbucket.org/reiniero/fpcup Out of the box with no reconfiguration it will download and install trunk for you. ---------------------------------------------------------------------- kpeters58 · 2014-10-09 18:21 Thanks for pointing out fpcup - worked like a charm. Contrary to User137, it's still broken there as well... ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-09 18:44 Many thanks for testing, and welcome to the world of Trunk :-)   You can re-run fpcup whenever you like, and you'll get all the latest updates.  Things occasionally break, just try re-running fpcup after an hour or two.  (Breakages are usually caught *very* quickly :-) ) Right, onto this issue.   I've now tested on Laz Trunk as well, and I can confirm. Oddly enough, at design time, the panel is correctly assigned a width of 300, which I guess is what I'd expect to see given the scrollbar range is 300.  At runtime, that panel also *appears* to have a width of 300, so I don't think that's going wrong.  What I *suspect* is happening is that the scrollbar range is increasing beyond 300 at runtime.  Lot's of guesswork there :-) I'm also intrigued as to why it worked for User137, and not for us?  Doncha hate bugs that refuse to play consistently? I've never worked with a Scrollbox with child controls set to align:=alTop/Bottom etc before.  I'll have a small play - see if I can make sense of what's going on :-) (UPDATE, hope you don't mind, but I've just deleted the Lazarus About image you uploaded to Mantis - just reducing file storage, and it didn't really add anything to the report that wasn't covered in the comments) (UPATE2:  User137 isn't incorrect as his screenshots show.   I just need to find why it works for some people, and not others.  @User137: Many thanks for that info, don't suppose you've got any idea why it worked for you?  I can't help notice that your Scrollbar thumbgrip is correctly sized, mine is the same size as @kpeters58) ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-09 20:08 I've added a test project to the issue in Mantis @User137 - could I ask a favour?  Could you please run the test project and see if you get the reported issue, or if the test project works for you?  Many thanks. I've confirmed this works as expected under GTK2, but QT & Win32 experience the same issue. ---------------------------------------------------------------------- User137 · 2014-10-10 08:37 Quote from: Mike.Cornflake on October 09, 2014, 10:08:42 pm@User137 - could I ask a favour?  Could you please run the test project and see if you get the reported issue, or if the test project works for you?  Many thanks.Tried this one http://bugs.freepascal.org/file_download.php?file_id=20824&type=bug and it's not aligning to top for some reason. I noticed that you had set Anchors.akRight:=true, but even setting it back to default didn't fix it. Code: [Select]Panel1.Width=300 (FormShow) Scrollbox1.HorzScrollbar.Range=300 (FormShow) Scrollbox1.HorzScrollBar.ClientSize=230 (FormShow) Scrollbox1.ClientWidth=196 (FormShow) Lazarus says i have SVN 42707M, and FPC 2.7.1 version i don't know. I haven't linked the sources to repositories after reinstalling whole Win7 some months ago, so it might not be too simple task updating to latest. And something can always break in that so i tend to only very rarely update, besides all things are working well anyway. Update: I recreate the scrollbar and panel, and it seems to work? Try with the modified LFM file. ---------------------------------------------------------------------- User137 · 2014-10-10 10:18 I updated to the "cutting edge" latest FPC and Lazarus and it's still not showing me the bug you mention, IF i recreate both scrollbox and panel. Difference with the new Lazarus is that it leaves empty space equal to vertical scrollbar to the right, even though it's hidden. ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-10 10:53 Quote from: User137 on October 10, 2014, 12:18:26 pmI updated to the "cutting edge" latest FPC and Lazarus and it's still not showing me the bug you mention, IF i recreate both scrollbox and panel. Difference with the new Lazarus is that it leaves empty space equal to vertical scrollbar to the right, even though it's hidden. Many thanks for all this information.  I appreciate you taking the time, and thanks for the lfm as well.   Well, I know what I'm doing this weekend :-)