From 1ecbf0622e99693c242f51c46ce4485f4fb07312 Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 4 Sep 2009 19:08:38 +0000 Subject: [PATCH] LCL, limit position of scrollbar in dbgrid on new records (fix gtk2 scrollbar issues on some themes) git-svn-id: trunk@21580 - --- lcl/dbgrids.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 96d82b526b..cf17cee515 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -38,7 +38,7 @@ unit DBGrids; interface uses - Classes, SysUtils, FileUtil, DB, + Classes, SysUtils, Math, FileUtil, DB, LCLStrConsts, LCLIntf, LCLProc, LCLType, LMessages, LResources, Controls, StdCtrls, Graphics, Grids, Dialogs, Themes; @@ -1368,7 +1368,7 @@ begin {$endif} ScrollInfo.nMin := 0; ScrollInfo.nMax := aRange; - ScrollInfo.nPos := aPos; + ScrollInfo.nPos := Min(aPos,aRange-aPage); ScrollInfo.nPage := aPage; // the redraw argument of SetScrollInfo means under gtk // if the scrollbar is visible or not, in windows it