Description
So now that most of the reliance on friend access has been remove, we can attempt to split things up to make the code base easier to work on.
Proposed split units (and where I am up to)
- VirtualTrees.Types
- VirtualTrees.Options
- VirtualTrees.Columns
- VirtualTrees.Header
- VirtualTrees.DragnDrop
- VirtualTrees.DragImage
- VirtualTrees.DataObject
- VirtualTrees.EditLink
- VirtualTrees.Colors
There will likely be a few more as I work through this.
Now a lot of the types are used in published props and event signatures, so what I am doing is adding aliases at the top of VirtualTrees.pas for those types - that will hopefully avoid breaking anyone's code (although the worst that would happen is they need to add to their uses clause).
There will be some (minor) breaking interface changes with this. For example TVTHeader exposes a TreeView property of type TBaseVirtualTree - that was only possible due to them being in the same unit.. with the split this becomes an issue of circular references. I changed this to TCustomControl and cast where needed in the code. There are a few more cases like this that couldn't be helped. I also needed to change the scope of some methods to public, I will try to avoid that using a cracker class where possible.
I'll update this issue with any breaking changes as I come across them. In the work I have done so far, VirtualTrees.pas shrunk from 38K to 27K lines - still way to large for lots of tooling (like github) but more manageable - and there is still more to split out.
Hopefully I should have a PR ready for review in a day or so.