LCL: Grids, Allow users to have a peek at the editor events, fixes issue #23983

This commit is contained in:
Jesus Reyes A 2021-07-30 15:06:38 -05:00
parent 3ae2076292
commit 2b5a54edc4

View File

@ -7596,15 +7596,19 @@ begin
MoveSel(True, 0, R.Bottom-R.Top); MoveSel(True, 0, R.Bottom-R.Top);
end; end;
VK_HOME: VK_HOME:
if ssCtrl in Shift then MoveSel(False, FCol, FFixedRows) if not FEditorKey then begin
else if ssCtrl in Shift then MoveSel(False, FCol, FFixedRows)
if Relaxed then MoveSel(False, FFixedCols, FRow) else
else MoveSel(False, FCol, FFixedRows); if Relaxed then MoveSel(False, FFixedCols, FRow)
else MoveSel(False, FCol, FFixedRows);
end;
VK_END: VK_END:
if ssCtrl in Shift then MoveSel(False, FCol, RowCount-1) if not FEditorKey then begin
else if ssCtrl in Shift then MoveSel(False, FCol, RowCount-1)
if Relaxed then MoveSel(False, ColCount-1, FRow) else
else MoveSel(False, FCol, RowCount-1); if Relaxed then MoveSel(False, ColCount-1, FRow)
else MoveSel(False, FCol, RowCount-1);
end;
VK_APPS: VK_APPS:
if not FEditorKey and EditingAllowed(FCol) then if not FEditorKey and EditingAllowed(FCol) then
EditorShow(False); // Will show popup menu in the editor. EditorShow(False); // Will show popup menu in the editor.
@ -10417,25 +10421,37 @@ begin
inherited KeyDown(Key,Shift); inherited KeyDown(Key,Shift);
case Key of case Key of
VK_F2: VK_F2:
if AllSelected then begin begin
SelLength := 0; doEditorKeyDown;
SelStart := Length(Text); if (key<>0) then begin
if AllSelected then begin
SelLength := 0;
SelStart := Length(Text);
end else if GetFastEntry then
SelectAll;
end;
end; end;
VK_DELETE, VK_BACK: VK_DELETE, VK_BACK:
CheckEditingKey; begin
CheckEditingKey;
if key<>0 then
doEditorKeyDown;
end;
VK_UP, VK_DOWN: VK_UP, VK_DOWN:
doGridKeyDown; doGridKeyDown;
VK_LEFT, VK_RIGHT: VK_LEFT, VK_RIGHT:
if GetFastEntry then begin begin
IntSel:= if GetFastEntry then begin
((Key=VK_LEFT) and not AtStart) or IntSel:=
((Key=VK_RIGHT) and not AtEnd); ((Key=VK_LEFT) and not AtStart) or
if not IntSel then begin ((Key=VK_RIGHT) and not AtEnd);
doGridKeyDown; if not IntSel then
doGridKeyDown
else
doEditorKeyDown;
end else
doEditorKeyDown;
end; end;
end;
VK_END, VK_HOME:
;
VK_ESCAPE: VK_ESCAPE:
begin begin
doGridKeyDown; doGridKeyDown;