+ -
当前位置:首页 → 问答吧 → [Error] fwzr.pas(595): Incompatible types

[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;

作者: imonsoft2011   发布时间: 2011-11-08

参数类型错误吧,LZ查查传入参数是否都符合

作者: funxu   发布时间: 2011-11-08

LZ什么意思呀?

作者: imonsoft2011   发布时间: 2011-11-08