mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-20 07:46:00 +02:00
implemented keep focused cell visible while scrollbar scrolling
git-svn-id: trunk@8647 -
This commit is contained in:
parent
55749b3025
commit
4ce49481be
@ -96,7 +96,8 @@ type
|
|||||||
goRelaxedRowSelect, // User can see focused cell on goRowSelect
|
goRelaxedRowSelect, // User can see focused cell on goRowSelect
|
||||||
goDblClickAutoSize, // dblclicking columns borders (on hdrs) resize col.
|
goDblClickAutoSize, // dblclicking columns borders (on hdrs) resize col.
|
||||||
goSmoothScroll, // Switch scrolling mode (pixel scroll is by default)
|
goSmoothScroll, // Switch scrolling mode (pixel scroll is by default)
|
||||||
goFixedRowNumbering // Ya
|
goFixedRowNumbering, // Ya
|
||||||
|
goScrollKeepVisible // keeps focused cell visible while scrolling
|
||||||
);
|
);
|
||||||
TGridOptions = set of TGridOption;
|
TGridOptions = set of TGridOption;
|
||||||
|
|
||||||
@ -3084,12 +3085,17 @@ end;
|
|||||||
procedure TCustomGrid.TryScrollTo(aCol, aRow: Integer);
|
procedure TCustomGrid.TryScrollTo(aCol, aRow: Integer);
|
||||||
var
|
var
|
||||||
TryTL: TPoint;
|
TryTL: TPoint;
|
||||||
|
NewCol,NewRow: Integer;
|
||||||
begin
|
begin
|
||||||
TryTL:=ScrollGrid(False,aCol, aRow);
|
TryTL:=ScrollGrid(False,aCol, aRow);
|
||||||
if not PointIgual(TryTL, FTopLeft) then begin
|
if not PointIgual(TryTL, FTopLeft) then begin
|
||||||
|
NewCol := TryTL.X - FTopLeft.X + Col;
|
||||||
|
NewRow := TryTL.Y - FTopLeft.Y + Row;
|
||||||
FTopLeft:=TryTL;
|
FTopLeft:=TryTL;
|
||||||
//DebugLn('TCustomGrid.TryScrollTo A ',DbgSName(Self),' FTopLeft=',dbgs(FTopLeft));
|
//DebugLn('TCustomGrid.TryScrollTo A ',DbgSName(Self),' FTopLeft=',dbgs(FTopLeft));
|
||||||
doTopleftChange(False);
|
doTopleftChange(False);
|
||||||
|
if goScrollKeepVisible in Options then
|
||||||
|
MoveNextSelectable(False, NewCol, NewRow);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user