Recent

Author Topic: TCustomListView: ownerdraw (custom drawing) seems to be not implemented  (Read 691 times)

Dmitry24

  • New Member
  • *
  • Posts: 20
Gtk*, qt* and win* widgetsets call TCustomListView.IntfCustomDraw function directly in their code.

Neither Cocoa nor Carbon widgetsets contain references to the function IntfCustomDraw. This results in that underlying CustomDraw* functions are never called for these widgetsets.

That is the following TListView properties/functions are ignored (disregarding OwnerDraw property value):

OnDrawItem,
OnCustomDrawItem,
OnCustomDrawSubItem.


As I can see, for Cocoa wigetset Listviews are implemented through the TCellCocoaTableListView objcclass which seems simply not supporting custom drawing.


Is there any workaround? Or am I missing something?
Should I implement a list viewer control via some scrollable control which allows custom drawing? Is there something suitable?

Dmitry24

  • New Member
  • *
  • Posts: 20
Re: TCustomListView: ownerdraw (custom drawing) seems to be not implemented
« Reply #1 on: September 10, 2019, 04:54:01 pm »
Fortunatelly I found the callback method

IListViewCallBack.DrawRow(rowidx: Integer; ctx: TCocoaContext; const r: TRect; state: TOwnerDrawState);

which is called inside

procedure TCocoaTableListView.drawRow_clipRect(row: NSInteger; clipRect: NSRect)

So this required only some minor changes to Cocoa code to resolve my problem and enable custom drawing support. I can post some more details if somebody needs.

PhilC

  • New Member
  • *
  • Posts: 10
This still seems to be broken on Carbon at least.

Anyone know of the fix for Carbon to get this working?

Thanks

Phil

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2426
    • havefunsoft.com
are you looking for TListView custom draw of cells?
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

PhilC

  • New Member
  • *
  • Posts: 10
Yes - currently I can't get TListView to call the OnCustomDrawXXX events :-(

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2426
    • havefunsoft.com
i might be able to help with that.
but you need to wait a day.

do you've any small test project ready? (it's not critical to have it, but it's a great timesaver)
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

PhilC

  • New Member
  • *
  • Posts: 10
No problems; I am not getting anywhere here, so a day or so will be faster than me sorting it :-)

Thanks

 

TinyPortal © 2005-2018