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 With TScrollingWinControl(FControl) do begin
// page // page
if Self.Kind=sbVertical then if Self.Kind=sbVertical then
FPage := TScrollBarInc(Min(ClientHeight + 1,High(FPage))) FPage := TScrollBarInc(Min(ClientHeight - 1,High(FPage)))
else else
FPage := TScrollBarInc(Min(ClientWidth + 1,High(FPage))); FPage := TScrollBarInc(Min(ClientWidth - 1,High(FPage)));
ScrollInfo.nPage := FPage; ScrollInfo.nPage := FPage;
// range // range

View File

@ -120,21 +120,8 @@ begin
end; end;
procedure TScrollingWinControl.ScrollBy(DeltaX, DeltaY: Integer); procedure TScrollingWinControl.ScrollBy(DeltaX, DeltaY: Integer);
var
Control: TControl;
I: integer;
begin begin
TWSScrollingWinControlClass(WidgetSetClass).ScrollBy(Self, DeltaX, DeltaY); 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; Invalidate;
end; end;

View File

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