LCL, limit position of scrollbar in dbgrid on new records (fix gtk2 scrollbar issues on some themes)

git-svn-id: trunk@21580 -
This commit is contained in:
jesus 2009-09-04 19:08:38 +00:00
parent c1afea1846
commit 1ecbf0622e

View File

@ -38,7 +38,7 @@ unit DBGrids;
interface interface
uses uses
Classes, SysUtils, FileUtil, DB, Classes, SysUtils, Math, FileUtil, DB,
LCLStrConsts, LCLIntf, LCLProc, LCLType, LMessages, LResources, LCLStrConsts, LCLIntf, LCLProc, LCLType, LMessages, LResources,
Controls, StdCtrls, Graphics, Grids, Dialogs, Themes; Controls, StdCtrls, Graphics, Grids, Dialogs, Themes;
@ -1368,7 +1368,7 @@ begin
{$endif} {$endif}
ScrollInfo.nMin := 0; ScrollInfo.nMin := 0;
ScrollInfo.nMax := aRange; ScrollInfo.nMax := aRange;
ScrollInfo.nPos := aPos; ScrollInfo.nPos := Min(aPos,aRange-aPage);
ScrollInfo.nPage := aPage; ScrollInfo.nPage := aPage;
// the redraw argument of SetScrollInfo means under gtk // the redraw argument of SetScrollInfo means under gtk
// if the scrollbar is visible or not, in windows it // if the scrollbar is visible or not, in windows it