mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 20:19:14 +02:00
cocoa: clearing selection of ListBox is itemIndex is set to negative index
git-svn-id: trunk@61760 -
This commit is contained in:
parent
5f10473e8d
commit
e768107d9c
@ -2194,8 +2194,13 @@ begin
|
||||
list := GetListBox(ACustomListBox);
|
||||
if not Assigned(list) then Exit();
|
||||
|
||||
list.selectRowIndexes_byExtendingSelection(NSIndexSet.indexSetWithIndex(AIndex), false);
|
||||
list.scrollRowToVisible(AIndex);
|
||||
if (AIndex < 0) then
|
||||
list.deselectAll(nil)
|
||||
else
|
||||
begin
|
||||
list.selectRowIndexes_byExtendingSelection(NSIndexSet.indexSetWithIndex(AIndex), false);
|
||||
list.scrollRowToVisible(AIndex);
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TCocoaWSCustomListBox.SetSelectionMode(const ACustomListBox: TCustomListBox; const AExtendedSelect, AMultiSelect: boolean);
|
||||
|
Loading…
Reference in New Issue
Block a user