View Issue Details

IDProjectCategoryView StatusLast Update
0036074LazarusWidgetsetpublic2019-09-13 04:13
ReporterLazProggerAssigned To 
PrioritynormalSeverityminorReproducibilityrandom
Status newResolutionopen 
PlatformCocoaOSmacOSOS VersionSierra
Product Version2.0.4Product Build 
Target VersionFixed in Version 
Summary0036074: ListView.Items[x].Selected not working on Cocoa with MultiSelect = true
DescriptionWhen you have a ListView with MultiSelect = true, the .Selected property of the items is not working correctly. Most times the result is always false, even when the Item is selected. Sometimes it is giving true, but that seems to be appearing randomly.

If MultiSelect is set to false .Selected seems to give the right results.
Steps To ReproduceI have attached an example project. Select an Item in the ListView, click on "Show Selected" and see the result.

The following code is used in the example:

procedure TForm1.bt_show_selectedClick(Sender: TObject);
var
  i: integer;
  s: string;
begin
  s := '';

  for i := 0 to lv.Items.Count - 1 do begin
    s += 'Item '+inttostr(i)+': ' + BoolToStr(lv.Items[i].Selected, 'selected', 'not selected') + LineEnding;
  end;

  ShowMessage(s);
end;
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetCocoa
Attached Files

Activities

LazProgger

2019-09-13 04:13

reporter  

CocoaListViewSelectedTest.zip (3,312 bytes)

Issue History

Date Modified Username Field Change
2019-09-13 04:13 LazProgger New Issue
2019-09-13 04:13 LazProgger File Added: CocoaListViewSelectedTest.zip