Guest
|
Posted: Fri Jun 16, 2006 11:59 pm Post subject: TScrollBar.SetPageSize bug |
|
|
I'm posting from Google because I can never get the other method(s) to
work, and I guess I don't care if not everyone can see this. I also
can't get the normal bug reporting methods to work, and don't really
care enough anyway. However, I do care about other people who may be
dealing with this same bug, so here goes:
In stdctrls.pas, inside of function:
procedure TScrollBar.SetPageSize(Value: Integer);
With BCB6, there is this line:
if (FPageSize = Value) or (Value > FMax) then exit;
Which should actually be:
if (FPageSize = Value) or (Value > (FMax - FMin)+1) then exit;
The check that Borland has only works if Min is set to 1. The default
for Min is 0, so even if you just take the defaults, Borland's check
doesn't work correctly.
If Min=0, and Max=100 (the defaults), you should be able to set
PageSize to 101 (to show that the entire scroll area is visible).
Of course if you change Min to something like -100, or 50, or whatever
else, the problem is even worse.
For me, the easiest work-around was to just set Min to 1, for any
scrollbars where I need to set PageSize this way. Too bad I already
had a bunch of code written before I found the bug, so now I have to go
rework things a bit to use the 1 based offset instead of 0. |
|