LCL: Check modifier keys (Shift, Ctrl, Alt) when editing the name of a TreeView. From n7800.

This commit is contained in:
Juha 2024-02-22 11:22:11 +02:00
parent fd01caa9a2
commit 7716068e1a

View File

@ -6498,7 +6498,7 @@ procedure TCustomTreeView.EditorEditingDone(Sender: TObject);
var
WasFocused: Boolean;
begin
WasFocused := (FEditor<>nil) and FEditor.Focused;
WasFocused := Assigned(FEditor) and FEditor.Focused;
EndEditing;
if WasFocused then
SetFocus;
@ -6509,7 +6509,7 @@ procedure TCustomTreeView.EditorKeyDown(Sender: TObject; var Key: Word;
var
WasFocused: Boolean;
begin
if (Key = VK_ESCAPE) or (Key = VK_RETURN) then
if (Key in [VK_RETURN, VK_ESCAPE]) and (Shift = []) then
begin
WasFocused := Assigned(FEditor) and FEditor.Focused;
EndEditing(Key = VK_ESCAPE);