type
PData = ^TData;
TData = record
FBold: Boolean;
FColored: Boolean;
end;
procedure TForm1.VSTPaintText(Sender: TBaseVirtualTree;
const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType);
var
Data: PData;
begin
if TextType <> ttNormal then
Exit;
Data := VST.GetNodeData(Node);
case Column of
-1: begin //if no columns are defined, the case is not needed
if Data^.FBold then
TargetCanvas.Font.Style := TargetCanvas.Font.Style + [fsBold];
if Data^.FColored then
if Node = Sender.FocusedNode then
TargetCanvas.Font.Color := VST.Colors.SelectionTextColor
else
TargetCanvas.Font.Color := clRed;
end;
0: begin
//each column has different font
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Node: PVirtualNode;
Data: PData;
begin
Node := VST.AddChild(nil);
Data := VST.GetNodeData(Node);
Data^.FBold := True;
Data^.FColored := False;
Node := VST.AddChild(nil);
Data := VST.GetNodeData(Node);
Data^.FBold := False;
Data^.FColored := True;
end;