Hi everyone.
I have got an app that uses my own custom TCustomListView descendant to list out music files in the current directory. The information visible is Filename, Title, Author and so on, read from ID3 tags.
I want to implement sorting - but that I know how to do.
the problem is, when I will sort, I want to indicate which value (column) are the files being sorted by and whether it is desc or asc sorting. In Delphi I used to do it with a small image of arrow next to the column's name.
The arrows (up and down) were drawn and added to SmallImages in overriden Create of the Form (now it's done in the overriden Create of the list). Then, all I had to do was change the ImageIndex of the correct column.
The code in Laz (overriden Create of the list, a fragment):
var TmpImg:TBitmap;
(...)
//Create the image list
SmallImages:=TImageList.Create(Self);
SmallImages.Width:=12;
SmallImages.Height:=12;
//Temp bitmap
TmpImg:=TBitmap.Create;
TmpImg.Width:=11;
TmpImg.Height:=11;
//Draw something
with TmpImg.Canvas do
begin
Brush.Color:=clBtnFace;
FillRect(0, 0, 11, 11);
Pen.Color:=clRed;
MoveTo(0, 0);
LineTo(11, 11);
end;
//add to SmallImages
SmallImages.Add(TmpImg, nil); //dodajemy bitmapke do SmallImages
TmpImg.Destroy;
Now, Everything above is fine - the bitmap being created, drawn and saved to SmallImages (tested - it does exist in SmallImages afterwards). But when I change SomeColumns.ImageIndex:=0 - nothing happens. No image displayed.
This was tested on Linux, soon I will check it under Windows.
Any ideas, what's wrong? A bug, a "not implemented yet", or smthing?

Cheers
Mike
P.S.
Ceterum censeo Lazarus rox.