[Error] fwzr.pas(595): Incompatible types
时间:2011-11-08
来源:互联网
             (Sender as TDBGridEh).DefaultDrawColumnCell(Rect,DataCol,Column,State);这段代码错误
DefaultDrawColumnCell()调用
procedure TCustomDBGridEh.DefaultDrawColumnCell(const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
var
Value: string;
ARect, ARect1: TRect;
XFrameOffs, YFrameOffs, KeyIndex: Integer;
RowHeight: Integer;
begin
ARect := Rect;
if (dghFooter3D in OptionsEh) then
begin
XFrameOffs := 1;
InflateRect(ARect, -1, -1);
end else XFrameOffs := 2;
YFrameOffs := XFrameOffs;
if Flat then Dec(YFrameOffs);
Value := Column.DisplayText;
if FDataLink.Active and MemTableSupport
then RowHeight := RowHeights[FIntMemTable.InstantReadCurRowNum + TopDataOffset]
else RowHeight := FStdDefaultRowHeight;
if Column.GetColumnType in [ctCommon..ctKeyPickList] then
WriteTextEh(Canvas, ARect, True, XFrameOffs, YFrameOffs, Value,
Column.Alignment, Column.Layout, Column.WordWrap and Column.CurLineWordWrap(RowHeight),
Column.EndEllipsis, 0, 0, Column.UseRightToLeftReading)
else if Column.GetColumnType = ctKeyImageList then
begin
Canvas.FillRect(ARect);
if Column.Field = nil
then KeyIndex := FColCellParamsEh.FImageIndex
else KeyIndex := Column.KeyList.IndexOf(Column.Field.Text);
if KeyIndex = -1
then KeyIndex := Column.NotInKeyListIndex;
DrawClipped(Column.ImageList, nil, Canvas, ARect, KeyIndex, 0, taCenter);
end else if Column.GetColumnType = ctCheckboxes then
begin
Canvas.FillRect(ARect);
ARect1.Left := ARect.Left + iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, 0,
(ARect.Right - ARect.Left) shr 1 - DefaultCheckBoxWidth shr 1);
ARect1.Right := iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, ARect.Right,
ARect1.Left + DefaultCheckBoxWidth);
ARect1.Top := ARect.Top + iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, 0,
(ARect.Bottom - ARect.Top) shr 1 - DefaultCheckBoxHeight shr 1);
ARect1.Bottom := iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, ARect.Bottom,
ARect1.Top + DefaultCheckBoxHeight);
//DrawCheck(Canvas.Handle,ARect1,Column.CheckboxState,True,Flat);
PaintButtonControl {Eh}(Canvas, ARect1, Canvas.Brush.Color, bcsCheckboxEh,
0, Flat, False, True, Column.CheckboxState);
end else if Column.GetColumnType = ctGraphicData then
DrawGraphicCell(Column, ARect, Canvas.Brush.Color);
end;
            DefaultDrawColumnCell()调用
procedure TCustomDBGridEh.DefaultDrawColumnCell(const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
var
Value: string;
ARect, ARect1: TRect;
XFrameOffs, YFrameOffs, KeyIndex: Integer;
RowHeight: Integer;
begin
ARect := Rect;
if (dghFooter3D in OptionsEh) then
begin
XFrameOffs := 1;
InflateRect(ARect, -1, -1);
end else XFrameOffs := 2;
YFrameOffs := XFrameOffs;
if Flat then Dec(YFrameOffs);
Value := Column.DisplayText;
if FDataLink.Active and MemTableSupport
then RowHeight := RowHeights[FIntMemTable.InstantReadCurRowNum + TopDataOffset]
else RowHeight := FStdDefaultRowHeight;
if Column.GetColumnType in [ctCommon..ctKeyPickList] then
WriteTextEh(Canvas, ARect, True, XFrameOffs, YFrameOffs, Value,
Column.Alignment, Column.Layout, Column.WordWrap and Column.CurLineWordWrap(RowHeight),
Column.EndEllipsis, 0, 0, Column.UseRightToLeftReading)
else if Column.GetColumnType = ctKeyImageList then
begin
Canvas.FillRect(ARect);
if Column.Field = nil
then KeyIndex := FColCellParamsEh.FImageIndex
else KeyIndex := Column.KeyList.IndexOf(Column.Field.Text);
if KeyIndex = -1
then KeyIndex := Column.NotInKeyListIndex;
DrawClipped(Column.ImageList, nil, Canvas, ARect, KeyIndex, 0, taCenter);
end else if Column.GetColumnType = ctCheckboxes then
begin
Canvas.FillRect(ARect);
ARect1.Left := ARect.Left + iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, 0,
(ARect.Right - ARect.Left) shr 1 - DefaultCheckBoxWidth shr 1);
ARect1.Right := iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, ARect.Right,
ARect1.Left + DefaultCheckBoxWidth);
ARect1.Top := ARect.Top + iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, 0,
(ARect.Bottom - ARect.Top) shr 1 - DefaultCheckBoxHeight shr 1);
ARect1.Bottom := iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, ARect.Bottom,
ARect1.Top + DefaultCheckBoxHeight);
//DrawCheck(Canvas.Handle,ARect1,Column.CheckboxState,True,Flat);
PaintButtonControl {Eh}(Canvas, ARect1, Canvas.Brush.Color, bcsCheckboxEh,
0, Flat, False, True, Column.CheckboxState);
end else if Column.GetColumnType = ctGraphicData then
DrawGraphicCell(Column, ARect, Canvas.Brush.Color);
end;
作者: imonsoft2011 发布时间: 2011-11-08
             参数类型错误吧,LZ查查传入参数是否都符合            
            作者: funxu 发布时间: 2011-11-08
             LZ什么意思呀?
            
            作者: imonsoft2011 发布时间: 2011-11-08
 相关阅读 更多  
      
    热门阅读
-   office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具 office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具阅读:74 
-   如何安装mysql8.0 如何安装mysql8.0阅读:31 
-   Word快速设置标题样式步骤详解 Word快速设置标题样式步骤详解阅读:28 
-   20+道必知必会的Vue面试题(附答案解析) 20+道必知必会的Vue面试题(附答案解析)阅读:37 
-   HTML如何制作表单 HTML如何制作表单阅读:22 
-   百词斩可以改天数吗?当然可以,4个步骤轻松修改天数! 百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!阅读:31 
-   ET文件格式和XLS格式文件之间如何转化? ET文件格式和XLS格式文件之间如何转化?阅读:24 
-   react和vue的区别及优缺点是什么 react和vue的区别及优缺点是什么阅读:121 
-   支付宝人脸识别如何关闭? 支付宝人脸识别如何关闭?阅读:21 
-   腾讯微云怎么修改照片或视频备份路径? 腾讯微云怎么修改照片或视频备份路径?阅读:28 















