Recent

Author Topic: macOS - TListView SubItemImages only in first column  (Read 2385 times)

sardu

  • Newbie
  • Posts: 4
macOS - TListView SubItemImages only in first column
« on: April 24, 2017, 04:53:39 pm »
Hi,
recently i've been working on porting my existing project to the macOS platform.
The first problem i ran into regards TListView component.

I use a TListView for displaying my dataset and i need to use some small images in some columns.

The code i've been using for testing is this:

Code: Pascal  [Select][+][-]
  1. var
  2.   LI: TListItem;
  3.   i: Integer;
  4. begin
  5.   ListView1.ViewStyle := vsReport;
  6.   for i := 0 to 1 do
  7.     with ListView1.Columns.Add do
  8.       Caption := 'Column ' + IntToStr(i);
  9.  
  10.   for i := 0 to ImageList1.Count - 1 do
  11.   begin
  12.     LI := ListView1.Items.Add;
  13.     LI.Caption := Format('Item %d', [i]);
  14.     LI.ImageIndex := i;
  15.     LI.SubItems.Add(Format('SubItem %d', [i]));
  16.     LI.SubItemImages[0] := i; // SubItems[ColumnIndex] := ImageIndex;
  17.   end;
  18. end;
  19.  


and it should be giving the result shown here: https://i.stack.imgur.com/rWSy8.png.

If i run this snippet of code in Windows or Linux, it works just fine,
but if i run it in macOS (Sierra - 10.12.4) the icons appear only in the first column.   %)

Anyone has experienced anything like this?
I don't know what to do  :-\

Thanks in advance to anybody,
R.

P.S. i'm using the latest release of Lazarus 1.6.4 on all three platforms.

balazsszekely

  • Guest
Re: macOS - TListView SubItemImages only in first column
« Reply #1 on: April 24, 2017, 06:09:16 pm »
Quote
Anyone has experienced anything like this?
Yes, it's a known bug.

Quote
I don't know what to do  :-\
If you are an experienced programmer, you can try to fix the bug, or you can switch to VirtualStringTree which will work under osx too.

 

TinyPortal © 2005-2018