Recent

Author Topic: TListView with OwnerDraw wrong arrangement?  (Read 696 times)

Alexandr F

  • New Member
  • *
  • Posts: 25
TListView with OwnerDraw wrong arrangement?
« on: December 25, 2018, 03:27:44 pm »
I want to use TListView with OwnderDrawItem feature. But I see one trouble: arrangement of icons is different for OwnerDraw = True and OwnerDraw = False.

See attahced picture please. On left side Listview.OwnerDraw = False, on right side OwnerDraw = True. You can see arrangement of icons is different.

I use run-time icons loading.

See attached project example for reference.

lucamar

  • Hero Member
  • *****
  • Posts: 2030
Re: TListView with OwnerDraw wrong arrangement?
« Reply #1 on: December 25, 2018, 04:16:13 pm »
I don't understand what you mean (other than it appears to be an empty item in the OwnerDraw=True ListBox). But then, with OwnerDraw it's you who is drawing the items, isn't it?

Perhaps it would be more apparent what you mean if your test had at least three or four items+icons.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Alexandr F

  • New Member
  • *
  • Posts: 25
Re: TListView with OwnerDraw wrong arrangement?
« Reply #2 on: December 25, 2018, 04:45:42 pm »
I don't understand what you mean (other than it appears to be an empty item in the OwnerDraw=True ListBox). But then, with OwnerDraw it's you who is drawing the items, isn't it?

Perhaps it would be more apparent what you mean if your test had at least three or four items+icons.

By default a CustomDraw handler have a DefaultDraw parameter. If this parameter is True, default drawing will be executed after my Custom Draw handler. I expressly remove all my code and use default code only. 

If I use more icons they whatever arranged wrong, by bottom side of ListViev.