[Lazarus] TListView compatibility Delphi <=> Lazarus?

Alexsander Rosa alexsander.rosa at gmail.com
Thu Oct 21 21:05:43 CEST 2010


Is there an example of TListView's CustomDraw?
The following code (found here [1]) did not work:

procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState;
  var DefaultDraw: Boolean);
const
  cStripe = $CCFFCC; // colour of alternate list items
begin
  if Odd(Item.Index) then
    // odd list items have green background
    ListView1.Canvas.Brush.Color := cStripe
  else
    // even list items have window colour background
    ListView1.Canvas.Brush.Color := clWindow;
end;

[1] http://mantis.freepascal.org/view.php?id=9255

2010/10/12 Bo Berglund <bo.berglund at gmail.com>

> I have tried to port our Delphi7 descendant of TListView to Lazarus
> but it seems like the Lazarus implementation lacks a number of
> properties that are present in Delphi.
> Just as an example: There is no Gridlines property available.
>
> Is there a more complete implementation available anywhere?
>
> I am running Lazarus 0.9.28.2 and FPC 2.2.4 on WindowsXP off of the
> recommended installer at SourceForge. Downloaded and installed 2 weeks
> ago.
>
> I also noted via Google that there was some discussion on
> implementation incompleteness of TListView back in Jan 2008, so surely
> this should have been fixed by now?
>
>
> --
> Bo Berglund
> Developer in Sweden
>
>
>
-- 
Atenciosamente,
Alexsander da Rosa
Linux User #113925

"Extremismo na defesa da liberdade não é defeito.
Moderação na busca por justiça não é virtude."
-- Barry Goldwater
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20101021/cc24a57d/attachment-0004.html>


More information about the Lazarus mailing list