View Issue Details

IDProjectCategoryView StatusLast Update
0035855LazarusLCLpublic2019-08-16 18:42
ReporterMIS5Assigned ToDmitry Boyarintsev 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionreopened 
PlatformCocoaOSMacOS VersionAll
Product Version2.0.3 (SVN)Product Build 
Target VersionFixed in Version 
Summary0035855: Missing implementation of TWidgetSet.DrawEdge used by e.g. virtual treeview
DescriptionE.g. Virtual Treeview calls DrawEdge to draw column separators/borders/splitters (whatever you want to call them) but nothing is drawn

The call ends ind

1) WinAPI.inc - DrawEdge - which calls WidgetSet.DrawEdge
2) ntfbasewinapi.inc - TWidgetSet.DrawEdge - where the entire code consist of "Result := False"

Additional InformationSee https://forum.lazarus.freepascal.org/index.php/topic,46122.0.html
TagsNo tags attached.
Fixed in Revision61617
LazTarget-
WidgetsetCocoa
Attached Files

Activities

Dmitry Boyarintsev

2019-07-23 16:09

developer   ~0117356

please test and close if ok

MIS5

2019-07-24 15:42

reporter   ~0117376

Well...

1) It has not helped in resolving TVirtualTreeview drawing edges... I find that pretty weird (maybe dependent on parameters passed?) I have tried recompiling virtualtreeview to make sure it uses the new call

2) Standard TToolBar is now drawn (what looks incorrect) with black borders around - My TToolBar uses EdgeBorders property where all sides are set, so my guess is disabling those solves that

I will update when I have tried to step through the code

MIS5

2019-07-24 16:14

reporter   ~0117377

2) Can be solved by setting ToolBar.EdgeBorders := []

moving on to 1)

Stepping through code called the TCocoaWidgetSet.DrawEdge it enters code

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

Stepping into DrawEdgeRect I seems something should be drawn since lineto etc. gets called. But currently I can't see values of anything in Lazarus debugger :(

MIS5

2019-07-24 21:41

reporter   ~0117385

See comments - not fully resolved it seems

MIS5

2019-08-10 21:08

reporter   ~0117627

Last edited: 2019-08-10 21:10

View 3 revisions

I *think* I have identified a bug in the new LCLCocoa solution...

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?

Dmitry Boyarintsev

2019-08-10 22:31

developer   ~0117628

yes. that can be the case... what should they actually be then?
Note that colors are currently using system provided colors. What alternative should be used?

MIS5

2019-08-10 23:22

reporter   ~0117629

Last edited: 2019-08-10 23:26

View 3 revisions

I am researching this myself. Preferably the colors should also match if macOS theme changes so has to to use a system color of sorts.

However, are we sure the color exist on macOS? i.e. cl3DDShadow is defined by TColor(Sys_COLOR_Base or COLOR_3DDKSHADOW) which all seems to map downto genertic graphics.pas and LCLtype.pas

I am not completely in the clear how cross platform color values/consts work here...

But looking here https://wiki.lazarus.freepascal.org/Cocoa_Internals/Graphics is seems that there are ??? for cl3DHiLight and cl3DShadow for where these are used

Dmitry Boyarintsev

2019-08-10 23:24

developer   ~0117630

you need to note that "3d" related colors have been deprecated in 10.14 and should no longer be used.
cl3DHiLight and cl3DShadow are aliases to other default system colors

MIS5

2019-08-10 23:39

reporter   ~0117631

Last edited: 2019-08-10 23:44

View 2 revisions

My guess is clWindowFrame which also works is the most appropriate - this appears to work okay - but I have only tried in Aqua/default macOS theme.

But all-in-all I don't know. (Let me know if there is something you want me to try?)

Luiz Americo

2019-08-16 18:42

developer   ~0117708

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

May help to find the bug. Run in windows or other supported widgetset and compare when running in cocoa

> cl3DHiLight and cl3DShadow are aliases to other default system colors

Should not be a problem because is passed to ColorToRGB when setting the pen color which converts to the appropriate color

Issue History

Date Modified Username Field Change
2019-07-17 17:11 MIS5 New Issue
2019-07-23 16:09 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2019-07-23 16:09 Dmitry Boyarintsev Status new => resolved
2019-07-23 16:09 Dmitry Boyarintsev Resolution open => fixed
2019-07-23 16:09 Dmitry Boyarintsev Fixed in Revision => 61617
2019-07-23 16:09 Dmitry Boyarintsev LazTarget => -
2019-07-23 16:09 Dmitry Boyarintsev Widgetset Cocoa => Cocoa
2019-07-23 16:09 Dmitry Boyarintsev Note Added: 0117356
2019-07-24 15:42 MIS5 Note Added: 0117376
2019-07-24 16:14 MIS5 Note Added: 0117377
2019-07-24 21:41 MIS5 Status resolved => assigned
2019-07-24 21:41 MIS5 Resolution fixed => reopened
2019-07-24 21:41 MIS5 Note Added: 0117385
2019-08-10 21:08 MIS5 Note Added: 0117627
2019-08-10 21:09 MIS5 Note Edited: 0117627 View Revisions
2019-08-10 21:10 MIS5 Note Edited: 0117627 View Revisions
2019-08-10 22:31 Dmitry Boyarintsev Note Added: 0117628
2019-08-10 23:22 MIS5 Note Added: 0117629
2019-08-10 23:23 MIS5 Note Edited: 0117629 View Revisions
2019-08-10 23:24 Dmitry Boyarintsev Note Added: 0117630
2019-08-10 23:26 MIS5 Note Edited: 0117629 View Revisions
2019-08-10 23:39 MIS5 Note Added: 0117631
2019-08-10 23:44 MIS5 Note Edited: 0117631 View Revisions
2019-08-16 18:42 Luiz Americo Note Added: 0117708