mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 13:21:46 +02:00
fix scrolling: left, top should not be changed while scrolling
git-svn-id: trunk@6604 -
This commit is contained in:
parent
c535f37167
commit
acf4a0fbbf
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user