[win32, gtk2, qt5] TStringGrid.scrollby broken
- Lazarus/FPC Version: 2.2.6 & trunc
- Operating System: Windows 10, Linux (win32, gtk2, qt5)
- CPU / Bitness: 64
What happens
TStringGrid.scrollby does not work correctly. There seem to be several problems:
On win32 and gtk2:
- The currently visible cells get moved correctly, however the cells that are currently not visible and should get pulled into the screen are not getting drawn.
- With every scrolling event, the updated area gets smaller until nothing gets updated anymore.
- The scrollbars don't get updated.
- You can scroll beyond the limits of the grid.
On qt5:
- scrollby does nothing at all
(Note: There is also a scrollby_WS function, which behaves very similar on win32 and also doesn't render correctly. On gtk2 this function only updates the scrollbars, but not the cells, and on qt5 it is the other way around. Here it only updates the cells, but not the scrollbars.
Unfortunately I cannot find any documentation about the differences between the two functions, and how each is supposed to work. It seems to me however that both functions don't work correct on any widgetset I tried.)
What did you expect
I'm not exactly sure what scrollby is supposed to do, and if point 3 and 4 (scrolling within the limits) can be achieved differently (Beside setting LeftCol or TopRow, which is more of a workaround and doesn't allow scrolling cells partially, or give pixel exact control).
Optimally scrollby should scroll the cells correctly within the limits of the grid and update the position of any visible scrollbars.
Steps to reproduce
Run the example project. Scroll slowly in single steps. Uncomment "sg.EndUpdate(true);" to better see what's going on.
Btw, I have a stepped mouse wheel, not sure how it looks with a smooth one.
Screenshots
Before scrolling (win32 and gtk2):
After scrolling (win32 and gtk2):