在RVTable.pas单元中修改
1.定义枚举
//斜线类型 无,左上右下,左下右上,左上右下2, 交叉
TSantType = (stNone, stLT_RB, stRT_LB, stLT_RB2, stCross);
2. 为TRVTableCellData类增加属性
published
.......
property SantType: TSantType read FSanType write FSanType;
3.修改方法 procedure TRVTableItemInfo.PaintTo.........
(1)增加变量 vPosLeft, vPosRight, vPosTop, vPosBottom: Integer;用来存放要绘制的单元格的Rect四角位置
(2)在他的内部方法 procedure DrawCell......
。。。。。。。
DrawBorder(Canvas, l - CBOffs - FUseMinBorder,t - CBOffs,
l + cw + CBOffs, t + ch + CBOffs + FUseMinBorder,
FCellBorderWidth, BLColor, BColor, Color, CellBorderStyle,
not (rvtoHideGridLines in Options), Editing,
rvidsPrinting in State, ClipRect2, Cell.VisibleBorders, r, c, ColorMode,
Style.GraphicInterface);
//增加代码开始
vPosLeft := l - CBOffs;
vPosTop := t - CBOffs;
vPosRight := l + cw + CBOffs;
vPosBottom := t + ch + CBOffs;
case Cell.SantType of
stNone: ;
stLT_RB:
begin
Canvas.MoveTo(vPosLeft, vPosTop);
Canvas.LineTo(vPosRight, vPosBottom);
end;
stRT_LB:
begin
Canvas.MoveTo(vPosRight, vPosTop);
Canvas.LineTo(vPosLeft, vPosBottom);
end;
stLT_RB2:
begin
Canvas.MoveTo(vPosLeft, vPosTop);
Canvas.LineTo(vPosRight,t + ch div 2 + CBOffs);
Canvas.MoveTo(vPosLeft, vPosTop);
Canvas.LineTo(l + cw div 2 + CBOffs, vPosBottom);
end;
stCross:
begin
Canvas.MoveTo(vPosLeft, vPosTop);
Canvas.LineTo(vPosRight, vPosBottom);
Canvas.MoveTo(vPosRight, vPosTop);
Canvas.LineTo(vPosLeft, vPosBottom);
end;
end;
//增加代码结束
。。。。。。。。。