mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Keyboard navigation behavior
This commit is contained in:
parent
f82e1de6c4
commit
41a4201d05
1 changed files with 34 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ type
|
|||
procedure Resize; override;
|
||||
procedure RowHeightsChanged; override;
|
||||
procedure ColWidthsChanged; override;
|
||||
procedure KeyDown(var Key : Word; Shift : TShiftState); override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent; AParent: TWinControl); reintroduce;
|
||||
|
||||
|
|
@ -210,6 +211,39 @@ begin
|
|||
CalculateColRowCount;
|
||||
end;
|
||||
|
||||
procedure TBriefDrawGrid.KeyDown(var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
case Key of
|
||||
VK_UP, VK_DOWN:
|
||||
begin
|
||||
if (CellToIndex(Col, Row) >= BriefView.FFiles.Count - 1) and
|
||||
(Key = VK_DOWN) then
|
||||
begin
|
||||
Key:= 0;
|
||||
end
|
||||
else if ((Row = RowCount-1) and (Key = VK_DOWN)) then
|
||||
begin
|
||||
if (Col < ColCount - 1) then
|
||||
begin
|
||||
Row:= 0;
|
||||
Col:= Col + 1;
|
||||
end;
|
||||
Key:= 0;
|
||||
end
|
||||
else if (Row = FixedRows) and (Key = VK_UP) then
|
||||
begin
|
||||
if (Col > 0) then
|
||||
begin
|
||||
Row:= RowCount - 1;
|
||||
Col:= Col - 1;
|
||||
end;
|
||||
Key:= 0;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
inherited KeyDown(Key, Shift);
|
||||
end;
|
||||
|
||||
constructor TBriefDrawGrid.Create(AOwner: TComponent; AParent: TWinControl);
|
||||
begin
|
||||
BriefView := AParent as TBriefFileView;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue