Hi,
Inside TCustomDBGrid.DefaultDrawColumnCell, the code looks as follows:
--------------------------------------------
procedure TCustomDBGrid.DefaultDrawColumnCell(const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
S: string;
F: TField;
begin
F := Column.Field;
DataCol := GridColumnFromColumnIndex(DataCol);
if DataCol>=FirstGridColumn then
case ColumnEditorStyle(DataCol, F) of
cbsCheckBoxColumn:
DrawCheckBoxBitmaps(DataCol, Rect, F);
else begin
if Fnil then begin
if F.dataType ftBlob then
S := F.DisplayText
else
S := '(blob)';
end else
S := '';
DrawCellText(0, DataCol, Rect, State, S);
end;
end;
end;
--------------------------------------------My confusion is the call to DrawCellText(). The parameter list for DrawCellText() is shown below. So why is the method above passing the "DataCol" variable in the aRow parameter? Shouldn't the DataCol be passed as the aCol parameter instead? Also, why is aCol always 0 in the call to DrawCellText()?
procedure DrawCellText(aCol,aRow: Integer; aRect: TRect; aState:
TGridDrawState; aText: String); virtual;