For a VCL migration session I recorded a short video covering some open source components recently upgraded to XE7 compatibility and collectively called "Turbo Pack". I blogged about these components last October on blog.marcocantu.com/blog/2014-october-turbopack-xe7.html. You can find the projects code direct links in Roman's blog at blog.kassebaum.eu/?p=379.
The video below has a short introduction to the various components and the idea behind their "modernization", followed by the updated version of a classic Virtual Tree minimal demo and a one-minute introduction to a handful (out of the hundreds) of components in the Orpheus package, as you can see below:
These are two two core code snippets of the minimal virtual tree demo you can see in action in the video. The first is for creating the nodes, the second for fetching the information to display for the virtual nodes:
procedure TMainForm.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string); var Data: PMyRec; begin Data := Sender.GetNodeData(Node); if Assigned(Data) then CellText := Data.Caption; end; procedure TMainForm.VSTInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates); var Data: PMyRec; begin with Sender do begin Data := GetNodeData(Node); Data.Caption := Format( 'Level %d, Index %d', [GetNodeLevel(Node), Node.Index]); end; end;
This is the demo at runtime, with the design time for in the background.
PS: The code VirtualTree demo in the video has a comment referring to WideString, while the actual code (based on the updated component) simply uses the more performance string (or UnicodeString) data type.
And here, is the real focus of this blog post, the actual video of "Turbo Pack":