From f99cfdf6b9d2aeab04d138d26f69d1818d11382e Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 4 Nov 2009 16:46:32 +0000 Subject: [PATCH] * Try to fix scroll bar problems git-svn-id: trunk@14052 - --- installer/install.pas | 17 ++++++++++++++--- installer/scroll.pas | 19 ++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/installer/install.pas b/installer/install.pas index 0b8b1ad190..664bf35465 100644 --- a/installer/install.pas +++ b/installer/install.pas @@ -1106,14 +1106,22 @@ program install; else {$endif MAYBE_LFN} begin - items[j]:=newsitem(package[i].name+diskspacestr(package[i].diskspace),items[j]); + items[j]:=newsitem(package[i].name+diskspacestr(package[i].diskspace) +{$ifdef DEBUG} + +' ('+dotstr(i)+')' +{$endif DEBUG} + ,items[j]); packmask[j]:=packmask[j] or packagemask(i); enabmask[j]:=enabmask[j] or packagemask(i); firstitem[j]:=i-1; end; end else - items[j]:=newsitem(package[i].name,items[j]); + items[j]:=newsitem(package[i].name +{$ifdef DEBUG} + +' ('+dotstr(i)+')' +{$endif DEBUG} + ,items[j]); end; end; @@ -1186,7 +1194,10 @@ program install; if (sbr.b.y-sbr.a.y) Delta.X) or (D.Y <> Delta.Y) then begin SetCursor(Cursor.X + Delta.X - D.X, Cursor.Y + Delta.Y - D.Y); - Delta := D; + ScrollTo(D.X,D.Y); if DrawLock <> 0 then DrawFlag := True else @@ -134,14 +140,19 @@ end; procedure TScrollBox.ScrollTo(X, Y: Sw_Integer); var DX,DY: sw_integer; + PrevScrollFlag : boolean; begin Inc(DrawLock); DX:=Delta.X-X; DY:=Delta.Y-Y; + PrevScrollFlag:=ScrollFlag; + ScrollFlag:=true; + if HScrollBar <> nil then HScrollBar^.SetValue(X); if VScrollBar <> nil then VScrollBar^.SetValue(Y); + ScrollFlag:=PrevScrollFlag; ShiftViews(DX,DY); Dec(DrawLock); CheckDraw; @@ -154,6 +165,8 @@ procedure TScrollBox.ShiftViews(DX,DY: sw_integer); end; begin ForEach(@DoShift); + Delta.X:=Delta.X-DX; + Delta.Y:=Delta.Y-DY; end; procedure TScrollBox.SetLimit(X, Y: Sw_Integer); @@ -162,9 +175,9 @@ begin Limit.Y := Y; Inc(DrawLock); if HScrollBar <> nil then - HScrollBar^.SetParams(HScrollBar^.Value, 0, X - Size.X, Size.X - 1, HScrollBar^.ArStep); + HScrollBar^.SetParams(HScrollBar^.Value, HScrollBar^.Min, HScrollBar^.Max, HScrollBar^.PgStep, HScrollBar^.ArStep); if VScrollBar <> nil then - VScrollBar^.SetParams(VScrollBar^.Value, 0, Y - Size.Y, Size.Y - 1, VScrollBar^.ArStep); + VScrollBar^.SetParams(VScrollBar^.Value, VScrollBar^.Min, VScrollBar^.Max, VScrollBar^.PgStep, VScrollBar^.ArStep); Dec(DrawLock); CheckDraw; end;