procedure TCustomDBGridEh.DefaultDrawColumnCell(const Rect: TRect;<br> DataCol: Integer; Column: TColumnEh; State: TGridDrawState);<br>var<br> Value: string;<br> ARect, ARect1: TRect;<br> XFrameOffs, YFrameOffs, KeyIndex: Integer;<br>begin<br> ARect := Rect;<br> if (dghFooter3D in OptionsEh) then<br> begin<br> XFrameOffs := 1;<br> InflateRect(ARect, -1, -1);<br> end else XFrameOffs := 2;<br> YFrameOffs := XFrameOffs;<br> if Flat then Dec(YFrameOffs);<br> Value := Column.DisplayText;<br><br> if Column.GetColumnType in [ctCommon..ctKeyPickList] then<br> WriteTextEh(Canvas, ARect, True, XFrameOffs, YFrameOffs, Value,<br> Column.Alignment, tlTop, Column.WordWrap and FAllowWordWrap,<br> Column.EndEllipsis, 0, 0, UseRightToLeftReading)<br> else if Column.GetColumnType = ctKeyImageList then<br> begin<br> Canvas.FillRect(ARect);<br> KeyIndex := Column.KeyList.IndexOf(Column.Field.Text);<br> if KeyIndex = -1<br> then KeyIndex := Column.NotInKeyListIndex;<br> DrawClipped(Column.ImageList, nil, Canvas, ARect, KeyIndex, 0, taCenter);<br> end else if Column.GetColumnType = ctCheckboxes then<br> begin<br> Canvas.FillRect(ARect);<br> ARect1.Left := ARect.Left + iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, 0,<br> (ARect.Right - ARect.Left) shr 1 - DefaultCheckBoxWidth shr 1);<br> ARect1.Right := iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, ARect.Right,<br> ARect1.Left + DefaultCheckBoxWidth);<br> ARect1.Top := ARect.Top + iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, 0,<br> (ARect.Bottom - ARect.Top) shr 1 - DefaultCheckBoxHeight shr 1);<br> ARect1.Bottom := iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, ARect.Bottom,<br> ARect1.Top + DefaultCheckBoxHeight);<br><br> //DrawCheck(Canvas.Handle,ARect1,Column.CheckboxState,True,Flat);<br> PaintButtonControl {Eh}(Canvas.Handle, ARect1, Canvas.Brush.Color, bcsCheckboxEh,<br> 0, Flat, False, True, Column.CheckboxState);<br> end;<br><br> //WriteTextEh(Canvas, ARect, True, XFrameOffs, YFrameOffs, Value, Column.Alignment,tlTop,Column.WordWrap and FAllowWordWrap, Column.EndEllipsis,0,0);<br>end;<br>-----------------------------------------------------------------------<br>procedure TCustomDBGrid.DefaultDrawColumnCell(const Rect: TRect;<br> DataCol: Integer; Column: TColumn; State: TGridDrawState);<br>var<br> Value: string;<br>begin<br> Value := '';<br> if Assigned(Column.Field) then<br> Value := Column.Field.DisplayText;<br> WriteText(Canvas, Rect, 2, 2, Value, Column.Alignment,<br> UseRightToLeftAlignmentForField(Column.Field, Column.Alignment));<br>end;