Recent

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

Dmitry24

  • New Member
  • *
  • Posts: 13
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: 13
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.