procedure TfrmMain.VstBeforeCellPaint(Sender: TBaseVirtualTree;
TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
CellRect: TRect);
var
J,I, PercentageSize, RndPercent: integer;
ColorStart: Word;
Data: PTreeData;
R,G,B: byte;
begin
J:= 0;
//SpeedGraph
if (Column = 4)
then
begin
Data := Sender.GetNodeData(Node);
RndPercent:=99;
///MEIN EINTRAG : HIER MUSS DER WERT ÜBER DIE RECORD MEM. STRUCTURE ÜBERGEBEN WERDEN
InflateRect(CellRect, 424, 3);
Cellrect.Left := Vst.Header.Columns.Items[4].Left;
DrawEdge(TargetCanvas.Handle, CellRect, BF_FLAT, BF_SOFT
or BF_FLAT);
PercentageSize := (CellRect.Right - CellRect.Left) * RndPercent
div 100;
if True
then
begin
ColorStart :=ClYellow;
R:= GetRValue(ColorStart);
G:= GetGValue(ColorStart);
B:= GetBValue(ColorStart);
for I := CellRect.Right
downto CellRect.Left
do
begin
TargetCanvas.Brush.Color :=
RGB(R,G,B);
Randomize;
J := Random(20);
TargetCanvas.Pen.Color := ClWhite;
TargetCanvas.MoveTo(j+i,0);
TargetCanvas.LineTo(1,75);
if CellRect.Right - CellRect.Left <= PercentageSize
then
TargetCanvas.FillRect(CellRect);
Dec(CellRect.Right);
Dec(G);
end;
end else
begin
CellRect.Right := CellRect.Left + PercentageSize;
if RndPercent = 100
then
TargetCanvas.Brush.Color := clRed
else
TargetCanvas.Brush.Color := clLime;
TargetCanvas.FillRect(CellRect);
end;
end;
end;