Automatic scrollbars in TCustomGrid not always correctly invalidated when hidden
Original Reporter info from Mantis: cobines
-
Reporter name:
Original Reporter info from Mantis: cobines
- Reporter name:
Description:
When scrollbars are set to show automatically they are not correctly cleared when they are hidden. See attached pictures. First is the at start of application, second after adding some items so that horizontal scrollbar is displayed, third is when those items are removed and scrollbar is hidden, but not redrawn correctly.
I attached this example application. Reproduce with:
- Start application
- Check "More items" box.
- Uncheck "More items" box.
This happens for horizontal and for vertical scrollbar, but I'll describe more using horizontal scrollbar as reference. It seems to happen only with ssAutoBoth and only because horizontal scrollbar is shown because of vertical scrollbar. I tried adding/removing items both horizontally and vertically at the same time, but then the scrollbars are redrawn correctly. So I think it happens only when one scrollbar is shown/hidden in response to the other scrollbar being shown/hidden (and not because the cells themselves won't fit). In the example app the width of the grid without vertical scrollbar is just enough so that horizontal scrollbar doesn't need to be shown, so maybe this is also the cause why it is not cleared.
I tested with TDrawGrid and TStringGrid. Tried on Linux/GTK2 and Linux/QT4 and Win32. On Win32 you might have to check "Double buffering" box to see this, because after scrollbar is hidden it is still completely visible, but it is a "ghost" control (only picture).
Lazarus SVN 22174