From da4ea2af2e1608f69454dda747f3324548b2485c Mon Sep 17 00:00:00 2001 From: zeljko Date: Fri, 26 Mar 2010 13:18:54 +0000 Subject: [PATCH] Gtk2: take care of adjustment max & min value in case of Gtk2WSScrollingWinControl git-svn-id: trunk@24220 - --- lcl/interfaces/gtk/gtkcallback.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index 9936423681..d755b75f10 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -2587,6 +2587,20 @@ begin else Msg.Msg := LM_VSCROLL; + if (AWidgetInfo^.LCLObject is TScrollingWinControl) then + begin + {$ifdef OldAutoSize} + MaxValue := ARange^.adjustment^.upper - ARange^.adjustment^.page_size; + {$else} + MaxValue := ARange^.adjustment^.upper; + {$endif} + if (AValue > MaxValue) or (AValue < ARange^.adjustment^.lower) then + begin + Result := not Result; + exit; + end; + end; + with Msg do begin Pos := Round(AValue);