mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-01 13:39:29 +01:00
LCL, use fully visible grids calc the amount of cols or rows to scroll, issue #17882
git-svn-id: trunk@28664 -
This commit is contained in:
parent
d14fe5acfe
commit
56fb0cb880
@ -604,6 +604,7 @@ type
|
|||||||
PushedCell: TPoint; // Cell coords of cell being pushed
|
PushedCell: TPoint; // Cell coords of cell being pushed
|
||||||
PushedMouse: TPoint; // mouse Coords of the cell being pushed
|
PushedMouse: TPoint; // mouse Coords of the cell being pushed
|
||||||
ClickCellPushed: boolean; // Header Cell is currently pushed?
|
ClickCellPushed: boolean; // Header Cell is currently pushed?
|
||||||
|
FullVisibleGrid: TRect; // visible cells excluding partially visible cells
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -4830,6 +4831,8 @@ end;
|
|||||||
|
|
||||||
{ Save to the cache the current visible grid (excluding fixed cells) }
|
{ Save to the cache the current visible grid (excluding fixed cells) }
|
||||||
procedure TCustomGrid.CacheVisibleGrid;
|
procedure TCustomGrid.CacheVisibleGrid;
|
||||||
|
var
|
||||||
|
R: TRect;
|
||||||
begin
|
begin
|
||||||
with FGCache do begin
|
with FGCache do begin
|
||||||
VisibleGrid:=GetVisibleGrid;
|
VisibleGrid:=GetVisibleGrid;
|
||||||
@ -4838,6 +4841,19 @@ begin
|
|||||||
ValidCols := (top>=0) and (bottom>=Top) and (ColCount>0) and (RowCount>0);
|
ValidCols := (top>=0) and (bottom>=Top) and (ColCount>0) and (RowCount>0);
|
||||||
ValidGrid := ValidRows and ValidCols;
|
ValidGrid := ValidRows and ValidCols;
|
||||||
end;
|
end;
|
||||||
|
FullVisibleGrid := VisibleGrid;
|
||||||
|
if ValidGrid then
|
||||||
|
with FullVisibleGrid do begin
|
||||||
|
if TLColOff>0 then
|
||||||
|
Left := Min(Left+1, Right);
|
||||||
|
if TLRowOff>0 then
|
||||||
|
Top := Min(Top+1, Bottom);
|
||||||
|
R := CellRect(Right, Bottom);
|
||||||
|
if R.Right>(ClientWidth+GetBorderWidth) then
|
||||||
|
Right := Max(Right-1, Left);
|
||||||
|
if R.Bottom>(ClientHeight+GetBorderWidth) then
|
||||||
|
Bottom := Max(Bottom-1, Top);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -6237,12 +6253,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
VK_PRIOR:
|
VK_PRIOR:
|
||||||
begin
|
begin
|
||||||
R:=FGCache.Visiblegrid;
|
R:=FGCache.FullVisiblegrid;
|
||||||
MoveSel(True, 0, R.Top-R.Bottom);
|
MoveSel(True, 0, R.Top-R.Bottom);
|
||||||
end;
|
end;
|
||||||
VK_NEXT:
|
VK_NEXT:
|
||||||
begin
|
begin
|
||||||
R:=FGCache.VisibleGrid;
|
R:=FGCache.FullVisibleGrid;
|
||||||
MoveSel(True, 0, R.Bottom-R.Top);
|
MoveSel(True, 0, R.Bottom-R.Top);
|
||||||
end;
|
end;
|
||||||
VK_HOME:
|
VK_HOME:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user