mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 01:41:22 +02:00
LCL/ListView: Better fix for editing virtual multi-select listview than 451f75e3ce
. Issue #39708.
This commit is contained in:
parent
451f75e3ce
commit
b694be37b0
@ -335,7 +335,7 @@ begin
|
||||
// end editing
|
||||
if IsEditing then
|
||||
HideEditor;
|
||||
|
||||
|
||||
// focus
|
||||
if (nm^.uOldState and LVIS_FOCUSED) <> (nm^.uNewState and LVIS_FOCUSED) then
|
||||
begin
|
||||
@ -446,7 +446,12 @@ var
|
||||
begin
|
||||
S := FEditor.Text;
|
||||
if FEditor.Item <> nil then
|
||||
DoEndEdit(FEditor.Item, S);
|
||||
begin
|
||||
if MultiSelect and OwnerData then
|
||||
DoEndEdit(Items[FSelectedIdx], S)
|
||||
else
|
||||
DoEndEdit(FEditor.Item, S);
|
||||
end;
|
||||
FEditor.Item := nil;
|
||||
FEditor.Visible := False;
|
||||
FEditor.SetBounds(0, 0, 0, 0);
|
||||
@ -1222,8 +1227,8 @@ end;
|
||||
|
||||
function TCustomListView.CanEdit(Item: TListItem): Boolean;
|
||||
begin
|
||||
Result := not (OwnerData and MultiSelect and (SelCount > 1));
|
||||
if Result and Assigned(FOnEditing) then
|
||||
Result := True;
|
||||
if Assigned(FOnEditing) then
|
||||
FOnEditing(Self, Item, Result);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user