fix scrolling: left, top should not be changed while scrolling

git-svn-id: trunk@6604 -
This commit is contained in:
micha 2005-01-15 15:36:19 +00:00
parent c535f37167
commit acf4a0fbbf
3 changed files with 11 additions and 18 deletions

View File

@ -247,9 +247,9 @@ begin
With TScrollingWinControl(FControl) do begin
// page
if Self.Kind=sbVertical then
FPage := TScrollBarInc(Min(ClientHeight + 1,High(FPage)))
FPage := TScrollBarInc(Min(ClientHeight - 1,High(FPage)))
else
FPage := TScrollBarInc(Min(ClientWidth + 1,High(FPage)));
FPage := TScrollBarInc(Min(ClientWidth - 1,High(FPage)));
ScrollInfo.nPage := FPage;
// range

View File

@ -120,21 +120,8 @@ begin
end;
procedure TScrollingWinControl.ScrollBy(DeltaX, DeltaY: Integer);
var
Control: TControl;
I: integer;
begin
TWSScrollingWinControlClass(WidgetSetClass).ScrollBy(Self, DeltaX, DeltaY);
for I := 0 to ControlCount - 1 do
begin
Control := Controls[I];
if not (Control is TWinControl) or not TWinControl(Control).HandleAllocated then
begin
// widgetset does not know about this control
Control.SetBounds(Control.Left+DeltaX, Control.Top+DeltaY,
Control.Width, Control.Height);
end;
end;
Invalidate;
end;

View File

@ -94,7 +94,7 @@ var
implementation
uses
SysUtils, LCLStrConsts, Menus, Dialogs, StdCtrls, ExtCtrls,
SysUtils, LCLStrConsts, Menus, Dialogs, StdCtrls, ExtCtrls, Forms,
LCLIntf; //remove this unit when GetWindowSize is moved to TWSWinControl
{$IFOPT C-}
@ -772,8 +772,14 @@ Begin
TheWinControl:=TWinControl(Sender);
if not TheWinControl.HandleAllocated then exit;
Handle := TheWinControl.Handle;
ORect.Left := 0;
ORect.Top := 0;
if TheWinControl is TScrollingWinControl then
begin
ORect.Left := -TScrollingWinControl(TheWinControl).HorzScrollBar.Position;
ORect.Top := -TScrollingWinControl(TheWinControl).VertScrollBar.Position;
end else begin
ORect.Left := 0;
ORect.Top := 0;
end;
ORect.Bottom := 0;
ORect.Right := 0;
If (TheWinControl is TCustomGroupBox) Then