Recent

Author Topic: Alternative to VirtualTreeView in Cocoa which does not mess up other controls?  (Read 16102 times)

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
I suggest reporting the bugs in the bugtracker

MISV

  • Hero Member
  • *****
  • Posts: 566
I originally reported this - and O have already updated it :)
https://bugs.freepascal.org/view.php?id=34002

@LuizAmérico
Now we are at it - beyond those two demos provided by you - do you think here are more things worth testing? Because if there is a 3rd issue / demo somewhere, I will be happy to test it out :)
« Last Edit: August 29, 2018, 11:42:22 am by MISV »

MISV

  • Hero Member
  • *****
  • Posts: 566
@skalogryz
Would you prefer two new separate bug reports? One for each example? And then possibly checking if that combination then solves the original bug report?


skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2123
    • havefunsoft.com
divide and conquer
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

MISV

  • Hero Member
  • *****
  • Posts: 566
Bug report for ExcludeClipRect
https://bugs.freepascal.org/view.php?id=34196

@LuizAmérico
I linked the demo provided since by you - I can download/attach if ok with you?
« Last Edit: August 29, 2018, 03:22:18 pm by MISV »

MISV

  • Hero Member
  • *****
  • Posts: 566
Bug report for BBitBlt/SetWindowOrgEx
https://bugs.freepascal.org/view.php?id=34197

@LuizAmérico
I linked to the demo found in the original Carbon bug report - I can download/attach if ok with you for the new Cocoa bug report?

MISV

  • Hero Member
  • *****
  • Posts: 566

MISV

  • Hero Member
  • *****
  • Posts: 566
Just to show the full problem of Cocoa/clipping/graphics/virtual-treeview/whatever-the-cause

how it should look
vtv-set-to-invisible--no-vtv-tab.png

problem manifested
vtv-set-to-visible--visible-vtv-tab--just-resized-form.png
vtv-set-to-visible--visible-vtv-tab--just-resized-form--2--hover-over-button.png
vtv--inside-ide-reversed-text-and-icons.png

MISV

  • Hero Member
  • *****
  • Posts: 566
Here is much better demo attached.

After a continued amount of testing in this discussion thread: https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8

It seems fixing the two reported issues will have a very high chance of solving all the issues. (Repeated tests seem to narrow down the problems to these.)
« Last Edit: September 05, 2018, 02:52:04 pm by MISV »

MISV

  • Hero Member
  • *****
  • Posts: 566
For the bug report
https://bugs.freepascal.org/view.php?id=34196
ExcludeClipRect

-- Possible explanation pinpointed by Lazarus virtual treeview maintainer - https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8 [^] --

Quote
There's a possible bug in TCocoaRegion.CombineWith when handling cc_DIFF (used by ExcludeClipRect)

If FShape is empty, a big one is created and stored in Shape var to be used in HIShapeCreateDifference, but Shape var is not used. The empty shape is used instead

Code: Pascal  [Select]
  1. cc_DIFF:
  2.       begin
  3.         if HIShapeIsEmpty(FShape) then
  4.           {HIShapeCreateDifference doesn't work properly if original shape is empty}
  5.           {to simulate "emptieness" very big shape is created }
  6.           Shape := HIShapeCreateWithRect(GetCGRect(MinCoord, MinCoord, MaxSize, MaxSize)); // create clip nothing.
  7.  
  8.         Shape := HIShapeCreateDifference(FShape, ARegion.Shape);
  9.         Result := GetType;
  10.       end;  
  11.  

However, that said, the attempted solution underneath here did not seem to be enough - not on its own at least:

Code: Pascal  [Select]
  1. cc_DIFF:
  2.       begin
  3.         if HIShapeIsEmpty(FShape) then
  4.           begin
  5.             {HIShapeCreateDifference doesn't work properly if original shape is empty}
  6.             {to simulate "emptieness" very big shape is created }
  7.             Shape := HIShapeCreateWithRect(GetCGRect(MinCoord, MinCoord, MaxSize, MaxSize)); // create clip nothing.
  8.             Shape := HIShapeCreateDifference(Shape, ARegion.Shape);
  9.           end
  10.         else
  11.           begin
  12.             Shape := HIShapeCreateDifference(FShape, ARegion.Shape);
  13.           end
  14.         ;
  15.         Result := GetType;
  16.       end;  
« Last Edit: September 05, 2018, 02:50:33 pm by MISV »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2123
    • havefunsoft.com
HIShape, huh?
check out the third line on cocoagdiobjects.pas
Code: Pascal  [Select]
  1. //todo: Remove HIShape usage used in TCocoaRegion.

I'm surprised this code still works (to some extent)
I wonder for how long Apple is going to drag the legacy compatibility code.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

MISV

  • Hero Member
  • *****
  • Posts: 566
I see the two bug reports are reported as solved- I will get back sunday/monday and check everything out in-depth. Great news if the problems are solved now :)

MISV

  • Hero Member
  • *****
  • Posts: 566
Testing against toggle-vtv-visible-then-reisze.zip in the parent bug report https://bugs.freepascal.org/view.php?id=34002#bugnotes shows the primary issue remain unsolved :(

...

I can see the demo app for the ExcludeClipRect child bug report https://bugs.freepascal.org/view.php?id=34196 [^] appears to be solved now though....

...

However, the reason I do not believe ExcludeClipRect is fixed yet is:

The toggle-vtv-visible-then-reisze.zip demo will work if ExcludeClipRect is replaced by a complete dummy function (!)

The Lazarus maintainter of virtual reeview for Lazarus applied the "dummy exclupdecliprect" fix for testing:
https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8#issuecomment-418730214 [^]

...

The  SetWindowOrgEx issue appear fixed in the demo app provided in the child bug report: https://bugs.freepascal.org/view.php?id=34197

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2123
    • havefunsoft.com
The toggle-vtv-visible-then-reisze.zip demo will work if ExcludeClipRect is replaced by a complete dummy function (!)

The Lazarus maintainter of virtual reeview for Lazarus applied the "dummy exclupdecliprect" fix for testing:
https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8#issuecomment-418730214 [^]
how does vtv test look with the dummy function vs the latest trunk?
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

MISV

  • Hero Member
  • *****
  • Posts: 566
The toggle-vtv-visible-then-reisze.zip demo:

- Lazaus trunk: Looks the same like earlier. Toolbuttons still go invisible when form is maximized maximized, Edit control looks weird etc.
- Dummy excludecliprect: Everything appears to work fine.

(If you test yourself, remember to click the button which toggles virtual treeview visiblity before maximizing)