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