blikblum/VirtualTreeView-Lazarus

Odd issue on Cocoa: Column separators not drawn (but do work for e.g. resize)

Closed this issue · 4 comments

On my Mac 10.14.4 (standard theme - not dark) newest Lazarus SVN Cocoa + newest virtual treeview

My virtual treeview does not draw its column separators (those you grab and drag to resize columns)

I have tried fiddling with treeview.header.options and teeview.treeoptions.paintoptions but no luck.

Can anyone else get these to work? It is a bit confusing for people new to my software. They may think they can not resize the columns (when infact they can - mouse cursor also changes when hovering over the invisible splitter/separator)

I just tried stepping through code and I think I now know why....

Virtual Treeview uses and calls DrawEdge (with flag to paint border)

which when stepping through code ends at

First) WinAPI.inc - DrawEdge - calls WidgetSet.DrawEdge
Then) intfbasewinapi.inc - TWidgetSet.DrawEdge - where entire code consist of "Result := False"

... So seems to be that is probably the reason...

I guess on Cocoa virtual treeview may need to code around this although I have also posted on the lazarus forum here:

https://forum.lazarus.freepascal.org/index.php/topic,46122.0.html

Update:
LCLCocoa have had an update so DrawEdge has been implemented. But I have identified a problem.

If we go to TCocoaWidgetSet.DrawEdge and see code snippets

const
InnLT= cl3DHiLight;
InnBRR = cl3dShadow

...

if (edge and BDR_INNER > 0) then
begin
if edge and BDR_RAISEDINNER > 0 then
DrawEdgeRect(ctx, r, grfFlags, InnLT, InnBR)

The drawn borders are NOT visible in virtual treeview... but if I e.g. set those values to clRed it works...

So I think the consts used to set the InnLT and InnBR value are not valid in Cocoa?

Anyhow - this means this is really a LCLCocoa issue which I believe is/will be addressed

I've put a DrawEdge demo at https://bitbucket.org/blikblum/pascal-demos/src/master/lazarus/LCLTests/DrawEdge/

Run it on Cocoa. If is not drawing correct (compare with other widget sets), the bug is on cocoa.
This demo will help also those working on it