Cocoa/ListView: in vsIcon/vsSmallIcon/vsList, dynamic setting TListView.MultiSelect supported

This commit is contained in:
rich2014 2024-08-06 21:31:30 +08:00
parent 3969855bc3
commit f05736ba41

View File

@ -1328,13 +1328,26 @@ end;
procedure TCocoaWSListView_CollectionViewHandler.SetProperty(
const AProp: TListViewProperty; const AIsSet: Boolean);
var
lclListView: TCustomListView;
index: Integer;
begin
case AProp of
{lvpAutoArrange,}
lvpCheckboxes: _collectionView.lclSetCheckBoxes(AIsSet);
{lvpHideSelection,
lvpHotTrack,}
lvpMultiSelect: _collectionView.setAllowsMultipleSelection(AIsSet);
lvpMultiSelect: begin
_collectionView.setAllowsMultipleSelection( AIsSet );
if NOT AIsSet and (_collectionView.selectionIndexPaths.count>1) then begin
lclListView:= TCustomListView( _listView.lclGetTarget );
if Assigned(lclListView.ItemFocused) then begin
index:= lclListView.ItemFocused.Index;
_collectionView.deselectAll( nil );
_collectionView.selectOneItemByIndex( index, True );
end;
end;
end;
{lvpOwnerDraw,
lvpReadOnly:
lvpShowWorkAreas,