procedure TVSTGrid.DoBeforeCellPaint(Canvas: TCanvas; Node: PVirtualNode;
Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect;
var ContentRect: TRect);
var
Data: PTTreeData;
begin
Try
//Fully Customizable
If Assigned(OnBeforeCellPaint) then begin
inherited;
//Easy to
handle Row-Color Modification
end else if Assigned(FBeforeRowDraw) then begin
//Data^.RowColor is already been loaded in AddFields Method
Data := Self.GetNodeData(Node);
Canvas.Brush.Color := Data^.RowColor;
if Self.Selected[Node] then begin
Canvas.Brush.Color := Canvas.Brush.Color - $222222;
end;
{
//dosent work, as the rest of the Form will not be repainted!?
if (Canvas.Brush.Color - $222222) > $0 then begin
//darker Color for Highlighting
Self.Colors.FocusedSelectionColor := Canvas.Brush.Color - $222222;
end else begin
Self.Colors.FocusedSelectionColor := clGradientActiveCaption;
end;
//}
Canvas.FillRect(CellRect);
end else begin
Data := Self.GetNodeData(Node);
IF Data^.Index mod 2 = 0 then begin
Canvas.Brush.Color := FRowModColor;
Canvas.FillRect(CellRect);
end;
Canvas.Font.Color := Self.FRowModFontColor;
end;
Except
on e:
Exception do begin
showmessage('DoBeforeCellPaint' + e.message);
end;
End;
end;