PageSize of TScrollBar leads to wrong visual position (Win32)
Original Reporter info from Mantis: warrence
-
Reporter name: Stefan Müller
Original Reporter info from Mantis: warrence
- Reporter name: Stefan Müller
Description:
When PageSize is different from 0, the block reaches the right end of the TScrollBar before Position=Max. I appended an example where Min=1, Max=10 and PageSize=5, the Label indicates the current Position.
It seems that the block is at the right end when Position=Max-PageSize, and not when Position=Max. In addition: the right button is already grayed out when Position=Max-PageSize, but it is still clickable. The maximum position when dragging the block is Max-PageSize, too.
Additional information:
There was the same problem with GTK2 widgetset (#16001 (closed)), which is already fixed.
I already made a patch that almost fixes this under Win32. With this patch the thumb has the correct size and leftmost and rightmost position are correct. The problem is that there is still something wrong: When a scrollbar has the focus, it blinks (that's just normal) and the "blinking animation" has the wrong size, as if PageSize is still considered as 0.
This maybe caused by a bug in TCustomScrollBar.SetParams: HandleAllocated is never true, because the Handle is created inside the "if HandleAllocated then"-block. If I remove
if HandleAllocated then
from this method it works under Win32, too. I'm not sure if the removal of this line is a good idea, as I am lacking knowledge about these mechanisms.
Mantis conversion info:
- Mantis ID: 16107
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.31 (SVN)
- Monitored by: » Vladimir (Vladimir Zhirov)
- Target version: 0.99.0