View Issue Details

IDProjectCategoryView StatusLast Update
0036074LazarusWidgetsetpublic2019-11-02 22:05
ReporterLazProgger Assigned ToDmitry Boyarintsev  
PrioritynormalSeverityminorReproducibilityrandom
Status resolvedResolutionfixed 
PlatformCocoaOSmacOS 
Product Version2.0.4 
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 Revision62157
LazTarget-
WidgetsetCocoa
Attached Files

Activities

LazProgger

2019-09-13 04:13

reporter  

Dmitry Boyarintsev

2019-11-02 22:05

developer   ~0118993

please test and close if ok

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
2019-11-02 22:05 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2019-11-02 22:05 Dmitry Boyarintsev Status new => resolved
2019-11-02 22:05 Dmitry Boyarintsev Resolution open => fixed
2019-11-02 22:05 Dmitry Boyarintsev Fixed in Revision => 62157
2019-11-02 22:05 Dmitry Boyarintsev LazTarget => -
2019-11-02 22:05 Dmitry Boyarintsev Widgetset Cocoa => Cocoa
2019-11-02 22:05 Dmitry Boyarintsev Note Added: 0118993