mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 21:18:01 +02:00
Cocoa/ListView: in vsIcon/vsSmallIcon/vsList, dynamic setting TListView.MultiSelect supported
This commit is contained in:
parent
3969855bc3
commit
f05736ba41
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user